diff --git a/services/aad/mgmt/2017-04-01/aad/CHANGELOG.md b/services/aad/mgmt/2017-04-01/aad/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/aad/mgmt/2017-04-01/aad/CHANGELOG.md +++ b/services/aad/mgmt/2017-04-01/aad/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/aad/mgmt/2017-04-01/aad/_meta.json b/services/aad/mgmt/2017-04-01/aad/_meta.json index 8419e1c3e385..c3c490dae660 100644 --- a/services/aad/mgmt/2017-04-01/aad/_meta.json +++ b/services/aad/mgmt/2017-04-01/aad/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "4742065e8d48160292fbce6790710c6835f8dc4f", "readme": "/_/azure-rest-api-specs/specification/azureactivedirectory/resource-manager/readme.md", "tag": "package-2017-04-01", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/aad/mgmt/2020-03-01/aad/CHANGELOG.md b/services/aad/mgmt/2020-03-01/aad/CHANGELOG.md new file mode 100644 index 000000000000..a1ecf841edb0 --- /dev/null +++ b/services/aad/mgmt/2020-03-01/aad/CHANGELOG.md @@ -0,0 +1,2 @@ +# Unreleased + diff --git a/services/aad/mgmt/2020-03-01/aad/_meta.json b/services/aad/mgmt/2020-03-01/aad/_meta.json new file mode 100644 index 000000000000..63b8568ac3a0 --- /dev/null +++ b/services/aad/mgmt/2020-03-01/aad/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "4742065e8d48160292fbce6790710c6835f8dc4f", + "readme": "/_/azure-rest-api-specs/specification/azureactivedirectory/resource-manager/readme.md", + "tag": "package-2020-03", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2020-03 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/azureactivedirectory/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/services/aad/mgmt/2020-03-01/aad/aadapi/interfaces.go b/services/aad/mgmt/2020-03-01/aad/aadapi/interfaces.go new file mode 100644 index 000000000000..a1eb2c9d0a57 --- /dev/null +++ b/services/aad/mgmt/2020-03-01/aad/aadapi/interfaces.go @@ -0,0 +1,47 @@ +package aadapi + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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/azure-sdk-for-go/services/aad/mgmt/2020-03-01/aad" + "github.com/Azure/go-autorest/autorest" +) + +// PrivateLinkForAzureAdClientAPI contains the set of methods on the PrivateLinkForAzureAdClient type. +type PrivateLinkForAzureAdClientAPI interface { + Create(ctx context.Context, resourceGroupName string, policyName string, privateLinkPolicy aad.PrivateLinkPolicy) (result aad.PrivateLinkForAzureAdCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, policyName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, policyName string) (result aad.PrivateLinkPolicy, err error) + List(ctx context.Context, resourceGroupName string) (result aad.PrivateLinkPolicyListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string) (result aad.PrivateLinkPolicyListResultIterator, err error) + ListBySubscription(ctx context.Context) (result aad.PrivateLinkPolicyListResultPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result aad.PrivateLinkPolicyListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, policyName string, privateLinkPolicy *aad.PrivateLinkPolicyUpdateParameter) (result aad.PrivateLinkPolicy, err error) +} + +var _ PrivateLinkForAzureAdClientAPI = (*aad.PrivateLinkForAzureAdClient)(nil) + +// PrivateLinkResourcesClientAPI contains the set of methods on the PrivateLinkResourcesClient type. +type PrivateLinkResourcesClientAPI interface { + Get(ctx context.Context, resourceGroupName string, policyName string, groupName string) (result aad.PrivateLinkResource, err error) + ListByPrivateLinkPolicy(ctx context.Context, resourceGroupName string, policyName string) (result aad.PrivateLinkResourceListResultPage, err error) + ListByPrivateLinkPolicyComplete(ctx context.Context, resourceGroupName string, policyName string) (result aad.PrivateLinkResourceListResultIterator, err error) +} + +var _ PrivateLinkResourcesClientAPI = (*aad.PrivateLinkResourcesClient)(nil) + +// PrivateEndpointConnectionsClientAPI contains the set of methods on the PrivateEndpointConnectionsClient type. +type PrivateEndpointConnectionsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, policyName string, privateEndpointConnectionName string, parameters aad.PrivateEndpointConnection) (result aad.PrivateEndpointConnectionsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, policyName string, privateEndpointConnectionName string) (result aad.PrivateEndpointConnectionsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, policyName string, privateEndpointConnectionName string) (result aad.PrivateEndpointConnection, err error) + ListByPolicyName(ctx context.Context, resourceGroupName string, policyName string) (result aad.PrivateEndpointConnectionListResultPage, err error) + ListByPolicyNameComplete(ctx context.Context, resourceGroupName string, policyName string) (result aad.PrivateEndpointConnectionListResultIterator, err error) +} + +var _ PrivateEndpointConnectionsClientAPI = (*aad.PrivateEndpointConnectionsClient)(nil) diff --git a/services/aad/mgmt/2020-03-01/aad/client.go b/services/aad/mgmt/2020-03-01/aad/client.go new file mode 100644 index 000000000000..6df5d714b9ea --- /dev/null +++ b/services/aad/mgmt/2020-03-01/aad/client.go @@ -0,0 +1,41 @@ +// Package aad implements the Azure ARM Aad service API version 2020-03-01. +// +// +package aad + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Aad + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Aad. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/services/aad/mgmt/2020-03-01/aad/enums.go b/services/aad/mgmt/2020-03-01/aad/enums.go new file mode 100644 index 000000000000..3d72fca7f475 --- /dev/null +++ b/services/aad/mgmt/2020-03-01/aad/enums.go @@ -0,0 +1,44 @@ +package aad + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// PrivateEndpointConnectionProvisioningState enumerates the values for private endpoint connection +// provisioning state. +type PrivateEndpointConnectionProvisioningState string + +const ( + // Failed ... + Failed PrivateEndpointConnectionProvisioningState = "Failed" + // Provisioning ... + Provisioning PrivateEndpointConnectionProvisioningState = "Provisioning" + // Succeeded ... + Succeeded PrivateEndpointConnectionProvisioningState = "Succeeded" +) + +// PossiblePrivateEndpointConnectionProvisioningStateValues returns an array of possible values for the PrivateEndpointConnectionProvisioningState const type. +func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { + return []PrivateEndpointConnectionProvisioningState{Failed, Provisioning, Succeeded} +} + +// PrivateEndpointServiceConnectionStatus enumerates the values for private endpoint service connection status. +type PrivateEndpointServiceConnectionStatus string + +const ( + // Approved ... + Approved PrivateEndpointServiceConnectionStatus = "Approved" + // Disconnected ... + Disconnected PrivateEndpointServiceConnectionStatus = "Disconnected" + // Pending ... + Pending PrivateEndpointServiceConnectionStatus = "Pending" + // Rejected ... + Rejected PrivateEndpointServiceConnectionStatus = "Rejected" +) + +// PossiblePrivateEndpointServiceConnectionStatusValues returns an array of possible values for the PrivateEndpointServiceConnectionStatus const type. +func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { + return []PrivateEndpointServiceConnectionStatus{Approved, Disconnected, Pending, Rejected} +} diff --git a/services/aad/mgmt/2020-03-01/aad/models.go b/services/aad/mgmt/2020-03-01/aad/models.go new file mode 100644 index 000000000000..adf52e74cbe6 --- /dev/null +++ b/services/aad/mgmt/2020-03-01/aad/models.go @@ -0,0 +1,1033 @@ +package aad + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/aad/mgmt/2020-03-01/aad" + +// ARMProxyResource the resource model definition for a ARM proxy resource. It will have everything other +// than required location and tags +type ARMProxyResource struct { + // ID - READ-ONLY; The unique resource identifier of the Azure AD PrivateLink Policy. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the Azure AD PrivateLink Policy. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ARMProxyResource. +func (apr ARMProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. +type AzureEntityResource struct { + // Etag - READ-ONLY; Resource Etag. + Etag *string `json:"etag,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureEntityResource. +func (aer AzureEntityResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// AzureResourceBase common properties for all Azure resources. +type AzureResourceBase struct { + // ID - READ-ONLY; String Id used to locate any resource on Azure. + ID *string `json:"id,omitempty"` + // Name - Name of this resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of this resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureResourceBase. +func (arb AzureResourceBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if arb.Name != nil { + objectMap["name"] = arb.Name + } + return json.Marshal(objectMap) +} + +// ErrorDefinition error definition. +type ErrorDefinition struct { + // Code - READ-ONLY; Service specific error code which serves as the substatus for the HTTP error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; Description of the error. + Message *string `json:"message,omitempty"` + // Details - READ-ONLY; Internal error details. + Details *[]ErrorDefinition `json:"details,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorDefinition. +func (ed ErrorDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ErrorResponse error response. +type ErrorResponse struct { + // Error - The error details. + Error *ErrorDefinition `json:"error,omitempty"` +} + +// PrivateEndpoint private endpoint object properties. +type PrivateEndpoint struct { + // ID - Full identifier of the private endpoint resource. + ID *string `json:"id,omitempty"` +} + +// PrivateEndpointConnection private endpoint connection resource. +type PrivateEndpointConnection struct { + autorest.Response `json:"-"` + // PrivateEndpointConnectionProperties - Resource properties. + *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnection. +func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pec.PrivateEndpointConnectionProperties != nil { + objectMap["properties"] = pec.PrivateEndpointConnectionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. +func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var privateEndpointConnectionProperties PrivateEndpointConnectionProperties + err = json.Unmarshal(*v, &privateEndpointConnectionProperties) + if err != nil { + return err + } + pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pec.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pec.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pec.Type = &typeVar + } + } + } + + return nil +} + +// PrivateEndpointConnectionListResult a list of private link resources +type PrivateEndpointConnectionListResult struct { + autorest.Response `json:"-"` + // Value - Array of private link resources + Value *[]PrivateEndpointConnection `json:"value,omitempty"` + // NextLink - URL to next page of results + NextLink *string `json:"nextLink,omitempty"` +} + +// PrivateEndpointConnectionListResultIterator provides access to a complete listing of +// PrivateEndpointConnection values. +type PrivateEndpointConnectionListResultIterator struct { + i int + page PrivateEndpointConnectionListResultPage +} + +// NextWithContext 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 *PrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PrivateEndpointConnectionListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PrivateEndpointConnectionListResultIterator) 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 PrivateEndpointConnectionListResultIterator) Response() PrivateEndpointConnectionListResult { + 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 PrivateEndpointConnectionListResultIterator) Value() PrivateEndpointConnection { + if !iter.page.NotDone() { + return PrivateEndpointConnection{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PrivateEndpointConnectionListResultIterator type. +func NewPrivateEndpointConnectionListResultIterator(page PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator { + return PrivateEndpointConnectionListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (peclr PrivateEndpointConnectionListResult) IsEmpty() bool { + return peclr.Value == nil || len(*peclr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (peclr PrivateEndpointConnectionListResult) hasNextLink() bool { + return peclr.NextLink != nil && len(*peclr.NextLink) != 0 +} + +// privateEndpointConnectionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (peclr PrivateEndpointConnectionListResult) privateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { + if !peclr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(peclr.NextLink))) +} + +// PrivateEndpointConnectionListResultPage contains a page of PrivateEndpointConnection values. +type PrivateEndpointConnectionListResultPage struct { + fn func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error) + peclr PrivateEndpointConnectionListResult +} + +// NextWithContext 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 *PrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.peclr) + if err != nil { + return err + } + page.peclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *PrivateEndpointConnectionListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PrivateEndpointConnectionListResultPage) NotDone() bool { + return !page.peclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PrivateEndpointConnectionListResultPage) Response() PrivateEndpointConnectionListResult { + return page.peclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PrivateEndpointConnectionListResultPage) Values() []PrivateEndpointConnection { + if page.peclr.IsEmpty() { + return nil + } + return *page.peclr.Value +} + +// Creates a new instance of the PrivateEndpointConnectionListResultPage type. +func NewPrivateEndpointConnectionListResultPage(cur PrivateEndpointConnectionListResult, getNextPage func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage { + return PrivateEndpointConnectionListResultPage{ + fn: getNextPage, + peclr: cur, + } +} + +// PrivateEndpointConnectionProperties properties of the private endpoint connection resource. +type PrivateEndpointConnectionProperties struct { + // PrivateEndpoint - Properties of the private endpoint object. + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + // PrivateLinkServiceConnectionState - Approval state of the private link connection. + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + // ProvisioningState - Provisioning state of the private endpoint connection. Possible values include: 'Succeeded', 'Provisioning', 'Failed' + ProvisioningState PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"` + // PrivateLinkConnectionTags - Updated tag information to set into the PrivateLinkConnection instance. + PrivateLinkConnectionTags *TagsResource `json:"privateLinkConnectionTags,omitempty"` +} + +// PrivateEndpointConnectionsCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type PrivateEndpointConnectionsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateEndpointConnectionsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PrivateEndpointConnectionsCreateFuture.Result. +func (future *PrivateEndpointConnectionsCreateFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateEndpointConnectionsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pec.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("aad.PrivateEndpointConnectionsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent { + pec, err = client.CreateResponder(pec.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateEndpointConnectionsCreateFuture", "Result", pec.Response.Response, "Failure responding to request") + } + } + return +} + +// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type PrivateEndpointConnectionsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateEndpointConnectionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PrivateEndpointConnectionsDeleteFuture.Result. +func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("aad.PrivateEndpointConnectionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// PrivateLinkForAzureAdCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type PrivateLinkForAzureAdCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateLinkForAzureAdClient) (PrivateLinkPolicy, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateLinkForAzureAdCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PrivateLinkForAzureAdCreateFuture.Result. +func (future *PrivateLinkForAzureAdCreateFuture) result(client PrivateLinkForAzureAdClient) (plp PrivateLinkPolicy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + plp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("aad.PrivateLinkForAzureAdCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if plp.Response.Response, err = future.GetResult(sender); err == nil && plp.Response.Response.StatusCode != http.StatusNoContent { + plp, err = client.CreateResponder(plp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdCreateFuture", "Result", plp.Response.Response, "Failure responding to request") + } + } + return +} + +// PrivateLinkPolicy privateLink Policy configuration object. +type PrivateLinkPolicy struct { + autorest.Response `json:"-"` + // OwnerTenantID - Guid of the owner tenant + OwnerTenantID *string `json:"ownerTenantId,omitempty"` + // AllTenants - Flag indicating whether all tenants are allowed + AllTenants *bool `json:"allTenants,omitempty"` + // Tenants - The list of tenantIds. + Tenants *[]string `json:"tenants,omitempty"` + // ResourceName - Name of the private link policy resource + ResourceName *string `json:"resourceName,omitempty"` + // SubscriptionID - Subscription Identifier + SubscriptionID *string `json:"subscriptionId,omitempty"` + // ResourceGroup - Name of the resource group + ResourceGroup *string `json:"resourceGroup,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ID - READ-ONLY; String Id used to locate any resource on Azure. + ID *string `json:"id,omitempty"` + // Name - Name of this resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of this resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkPolicy. +func (plp PrivateLinkPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plp.OwnerTenantID != nil { + objectMap["ownerTenantId"] = plp.OwnerTenantID + } + if plp.AllTenants != nil { + objectMap["allTenants"] = plp.AllTenants + } + if plp.Tenants != nil { + objectMap["tenants"] = plp.Tenants + } + if plp.ResourceName != nil { + objectMap["resourceName"] = plp.ResourceName + } + if plp.SubscriptionID != nil { + objectMap["subscriptionId"] = plp.SubscriptionID + } + if plp.ResourceGroup != nil { + objectMap["resourceGroup"] = plp.ResourceGroup + } + if plp.Tags != nil { + objectMap["tags"] = plp.Tags + } + if plp.Name != nil { + objectMap["name"] = plp.Name + } + return json.Marshal(objectMap) +} + +// PrivateLinkPolicyListResult a list of private link policies +type PrivateLinkPolicyListResult struct { + autorest.Response `json:"-"` + // Value - Array of private link policies + Value *[]PrivateLinkPolicy `json:"value,omitempty"` + // NextLink - The link used to get the next page of operations. + NextLink *string `json:"nextLink,omitempty"` +} + +// PrivateLinkPolicyListResultIterator provides access to a complete listing of PrivateLinkPolicy values. +type PrivateLinkPolicyListResultIterator struct { + i int + page PrivateLinkPolicyListResultPage +} + +// NextWithContext 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 *PrivateLinkPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkPolicyListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PrivateLinkPolicyListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PrivateLinkPolicyListResultIterator) 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 PrivateLinkPolicyListResultIterator) Response() PrivateLinkPolicyListResult { + 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 PrivateLinkPolicyListResultIterator) Value() PrivateLinkPolicy { + if !iter.page.NotDone() { + return PrivateLinkPolicy{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PrivateLinkPolicyListResultIterator type. +func NewPrivateLinkPolicyListResultIterator(page PrivateLinkPolicyListResultPage) PrivateLinkPolicyListResultIterator { + return PrivateLinkPolicyListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (plplr PrivateLinkPolicyListResult) IsEmpty() bool { + return plplr.Value == nil || len(*plplr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (plplr PrivateLinkPolicyListResult) hasNextLink() bool { + return plplr.NextLink != nil && len(*plplr.NextLink) != 0 +} + +// privateLinkPolicyListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (plplr PrivateLinkPolicyListResult) privateLinkPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { + if !plplr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(plplr.NextLink))) +} + +// PrivateLinkPolicyListResultPage contains a page of PrivateLinkPolicy values. +type PrivateLinkPolicyListResultPage struct { + fn func(context.Context, PrivateLinkPolicyListResult) (PrivateLinkPolicyListResult, error) + plplr PrivateLinkPolicyListResult +} + +// NextWithContext 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 *PrivateLinkPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkPolicyListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.plplr) + if err != nil { + return err + } + page.plplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *PrivateLinkPolicyListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PrivateLinkPolicyListResultPage) NotDone() bool { + return !page.plplr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PrivateLinkPolicyListResultPage) Response() PrivateLinkPolicyListResult { + return page.plplr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PrivateLinkPolicyListResultPage) Values() []PrivateLinkPolicy { + if page.plplr.IsEmpty() { + return nil + } + return *page.plplr.Value +} + +// Creates a new instance of the PrivateLinkPolicyListResultPage type. +func NewPrivateLinkPolicyListResultPage(cur PrivateLinkPolicyListResult, getNextPage func(context.Context, PrivateLinkPolicyListResult) (PrivateLinkPolicyListResult, error)) PrivateLinkPolicyListResultPage { + return PrivateLinkPolicyListResultPage{ + fn: getNextPage, + plplr: cur, + } +} + +// PrivateLinkPolicyUpdateParameter private Link policy parameters to be updated. +type PrivateLinkPolicyUpdateParameter struct { + // Tags - Resource tags to be updated. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkPolicyUpdateParameter. +func (plpup PrivateLinkPolicyUpdateParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plpup.Tags != nil { + objectMap["tags"] = plpup.Tags + } + return json.Marshal(objectMap) +} + +// PrivateLinkResource a private link resource +type PrivateLinkResource struct { + autorest.Response `json:"-"` + // PrivateLinkResourceProperties - Resource properties. + *PrivateLinkResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the Azure AD PrivateLink Policy. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the Azure AD PrivateLink Policy. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkResource. +func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plr.PrivateLinkResourceProperties != nil { + objectMap["properties"] = plr.PrivateLinkResourceProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct. +func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var privateLinkResourceProperties PrivateLinkResourceProperties + err = json.Unmarshal(*v, &privateLinkResourceProperties) + if err != nil { + return err + } + plr.PrivateLinkResourceProperties = &privateLinkResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + plr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + plr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + plr.Type = &typeVar + } + } + } + + return nil +} + +// PrivateLinkResourceListResult a list of private link resources +type PrivateLinkResourceListResult struct { + autorest.Response `json:"-"` + // Value - Array of private link resources + Value *[]PrivateLinkResource `json:"value,omitempty"` + // NextLink - The link used to get the next page of operations. + NextLink *string `json:"nextLink,omitempty"` +} + +// PrivateLinkResourceListResultIterator provides access to a complete listing of PrivateLinkResource +// values. +type PrivateLinkResourceListResultIterator struct { + i int + page PrivateLinkResourceListResultPage +} + +// NextWithContext 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 *PrivateLinkResourceListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PrivateLinkResourceListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PrivateLinkResourceListResultIterator) 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 PrivateLinkResourceListResultIterator) Response() PrivateLinkResourceListResult { + 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 PrivateLinkResourceListResultIterator) Value() PrivateLinkResource { + if !iter.page.NotDone() { + return PrivateLinkResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PrivateLinkResourceListResultIterator type. +func NewPrivateLinkResourceListResultIterator(page PrivateLinkResourceListResultPage) PrivateLinkResourceListResultIterator { + return PrivateLinkResourceListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (plrlr PrivateLinkResourceListResult) IsEmpty() bool { + return plrlr.Value == nil || len(*plrlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (plrlr PrivateLinkResourceListResult) hasNextLink() bool { + return plrlr.NextLink != nil && len(*plrlr.NextLink) != 0 +} + +// privateLinkResourceListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (plrlr PrivateLinkResourceListResult) privateLinkResourceListResultPreparer(ctx context.Context) (*http.Request, error) { + if !plrlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(plrlr.NextLink))) +} + +// PrivateLinkResourceListResultPage contains a page of PrivateLinkResource values. +type PrivateLinkResourceListResultPage struct { + fn func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error) + plrlr PrivateLinkResourceListResult +} + +// NextWithContext 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 *PrivateLinkResourceListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.plrlr) + if err != nil { + return err + } + page.plrlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *PrivateLinkResourceListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PrivateLinkResourceListResultPage) NotDone() bool { + return !page.plrlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PrivateLinkResourceListResultPage) Response() PrivateLinkResourceListResult { + return page.plrlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PrivateLinkResourceListResultPage) Values() []PrivateLinkResource { + if page.plrlr.IsEmpty() { + return nil + } + return *page.plrlr.Value +} + +// Creates a new instance of the PrivateLinkResourceListResultPage type. +func NewPrivateLinkResourceListResultPage(cur PrivateLinkResourceListResult, getNextPage func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)) PrivateLinkResourceListResultPage { + return PrivateLinkResourceListResultPage{ + fn: getNextPage, + plrlr: cur, + } +} + +// PrivateLinkResourceProperties properties of a private link resource. +type PrivateLinkResourceProperties struct { + // GroupID - READ-ONLY; The private link resource group id. + GroupID *string `json:"groupId,omitempty"` + // RequiredMembers - READ-ONLY; The private link resource required member names. + RequiredMembers *[]string `json:"requiredMembers,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties. +func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PrivateLinkServiceConnectionState an object that represents the approval state of the private link +// connection. +type PrivateLinkServiceConnectionState struct { + // Status - Indicates whether the connection has been approved, rejected or removed by the given policy owner. Possible values include: 'Approved', 'Pending', 'Rejected', 'Disconnected' + Status PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` + // Description - The reason for approval or rejection. + Description *string `json:"description,omitempty"` + // ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer. + ActionsRequired *string `json:"actionsRequired,omitempty"` +} + +// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not +// have tags and a location +type ProxyResource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProxyResource. +func (pr ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// Resource common fields that are returned in the response for all Azure Resource Manager resources +type Resource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// TagsResource a container holding only the Tags for a resource, allowing the user to update the tags on a +// PrivateLinkConnection instance. +type TagsResource struct { + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for TagsResource. +func (tr TagsResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + return json.Marshal(objectMap) +} + +// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource +// which has 'tags' and a 'location' +type TrackedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + return json.Marshal(objectMap) +} diff --git a/services/aad/mgmt/2020-03-01/aad/privateendpointconnections.go b/services/aad/mgmt/2020-03-01/aad/privateendpointconnections.go new file mode 100644 index 000000000000..b40d0bd71356 --- /dev/null +++ b/services/aad/mgmt/2020-03-01/aad/privateendpointconnections.go @@ -0,0 +1,431 @@ +package aad + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PrivateEndpointConnectionsClient is the client for the PrivateEndpointConnections methods of the Aad service. +type PrivateEndpointConnectionsClient struct { + BaseClient +} + +// NewPrivateEndpointConnectionsClient creates an instance of the PrivateEndpointConnectionsClient client. +func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient { + return NewPrivateEndpointConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateEndpointConnectionsClientWithBaseURI creates an instance of the PrivateEndpointConnectionsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { + return PrivateEndpointConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates specified private endpoint connection associated with the given policy. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// policyName - the name of the private link policy in Azure AD. +// privateEndpointConnectionName - the PrivateEndpointConnection name. +// parameters - the intended state of private endpoint connection. +func (client PrivateEndpointConnectionsClient) Create(ctx context.Context, resourceGroupName string, policyName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection) (result PrivateEndpointConnectionsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: privateEndpointConnectionName, + Constraints: []validation.Constraint{{Target: "privateEndpointConnectionName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("aad.PrivateEndpointConnectionsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, policyName, privateEndpointConnectionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateEndpointConnectionsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateEndpointConnectionsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client PrivateEndpointConnectionsClient) CreatePreparer(ctx context.Context, resourceGroupName string, policyName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.aadiam/privateLinkForAzureAd/{policyName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) CreateSender(req *http.Request) (future PrivateEndpointConnectionsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) CreateResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified private endpoint connection associated with the given policy. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// policyName - the name of the private link policy in Azure AD. +// privateEndpointConnectionName - the PrivateEndpointConnection name. +func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, policyName string, privateEndpointConnectionName string) (result PrivateEndpointConnectionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: privateEndpointConnectionName, + Constraints: []validation.Constraint{{Target: "privateEndpointConnectionName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("aad.PrivateEndpointConnectionsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, policyName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateEndpointConnectionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateEndpointConnectionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PrivateEndpointConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, policyName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-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.aadiam/privateLinkForAzureAd/{policyName}/privateEndpointConnections/{privateEndpointConnectionName}", 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 PrivateEndpointConnectionsClient) DeleteSender(req *http.Request) (future PrivateEndpointConnectionsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the specified private endpoint connection associated with the given policy. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// policyName - the name of the private link policy in Azure AD. +// privateEndpointConnectionName - the PrivateEndpointConnection name. +func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, policyName string, privateEndpointConnectionName string) (result PrivateEndpointConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: privateEndpointConnectionName, + Constraints: []validation.Constraint{{Target: "privateEndpointConnectionName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("aad.PrivateEndpointConnectionsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, policyName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateEndpointConnectionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "aad.PrivateEndpointConnectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateEndpointConnectionsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateEndpointConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, policyName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-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.aadiam/privateLinkForAzureAd/{policyName}/privateEndpointConnections/{privateEndpointConnectionName}", 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 PrivateEndpointConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) GetResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByPolicyName lists all Private Endpoint Connections for the given policy. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// policyName - the name of the private link policy in Azure AD. +func (client PrivateEndpointConnectionsClient) ListByPolicyName(ctx context.Context, resourceGroupName string, policyName string) (result PrivateEndpointConnectionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.ListByPolicyName") + defer func() { + sc := -1 + if result.peclr.Response.Response != nil { + sc = result.peclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("aad.PrivateEndpointConnectionsClient", "ListByPolicyName", err.Error()) + } + + result.fn = client.listByPolicyNameNextResults + req, err := client.ListByPolicyNamePreparer(ctx, resourceGroupName, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateEndpointConnectionsClient", "ListByPolicyName", nil, "Failure preparing request") + return + } + + resp, err := client.ListByPolicyNameSender(req) + if err != nil { + result.peclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "aad.PrivateEndpointConnectionsClient", "ListByPolicyName", resp, "Failure sending request") + return + } + + result.peclr, err = client.ListByPolicyNameResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateEndpointConnectionsClient", "ListByPolicyName", resp, "Failure responding to request") + return + } + if result.peclr.hasNextLink() && result.peclr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByPolicyNamePreparer prepares the ListByPolicyName request. +func (client PrivateEndpointConnectionsClient) ListByPolicyNamePreparer(ctx context.Context, resourceGroupName string, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-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.aadiam/privateLinkForAzureAd/{policyName}/privateEndpointConnections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByPolicyNameSender sends the ListByPolicyName request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) ListByPolicyNameSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByPolicyNameResponder handles the response to the ListByPolicyName request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) ListByPolicyNameResponder(resp *http.Response) (result PrivateEndpointConnectionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByPolicyNameNextResults retrieves the next set of results, if any. +func (client PrivateEndpointConnectionsClient) listByPolicyNameNextResults(ctx context.Context, lastResults PrivateEndpointConnectionListResult) (result PrivateEndpointConnectionListResult, err error) { + req, err := lastResults.privateEndpointConnectionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "aad.PrivateEndpointConnectionsClient", "listByPolicyNameNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByPolicyNameSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "aad.PrivateEndpointConnectionsClient", "listByPolicyNameNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByPolicyNameResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateEndpointConnectionsClient", "listByPolicyNameNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByPolicyNameComplete enumerates all values, automatically crossing page boundaries as required. +func (client PrivateEndpointConnectionsClient) ListByPolicyNameComplete(ctx context.Context, resourceGroupName string, policyName string) (result PrivateEndpointConnectionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.ListByPolicyName") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByPolicyName(ctx, resourceGroupName, policyName) + return +} diff --git a/services/aad/mgmt/2020-03-01/aad/privatelinkforazuread.go b/services/aad/mgmt/2020-03-01/aad/privatelinkforazuread.go new file mode 100644 index 000000000000..2d98686824fb --- /dev/null +++ b/services/aad/mgmt/2020-03-01/aad/privatelinkforazuread.go @@ -0,0 +1,617 @@ +package aad + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PrivateLinkForAzureAdClient is the client for the PrivateLinkForAzureAd methods of the Aad service. +type PrivateLinkForAzureAdClient struct { + BaseClient +} + +// NewPrivateLinkForAzureAdClient creates an instance of the PrivateLinkForAzureAdClient client. +func NewPrivateLinkForAzureAdClient(subscriptionID string) PrivateLinkForAzureAdClient { + return NewPrivateLinkForAzureAdClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateLinkForAzureAdClientWithBaseURI creates an instance of the PrivateLinkForAzureAdClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewPrivateLinkForAzureAdClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkForAzureAdClient { + return PrivateLinkForAzureAdClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a private link policy. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// policyName - the name of the private link policy in Azure AD. +// privateLinkPolicy - private link Policy supplied to the operation. +func (client PrivateLinkForAzureAdClient) Create(ctx context.Context, resourceGroupName string, policyName string, privateLinkPolicy PrivateLinkPolicy) (result PrivateLinkForAzureAdCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkForAzureAdClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("aad.PrivateLinkForAzureAdClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, policyName, privateLinkPolicy) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client PrivateLinkForAzureAdClient) CreatePreparer(ctx context.Context, resourceGroupName string, policyName string, privateLinkPolicy PrivateLinkPolicy) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.aadiam/privateLinkForAzureAd/{policyName}", pathParameters), + autorest.WithJSON(privateLinkPolicy), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateLinkForAzureAdClient) CreateSender(req *http.Request) (future PrivateLinkForAzureAdCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client PrivateLinkForAzureAdClient) CreateResponder(resp *http.Response) (result PrivateLinkPolicy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a private link policy. When operation completes, status code 200 returned without content. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// policyName - the name of the private link policy in Azure AD. +func (client PrivateLinkForAzureAdClient) Delete(ctx context.Context, resourceGroupName string, policyName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkForAzureAdClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("aad.PrivateLinkForAzureAdClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PrivateLinkForAzureAdClient) DeletePreparer(ctx context.Context, resourceGroupName string, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-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.aadiam/privateLinkForAzureAd/{policyName}", 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 PrivateLinkForAzureAdClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client PrivateLinkForAzureAdClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a private link policy with a given name. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// policyName - the name of the private link policy in Azure AD. +func (client PrivateLinkForAzureAdClient) Get(ctx context.Context, resourceGroupName string, policyName string) (result PrivateLinkPolicy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkForAzureAdClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("aad.PrivateLinkForAzureAdClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateLinkForAzureAdClient) GetPreparer(ctx context.Context, resourceGroupName string, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-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.aadiam/privateLinkForAzureAd/{policyName}", 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 PrivateLinkForAzureAdClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client PrivateLinkForAzureAdClient) GetResponder(resp *http.Response) (result PrivateLinkPolicy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List operation to return the list of Private Link Policies For AzureAD scoped to the resourceGroup. +// Parameters: +// resourceGroupName - name of an Azure resource group. +func (client PrivateLinkForAzureAdClient) List(ctx context.Context, resourceGroupName string) (result PrivateLinkPolicyListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkForAzureAdClient.List") + defer func() { + sc := -1 + if result.plplr.Response.Response != nil { + sc = result.plplr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("aad.PrivateLinkForAzureAdClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.plplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "List", resp, "Failure sending request") + return + } + + result.plplr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "List", resp, "Failure responding to request") + return + } + if result.plplr.hasNextLink() && result.plplr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client PrivateLinkForAzureAdClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-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.aadiam/privateLinkForAzureAd", 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 PrivateLinkForAzureAdClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client PrivateLinkForAzureAdClient) ListResponder(resp *http.Response) (result PrivateLinkPolicyListResult, err error) { + err = autorest.Respond( + resp, + 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 PrivateLinkForAzureAdClient) listNextResults(ctx context.Context, lastResults PrivateLinkPolicyListResult) (result PrivateLinkPolicyListResult, err error) { + req, err := lastResults.privateLinkPolicyListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "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, "aad.PrivateLinkForAzureAdClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client PrivateLinkForAzureAdClient) ListComplete(ctx context.Context, resourceGroupName string) (result PrivateLinkPolicyListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkForAzureAdClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName) + return +} + +// ListBySubscription lists all Private Link Policies For AzureAD in the given subscription. +func (client PrivateLinkForAzureAdClient) ListBySubscription(ctx context.Context) (result PrivateLinkPolicyListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkForAzureAdClient.ListBySubscription") + defer func() { + sc := -1 + if result.plplr.Response.Response != nil { + sc = result.plplr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.plplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.plplr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.plplr.hasNextLink() && result.plplr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client PrivateLinkForAzureAdClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/microsoft.aadiam/privateLinkForAzureAd", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateLinkForAzureAdClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client PrivateLinkForAzureAdClient) ListBySubscriptionResponder(resp *http.Response) (result PrivateLinkPolicyListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client PrivateLinkForAzureAdClient) listBySubscriptionNextResults(ctx context.Context, lastResults PrivateLinkPolicyListResult) (result PrivateLinkPolicyListResult, err error) { + req, err := lastResults.privateLinkPolicyListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client PrivateLinkForAzureAdClient) ListBySubscriptionComplete(ctx context.Context) (result PrivateLinkPolicyListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkForAzureAdClient.ListBySubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBySubscription(ctx) + return +} + +// Update updates private link policy tags with specified values. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// policyName - the name of the private link policy in Azure AD. +// privateLinkPolicy - private Link Policy resource with the tags to be updated. +func (client PrivateLinkForAzureAdClient) Update(ctx context.Context, resourceGroupName string, policyName string, privateLinkPolicy *PrivateLinkPolicyUpdateParameter) (result PrivateLinkPolicy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkForAzureAdClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("aad.PrivateLinkForAzureAdClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, policyName, privateLinkPolicy) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client PrivateLinkForAzureAdClient) UpdatePreparer(ctx context.Context, resourceGroupName string, policyName string, privateLinkPolicy *PrivateLinkPolicyUpdateParameter) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.aadiam/privateLinkForAzureAd/{policyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if privateLinkPolicy != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(privateLinkPolicy)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateLinkForAzureAdClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client PrivateLinkForAzureAdClient) UpdateResponder(resp *http.Response) (result PrivateLinkPolicy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/aad/mgmt/2020-03-01/aad/privatelinkresources.go b/services/aad/mgmt/2020-03-01/aad/privatelinkresources.go new file mode 100644 index 000000000000..1f2cc7c7537a --- /dev/null +++ b/services/aad/mgmt/2020-03-01/aad/privatelinkresources.go @@ -0,0 +1,245 @@ +package aad + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PrivateLinkResourcesClient is the client for the PrivateLinkResources methods of the Aad service. +type PrivateLinkResourcesClient struct { + BaseClient +} + +// NewPrivateLinkResourcesClient creates an instance of the PrivateLinkResourcesClient client. +func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { + return NewPrivateLinkResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateLinkResourcesClientWithBaseURI creates an instance of the PrivateLinkResourcesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { + return PrivateLinkResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets the private link resources that need to be created for a policy of AzureAD. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// policyName - the name of the private link policy in Azure AD. +// groupName - the name of the private link resource. +func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, policyName string, groupName string) (result PrivateLinkResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("aad.PrivateLinkResourcesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, policyName, groupName) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkResourcesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "aad.PrivateLinkResourcesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkResourcesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateLinkResourcesClient) GetPreparer(ctx context.Context, resourceGroupName string, policyName string, groupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupName": autorest.Encode("path", groupName), + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-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.aadiam/privateLinkForAzureAd/{policyName}/privateLinkResources/{groupName}", 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 PrivateLinkResourcesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client PrivateLinkResourcesClient) GetResponder(resp *http.Response) (result PrivateLinkResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByPrivateLinkPolicy gets the private link resources that need to be created for a policy of AzureAD. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// policyName - the name of the private link policy in Azure AD. +func (client PrivateLinkResourcesClient) ListByPrivateLinkPolicy(ctx context.Context, resourceGroupName string, policyName string) (result PrivateLinkResourceListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.ListByPrivateLinkPolicy") + defer func() { + sc := -1 + if result.plrlr.Response.Response != nil { + sc = result.plrlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("aad.PrivateLinkResourcesClient", "ListByPrivateLinkPolicy", err.Error()) + } + + result.fn = client.listByPrivateLinkPolicyNextResults + req, err := client.ListByPrivateLinkPolicyPreparer(ctx, resourceGroupName, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkResourcesClient", "ListByPrivateLinkPolicy", nil, "Failure preparing request") + return + } + + resp, err := client.ListByPrivateLinkPolicySender(req) + if err != nil { + result.plrlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "aad.PrivateLinkResourcesClient", "ListByPrivateLinkPolicy", resp, "Failure sending request") + return + } + + result.plrlr, err = client.ListByPrivateLinkPolicyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkResourcesClient", "ListByPrivateLinkPolicy", resp, "Failure responding to request") + return + } + if result.plrlr.hasNextLink() && result.plrlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByPrivateLinkPolicyPreparer prepares the ListByPrivateLinkPolicy request. +func (client PrivateLinkResourcesClient) ListByPrivateLinkPolicyPreparer(ctx context.Context, resourceGroupName string, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-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.aadiam/privateLinkForAzureAd/{policyName}/privateLinkResources", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByPrivateLinkPolicySender sends the ListByPrivateLinkPolicy request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateLinkResourcesClient) ListByPrivateLinkPolicySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByPrivateLinkPolicyResponder handles the response to the ListByPrivateLinkPolicy request. The method always +// closes the http.Response Body. +func (client PrivateLinkResourcesClient) ListByPrivateLinkPolicyResponder(resp *http.Response) (result PrivateLinkResourceListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByPrivateLinkPolicyNextResults retrieves the next set of results, if any. +func (client PrivateLinkResourcesClient) listByPrivateLinkPolicyNextResults(ctx context.Context, lastResults PrivateLinkResourceListResult) (result PrivateLinkResourceListResult, err error) { + req, err := lastResults.privateLinkResourceListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "aad.PrivateLinkResourcesClient", "listByPrivateLinkPolicyNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByPrivateLinkPolicySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "aad.PrivateLinkResourcesClient", "listByPrivateLinkPolicyNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByPrivateLinkPolicyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkResourcesClient", "listByPrivateLinkPolicyNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByPrivateLinkPolicyComplete enumerates all values, automatically crossing page boundaries as required. +func (client PrivateLinkResourcesClient) ListByPrivateLinkPolicyComplete(ctx context.Context, resourceGroupName string, policyName string) (result PrivateLinkResourceListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.ListByPrivateLinkPolicy") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByPrivateLinkPolicy(ctx, resourceGroupName, policyName) + return +} diff --git a/services/aad/mgmt/2020-03-01/aad/version.go b/services/aad/mgmt/2020-03-01/aad/version.go new file mode 100644 index 000000000000..ffb63aeb2635 --- /dev/null +++ b/services/aad/mgmt/2020-03-01/aad/version.go @@ -0,0 +1,19 @@ +package aad + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " aad/2020-03-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/azurestackhci/mgmt/2020-10-01/azurestackhci/CHANGELOG.md b/services/azurestackhci/mgmt/2020-10-01/azurestackhci/CHANGELOG.md index 52911e4cc5e4..28323fe3325a 100644 --- a/services/azurestackhci/mgmt/2020-10-01/azurestackhci/CHANGELOG.md +++ b/services/azurestackhci/mgmt/2020-10-01/azurestackhci/CHANGELOG.md @@ -1,2 +1,24 @@ -# Change History +# Unreleased +## Additive Changes + +### New Constants + +1. CreatedByType.Application +1. CreatedByType.Key +1. CreatedByType.ManagedIdentity +1. CreatedByType.User + +### New Funcs + +1. PossibleCreatedByTypeValues() []CreatedByType + +### Struct Changes + +#### New Structs + +1. SystemData + +#### New Struct Fields + +1. Cluster.*SystemData diff --git a/services/azurestackhci/mgmt/2020-10-01/azurestackhci/_meta.json b/services/azurestackhci/mgmt/2020-10-01/azurestackhci/_meta.json index cb79c14a28d3..b37814587f8b 100644 --- a/services/azurestackhci/mgmt/2020-10-01/azurestackhci/_meta.json +++ b/services/azurestackhci/mgmt/2020-10-01/azurestackhci/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "4742065e8d48160292fbce6790710c6835f8dc4f", "readme": "/_/azure-rest-api-specs/specification/azurestackhci/resource-manager/readme.md", "tag": "package-2020-10", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/azurestackhci/mgmt/2020-10-01/azurestackhci/clusters.go b/services/azurestackhci/mgmt/2020-10-01/azurestackhci/clusters.go index da08688084dd..7730996153d8 100644 --- a/services/azurestackhci/mgmt/2020-10-01/azurestackhci/clusters.go +++ b/services/azurestackhci/mgmt/2020-10-01/azurestackhci/clusters.go @@ -52,8 +52,7 @@ func (client ClustersClient) Create(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: cluster, Constraints: []validation.Constraint{{Target: "cluster.ClusterProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "cluster.ClusterProperties.AadClientID", Name: validation.Null, Rule: true, Chain: nil}, @@ -97,6 +96,7 @@ func (client ClustersClient) CreatePreparer(ctx context.Context, resourceGroupNa "api-version": APIVersion, } + cluster.SystemData = nil preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), @@ -145,8 +145,7 @@ func (client ClustersClient) Delete(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("azurestackhci.ClustersClient", "Delete", err.Error()) } @@ -230,8 +229,7 @@ func (client ClustersClient) Get(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("azurestackhci.ClustersClient", "Get", err.Error()) } @@ -315,8 +313,7 @@ func (client ClustersClient) ListByResourceGroup(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("azurestackhci.ClustersClient", "ListByResourceGroup", err.Error()) } @@ -562,8 +559,7 @@ func (client ClustersClient) Update(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("azurestackhci.ClustersClient", "Update", err.Error()) } diff --git a/services/azurestackhci/mgmt/2020-10-01/azurestackhci/enums.go b/services/azurestackhci/mgmt/2020-10-01/azurestackhci/enums.go index 76d5de2164d2..444ad417e5e4 100644 --- a/services/azurestackhci/mgmt/2020-10-01/azurestackhci/enums.go +++ b/services/azurestackhci/mgmt/2020-10-01/azurestackhci/enums.go @@ -6,6 +6,25 @@ package azurestackhci // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// CreatedByType enumerates the values for created by type. +type CreatedByType string + +const ( + // Application ... + Application CreatedByType = "Application" + // Key ... + Key CreatedByType = "Key" + // ManagedIdentity ... + ManagedIdentity CreatedByType = "ManagedIdentity" + // User ... + User CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns an array of possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{Application, Key, ManagedIdentity, User} +} + // ProvisioningState enumerates the values for provisioning state. type ProvisioningState string diff --git a/services/azurestackhci/mgmt/2020-10-01/azurestackhci/models.go b/services/azurestackhci/mgmt/2020-10-01/azurestackhci/models.go index 02fcceff5bfb..320c5223095f 100644 --- a/services/azurestackhci/mgmt/2020-10-01/azurestackhci/models.go +++ b/services/azurestackhci/mgmt/2020-10-01/azurestackhci/models.go @@ -50,6 +50,8 @@ func (aer AzureEntityResource) MarshalJSON() ([]byte, error) { // Cluster cluster details. type Cluster struct { autorest.Response `json:"-"` + // SystemData - READ-ONLY; System data of Cluster resource + *SystemData `json:"systemData,omitempty"` // ClusterProperties - Cluster properties. *ClusterProperties `json:"properties,omitempty"` // Tags - Resource tags. @@ -88,6 +90,15 @@ func (c *Cluster) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + c.SystemData = &systemData + } case "properties": if v != nil { var clusterProperties ClusterProperties @@ -487,8 +498,8 @@ type OperationDisplay struct { Description *string `json:"description,omitempty"` } -// ProxyResource the resource model definition for an Azure Resource Manager proxy resource. It will have -// everything other than required location and tags +// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not +// have tags and a location type ProxyResource struct { // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` @@ -520,7 +531,24 @@ func (r Resource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// SystemData metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // CreatedBy - The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + // CreatedByType - The type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + CreatedByType CreatedByType `json:"createdByType,omitempty"` + // CreatedAt - The timestamp of resource creation (UTC). + CreatedAt *date.Time `json:"createdAt,omitempty"` + // LastModifiedBy - The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` + // LastModifiedAt - The timestamp of resource last modification (UTC) + LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` +} + // TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource +// which has 'tags' and a 'location' type TrackedResource struct { // Tags - Resource tags. Tags map[string]*string `json:"tags"` diff --git a/services/azurestackhci/mgmt/2022-01-01/azurestackhci/CHANGELOG.md b/services/azurestackhci/mgmt/2022-01-01/azurestackhci/CHANGELOG.md new file mode 100644 index 000000000000..a1ecf841edb0 --- /dev/null +++ b/services/azurestackhci/mgmt/2022-01-01/azurestackhci/CHANGELOG.md @@ -0,0 +1,2 @@ +# Unreleased + diff --git a/services/azurestackhci/mgmt/2022-01-01/azurestackhci/_meta.json b/services/azurestackhci/mgmt/2022-01-01/azurestackhci/_meta.json new file mode 100644 index 000000000000..1715901e727a --- /dev/null +++ b/services/azurestackhci/mgmt/2022-01-01/azurestackhci/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "4742065e8d48160292fbce6790710c6835f8dc4f", + "readme": "/_/azure-rest-api-specs/specification/azurestackhci/resource-manager/readme.md", + "tag": "package-2022-01", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2022-01 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/azurestackhci/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/services/azurestackhci/mgmt/2022-01-01/azurestackhci/arcsettings.go b/services/azurestackhci/mgmt/2022-01-01/azurestackhci/arcsettings.go new file mode 100644 index 000000000000..b26bca3e74f3 --- /dev/null +++ b/services/azurestackhci/mgmt/2022-01-01/azurestackhci/arcsettings.go @@ -0,0 +1,426 @@ +package azurestackhci + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ArcSettingsClient is the azure Stack HCI management service +type ArcSettingsClient struct { + BaseClient +} + +// NewArcSettingsClient creates an instance of the ArcSettingsClient client. +func NewArcSettingsClient(subscriptionID string) ArcSettingsClient { + return NewArcSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewArcSettingsClientWithBaseURI creates an instance of the ArcSettingsClient client using a custom endpoint. Use +// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewArcSettingsClientWithBaseURI(baseURI string, subscriptionID string) ArcSettingsClient { + return ArcSettingsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create ArcSetting for HCI cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +// arcSettingName - the name of the proxy resource holding details of HCI ArcSetting information. +// arcSetting - parameters supplied to the Create ArcSetting resource for this HCI cluster. +func (client ArcSettingsClient) Create(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, arcSetting ArcSetting) (result ArcSetting, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ArcSettingsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ArcSettingsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, clusterName, arcSettingName, arcSetting) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ArcSettingsClient) CreatePreparer(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, arcSetting ArcSetting) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "arcSettingName": autorest.Encode("path", arcSettingName), + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + arcSetting.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", pathParameters), + autorest.WithJSON(arcSetting), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ArcSettingsClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ArcSettingsClient) CreateResponder(resp *http.Response) (result ArcSetting, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete ArcSetting resource details of HCI Cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +// arcSettingName - the name of the proxy resource holding details of HCI ArcSetting information. +func (client ArcSettingsClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (result ArcSettingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ArcSettingsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ArcSettingsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, arcSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ArcSettingsClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "arcSettingName": autorest.Encode("path", arcSettingName), + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-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.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", 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 ArcSettingsClient) DeleteSender(req *http.Request) (future ArcSettingsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ArcSettingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get ArcSetting resource details of HCI Cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +// arcSettingName - the name of the proxy resource holding details of HCI ArcSetting information. +func (client ArcSettingsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (result ArcSetting, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ArcSettingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ArcSettingsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, clusterName, arcSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ArcSettingsClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "arcSettingName": autorest.Encode("path", arcSettingName), + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-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.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", 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 ArcSettingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ArcSettingsClient) GetResponder(resp *http.Response) (result ArcSetting, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByCluster get ArcSetting resources of HCI Cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +func (client ArcSettingsClient) ListByCluster(ctx context.Context, resourceGroupName string, clusterName string) (result ArcSettingListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ArcSettingsClient.ListByCluster") + defer func() { + sc := -1 + if result.asl.Response.Response != nil { + sc = result.asl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ArcSettingsClient", "ListByCluster", err.Error()) + } + + result.fn = client.listByClusterNextResults + req, err := client.ListByClusterPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "ListByCluster", nil, "Failure preparing request") + return + } + + resp, err := client.ListByClusterSender(req) + if err != nil { + result.asl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "ListByCluster", resp, "Failure sending request") + return + } + + result.asl, err = client.ListByClusterResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "ListByCluster", resp, "Failure responding to request") + return + } + if result.asl.hasNextLink() && result.asl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByClusterPreparer prepares the ListByCluster request. +func (client ArcSettingsClient) ListByClusterPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-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.AzureStackHCI/clusters/{clusterName}/arcSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByClusterSender sends the ListByCluster request. The method will close the +// http.Response Body if it receives an error. +func (client ArcSettingsClient) ListByClusterSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByClusterResponder handles the response to the ListByCluster request. The method always +// closes the http.Response Body. +func (client ArcSettingsClient) ListByClusterResponder(resp *http.Response) (result ArcSettingList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByClusterNextResults retrieves the next set of results, if any. +func (client ArcSettingsClient) listByClusterNextResults(ctx context.Context, lastResults ArcSettingList) (result ArcSettingList, err error) { + req, err := lastResults.arcSettingListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "listByClusterNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByClusterSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "listByClusterNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByClusterResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "listByClusterNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByClusterComplete enumerates all values, automatically crossing page boundaries as required. +func (client ArcSettingsClient) ListByClusterComplete(ctx context.Context, resourceGroupName string, clusterName string) (result ArcSettingListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ArcSettingsClient.ListByCluster") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByCluster(ctx, resourceGroupName, clusterName) + return +} diff --git a/services/azurestackhci/mgmt/2022-01-01/azurestackhci/azurestackhciapi/interfaces.go b/services/azurestackhci/mgmt/2022-01-01/azurestackhci/azurestackhciapi/interfaces.go new file mode 100644 index 000000000000..8b787be518e4 --- /dev/null +++ b/services/azurestackhci/mgmt/2022-01-01/azurestackhci/azurestackhciapi/interfaces.go @@ -0,0 +1,57 @@ +package azurestackhciapi + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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/azure-sdk-for-go/services/azurestackhci/mgmt/2022-01-01/azurestackhci" + "github.com/Azure/go-autorest/autorest" +) + +// ArcSettingsClientAPI contains the set of methods on the ArcSettingsClient type. +type ArcSettingsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, arcSetting azurestackhci.ArcSetting) (result azurestackhci.ArcSetting, err error) + Delete(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (result azurestackhci.ArcSettingsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (result azurestackhci.ArcSetting, err error) + ListByCluster(ctx context.Context, resourceGroupName string, clusterName string) (result azurestackhci.ArcSettingListPage, err error) + ListByClusterComplete(ctx context.Context, resourceGroupName string, clusterName string) (result azurestackhci.ArcSettingListIterator, err error) +} + +var _ ArcSettingsClientAPI = (*azurestackhci.ArcSettingsClient)(nil) + +// ClustersClientAPI contains the set of methods on the ClustersClient type. +type ClustersClientAPI interface { + Create(ctx context.Context, resourceGroupName string, clusterName string, cluster azurestackhci.Cluster) (result azurestackhci.Cluster, err error) + Delete(ctx context.Context, resourceGroupName string, clusterName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, clusterName string) (result azurestackhci.Cluster, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result azurestackhci.ClusterListPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result azurestackhci.ClusterListIterator, err error) + ListBySubscription(ctx context.Context) (result azurestackhci.ClusterListPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result azurestackhci.ClusterListIterator, err error) + Update(ctx context.Context, resourceGroupName string, clusterName string, cluster azurestackhci.ClusterPatch) (result azurestackhci.Cluster, err error) +} + +var _ ClustersClientAPI = (*azurestackhci.ClustersClient)(nil) + +// ExtensionsClientAPI contains the set of methods on the ExtensionsClient type. +type ExtensionsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string, extension azurestackhci.Extension) (result azurestackhci.ExtensionsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string) (result azurestackhci.ExtensionsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string) (result azurestackhci.Extension, err error) + ListByArcSetting(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (result azurestackhci.ExtensionListPage, err error) + ListByArcSettingComplete(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (result azurestackhci.ExtensionListIterator, err error) + Update(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string, extension azurestackhci.Extension) (result azurestackhci.ExtensionsUpdateFuture, err error) +} + +var _ ExtensionsClientAPI = (*azurestackhci.ExtensionsClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result azurestackhci.OperationListResult, err error) +} + +var _ OperationsClientAPI = (*azurestackhci.OperationsClient)(nil) diff --git a/services/azurestackhci/mgmt/2022-01-01/azurestackhci/client.go b/services/azurestackhci/mgmt/2022-01-01/azurestackhci/client.go new file mode 100644 index 000000000000..9fad13abe79e --- /dev/null +++ b/services/azurestackhci/mgmt/2022-01-01/azurestackhci/client.go @@ -0,0 +1,41 @@ +// Package azurestackhci implements the Azure ARM Azurestackhci service API version 2022-01-01. +// +// Azure Stack HCI management service +package azurestackhci + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Azurestackhci + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Azurestackhci. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/services/azurestackhci/mgmt/2022-01-01/azurestackhci/clusters.go b/services/azurestackhci/mgmt/2022-01-01/azurestackhci/clusters.go new file mode 100644 index 000000000000..64ee281f0719 --- /dev/null +++ b/services/azurestackhci/mgmt/2022-01-01/azurestackhci/clusters.go @@ -0,0 +1,627 @@ +package azurestackhci + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ClustersClient is the azure Stack HCI management service +type ClustersClient struct { + BaseClient +} + +// NewClustersClient creates an instance of the ClustersClient client. +func NewClustersClient(subscriptionID string) ClustersClient { + return NewClustersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewClustersClientWithBaseURI creates an instance of the ClustersClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewClustersClientWithBaseURI(baseURI string, subscriptionID string) ClustersClient { + return ClustersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create an HCI cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +// cluster - details of the HCI cluster. +func (client ClustersClient) Create(ctx context.Context, resourceGroupName string, clusterName string, cluster Cluster) (result Cluster, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: cluster, + Constraints: []validation.Constraint{{Target: "cluster.ClusterProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "cluster.ClusterProperties.AadClientID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "cluster.ClusterProperties.AadTenantID", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("azurestackhci.ClustersClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, clusterName, cluster) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ClustersClient) CreatePreparer(ctx context.Context, resourceGroupName string, clusterName string, cluster Cluster) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + cluster.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", pathParameters), + autorest.WithJSON(cluster), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ClustersClient) CreateResponder(resp *http.Response) (result Cluster, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete an HCI cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +func (client ClustersClient) Delete(ctx context.Context, resourceGroupName string, clusterName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ClustersClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ClustersClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-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.AzureStackHCI/clusters/{clusterName}", 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 ClustersClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ClustersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get HCI cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +func (client ClustersClient) Get(ctx context.Context, resourceGroupName string, clusterName string) (result Cluster, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ClustersClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ClustersClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-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.AzureStackHCI/clusters/{clusterName}", 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 ClustersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ClustersClient) GetResponder(resp *http.Response) (result Cluster, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup list all HCI clusters in a resource group. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +func (client ClustersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ClusterListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.cl.Response.Response != nil { + sc = result.cl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ClustersClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.cl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.cl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.cl.hasNextLink() && result.cl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ClustersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-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.AzureStackHCI/clusters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client ClustersClient) ListByResourceGroupResponder(resp *http.Response) (result ClusterList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client ClustersClient) listByResourceGroupNextResults(ctx context.Context, lastResults ClusterList) (result ClusterList, err error) { + req, err := lastResults.clusterListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ClustersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ClusterListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListBySubscription list all HCI clusters in a subscription. +func (client ClustersClient) ListBySubscription(ctx context.Context) (result ClusterListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.ListBySubscription") + defer func() { + sc := -1 + if result.cl.Response.Response != nil { + sc = result.cl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ClustersClient", "ListBySubscription", err.Error()) + } + + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.cl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.cl, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.cl.hasNextLink() && result.cl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client ClustersClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/clusters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client ClustersClient) ListBySubscriptionResponder(resp *http.Response) (result ClusterList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client ClustersClient) listBySubscriptionNextResults(ctx context.Context, lastResults ClusterList) (result ClusterList, err error) { + req, err := lastResults.clusterListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client ClustersClient) ListBySubscriptionComplete(ctx context.Context) (result ClusterListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.ListBySubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBySubscription(ctx) + return +} + +// Update update an HCI cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +// cluster - details of the HCI cluster. +func (client ClustersClient) Update(ctx context.Context, resourceGroupName string, clusterName string, cluster ClusterPatch) (result Cluster, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ClustersClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, clusterName, cluster) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ClustersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, cluster ClusterPatch) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", pathParameters), + autorest.WithJSON(cluster), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ClustersClient) UpdateResponder(resp *http.Response) (result Cluster, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/azurestackhci/mgmt/2022-01-01/azurestackhci/enums.go b/services/azurestackhci/mgmt/2022-01-01/azurestackhci/enums.go new file mode 100644 index 000000000000..9abbdd351530 --- /dev/null +++ b/services/azurestackhci/mgmt/2022-01-01/azurestackhci/enums.go @@ -0,0 +1,297 @@ +package azurestackhci + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// ActionType enumerates the values for action type. +type ActionType string + +const ( + // Internal ... + Internal ActionType = "Internal" +) + +// PossibleActionTypeValues returns an array of possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{Internal} +} + +// ArcSettingAggregateState enumerates the values for arc setting aggregate state. +type ArcSettingAggregateState string + +const ( + // Canceled ... + Canceled ArcSettingAggregateState = "Canceled" + // Connected ... + Connected ArcSettingAggregateState = "Connected" + // Creating ... + Creating ArcSettingAggregateState = "Creating" + // Deleted ... + Deleted ArcSettingAggregateState = "Deleted" + // Deleting ... + Deleting ArcSettingAggregateState = "Deleting" + // Disconnected ... + Disconnected ArcSettingAggregateState = "Disconnected" + // Error ... + Error ArcSettingAggregateState = "Error" + // Failed ... + Failed ArcSettingAggregateState = "Failed" + // InProgress ... + InProgress ArcSettingAggregateState = "InProgress" + // Moving ... + Moving ArcSettingAggregateState = "Moving" + // NotSpecified ... + NotSpecified ArcSettingAggregateState = "NotSpecified" + // PartiallyConnected ... + PartiallyConnected ArcSettingAggregateState = "PartiallyConnected" + // PartiallySucceeded ... + PartiallySucceeded ArcSettingAggregateState = "PartiallySucceeded" + // Succeeded ... + Succeeded ArcSettingAggregateState = "Succeeded" + // Updating ... + Updating ArcSettingAggregateState = "Updating" +) + +// PossibleArcSettingAggregateStateValues returns an array of possible values for the ArcSettingAggregateState const type. +func PossibleArcSettingAggregateStateValues() []ArcSettingAggregateState { + return []ArcSettingAggregateState{Canceled, Connected, Creating, Deleted, Deleting, Disconnected, Error, Failed, InProgress, Moving, NotSpecified, PartiallyConnected, PartiallySucceeded, Succeeded, Updating} +} + +// CreatedByType enumerates the values for created by type. +type CreatedByType string + +const ( + // Application ... + Application CreatedByType = "Application" + // Key ... + Key CreatedByType = "Key" + // ManagedIdentity ... + ManagedIdentity CreatedByType = "ManagedIdentity" + // User ... + User CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns an array of possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{Application, Key, ManagedIdentity, User} +} + +// DiagnosticLevel enumerates the values for diagnostic level. +type DiagnosticLevel string + +const ( + // Basic ... + Basic DiagnosticLevel = "Basic" + // Enhanced ... + Enhanced DiagnosticLevel = "Enhanced" + // Off ... + Off DiagnosticLevel = "Off" +) + +// PossibleDiagnosticLevelValues returns an array of possible values for the DiagnosticLevel const type. +func PossibleDiagnosticLevelValues() []DiagnosticLevel { + return []DiagnosticLevel{Basic, Enhanced, Off} +} + +// ExtensionAggregateState enumerates the values for extension aggregate state. +type ExtensionAggregateState string + +const ( + // ExtensionAggregateStateCanceled ... + ExtensionAggregateStateCanceled ExtensionAggregateState = "Canceled" + // ExtensionAggregateStateConnected ... + ExtensionAggregateStateConnected ExtensionAggregateState = "Connected" + // ExtensionAggregateStateCreating ... + ExtensionAggregateStateCreating ExtensionAggregateState = "Creating" + // ExtensionAggregateStateDeleted ... + ExtensionAggregateStateDeleted ExtensionAggregateState = "Deleted" + // ExtensionAggregateStateDeleting ... + ExtensionAggregateStateDeleting ExtensionAggregateState = "Deleting" + // ExtensionAggregateStateDisconnected ... + ExtensionAggregateStateDisconnected ExtensionAggregateState = "Disconnected" + // ExtensionAggregateStateError ... + ExtensionAggregateStateError ExtensionAggregateState = "Error" + // ExtensionAggregateStateFailed ... + ExtensionAggregateStateFailed ExtensionAggregateState = "Failed" + // ExtensionAggregateStateInProgress ... + ExtensionAggregateStateInProgress ExtensionAggregateState = "InProgress" + // ExtensionAggregateStateMoving ... + ExtensionAggregateStateMoving ExtensionAggregateState = "Moving" + // ExtensionAggregateStateNotSpecified ... + ExtensionAggregateStateNotSpecified ExtensionAggregateState = "NotSpecified" + // ExtensionAggregateStatePartiallyConnected ... + ExtensionAggregateStatePartiallyConnected ExtensionAggregateState = "PartiallyConnected" + // ExtensionAggregateStatePartiallySucceeded ... + ExtensionAggregateStatePartiallySucceeded ExtensionAggregateState = "PartiallySucceeded" + // ExtensionAggregateStateSucceeded ... + ExtensionAggregateStateSucceeded ExtensionAggregateState = "Succeeded" + // ExtensionAggregateStateUpdating ... + ExtensionAggregateStateUpdating ExtensionAggregateState = "Updating" +) + +// PossibleExtensionAggregateStateValues returns an array of possible values for the ExtensionAggregateState const type. +func PossibleExtensionAggregateStateValues() []ExtensionAggregateState { + return []ExtensionAggregateState{ExtensionAggregateStateCanceled, ExtensionAggregateStateConnected, ExtensionAggregateStateCreating, ExtensionAggregateStateDeleted, ExtensionAggregateStateDeleting, ExtensionAggregateStateDisconnected, ExtensionAggregateStateError, ExtensionAggregateStateFailed, ExtensionAggregateStateInProgress, ExtensionAggregateStateMoving, ExtensionAggregateStateNotSpecified, ExtensionAggregateStatePartiallyConnected, ExtensionAggregateStatePartiallySucceeded, ExtensionAggregateStateSucceeded, ExtensionAggregateStateUpdating} +} + +// ImdsAttestation enumerates the values for imds attestation. +type ImdsAttestation string + +const ( + // Disabled ... + Disabled ImdsAttestation = "Disabled" + // Enabled ... + Enabled ImdsAttestation = "Enabled" +) + +// PossibleImdsAttestationValues returns an array of possible values for the ImdsAttestation const type. +func PossibleImdsAttestationValues() []ImdsAttestation { + return []ImdsAttestation{Disabled, Enabled} +} + +// NodeArcState enumerates the values for node arc state. +type NodeArcState string + +const ( + // NodeArcStateCanceled ... + NodeArcStateCanceled NodeArcState = "Canceled" + // NodeArcStateConnected ... + NodeArcStateConnected NodeArcState = "Connected" + // NodeArcStateCreating ... + NodeArcStateCreating NodeArcState = "Creating" + // NodeArcStateDeleted ... + NodeArcStateDeleted NodeArcState = "Deleted" + // NodeArcStateDeleting ... + NodeArcStateDeleting NodeArcState = "Deleting" + // NodeArcStateDisconnected ... + NodeArcStateDisconnected NodeArcState = "Disconnected" + // NodeArcStateError ... + NodeArcStateError NodeArcState = "Error" + // NodeArcStateFailed ... + NodeArcStateFailed NodeArcState = "Failed" + // NodeArcStateMoving ... + NodeArcStateMoving NodeArcState = "Moving" + // NodeArcStateNotSpecified ... + NodeArcStateNotSpecified NodeArcState = "NotSpecified" + // NodeArcStateSucceeded ... + NodeArcStateSucceeded NodeArcState = "Succeeded" + // NodeArcStateUpdating ... + NodeArcStateUpdating NodeArcState = "Updating" +) + +// PossibleNodeArcStateValues returns an array of possible values for the NodeArcState const type. +func PossibleNodeArcStateValues() []NodeArcState { + return []NodeArcState{NodeArcStateCanceled, NodeArcStateConnected, NodeArcStateCreating, NodeArcStateDeleted, NodeArcStateDeleting, NodeArcStateDisconnected, NodeArcStateError, NodeArcStateFailed, NodeArcStateMoving, NodeArcStateNotSpecified, NodeArcStateSucceeded, NodeArcStateUpdating} +} + +// NodeExtensionState enumerates the values for node extension state. +type NodeExtensionState string + +const ( + // NodeExtensionStateCanceled ... + NodeExtensionStateCanceled NodeExtensionState = "Canceled" + // NodeExtensionStateConnected ... + NodeExtensionStateConnected NodeExtensionState = "Connected" + // NodeExtensionStateCreating ... + NodeExtensionStateCreating NodeExtensionState = "Creating" + // NodeExtensionStateDeleted ... + NodeExtensionStateDeleted NodeExtensionState = "Deleted" + // NodeExtensionStateDeleting ... + NodeExtensionStateDeleting NodeExtensionState = "Deleting" + // NodeExtensionStateDisconnected ... + NodeExtensionStateDisconnected NodeExtensionState = "Disconnected" + // NodeExtensionStateError ... + NodeExtensionStateError NodeExtensionState = "Error" + // NodeExtensionStateFailed ... + NodeExtensionStateFailed NodeExtensionState = "Failed" + // NodeExtensionStateMoving ... + NodeExtensionStateMoving NodeExtensionState = "Moving" + // NodeExtensionStateNotSpecified ... + NodeExtensionStateNotSpecified NodeExtensionState = "NotSpecified" + // NodeExtensionStateSucceeded ... + NodeExtensionStateSucceeded NodeExtensionState = "Succeeded" + // NodeExtensionStateUpdating ... + NodeExtensionStateUpdating NodeExtensionState = "Updating" +) + +// PossibleNodeExtensionStateValues returns an array of possible values for the NodeExtensionState const type. +func PossibleNodeExtensionStateValues() []NodeExtensionState { + return []NodeExtensionState{NodeExtensionStateCanceled, NodeExtensionStateConnected, NodeExtensionStateCreating, NodeExtensionStateDeleted, NodeExtensionStateDeleting, NodeExtensionStateDisconnected, NodeExtensionStateError, NodeExtensionStateFailed, NodeExtensionStateMoving, NodeExtensionStateNotSpecified, NodeExtensionStateSucceeded, NodeExtensionStateUpdating} +} + +// Origin enumerates the values for origin. +type Origin string + +const ( + // OriginSystem ... + OriginSystem Origin = "system" + // OriginUser ... + OriginUser Origin = "user" + // OriginUsersystem ... + OriginUsersystem Origin = "user,system" +) + +// PossibleOriginValues returns an array of possible values for the Origin const type. +func PossibleOriginValues() []Origin { + return []Origin{OriginSystem, OriginUser, OriginUsersystem} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // ProvisioningStateAccepted ... + ProvisioningStateAccepted ProvisioningState = "Accepted" + // ProvisioningStateCanceled ... + ProvisioningStateCanceled ProvisioningState = "Canceled" + // ProvisioningStateFailed ... + ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateProvisioning ... + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + // ProvisioningStateSucceeded ... + ProvisioningStateSucceeded ProvisioningState = "Succeeded" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ProvisioningStateAccepted, ProvisioningStateCanceled, ProvisioningStateFailed, ProvisioningStateProvisioning, ProvisioningStateSucceeded} +} + +// Status enumerates the values for status. +type Status string + +const ( + // StatusConnectedRecently ... + StatusConnectedRecently Status = "ConnectedRecently" + // StatusDisconnected ... + StatusDisconnected Status = "Disconnected" + // StatusError ... + StatusError Status = "Error" + // StatusNotConnectedRecently ... + StatusNotConnectedRecently Status = "NotConnectedRecently" + // StatusNotYetRegistered ... + StatusNotYetRegistered Status = "NotYetRegistered" +) + +// PossibleStatusValues returns an array of possible values for the Status const type. +func PossibleStatusValues() []Status { + return []Status{StatusConnectedRecently, StatusDisconnected, StatusError, StatusNotConnectedRecently, StatusNotYetRegistered} +} + +// WindowsServerSubscription enumerates the values for windows server subscription. +type WindowsServerSubscription string + +const ( + // WindowsServerSubscriptionDisabled ... + WindowsServerSubscriptionDisabled WindowsServerSubscription = "Disabled" + // WindowsServerSubscriptionEnabled ... + WindowsServerSubscriptionEnabled WindowsServerSubscription = "Enabled" +) + +// PossibleWindowsServerSubscriptionValues returns an array of possible values for the WindowsServerSubscription const type. +func PossibleWindowsServerSubscriptionValues() []WindowsServerSubscription { + return []WindowsServerSubscription{WindowsServerSubscriptionDisabled, WindowsServerSubscriptionEnabled} +} diff --git a/services/azurestackhci/mgmt/2022-01-01/azurestackhci/extensions.go b/services/azurestackhci/mgmt/2022-01-01/azurestackhci/extensions.go new file mode 100644 index 000000000000..7b45a2634a80 --- /dev/null +++ b/services/azurestackhci/mgmt/2022-01-01/azurestackhci/extensions.go @@ -0,0 +1,533 @@ +package azurestackhci + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ExtensionsClient is the azure Stack HCI management service +type ExtensionsClient struct { + BaseClient +} + +// NewExtensionsClient creates an instance of the ExtensionsClient client. +func NewExtensionsClient(subscriptionID string) ExtensionsClient { + return NewExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewExtensionsClientWithBaseURI creates an instance of the ExtensionsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewExtensionsClientWithBaseURI(baseURI string, subscriptionID string) ExtensionsClient { + return ExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create Extension for HCI cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +// arcSettingName - the name of the proxy resource holding details of HCI ArcSetting information. +// extensionName - the name of the machine extension. +// extension - details of the Machine Extension to be created. +func (client ExtensionsClient) Create(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string, extension Extension) (result ExtensionsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtensionsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ExtensionsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, clusterName, arcSettingName, extensionName, extension) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ExtensionsClient) CreatePreparer(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string, extension Extension) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "arcSettingName": autorest.Encode("path", arcSettingName), + "clusterName": autorest.Encode("path", clusterName), + "extensionName": autorest.Encode("path", extensionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + extension.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", pathParameters), + autorest.WithJSON(extension), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ExtensionsClient) CreateSender(req *http.Request) (future ExtensionsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ExtensionsClient) CreateResponder(resp *http.Response) (result Extension, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete particular Arc Extension of HCI Cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +// arcSettingName - the name of the proxy resource holding details of HCI ArcSetting information. +// extensionName - the name of the machine extension. +func (client ExtensionsClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string) (result ExtensionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtensionsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ExtensionsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, arcSettingName, extensionName) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ExtensionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "arcSettingName": autorest.Encode("path", arcSettingName), + "clusterName": autorest.Encode("path", clusterName), + "extensionName": autorest.Encode("path", extensionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-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.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", 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 ExtensionsClient) DeleteSender(req *http.Request) (future ExtensionsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get particular Arc Extension of HCI Cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +// arcSettingName - the name of the proxy resource holding details of HCI ArcSetting information. +// extensionName - the name of the machine extension. +func (client ExtensionsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string) (result Extension, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtensionsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ExtensionsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, clusterName, arcSettingName, extensionName) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ExtensionsClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "arcSettingName": autorest.Encode("path", arcSettingName), + "clusterName": autorest.Encode("path", clusterName), + "extensionName": autorest.Encode("path", extensionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-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.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", 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 ExtensionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ExtensionsClient) GetResponder(resp *http.Response) (result Extension, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByArcSetting list all Extensions under ArcSetting resource. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +// arcSettingName - the name of the proxy resource holding details of HCI ArcSetting information. +func (client ExtensionsClient) ListByArcSetting(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (result ExtensionListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtensionsClient.ListByArcSetting") + defer func() { + sc := -1 + if result.el.Response.Response != nil { + sc = result.el.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ExtensionsClient", "ListByArcSetting", err.Error()) + } + + result.fn = client.listByArcSettingNextResults + req, err := client.ListByArcSettingPreparer(ctx, resourceGroupName, clusterName, arcSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "ListByArcSetting", nil, "Failure preparing request") + return + } + + resp, err := client.ListByArcSettingSender(req) + if err != nil { + result.el.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "ListByArcSetting", resp, "Failure sending request") + return + } + + result.el, err = client.ListByArcSettingResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "ListByArcSetting", resp, "Failure responding to request") + return + } + if result.el.hasNextLink() && result.el.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByArcSettingPreparer prepares the ListByArcSetting request. +func (client ExtensionsClient) ListByArcSettingPreparer(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "arcSettingName": autorest.Encode("path", arcSettingName), + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-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.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByArcSettingSender sends the ListByArcSetting request. The method will close the +// http.Response Body if it receives an error. +func (client ExtensionsClient) ListByArcSettingSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByArcSettingResponder handles the response to the ListByArcSetting request. The method always +// closes the http.Response Body. +func (client ExtensionsClient) ListByArcSettingResponder(resp *http.Response) (result ExtensionList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByArcSettingNextResults retrieves the next set of results, if any. +func (client ExtensionsClient) listByArcSettingNextResults(ctx context.Context, lastResults ExtensionList) (result ExtensionList, err error) { + req, err := lastResults.extensionListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "listByArcSettingNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByArcSettingSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "listByArcSettingNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByArcSettingResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "listByArcSettingNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByArcSettingComplete enumerates all values, automatically crossing page boundaries as required. +func (client ExtensionsClient) ListByArcSettingComplete(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (result ExtensionListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtensionsClient.ListByArcSetting") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByArcSetting(ctx, resourceGroupName, clusterName, arcSettingName) + return +} + +// Update update Extension for HCI cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +// arcSettingName - the name of the proxy resource holding details of HCI ArcSetting information. +// extensionName - the name of the machine extension. +// extension - details of the Machine Extension to be created. +func (client ExtensionsClient) Update(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string, extension Extension) (result ExtensionsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtensionsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ExtensionsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, clusterName, arcSettingName, extensionName, extension) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ExtensionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string, extension Extension) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "arcSettingName": autorest.Encode("path", arcSettingName), + "clusterName": autorest.Encode("path", clusterName), + "extensionName": autorest.Encode("path", extensionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + extension.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", pathParameters), + autorest.WithJSON(extension), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ExtensionsClient) UpdateSender(req *http.Request) (future ExtensionsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ExtensionsClient) UpdateResponder(resp *http.Response) (result Extension, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/azurestackhci/mgmt/2022-01-01/azurestackhci/models.go b/services/azurestackhci/mgmt/2022-01-01/azurestackhci/models.go new file mode 100644 index 000000000000..69022bfbd1c8 --- /dev/null +++ b/services/azurestackhci/mgmt/2022-01-01/azurestackhci/models.go @@ -0,0 +1,1473 @@ +package azurestackhci + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/azurestackhci/mgmt/2022-01-01/azurestackhci" + +// ArcSetting arcSetting details. +type ArcSetting struct { + autorest.Response `json:"-"` + // SystemData - READ-ONLY; System data of ArcSetting resource + *SystemData `json:"systemData,omitempty"` + // ArcSettingProperties - ArcSetting properties. + *ArcSettingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ArcSetting. +func (as ArcSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if as.ArcSettingProperties != nil { + objectMap["properties"] = as.ArcSettingProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ArcSetting struct. +func (as *ArcSetting) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + as.SystemData = &systemData + } + case "properties": + if v != nil { + var arcSettingProperties ArcSettingProperties + err = json.Unmarshal(*v, &arcSettingProperties) + if err != nil { + return err + } + as.ArcSettingProperties = &arcSettingProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + as.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + as.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + as.Type = &typeVar + } + } + } + + return nil +} + +// ArcSettingList list of ArcSetting proxy resources for the HCI cluster. +type ArcSettingList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of ArcSetting proxy resources. + Value *[]ArcSetting `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ArcSettingList. +func (asl ArcSettingList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ArcSettingListIterator provides access to a complete listing of ArcSetting values. +type ArcSettingListIterator struct { + i int + page ArcSettingListPage +} + +// NextWithContext 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 *ArcSettingListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ArcSettingListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ArcSettingListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ArcSettingListIterator) 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 ArcSettingListIterator) Response() ArcSettingList { + 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 ArcSettingListIterator) Value() ArcSetting { + if !iter.page.NotDone() { + return ArcSetting{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ArcSettingListIterator type. +func NewArcSettingListIterator(page ArcSettingListPage) ArcSettingListIterator { + return ArcSettingListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (asl ArcSettingList) IsEmpty() bool { + return asl.Value == nil || len(*asl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (asl ArcSettingList) hasNextLink() bool { + return asl.NextLink != nil && len(*asl.NextLink) != 0 +} + +// arcSettingListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (asl ArcSettingList) arcSettingListPreparer(ctx context.Context) (*http.Request, error) { + if !asl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(asl.NextLink))) +} + +// ArcSettingListPage contains a page of ArcSetting values. +type ArcSettingListPage struct { + fn func(context.Context, ArcSettingList) (ArcSettingList, error) + asl ArcSettingList +} + +// NextWithContext 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 *ArcSettingListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ArcSettingListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.asl) + if err != nil { + return err + } + page.asl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *ArcSettingListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ArcSettingListPage) NotDone() bool { + return !page.asl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ArcSettingListPage) Response() ArcSettingList { + return page.asl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ArcSettingListPage) Values() []ArcSetting { + if page.asl.IsEmpty() { + return nil + } + return *page.asl.Value +} + +// Creates a new instance of the ArcSettingListPage type. +func NewArcSettingListPage(cur ArcSettingList, getNextPage func(context.Context, ArcSettingList) (ArcSettingList, error)) ArcSettingListPage { + return ArcSettingListPage{ + fn: getNextPage, + asl: cur, + } +} + +// ArcSettingProperties arcSetting properties. +type ArcSettingProperties struct { + // ProvisioningState - READ-ONLY; Provisioning state of the ArcSetting proxy resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateAccepted', 'ProvisioningStateProvisioning' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ArcInstanceResourceGroup - The resource group that hosts the Arc agents, ie. Hybrid Compute Machine resources. + ArcInstanceResourceGroup *string `json:"arcInstanceResourceGroup,omitempty"` + // AggregateState - READ-ONLY; Aggregate state of Arc agent across the nodes in this HCI cluster. Possible values include: 'NotSpecified', 'Error', 'Succeeded', 'Canceled', 'Failed', 'Connected', 'Disconnected', 'Deleted', 'Creating', 'Updating', 'Deleting', 'Moving', 'PartiallySucceeded', 'PartiallyConnected', 'InProgress' + AggregateState ArcSettingAggregateState `json:"aggregateState,omitempty"` + // PerNodeDetails - READ-ONLY; State of Arc agent in each of the nodes. + PerNodeDetails *[]PerNodeState `json:"perNodeDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for ArcSettingProperties. +func (asp ArcSettingProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asp.ArcInstanceResourceGroup != nil { + objectMap["arcInstanceResourceGroup"] = asp.ArcInstanceResourceGroup + } + return json.Marshal(objectMap) +} + +// ArcSettingsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ArcSettingsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ArcSettingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ArcSettingsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ArcSettingsDeleteFuture.Result. +func (future *ArcSettingsDeleteFuture) result(client ArcSettingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("azurestackhci.ArcSettingsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. +type AzureEntityResource struct { + // Etag - READ-ONLY; Resource Etag. + Etag *string `json:"etag,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureEntityResource. +func (aer AzureEntityResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// Cluster cluster details. +type Cluster struct { + autorest.Response `json:"-"` + // SystemData - READ-ONLY; System data of Cluster resource + *SystemData `json:"systemData,omitempty"` + // ClusterProperties - Cluster properties. + *ClusterProperties `json:"properties,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Cluster. +func (c Cluster) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.ClusterProperties != nil { + objectMap["properties"] = c.ClusterProperties + } + if c.Tags != nil { + objectMap["tags"] = c.Tags + } + if c.Location != nil { + objectMap["location"] = c.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Cluster struct. +func (c *Cluster) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + c.SystemData = &systemData + } + case "properties": + if v != nil { + var clusterProperties ClusterProperties + err = json.Unmarshal(*v, &clusterProperties) + if err != nil { + return err + } + c.ClusterProperties = &clusterProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + c.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + c.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + c.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + } + } + + return nil +} + +// ClusterDesiredProperties desired properties of the cluster. +type ClusterDesiredProperties struct { + // WindowsServerSubscription - Desired state of Windows Server Subscription. Possible values include: 'WindowsServerSubscriptionDisabled', 'WindowsServerSubscriptionEnabled' + WindowsServerSubscription WindowsServerSubscription `json:"windowsServerSubscription,omitempty"` + // DiagnosticLevel - Desired level of diagnostic data emitted by the cluster. Possible values include: 'Off', 'Basic', 'Enhanced' + DiagnosticLevel DiagnosticLevel `json:"diagnosticLevel,omitempty"` +} + +// ClusterList list of clusters. +type ClusterList struct { + autorest.Response `json:"-"` + // Value - List of clusters. + Value *[]Cluster `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ClusterList. +func (cl ClusterList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cl.Value != nil { + objectMap["value"] = cl.Value + } + return json.Marshal(objectMap) +} + +// ClusterListIterator provides access to a complete listing of Cluster values. +type ClusterListIterator struct { + i int + page ClusterListPage +} + +// NextWithContext 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 *ClusterListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClusterListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ClusterListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ClusterListIterator) 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 ClusterListIterator) Response() ClusterList { + 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 ClusterListIterator) Value() Cluster { + if !iter.page.NotDone() { + return Cluster{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ClusterListIterator type. +func NewClusterListIterator(page ClusterListPage) ClusterListIterator { + return ClusterListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (cl ClusterList) IsEmpty() bool { + return cl.Value == nil || len(*cl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (cl ClusterList) hasNextLink() bool { + return cl.NextLink != nil && len(*cl.NextLink) != 0 +} + +// clusterListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cl ClusterList) clusterListPreparer(ctx context.Context) (*http.Request, error) { + if !cl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cl.NextLink))) +} + +// ClusterListPage contains a page of Cluster values. +type ClusterListPage struct { + fn func(context.Context, ClusterList) (ClusterList, error) + cl ClusterList +} + +// NextWithContext 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 *ClusterListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClusterListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.cl) + if err != nil { + return err + } + page.cl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *ClusterListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ClusterListPage) NotDone() bool { + return !page.cl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ClusterListPage) Response() ClusterList { + return page.cl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ClusterListPage) Values() []Cluster { + if page.cl.IsEmpty() { + return nil + } + return *page.cl.Value +} + +// Creates a new instance of the ClusterListPage type. +func NewClusterListPage(cur ClusterList, getNextPage func(context.Context, ClusterList) (ClusterList, error)) ClusterListPage { + return ClusterListPage{ + fn: getNextPage, + cl: cur, + } +} + +// ClusterNode cluster node details. +type ClusterNode struct { + // Name - READ-ONLY; Name of the cluster node. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; Id of the node in the cluster. + ID *float64 `json:"id,omitempty"` + // WindowsServerSubscription - READ-ONLY; State of Windows Server Subscription. Possible values include: 'WindowsServerSubscriptionDisabled', 'WindowsServerSubscriptionEnabled' + WindowsServerSubscription WindowsServerSubscription `json:"windowsServerSubscription,omitempty"` + // Manufacturer - READ-ONLY; Manufacturer of the cluster node hardware. + Manufacturer *string `json:"manufacturer,omitempty"` + // Model - READ-ONLY; Model name of the cluster node hardware. + Model *string `json:"model,omitempty"` + // OsName - READ-ONLY; Operating system running on the cluster node. + OsName *string `json:"osName,omitempty"` + // OsVersion - READ-ONLY; Version of the operating system running on the cluster node. + OsVersion *string `json:"osVersion,omitempty"` + // SerialNumber - READ-ONLY; Immutable id of the cluster node. + SerialNumber *string `json:"serialNumber,omitempty"` + // CoreCount - READ-ONLY; Number of physical cores on the cluster node. + CoreCount *float64 `json:"coreCount,omitempty"` + // MemoryInGiB - READ-ONLY; Total available memory on the cluster node (in GiB). + MemoryInGiB *float64 `json:"memoryInGiB,omitempty"` +} + +// MarshalJSON is the custom marshaler for ClusterNode. +func (cn ClusterNode) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ClusterPatch cluster details to update. +type ClusterPatch struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ClusterPatchProperties - Cluster properties. + *ClusterPatchProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ClusterPatch. +func (cp ClusterPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cp.Tags != nil { + objectMap["tags"] = cp.Tags + } + if cp.ClusterPatchProperties != nil { + objectMap["properties"] = cp.ClusterPatchProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ClusterPatch struct. +func (cp *ClusterPatch) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + cp.Tags = tags + } + case "properties": + if v != nil { + var clusterPatchProperties ClusterPatchProperties + err = json.Unmarshal(*v, &clusterPatchProperties) + if err != nil { + return err + } + cp.ClusterPatchProperties = &clusterPatchProperties + } + } + } + + return nil +} + +// ClusterPatchProperties cluster properties. +type ClusterPatchProperties struct { + // CloudManagementEndpoint - Endpoint configured for management from the Azure portal + CloudManagementEndpoint *string `json:"cloudManagementEndpoint,omitempty"` + // AadClientID - App id of cluster AAD identity. + AadClientID *string `json:"aadClientId,omitempty"` + // AadTenantID - Tenant id of cluster AAD identity. + AadTenantID *string `json:"aadTenantId,omitempty"` + // DesiredProperties - Desired properties of the cluster. + DesiredProperties *ClusterDesiredProperties `json:"desiredProperties,omitempty"` +} + +// ClusterProperties cluster properties. +type ClusterProperties struct { + // ProvisioningState - READ-ONLY; Provisioning state. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateAccepted', 'ProvisioningStateProvisioning' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Status - READ-ONLY; Status of the cluster agent. Possible values include: 'StatusNotYetRegistered', 'StatusConnectedRecently', 'StatusNotConnectedRecently', 'StatusDisconnected', 'StatusError' + Status Status `json:"status,omitempty"` + // CloudID - READ-ONLY; Unique, immutable resource id. + CloudID *string `json:"cloudId,omitempty"` + // CloudManagementEndpoint - Endpoint configured for management from the Azure portal. + CloudManagementEndpoint *string `json:"cloudManagementEndpoint,omitempty"` + // AadClientID - App id of cluster AAD identity. + AadClientID *string `json:"aadClientId,omitempty"` + // AadTenantID - Tenant id of cluster AAD identity. + AadTenantID *string `json:"aadTenantId,omitempty"` + // DesiredProperties - Desired properties of the cluster. + DesiredProperties *ClusterDesiredProperties `json:"desiredProperties,omitempty"` + // ReportedProperties - READ-ONLY; Properties reported by cluster agent. + ReportedProperties *ClusterReportedProperties `json:"reportedProperties,omitempty"` + // TrialDaysRemaining - READ-ONLY; Number of days remaining in the trial period. + TrialDaysRemaining *float64 `json:"trialDaysRemaining,omitempty"` + // BillingModel - READ-ONLY; Type of billing applied to the resource. + BillingModel *string `json:"billingModel,omitempty"` + // RegistrationTimestamp - READ-ONLY; First cluster sync timestamp. + RegistrationTimestamp *date.Time `json:"registrationTimestamp,omitempty"` + // LastSyncTimestamp - READ-ONLY; Most recent cluster sync timestamp. + LastSyncTimestamp *date.Time `json:"lastSyncTimestamp,omitempty"` + // LastBillingTimestamp - READ-ONLY; Most recent billing meter timestamp. + LastBillingTimestamp *date.Time `json:"lastBillingTimestamp,omitempty"` +} + +// MarshalJSON is the custom marshaler for ClusterProperties. +func (cp ClusterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cp.CloudManagementEndpoint != nil { + objectMap["cloudManagementEndpoint"] = cp.CloudManagementEndpoint + } + if cp.AadClientID != nil { + objectMap["aadClientId"] = cp.AadClientID + } + if cp.AadTenantID != nil { + objectMap["aadTenantId"] = cp.AadTenantID + } + if cp.DesiredProperties != nil { + objectMap["desiredProperties"] = cp.DesiredProperties + } + return json.Marshal(objectMap) +} + +// ClusterReportedProperties properties reported by cluster agent. +type ClusterReportedProperties struct { + // ClusterName - READ-ONLY; Name of the on-prem cluster connected to this resource. + ClusterName *string `json:"clusterName,omitempty"` + // ClusterID - READ-ONLY; Unique id generated by the on-prem cluster. + ClusterID *string `json:"clusterId,omitempty"` + // ClusterVersion - READ-ONLY; Version of the cluster software. + ClusterVersion *string `json:"clusterVersion,omitempty"` + // Nodes - READ-ONLY; List of nodes reported by the cluster. + Nodes *[]ClusterNode `json:"nodes,omitempty"` + // LastUpdated - READ-ONLY; Last time the cluster reported the data. + LastUpdated *date.Time `json:"lastUpdated,omitempty"` + // ImdsAttestation - READ-ONLY; IMDS attestation status of the cluster. Possible values include: 'Disabled', 'Enabled' + ImdsAttestation ImdsAttestation `json:"imdsAttestation,omitempty"` + // DiagnosticLevel - Level of diagnostic data emitted by the cluster. Possible values include: 'Off', 'Basic', 'Enhanced' + DiagnosticLevel DiagnosticLevel `json:"diagnosticLevel,omitempty"` +} + +// MarshalJSON is the custom marshaler for ClusterReportedProperties. +func (crp ClusterReportedProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if crp.DiagnosticLevel != "" { + objectMap["diagnosticLevel"] = crp.DiagnosticLevel + } + return json.Marshal(objectMap) +} + +// ErrorAdditionalInfo the resource management error additional info. +type ErrorAdditionalInfo struct { + // Type - READ-ONLY; The additional info type. + Type *string `json:"type,omitempty"` + // Info - READ-ONLY; The additional info. + Info interface{} `json:"info,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorAdditionalInfo. +func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ErrorDetail the error detail. +type ErrorDetail struct { + // Code - READ-ONLY; The error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; The error message. + Message *string `json:"message,omitempty"` + // Target - READ-ONLY; The error target. + Target *string `json:"target,omitempty"` + // Details - READ-ONLY; The error details. + Details *[]ErrorDetail `json:"details,omitempty"` + // AdditionalInfo - READ-ONLY; The error additional info. + AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorDetail. +func (ed ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ErrorResponse common error response for all Azure Resource Manager APIs to return error details for +// failed operations. (This also follows the OData error response format.). +type ErrorResponse struct { + // Error - The error object. + Error *ErrorDetail `json:"error,omitempty"` +} + +// Extension details of a particular extension in HCI Cluster. +type Extension struct { + autorest.Response `json:"-"` + // SystemData - READ-ONLY; System data of Extension resource. + *SystemData `json:"systemData,omitempty"` + // ExtensionProperties - Describes Machine Extension Properties. + *ExtensionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Extension. +func (e Extension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if e.ExtensionProperties != nil { + objectMap["properties"] = e.ExtensionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Extension struct. +func (e *Extension) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + e.SystemData = &systemData + } + case "properties": + if v != nil { + var extensionProperties ExtensionProperties + err = json.Unmarshal(*v, &extensionProperties) + if err != nil { + return err + } + e.ExtensionProperties = &extensionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + e.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + e.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + e.Type = &typeVar + } + } + } + + return nil +} + +// ExtensionList list of Extensions in HCI cluster. +type ExtensionList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Extensions in HCI cluster. + Value *[]Extension `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExtensionList. +func (el ExtensionList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ExtensionListIterator provides access to a complete listing of Extension values. +type ExtensionListIterator struct { + i int + page ExtensionListPage +} + +// NextWithContext 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 *ExtensionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtensionListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ExtensionListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ExtensionListIterator) 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 ExtensionListIterator) Response() ExtensionList { + 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 ExtensionListIterator) Value() Extension { + if !iter.page.NotDone() { + return Extension{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ExtensionListIterator type. +func NewExtensionListIterator(page ExtensionListPage) ExtensionListIterator { + return ExtensionListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (el ExtensionList) IsEmpty() bool { + return el.Value == nil || len(*el.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (el ExtensionList) hasNextLink() bool { + return el.NextLink != nil && len(*el.NextLink) != 0 +} + +// extensionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (el ExtensionList) extensionListPreparer(ctx context.Context) (*http.Request, error) { + if !el.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(el.NextLink))) +} + +// ExtensionListPage contains a page of Extension values. +type ExtensionListPage struct { + fn func(context.Context, ExtensionList) (ExtensionList, error) + el ExtensionList +} + +// NextWithContext 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 *ExtensionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtensionListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.el) + if err != nil { + return err + } + page.el = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *ExtensionListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ExtensionListPage) NotDone() bool { + return !page.el.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ExtensionListPage) Response() ExtensionList { + return page.el +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ExtensionListPage) Values() []Extension { + if page.el.IsEmpty() { + return nil + } + return *page.el.Value +} + +// Creates a new instance of the ExtensionListPage type. +func NewExtensionListPage(cur ExtensionList, getNextPage func(context.Context, ExtensionList) (ExtensionList, error)) ExtensionListPage { + return ExtensionListPage{ + fn: getNextPage, + el: cur, + } +} + +// ExtensionParameters describes the properties of a Machine Extension. This object mirrors the definition +// in HybridCompute. +type ExtensionParameters struct { + // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. + ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` + // Publisher - The name of the extension handler publisher. + Publisher *string `json:"publisher,omitempty"` + // Type - Specifies the type of the extension; an example is "CustomScriptExtension". + Type *string `json:"type,omitempty"` + // TypeHandlerVersion - Specifies the version of the script handler. + TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` + // AutoUpgradeMinorVersion - Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` + // Settings - Json formatted public settings for the extension. + Settings interface{} `json:"settings,omitempty"` + // ProtectedSettings - Protected settings (may contain secrets). + ProtectedSettings interface{} `json:"protectedSettings,omitempty"` +} + +// ExtensionProperties status of Arc Extension for a particular node in HCI Cluster. +type ExtensionProperties struct { + // ProvisioningState - READ-ONLY; Provisioning state of the Extension proxy resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateAccepted', 'ProvisioningStateProvisioning' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ExtensionParameters - Parameters specific to this extension type. + *ExtensionParameters `json:"extensionParameters,omitempty"` + // AggregateState - READ-ONLY; Aggregate state of Arc Extensions across the nodes in this HCI cluster. Possible values include: 'ExtensionAggregateStateNotSpecified', 'ExtensionAggregateStateError', 'ExtensionAggregateStateSucceeded', 'ExtensionAggregateStateCanceled', 'ExtensionAggregateStateFailed', 'ExtensionAggregateStateConnected', 'ExtensionAggregateStateDisconnected', 'ExtensionAggregateStateDeleted', 'ExtensionAggregateStateCreating', 'ExtensionAggregateStateUpdating', 'ExtensionAggregateStateDeleting', 'ExtensionAggregateStateMoving', 'ExtensionAggregateStatePartiallySucceeded', 'ExtensionAggregateStatePartiallyConnected', 'ExtensionAggregateStateInProgress' + AggregateState ExtensionAggregateState `json:"aggregateState,omitempty"` + // PerNodeExtensionDetails - READ-ONLY; State of Arc Extension in each of the nodes. + PerNodeExtensionDetails *[]PerNodeExtensionState `json:"perNodeExtensionDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExtensionProperties. +func (ep ExtensionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ep.ExtensionParameters != nil { + objectMap["extensionParameters"] = ep.ExtensionParameters + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ExtensionProperties struct. +func (ep *ExtensionProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "provisioningState": + if v != nil { + var provisioningState ProvisioningState + err = json.Unmarshal(*v, &provisioningState) + if err != nil { + return err + } + ep.ProvisioningState = provisioningState + } + case "extensionParameters": + if v != nil { + var extensionParameters ExtensionParameters + err = json.Unmarshal(*v, &extensionParameters) + if err != nil { + return err + } + ep.ExtensionParameters = &extensionParameters + } + case "aggregateState": + if v != nil { + var aggregateState ExtensionAggregateState + err = json.Unmarshal(*v, &aggregateState) + if err != nil { + return err + } + ep.AggregateState = aggregateState + } + case "perNodeExtensionDetails": + if v != nil { + var perNodeExtensionDetails []PerNodeExtensionState + err = json.Unmarshal(*v, &perNodeExtensionDetails) + if err != nil { + return err + } + ep.PerNodeExtensionDetails = &perNodeExtensionDetails + } + } + } + + return nil +} + +// ExtensionsCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ExtensionsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExtensionsClient) (Extension, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExtensionsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ExtensionsCreateFuture.Result. +func (future *ExtensionsCreateFuture) result(client ExtensionsClient) (e Extension, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + e.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("azurestackhci.ExtensionsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if e.Response.Response, err = future.GetResult(sender); err == nil && e.Response.Response.StatusCode != http.StatusNoContent { + e, err = client.CreateResponder(e.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsCreateFuture", "Result", e.Response.Response, "Failure responding to request") + } + } + return +} + +// ExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ExtensionsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExtensionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ExtensionsDeleteFuture.Result. +func (future *ExtensionsDeleteFuture) result(client ExtensionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("azurestackhci.ExtensionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ExtensionsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExtensionsClient) (Extension, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ExtensionsUpdateFuture.Result. +func (future *ExtensionsUpdateFuture) result(client ExtensionsClient) (e Extension, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + e.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("azurestackhci.ExtensionsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if e.Response.Response, err = future.GetResult(sender); err == nil && e.Response.Response.StatusCode != http.StatusNoContent { + e, err = client.UpdateResponder(e.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsUpdateFuture", "Result", e.Response.Response, "Failure responding to request") + } + } + return +} + +// Operation details of a REST API operation, returned from the Resource Provider Operations API +type Operation struct { + // Name - READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + Name *string `json:"name,omitempty"` + // IsDataAction - READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. + IsDataAction *bool `json:"isDataAction,omitempty"` + // Display - Localized display information for this particular operation. + Display *OperationDisplay `json:"display,omitempty"` + // Origin - READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system". Possible values include: 'OriginUser', 'OriginSystem', 'OriginUsersystem' + Origin Origin `json:"origin,omitempty"` + // ActionType - READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. Possible values include: 'Internal' + ActionType ActionType `json:"actionType,omitempty"` +} + +// MarshalJSON is the custom marshaler for Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if o.Display != nil { + objectMap["display"] = o.Display + } + return json.Marshal(objectMap) +} + +// OperationDisplay localized display information for this particular operation. +type OperationDisplay struct { + // Provider - READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + Provider *string `json:"provider,omitempty"` + // Resource - READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + Resource *string `json:"resource,omitempty"` + // Operation - READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + Operation *string `json:"operation,omitempty"` + // Description - READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// OperationListResult a list of REST API operations supported by an Azure Resource Provider. It contains +// an URL link to get the next set of results. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of operations supported by the resource provider + Value *[]Operation `json:"value,omitempty"` + // NextLink - READ-ONLY; URL to get the next set of operation list results (if there are any). + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationListResult. +func (olr OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PerNodeExtensionState status of Arc Extension for a particular node in HCI Cluster. +type PerNodeExtensionState struct { + // Name - READ-ONLY; Name of the node in HCI Cluster. + Name *string `json:"name,omitempty"` + // Extension - READ-ONLY; Fully qualified resource ID for the particular Arc Extension on this node. + Extension *string `json:"extension,omitempty"` + // State - READ-ONLY; State of Arc Extension in this node. Possible values include: 'NodeExtensionStateNotSpecified', 'NodeExtensionStateError', 'NodeExtensionStateSucceeded', 'NodeExtensionStateCanceled', 'NodeExtensionStateFailed', 'NodeExtensionStateConnected', 'NodeExtensionStateDisconnected', 'NodeExtensionStateDeleted', 'NodeExtensionStateCreating', 'NodeExtensionStateUpdating', 'NodeExtensionStateDeleting', 'NodeExtensionStateMoving' + State NodeExtensionState `json:"state,omitempty"` +} + +// MarshalJSON is the custom marshaler for PerNodeExtensionState. +func (pnes PerNodeExtensionState) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PerNodeState status of Arc agent for a particular node in HCI Cluster. +type PerNodeState struct { + // Name - READ-ONLY; Name of the Node in HCI Cluster + Name *string `json:"name,omitempty"` + // ArcInstance - READ-ONLY; Fully qualified resource ID for the Arc agent of this node. + ArcInstance *string `json:"arcInstance,omitempty"` + // State - READ-ONLY; State of Arc agent in this node. Possible values include: 'NodeArcStateNotSpecified', 'NodeArcStateError', 'NodeArcStateSucceeded', 'NodeArcStateCanceled', 'NodeArcStateFailed', 'NodeArcStateConnected', 'NodeArcStateDisconnected', 'NodeArcStateDeleted', 'NodeArcStateCreating', 'NodeArcStateUpdating', 'NodeArcStateDeleting', 'NodeArcStateMoving' + State NodeArcState `json:"state,omitempty"` +} + +// MarshalJSON is the custom marshaler for PerNodeState. +func (pns PerNodeState) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not +// have tags and a location +type ProxyResource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProxyResource. +func (pr ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// Resource common fields that are returned in the response for all Azure Resource Manager resources +type Resource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SystemData metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // CreatedBy - The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + // CreatedByType - The type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + CreatedByType CreatedByType `json:"createdByType,omitempty"` + // CreatedAt - The timestamp of resource creation (UTC). + CreatedAt *date.Time `json:"createdAt,omitempty"` + // LastModifiedBy - The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` + // LastModifiedAt - The timestamp of resource last modification (UTC) + LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` +} + +// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource +// which has 'tags' and a 'location' +type TrackedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + return json.Marshal(objectMap) +} diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/operations.go b/services/azurestackhci/mgmt/2022-01-01/azurestackhci/operations.go similarity index 53% rename from services/recoveryservices/mgmt/2020-02-02/backup/operations.go rename to services/azurestackhci/mgmt/2022-01-01/azurestackhci/operations.go index 75e1357de17f..25b13941ac83 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/operations.go +++ b/services/azurestackhci/mgmt/2022-01-01/azurestackhci/operations.go @@ -1,4 +1,4 @@ -package backup +package azurestackhci // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,7 +14,7 @@ import ( "net/http" ) -// OperationsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +// OperationsClient is the azure Stack HCI management service type OperationsClient struct { BaseClient } @@ -30,39 +30,34 @@ func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) Opera return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List returns the list of available operations. -func (client OperationsClient) List(ctx context.Context) (result ClientDiscoveryResponsePage, err error) { +// List list all available Microsoft.AzureStackHCI provider operations +func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { sc := -1 - if result.cdr.Response.Response != nil { - sc = result.cdr.Response.Response.StatusCode + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } - result.fn = client.listNextResults req, err := client.ListPreparer(ctx) if err != nil { - err = autorest.NewErrorWithError(err, "backup.OperationsClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "azurestackhci.OperationsClient", "List", nil, "Failure preparing request") return } resp, err := client.ListSender(req) if err != nil { - result.cdr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.OperationsClient", "List", resp, "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azurestackhci.OperationsClient", "List", resp, "Failure sending request") return } - result.cdr, err = client.ListResponder(resp) + result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "backup.OperationsClient", "List", resp, "Failure responding to request") - return - } - if result.cdr.hasNextLink() && result.cdr.IsEmpty() { - err = result.NextWithContext(ctx) + err = autorest.NewErrorWithError(err, "azurestackhci.OperationsClient", "List", resp, "Failure responding to request") return } @@ -71,7 +66,7 @@ func (client OperationsClient) List(ctx context.Context) (result ClientDiscovery // ListPreparer prepares the List request. func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2016-08-10" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -79,7 +74,7 @@ func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.RecoveryServices/operations"), + autorest.WithPath("/providers/Microsoft.AzureStackHCI/operations"), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -92,7 +87,7 @@ func (client OperationsClient) ListSender(req *http.Request) (*http.Response, er // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client OperationsClient) ListResponder(resp *http.Response) (result ClientDiscoveryResponse, err error) { +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -101,40 +96,3 @@ func (client OperationsClient) ListResponder(resp *http.Response) (result Client result.Response = autorest.Response{Response: resp} return } - -// listNextResults retrieves the next set of results, if any. -func (client OperationsClient) listNextResults(ctx context.Context, lastResults ClientDiscoveryResponse) (result ClientDiscoveryResponse, err error) { - req, err := lastResults.clientDiscoveryResponsePreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "backup.OperationsClient", "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.OperationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.OperationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client OperationsClient) ListComplete(ctx context.Context) (result ClientDiscoveryResponseIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} diff --git a/services/azurestackhci/mgmt/2022-01-01/azurestackhci/version.go b/services/azurestackhci/mgmt/2022-01-01/azurestackhci/version.go new file mode 100644 index 000000000000..4cc294d6a6cc --- /dev/null +++ b/services/azurestackhci/mgmt/2022-01-01/azurestackhci/version.go @@ -0,0 +1,19 @@ +package azurestackhci + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " azurestackhci/2022-01-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/azurestackhci/mgmt/2022-05-01/azurestackhci/CHANGELOG.md b/services/azurestackhci/mgmt/2022-05-01/azurestackhci/CHANGELOG.md new file mode 100644 index 000000000000..a1ecf841edb0 --- /dev/null +++ b/services/azurestackhci/mgmt/2022-05-01/azurestackhci/CHANGELOG.md @@ -0,0 +1,2 @@ +# Unreleased + diff --git a/services/azurestackhci/mgmt/2022-05-01/azurestackhci/_meta.json b/services/azurestackhci/mgmt/2022-05-01/azurestackhci/_meta.json new file mode 100644 index 000000000000..b5b50fee83a6 --- /dev/null +++ b/services/azurestackhci/mgmt/2022-05-01/azurestackhci/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "4742065e8d48160292fbce6790710c6835f8dc4f", + "readme": "/_/azure-rest-api-specs/specification/azurestackhci/resource-manager/readme.md", + "tag": "package-2022-05", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2022-05 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/azurestackhci/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/services/azurestackhci/mgmt/2022-05-01/azurestackhci/arcsettings.go b/services/azurestackhci/mgmt/2022-05-01/azurestackhci/arcsettings.go new file mode 100644 index 000000000000..c03b0c717732 --- /dev/null +++ b/services/azurestackhci/mgmt/2022-05-01/azurestackhci/arcsettings.go @@ -0,0 +1,693 @@ +package azurestackhci + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ArcSettingsClient is the azure Stack HCI management service +type ArcSettingsClient struct { + BaseClient +} + +// NewArcSettingsClient creates an instance of the ArcSettingsClient client. +func NewArcSettingsClient(subscriptionID string) ArcSettingsClient { + return NewArcSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewArcSettingsClientWithBaseURI creates an instance of the ArcSettingsClient client using a custom endpoint. Use +// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewArcSettingsClientWithBaseURI(baseURI string, subscriptionID string) ArcSettingsClient { + return ArcSettingsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create ArcSetting for HCI cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +// arcSettingName - the name of the proxy resource holding details of HCI ArcSetting information. +// arcSetting - parameters supplied to the Create ArcSetting resource for this HCI cluster. +func (client ArcSettingsClient) Create(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, arcSetting ArcSetting) (result ArcSetting, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ArcSettingsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ArcSettingsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, clusterName, arcSettingName, arcSetting) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ArcSettingsClient) CreatePreparer(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, arcSetting ArcSetting) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "arcSettingName": autorest.Encode("path", arcSettingName), + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + arcSetting.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", pathParameters), + autorest.WithJSON(arcSetting), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ArcSettingsClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ArcSettingsClient) CreateResponder(resp *http.Response) (result ArcSetting, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateIdentity create Aad identity for arc settings. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +// arcSettingName - the name of the proxy resource holding details of HCI ArcSetting information. +func (client ArcSettingsClient) CreateIdentity(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (result ArcSettingsCreateIdentityFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ArcSettingsClient.CreateIdentity") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ArcSettingsClient", "CreateIdentity", err.Error()) + } + + req, err := client.CreateIdentityPreparer(ctx, resourceGroupName, clusterName, arcSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "CreateIdentity", nil, "Failure preparing request") + return + } + + result, err = client.CreateIdentitySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "CreateIdentity", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateIdentityPreparer prepares the CreateIdentity request. +func (client ArcSettingsClient) CreateIdentityPreparer(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "arcSettingName": autorest.Encode("path", arcSettingName), + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/createArcIdentity", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateIdentitySender sends the CreateIdentity request. The method will close the +// http.Response Body if it receives an error. +func (client ArcSettingsClient) CreateIdentitySender(req *http.Request) (future ArcSettingsCreateIdentityFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateIdentityResponder handles the response to the CreateIdentity request. The method always +// closes the http.Response Body. +func (client ArcSettingsClient) CreateIdentityResponder(resp *http.Response) (result ArcIdentityResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete ArcSetting resource details of HCI Cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +// arcSettingName - the name of the proxy resource holding details of HCI ArcSetting information. +func (client ArcSettingsClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (result ArcSettingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ArcSettingsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ArcSettingsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, arcSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ArcSettingsClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "arcSettingName": autorest.Encode("path", arcSettingName), + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-05-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.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", 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 ArcSettingsClient) DeleteSender(req *http.Request) (future ArcSettingsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ArcSettingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GeneratePassword generate password for arc settings. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +// arcSettingName - the name of the proxy resource holding details of HCI ArcSetting information. +func (client ArcSettingsClient) GeneratePassword(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (result PasswordCredential, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ArcSettingsClient.GeneratePassword") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ArcSettingsClient", "GeneratePassword", err.Error()) + } + + req, err := client.GeneratePasswordPreparer(ctx, resourceGroupName, clusterName, arcSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "GeneratePassword", nil, "Failure preparing request") + return + } + + resp, err := client.GeneratePasswordSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "GeneratePassword", resp, "Failure sending request") + return + } + + result, err = client.GeneratePasswordResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "GeneratePassword", resp, "Failure responding to request") + return + } + + return +} + +// GeneratePasswordPreparer prepares the GeneratePassword request. +func (client ArcSettingsClient) GeneratePasswordPreparer(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "arcSettingName": autorest.Encode("path", arcSettingName), + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/generatePassword", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GeneratePasswordSender sends the GeneratePassword request. The method will close the +// http.Response Body if it receives an error. +func (client ArcSettingsClient) GeneratePasswordSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GeneratePasswordResponder handles the response to the GeneratePassword request. The method always +// closes the http.Response Body. +func (client ArcSettingsClient) GeneratePasswordResponder(resp *http.Response) (result PasswordCredential, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get get ArcSetting resource details of HCI Cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +// arcSettingName - the name of the proxy resource holding details of HCI ArcSetting information. +func (client ArcSettingsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (result ArcSetting, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ArcSettingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ArcSettingsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, clusterName, arcSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ArcSettingsClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "arcSettingName": autorest.Encode("path", arcSettingName), + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-05-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.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", 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 ArcSettingsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ArcSettingsClient) GetResponder(resp *http.Response) (result ArcSetting, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByCluster get ArcSetting resources of HCI Cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +func (client ArcSettingsClient) ListByCluster(ctx context.Context, resourceGroupName string, clusterName string) (result ArcSettingListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ArcSettingsClient.ListByCluster") + defer func() { + sc := -1 + if result.asl.Response.Response != nil { + sc = result.asl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ArcSettingsClient", "ListByCluster", err.Error()) + } + + result.fn = client.listByClusterNextResults + req, err := client.ListByClusterPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "ListByCluster", nil, "Failure preparing request") + return + } + + resp, err := client.ListByClusterSender(req) + if err != nil { + result.asl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "ListByCluster", resp, "Failure sending request") + return + } + + result.asl, err = client.ListByClusterResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "ListByCluster", resp, "Failure responding to request") + return + } + if result.asl.hasNextLink() && result.asl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByClusterPreparer prepares the ListByCluster request. +func (client ArcSettingsClient) ListByClusterPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-05-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.AzureStackHCI/clusters/{clusterName}/arcSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByClusterSender sends the ListByCluster request. The method will close the +// http.Response Body if it receives an error. +func (client ArcSettingsClient) ListByClusterSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByClusterResponder handles the response to the ListByCluster request. The method always +// closes the http.Response Body. +func (client ArcSettingsClient) ListByClusterResponder(resp *http.Response) (result ArcSettingList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByClusterNextResults retrieves the next set of results, if any. +func (client ArcSettingsClient) listByClusterNextResults(ctx context.Context, lastResults ArcSettingList) (result ArcSettingList, err error) { + req, err := lastResults.arcSettingListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "listByClusterNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByClusterSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "listByClusterNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByClusterResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "listByClusterNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByClusterComplete enumerates all values, automatically crossing page boundaries as required. +func (client ArcSettingsClient) ListByClusterComplete(ctx context.Context, resourceGroupName string, clusterName string) (result ArcSettingListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ArcSettingsClient.ListByCluster") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByCluster(ctx, resourceGroupName, clusterName) + return +} + +// Update update ArcSettings for HCI cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +// arcSettingName - the name of the proxy resource holding details of HCI ArcSetting information. +// arcSetting - arcSettings parameters that needs to be updated +func (client ArcSettingsClient) Update(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, arcSetting ArcSettingsPatch) (result ArcSetting, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ArcSettingsClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ArcSettingsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, clusterName, arcSettingName, arcSetting) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ArcSettingsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, arcSetting ArcSettingsPatch) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "arcSettingName": autorest.Encode("path", arcSettingName), + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", pathParameters), + autorest.WithJSON(arcSetting), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ArcSettingsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ArcSettingsClient) UpdateResponder(resp *http.Response) (result ArcSetting, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/azurestackhci/mgmt/2022-05-01/azurestackhci/azurestackhciapi/interfaces.go b/services/azurestackhci/mgmt/2022-05-01/azurestackhci/azurestackhciapi/interfaces.go new file mode 100644 index 000000000000..2e8ac17bfc85 --- /dev/null +++ b/services/azurestackhci/mgmt/2022-05-01/azurestackhci/azurestackhciapi/interfaces.go @@ -0,0 +1,61 @@ +package azurestackhciapi + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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/azure-sdk-for-go/services/azurestackhci/mgmt/2022-05-01/azurestackhci" +) + +// ArcSettingsClientAPI contains the set of methods on the ArcSettingsClient type. +type ArcSettingsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, arcSetting azurestackhci.ArcSetting) (result azurestackhci.ArcSetting, err error) + CreateIdentity(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (result azurestackhci.ArcSettingsCreateIdentityFuture, err error) + Delete(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (result azurestackhci.ArcSettingsDeleteFuture, err error) + GeneratePassword(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (result azurestackhci.PasswordCredential, err error) + Get(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (result azurestackhci.ArcSetting, err error) + ListByCluster(ctx context.Context, resourceGroupName string, clusterName string) (result azurestackhci.ArcSettingListPage, err error) + ListByClusterComplete(ctx context.Context, resourceGroupName string, clusterName string) (result azurestackhci.ArcSettingListIterator, err error) + Update(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, arcSetting azurestackhci.ArcSettingsPatch) (result azurestackhci.ArcSetting, err error) +} + +var _ ArcSettingsClientAPI = (*azurestackhci.ArcSettingsClient)(nil) + +// ClustersClientAPI contains the set of methods on the ClustersClient type. +type ClustersClientAPI interface { + Create(ctx context.Context, resourceGroupName string, clusterName string, cluster azurestackhci.Cluster) (result azurestackhci.Cluster, err error) + CreateIdentity(ctx context.Context, resourceGroupName string, clusterName string) (result azurestackhci.ClustersCreateIdentityFuture, err error) + Delete(ctx context.Context, resourceGroupName string, clusterName string) (result azurestackhci.ClustersDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, clusterName string) (result azurestackhci.Cluster, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result azurestackhci.ClusterListPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result azurestackhci.ClusterListIterator, err error) + ListBySubscription(ctx context.Context) (result azurestackhci.ClusterListPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result azurestackhci.ClusterListIterator, err error) + Update(ctx context.Context, resourceGroupName string, clusterName string, cluster azurestackhci.ClusterPatch) (result azurestackhci.Cluster, err error) + UploadCertificate(ctx context.Context, resourceGroupName string, clusterName string, uploadCertificateRequest azurestackhci.UploadCertificateRequest) (result azurestackhci.ClustersUploadCertificateFuture, err error) +} + +var _ ClustersClientAPI = (*azurestackhci.ClustersClient)(nil) + +// ExtensionsClientAPI contains the set of methods on the ExtensionsClient type. +type ExtensionsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string, extension azurestackhci.Extension) (result azurestackhci.ExtensionsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string) (result azurestackhci.ExtensionsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string) (result azurestackhci.Extension, err error) + ListByArcSetting(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (result azurestackhci.ExtensionListPage, err error) + ListByArcSettingComplete(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (result azurestackhci.ExtensionListIterator, err error) + Update(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string, extension azurestackhci.Extension) (result azurestackhci.ExtensionsUpdateFuture, err error) +} + +var _ ExtensionsClientAPI = (*azurestackhci.ExtensionsClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result azurestackhci.OperationListResult, err error) +} + +var _ OperationsClientAPI = (*azurestackhci.OperationsClient)(nil) diff --git a/services/azurestackhci/mgmt/2022-05-01/azurestackhci/client.go b/services/azurestackhci/mgmt/2022-05-01/azurestackhci/client.go new file mode 100644 index 000000000000..007a9a3f0673 --- /dev/null +++ b/services/azurestackhci/mgmt/2022-05-01/azurestackhci/client.go @@ -0,0 +1,41 @@ +// Package azurestackhci implements the Azure ARM Azurestackhci service API version 2022-05-01. +// +// Azure Stack HCI management service +package azurestackhci + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Azurestackhci + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Azurestackhci. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/services/azurestackhci/mgmt/2022-05-01/azurestackhci/clusters.go b/services/azurestackhci/mgmt/2022-05-01/azurestackhci/clusters.go new file mode 100644 index 000000000000..a425c7592324 --- /dev/null +++ b/services/azurestackhci/mgmt/2022-05-01/azurestackhci/clusters.go @@ -0,0 +1,803 @@ +package azurestackhci + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ClustersClient is the azure Stack HCI management service +type ClustersClient struct { + BaseClient +} + +// NewClustersClient creates an instance of the ClustersClient client. +func NewClustersClient(subscriptionID string) ClustersClient { + return NewClustersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewClustersClientWithBaseURI creates an instance of the ClustersClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewClustersClientWithBaseURI(baseURI string, subscriptionID string) ClustersClient { + return ClustersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create an HCI cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +// cluster - details of the HCI cluster. +func (client ClustersClient) Create(ctx context.Context, resourceGroupName string, clusterName string, cluster Cluster) (result Cluster, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ClustersClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, clusterName, cluster) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ClustersClient) CreatePreparer(ctx context.Context, resourceGroupName string, clusterName string, cluster Cluster) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + cluster.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", pathParameters), + autorest.WithJSON(cluster), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ClustersClient) CreateResponder(resp *http.Response) (result Cluster, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateIdentity create cluster identity. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +func (client ClustersClient) CreateIdentity(ctx context.Context, resourceGroupName string, clusterName string) (result ClustersCreateIdentityFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.CreateIdentity") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ClustersClient", "CreateIdentity", err.Error()) + } + + req, err := client.CreateIdentityPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "CreateIdentity", nil, "Failure preparing request") + return + } + + result, err = client.CreateIdentitySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "CreateIdentity", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateIdentityPreparer prepares the CreateIdentity request. +func (client ClustersClient) CreateIdentityPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/createClusterIdentity", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateIdentitySender sends the CreateIdentity request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) CreateIdentitySender(req *http.Request) (future ClustersCreateIdentityFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateIdentityResponder handles the response to the CreateIdentity request. The method always +// closes the http.Response Body. +func (client ClustersClient) CreateIdentityResponder(resp *http.Response) (result ClusterIdentityResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete an HCI cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +func (client ClustersClient) Delete(ctx context.Context, resourceGroupName string, clusterName string) (result ClustersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ClustersClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ClustersClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-05-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.AzureStackHCI/clusters/{clusterName}", 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 ClustersClient) DeleteSender(req *http.Request) (future ClustersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ClustersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get HCI cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +func (client ClustersClient) Get(ctx context.Context, resourceGroupName string, clusterName string) (result Cluster, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ClustersClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ClustersClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-05-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.AzureStackHCI/clusters/{clusterName}", 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 ClustersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ClustersClient) GetResponder(resp *http.Response) (result Cluster, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup list all HCI clusters in a resource group. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +func (client ClustersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ClusterListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.cl.Response.Response != nil { + sc = result.cl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ClustersClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.cl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.cl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.cl.hasNextLink() && result.cl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ClustersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-05-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.AzureStackHCI/clusters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client ClustersClient) ListByResourceGroupResponder(resp *http.Response) (result ClusterList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client ClustersClient) listByResourceGroupNextResults(ctx context.Context, lastResults ClusterList) (result ClusterList, err error) { + req, err := lastResults.clusterListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ClustersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ClusterListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListBySubscription list all HCI clusters in a subscription. +func (client ClustersClient) ListBySubscription(ctx context.Context) (result ClusterListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.ListBySubscription") + defer func() { + sc := -1 + if result.cl.Response.Response != nil { + sc = result.cl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ClustersClient", "ListBySubscription", err.Error()) + } + + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.cl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.cl, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.cl.hasNextLink() && result.cl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client ClustersClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/clusters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client ClustersClient) ListBySubscriptionResponder(resp *http.Response) (result ClusterList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client ClustersClient) listBySubscriptionNextResults(ctx context.Context, lastResults ClusterList) (result ClusterList, err error) { + req, err := lastResults.clusterListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client ClustersClient) ListBySubscriptionComplete(ctx context.Context) (result ClusterListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.ListBySubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBySubscription(ctx) + return +} + +// Update update an HCI cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +// cluster - details of the HCI cluster. +func (client ClustersClient) Update(ctx context.Context, resourceGroupName string, clusterName string, cluster ClusterPatch) (result Cluster, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ClustersClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, clusterName, cluster) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ClustersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, cluster ClusterPatch) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", pathParameters), + autorest.WithJSON(cluster), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ClustersClient) UpdateResponder(resp *http.Response) (result Cluster, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UploadCertificate upload certificate. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +// uploadCertificateRequest - upload certificate request. +func (client ClustersClient) UploadCertificate(ctx context.Context, resourceGroupName string, clusterName string, uploadCertificateRequest UploadCertificateRequest) (result ClustersUploadCertificateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.UploadCertificate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ClustersClient", "UploadCertificate", err.Error()) + } + + req, err := client.UploadCertificatePreparer(ctx, resourceGroupName, clusterName, uploadCertificateRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "UploadCertificate", nil, "Failure preparing request") + return + } + + result, err = client.UploadCertificateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersClient", "UploadCertificate", result.Response(), "Failure sending request") + return + } + + return +} + +// UploadCertificatePreparer prepares the UploadCertificate request. +func (client ClustersClient) UploadCertificatePreparer(ctx context.Context, resourceGroupName string, clusterName string, uploadCertificateRequest UploadCertificateRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/uploadCertificate", pathParameters), + autorest.WithJSON(uploadCertificateRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UploadCertificateSender sends the UploadCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) UploadCertificateSender(req *http.Request) (future ClustersUploadCertificateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UploadCertificateResponder handles the response to the UploadCertificate request. The method always +// closes the http.Response Body. +func (client ClustersClient) UploadCertificateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/azurestackhci/mgmt/2022-05-01/azurestackhci/enums.go b/services/azurestackhci/mgmt/2022-05-01/azurestackhci/enums.go new file mode 100644 index 000000000000..9abbdd351530 --- /dev/null +++ b/services/azurestackhci/mgmt/2022-05-01/azurestackhci/enums.go @@ -0,0 +1,297 @@ +package azurestackhci + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// ActionType enumerates the values for action type. +type ActionType string + +const ( + // Internal ... + Internal ActionType = "Internal" +) + +// PossibleActionTypeValues returns an array of possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{Internal} +} + +// ArcSettingAggregateState enumerates the values for arc setting aggregate state. +type ArcSettingAggregateState string + +const ( + // Canceled ... + Canceled ArcSettingAggregateState = "Canceled" + // Connected ... + Connected ArcSettingAggregateState = "Connected" + // Creating ... + Creating ArcSettingAggregateState = "Creating" + // Deleted ... + Deleted ArcSettingAggregateState = "Deleted" + // Deleting ... + Deleting ArcSettingAggregateState = "Deleting" + // Disconnected ... + Disconnected ArcSettingAggregateState = "Disconnected" + // Error ... + Error ArcSettingAggregateState = "Error" + // Failed ... + Failed ArcSettingAggregateState = "Failed" + // InProgress ... + InProgress ArcSettingAggregateState = "InProgress" + // Moving ... + Moving ArcSettingAggregateState = "Moving" + // NotSpecified ... + NotSpecified ArcSettingAggregateState = "NotSpecified" + // PartiallyConnected ... + PartiallyConnected ArcSettingAggregateState = "PartiallyConnected" + // PartiallySucceeded ... + PartiallySucceeded ArcSettingAggregateState = "PartiallySucceeded" + // Succeeded ... + Succeeded ArcSettingAggregateState = "Succeeded" + // Updating ... + Updating ArcSettingAggregateState = "Updating" +) + +// PossibleArcSettingAggregateStateValues returns an array of possible values for the ArcSettingAggregateState const type. +func PossibleArcSettingAggregateStateValues() []ArcSettingAggregateState { + return []ArcSettingAggregateState{Canceled, Connected, Creating, Deleted, Deleting, Disconnected, Error, Failed, InProgress, Moving, NotSpecified, PartiallyConnected, PartiallySucceeded, Succeeded, Updating} +} + +// CreatedByType enumerates the values for created by type. +type CreatedByType string + +const ( + // Application ... + Application CreatedByType = "Application" + // Key ... + Key CreatedByType = "Key" + // ManagedIdentity ... + ManagedIdentity CreatedByType = "ManagedIdentity" + // User ... + User CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns an array of possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{Application, Key, ManagedIdentity, User} +} + +// DiagnosticLevel enumerates the values for diagnostic level. +type DiagnosticLevel string + +const ( + // Basic ... + Basic DiagnosticLevel = "Basic" + // Enhanced ... + Enhanced DiagnosticLevel = "Enhanced" + // Off ... + Off DiagnosticLevel = "Off" +) + +// PossibleDiagnosticLevelValues returns an array of possible values for the DiagnosticLevel const type. +func PossibleDiagnosticLevelValues() []DiagnosticLevel { + return []DiagnosticLevel{Basic, Enhanced, Off} +} + +// ExtensionAggregateState enumerates the values for extension aggregate state. +type ExtensionAggregateState string + +const ( + // ExtensionAggregateStateCanceled ... + ExtensionAggregateStateCanceled ExtensionAggregateState = "Canceled" + // ExtensionAggregateStateConnected ... + ExtensionAggregateStateConnected ExtensionAggregateState = "Connected" + // ExtensionAggregateStateCreating ... + ExtensionAggregateStateCreating ExtensionAggregateState = "Creating" + // ExtensionAggregateStateDeleted ... + ExtensionAggregateStateDeleted ExtensionAggregateState = "Deleted" + // ExtensionAggregateStateDeleting ... + ExtensionAggregateStateDeleting ExtensionAggregateState = "Deleting" + // ExtensionAggregateStateDisconnected ... + ExtensionAggregateStateDisconnected ExtensionAggregateState = "Disconnected" + // ExtensionAggregateStateError ... + ExtensionAggregateStateError ExtensionAggregateState = "Error" + // ExtensionAggregateStateFailed ... + ExtensionAggregateStateFailed ExtensionAggregateState = "Failed" + // ExtensionAggregateStateInProgress ... + ExtensionAggregateStateInProgress ExtensionAggregateState = "InProgress" + // ExtensionAggregateStateMoving ... + ExtensionAggregateStateMoving ExtensionAggregateState = "Moving" + // ExtensionAggregateStateNotSpecified ... + ExtensionAggregateStateNotSpecified ExtensionAggregateState = "NotSpecified" + // ExtensionAggregateStatePartiallyConnected ... + ExtensionAggregateStatePartiallyConnected ExtensionAggregateState = "PartiallyConnected" + // ExtensionAggregateStatePartiallySucceeded ... + ExtensionAggregateStatePartiallySucceeded ExtensionAggregateState = "PartiallySucceeded" + // ExtensionAggregateStateSucceeded ... + ExtensionAggregateStateSucceeded ExtensionAggregateState = "Succeeded" + // ExtensionAggregateStateUpdating ... + ExtensionAggregateStateUpdating ExtensionAggregateState = "Updating" +) + +// PossibleExtensionAggregateStateValues returns an array of possible values for the ExtensionAggregateState const type. +func PossibleExtensionAggregateStateValues() []ExtensionAggregateState { + return []ExtensionAggregateState{ExtensionAggregateStateCanceled, ExtensionAggregateStateConnected, ExtensionAggregateStateCreating, ExtensionAggregateStateDeleted, ExtensionAggregateStateDeleting, ExtensionAggregateStateDisconnected, ExtensionAggregateStateError, ExtensionAggregateStateFailed, ExtensionAggregateStateInProgress, ExtensionAggregateStateMoving, ExtensionAggregateStateNotSpecified, ExtensionAggregateStatePartiallyConnected, ExtensionAggregateStatePartiallySucceeded, ExtensionAggregateStateSucceeded, ExtensionAggregateStateUpdating} +} + +// ImdsAttestation enumerates the values for imds attestation. +type ImdsAttestation string + +const ( + // Disabled ... + Disabled ImdsAttestation = "Disabled" + // Enabled ... + Enabled ImdsAttestation = "Enabled" +) + +// PossibleImdsAttestationValues returns an array of possible values for the ImdsAttestation const type. +func PossibleImdsAttestationValues() []ImdsAttestation { + return []ImdsAttestation{Disabled, Enabled} +} + +// NodeArcState enumerates the values for node arc state. +type NodeArcState string + +const ( + // NodeArcStateCanceled ... + NodeArcStateCanceled NodeArcState = "Canceled" + // NodeArcStateConnected ... + NodeArcStateConnected NodeArcState = "Connected" + // NodeArcStateCreating ... + NodeArcStateCreating NodeArcState = "Creating" + // NodeArcStateDeleted ... + NodeArcStateDeleted NodeArcState = "Deleted" + // NodeArcStateDeleting ... + NodeArcStateDeleting NodeArcState = "Deleting" + // NodeArcStateDisconnected ... + NodeArcStateDisconnected NodeArcState = "Disconnected" + // NodeArcStateError ... + NodeArcStateError NodeArcState = "Error" + // NodeArcStateFailed ... + NodeArcStateFailed NodeArcState = "Failed" + // NodeArcStateMoving ... + NodeArcStateMoving NodeArcState = "Moving" + // NodeArcStateNotSpecified ... + NodeArcStateNotSpecified NodeArcState = "NotSpecified" + // NodeArcStateSucceeded ... + NodeArcStateSucceeded NodeArcState = "Succeeded" + // NodeArcStateUpdating ... + NodeArcStateUpdating NodeArcState = "Updating" +) + +// PossibleNodeArcStateValues returns an array of possible values for the NodeArcState const type. +func PossibleNodeArcStateValues() []NodeArcState { + return []NodeArcState{NodeArcStateCanceled, NodeArcStateConnected, NodeArcStateCreating, NodeArcStateDeleted, NodeArcStateDeleting, NodeArcStateDisconnected, NodeArcStateError, NodeArcStateFailed, NodeArcStateMoving, NodeArcStateNotSpecified, NodeArcStateSucceeded, NodeArcStateUpdating} +} + +// NodeExtensionState enumerates the values for node extension state. +type NodeExtensionState string + +const ( + // NodeExtensionStateCanceled ... + NodeExtensionStateCanceled NodeExtensionState = "Canceled" + // NodeExtensionStateConnected ... + NodeExtensionStateConnected NodeExtensionState = "Connected" + // NodeExtensionStateCreating ... + NodeExtensionStateCreating NodeExtensionState = "Creating" + // NodeExtensionStateDeleted ... + NodeExtensionStateDeleted NodeExtensionState = "Deleted" + // NodeExtensionStateDeleting ... + NodeExtensionStateDeleting NodeExtensionState = "Deleting" + // NodeExtensionStateDisconnected ... + NodeExtensionStateDisconnected NodeExtensionState = "Disconnected" + // NodeExtensionStateError ... + NodeExtensionStateError NodeExtensionState = "Error" + // NodeExtensionStateFailed ... + NodeExtensionStateFailed NodeExtensionState = "Failed" + // NodeExtensionStateMoving ... + NodeExtensionStateMoving NodeExtensionState = "Moving" + // NodeExtensionStateNotSpecified ... + NodeExtensionStateNotSpecified NodeExtensionState = "NotSpecified" + // NodeExtensionStateSucceeded ... + NodeExtensionStateSucceeded NodeExtensionState = "Succeeded" + // NodeExtensionStateUpdating ... + NodeExtensionStateUpdating NodeExtensionState = "Updating" +) + +// PossibleNodeExtensionStateValues returns an array of possible values for the NodeExtensionState const type. +func PossibleNodeExtensionStateValues() []NodeExtensionState { + return []NodeExtensionState{NodeExtensionStateCanceled, NodeExtensionStateConnected, NodeExtensionStateCreating, NodeExtensionStateDeleted, NodeExtensionStateDeleting, NodeExtensionStateDisconnected, NodeExtensionStateError, NodeExtensionStateFailed, NodeExtensionStateMoving, NodeExtensionStateNotSpecified, NodeExtensionStateSucceeded, NodeExtensionStateUpdating} +} + +// Origin enumerates the values for origin. +type Origin string + +const ( + // OriginSystem ... + OriginSystem Origin = "system" + // OriginUser ... + OriginUser Origin = "user" + // OriginUsersystem ... + OriginUsersystem Origin = "user,system" +) + +// PossibleOriginValues returns an array of possible values for the Origin const type. +func PossibleOriginValues() []Origin { + return []Origin{OriginSystem, OriginUser, OriginUsersystem} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // ProvisioningStateAccepted ... + ProvisioningStateAccepted ProvisioningState = "Accepted" + // ProvisioningStateCanceled ... + ProvisioningStateCanceled ProvisioningState = "Canceled" + // ProvisioningStateFailed ... + ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateProvisioning ... + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + // ProvisioningStateSucceeded ... + ProvisioningStateSucceeded ProvisioningState = "Succeeded" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ProvisioningStateAccepted, ProvisioningStateCanceled, ProvisioningStateFailed, ProvisioningStateProvisioning, ProvisioningStateSucceeded} +} + +// Status enumerates the values for status. +type Status string + +const ( + // StatusConnectedRecently ... + StatusConnectedRecently Status = "ConnectedRecently" + // StatusDisconnected ... + StatusDisconnected Status = "Disconnected" + // StatusError ... + StatusError Status = "Error" + // StatusNotConnectedRecently ... + StatusNotConnectedRecently Status = "NotConnectedRecently" + // StatusNotYetRegistered ... + StatusNotYetRegistered Status = "NotYetRegistered" +) + +// PossibleStatusValues returns an array of possible values for the Status const type. +func PossibleStatusValues() []Status { + return []Status{StatusConnectedRecently, StatusDisconnected, StatusError, StatusNotConnectedRecently, StatusNotYetRegistered} +} + +// WindowsServerSubscription enumerates the values for windows server subscription. +type WindowsServerSubscription string + +const ( + // WindowsServerSubscriptionDisabled ... + WindowsServerSubscriptionDisabled WindowsServerSubscription = "Disabled" + // WindowsServerSubscriptionEnabled ... + WindowsServerSubscriptionEnabled WindowsServerSubscription = "Enabled" +) + +// PossibleWindowsServerSubscriptionValues returns an array of possible values for the WindowsServerSubscription const type. +func PossibleWindowsServerSubscriptionValues() []WindowsServerSubscription { + return []WindowsServerSubscription{WindowsServerSubscriptionDisabled, WindowsServerSubscriptionEnabled} +} diff --git a/services/azurestackhci/mgmt/2022-05-01/azurestackhci/extensions.go b/services/azurestackhci/mgmt/2022-05-01/azurestackhci/extensions.go new file mode 100644 index 000000000000..328b66a5252d --- /dev/null +++ b/services/azurestackhci/mgmt/2022-05-01/azurestackhci/extensions.go @@ -0,0 +1,533 @@ +package azurestackhci + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ExtensionsClient is the azure Stack HCI management service +type ExtensionsClient struct { + BaseClient +} + +// NewExtensionsClient creates an instance of the ExtensionsClient client. +func NewExtensionsClient(subscriptionID string) ExtensionsClient { + return NewExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewExtensionsClientWithBaseURI creates an instance of the ExtensionsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewExtensionsClientWithBaseURI(baseURI string, subscriptionID string) ExtensionsClient { + return ExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create Extension for HCI cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +// arcSettingName - the name of the proxy resource holding details of HCI ArcSetting information. +// extensionName - the name of the machine extension. +// extension - details of the Machine Extension to be created. +func (client ExtensionsClient) Create(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string, extension Extension) (result ExtensionsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtensionsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ExtensionsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, clusterName, arcSettingName, extensionName, extension) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ExtensionsClient) CreatePreparer(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string, extension Extension) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "arcSettingName": autorest.Encode("path", arcSettingName), + "clusterName": autorest.Encode("path", clusterName), + "extensionName": autorest.Encode("path", extensionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + extension.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", pathParameters), + autorest.WithJSON(extension), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ExtensionsClient) CreateSender(req *http.Request) (future ExtensionsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ExtensionsClient) CreateResponder(resp *http.Response) (result Extension, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete particular Arc Extension of HCI Cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +// arcSettingName - the name of the proxy resource holding details of HCI ArcSetting information. +// extensionName - the name of the machine extension. +func (client ExtensionsClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string) (result ExtensionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtensionsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ExtensionsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, arcSettingName, extensionName) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ExtensionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "arcSettingName": autorest.Encode("path", arcSettingName), + "clusterName": autorest.Encode("path", clusterName), + "extensionName": autorest.Encode("path", extensionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-05-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.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", 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 ExtensionsClient) DeleteSender(req *http.Request) (future ExtensionsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get particular Arc Extension of HCI Cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +// arcSettingName - the name of the proxy resource holding details of HCI ArcSetting information. +// extensionName - the name of the machine extension. +func (client ExtensionsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string) (result Extension, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtensionsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ExtensionsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, clusterName, arcSettingName, extensionName) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ExtensionsClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "arcSettingName": autorest.Encode("path", arcSettingName), + "clusterName": autorest.Encode("path", clusterName), + "extensionName": autorest.Encode("path", extensionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-05-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.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", 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 ExtensionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ExtensionsClient) GetResponder(resp *http.Response) (result Extension, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByArcSetting list all Extensions under ArcSetting resource. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +// arcSettingName - the name of the proxy resource holding details of HCI ArcSetting information. +func (client ExtensionsClient) ListByArcSetting(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (result ExtensionListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtensionsClient.ListByArcSetting") + defer func() { + sc := -1 + if result.el.Response.Response != nil { + sc = result.el.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ExtensionsClient", "ListByArcSetting", err.Error()) + } + + result.fn = client.listByArcSettingNextResults + req, err := client.ListByArcSettingPreparer(ctx, resourceGroupName, clusterName, arcSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "ListByArcSetting", nil, "Failure preparing request") + return + } + + resp, err := client.ListByArcSettingSender(req) + if err != nil { + result.el.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "ListByArcSetting", resp, "Failure sending request") + return + } + + result.el, err = client.ListByArcSettingResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "ListByArcSetting", resp, "Failure responding to request") + return + } + if result.el.hasNextLink() && result.el.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByArcSettingPreparer prepares the ListByArcSetting request. +func (client ExtensionsClient) ListByArcSettingPreparer(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "arcSettingName": autorest.Encode("path", arcSettingName), + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-05-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.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByArcSettingSender sends the ListByArcSetting request. The method will close the +// http.Response Body if it receives an error. +func (client ExtensionsClient) ListByArcSettingSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByArcSettingResponder handles the response to the ListByArcSetting request. The method always +// closes the http.Response Body. +func (client ExtensionsClient) ListByArcSettingResponder(resp *http.Response) (result ExtensionList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByArcSettingNextResults retrieves the next set of results, if any. +func (client ExtensionsClient) listByArcSettingNextResults(ctx context.Context, lastResults ExtensionList) (result ExtensionList, err error) { + req, err := lastResults.extensionListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "listByArcSettingNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByArcSettingSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "listByArcSettingNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByArcSettingResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "listByArcSettingNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByArcSettingComplete enumerates all values, automatically crossing page boundaries as required. +func (client ExtensionsClient) ListByArcSettingComplete(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string) (result ExtensionListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtensionsClient.ListByArcSetting") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByArcSetting(ctx, resourceGroupName, clusterName, arcSettingName) + return +} + +// Update update Extension for HCI cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the cluster. +// arcSettingName - the name of the proxy resource holding details of HCI ArcSetting information. +// extensionName - the name of the machine extension. +// extension - details of the Machine Extension to be created. +func (client ExtensionsClient) Update(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string, extension Extension) (result ExtensionsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtensionsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("azurestackhci.ExtensionsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, clusterName, arcSettingName, extensionName, extension) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ExtensionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, arcSettingName string, extensionName string, extension Extension) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "arcSettingName": autorest.Encode("path", arcSettingName), + "clusterName": autorest.Encode("path", clusterName), + "extensionName": autorest.Encode("path", extensionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + extension.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", pathParameters), + autorest.WithJSON(extension), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ExtensionsClient) UpdateSender(req *http.Request) (future ExtensionsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ExtensionsClient) UpdateResponder(resp *http.Response) (result Extension, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/azurestackhci/mgmt/2022-05-01/azurestackhci/models.go b/services/azurestackhci/mgmt/2022-05-01/azurestackhci/models.go new file mode 100644 index 000000000000..bf2d2255423f --- /dev/null +++ b/services/azurestackhci/mgmt/2022-05-01/azurestackhci/models.go @@ -0,0 +1,1850 @@ +package azurestackhci + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/azurestackhci/mgmt/2022-05-01/azurestackhci" + +// ArcConnectivityProperties connectivity related configuration required by arc server. +type ArcConnectivityProperties struct { + // Enabled - True indicates ARC connectivity is enabled + Enabled *bool `json:"enabled,omitempty"` +} + +// ArcIdentityResponse arcIdentity details. +type ArcIdentityResponse struct { + autorest.Response `json:"-"` + // ArcIdentityResponseProperties - ArcIdentity properties. + *ArcIdentityResponseProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ArcIdentityResponse. +func (air ArcIdentityResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if air.ArcIdentityResponseProperties != nil { + objectMap["properties"] = air.ArcIdentityResponseProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ArcIdentityResponse struct. +func (air *ArcIdentityResponse) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var arcIdentityResponseProperties ArcIdentityResponseProperties + err = json.Unmarshal(*v, &arcIdentityResponseProperties) + if err != nil { + return err + } + air.ArcIdentityResponseProperties = &arcIdentityResponseProperties + } + } + } + + return nil +} + +// ArcIdentityResponseProperties ... +type ArcIdentityResponseProperties struct { + ArcApplicationClientID *string `json:"arcApplicationClientId,omitempty"` + ArcApplicationTenantID *string `json:"arcApplicationTenantId,omitempty"` + ArcServicePrincipalObjectID *string `json:"arcServicePrincipalObjectId,omitempty"` + ArcApplicationObjectID *string `json:"arcApplicationObjectId,omitempty"` +} + +// ArcSetting arcSetting details. +type ArcSetting struct { + autorest.Response `json:"-"` + // SystemData - READ-ONLY; System data of ArcSetting resource + *SystemData `json:"systemData,omitempty"` + // ArcSettingProperties - ArcSetting properties. + *ArcSettingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ArcSetting. +func (as ArcSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if as.ArcSettingProperties != nil { + objectMap["properties"] = as.ArcSettingProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ArcSetting struct. +func (as *ArcSetting) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + as.SystemData = &systemData + } + case "properties": + if v != nil { + var arcSettingProperties ArcSettingProperties + err = json.Unmarshal(*v, &arcSettingProperties) + if err != nil { + return err + } + as.ArcSettingProperties = &arcSettingProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + as.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + as.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + as.Type = &typeVar + } + } + } + + return nil +} + +// ArcSettingList list of ArcSetting proxy resources for the HCI cluster. +type ArcSettingList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of ArcSetting proxy resources. + Value *[]ArcSetting `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ArcSettingList. +func (asl ArcSettingList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ArcSettingListIterator provides access to a complete listing of ArcSetting values. +type ArcSettingListIterator struct { + i int + page ArcSettingListPage +} + +// NextWithContext 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 *ArcSettingListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ArcSettingListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ArcSettingListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ArcSettingListIterator) 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 ArcSettingListIterator) Response() ArcSettingList { + 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 ArcSettingListIterator) Value() ArcSetting { + if !iter.page.NotDone() { + return ArcSetting{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ArcSettingListIterator type. +func NewArcSettingListIterator(page ArcSettingListPage) ArcSettingListIterator { + return ArcSettingListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (asl ArcSettingList) IsEmpty() bool { + return asl.Value == nil || len(*asl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (asl ArcSettingList) hasNextLink() bool { + return asl.NextLink != nil && len(*asl.NextLink) != 0 +} + +// arcSettingListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (asl ArcSettingList) arcSettingListPreparer(ctx context.Context) (*http.Request, error) { + if !asl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(asl.NextLink))) +} + +// ArcSettingListPage contains a page of ArcSetting values. +type ArcSettingListPage struct { + fn func(context.Context, ArcSettingList) (ArcSettingList, error) + asl ArcSettingList +} + +// NextWithContext 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 *ArcSettingListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ArcSettingListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.asl) + if err != nil { + return err + } + page.asl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *ArcSettingListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ArcSettingListPage) NotDone() bool { + return !page.asl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ArcSettingListPage) Response() ArcSettingList { + return page.asl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ArcSettingListPage) Values() []ArcSetting { + if page.asl.IsEmpty() { + return nil + } + return *page.asl.Value +} + +// Creates a new instance of the ArcSettingListPage type. +func NewArcSettingListPage(cur ArcSettingList, getNextPage func(context.Context, ArcSettingList) (ArcSettingList, error)) ArcSettingListPage { + return ArcSettingListPage{ + fn: getNextPage, + asl: cur, + } +} + +// ArcSettingProperties arcSetting properties. +type ArcSettingProperties struct { + // ProvisioningState - READ-ONLY; Provisioning state of the ArcSetting proxy resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateAccepted', 'ProvisioningStateProvisioning' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ArcInstanceResourceGroup - The resource group that hosts the Arc agents, ie. Hybrid Compute Machine resources. + ArcInstanceResourceGroup *string `json:"arcInstanceResourceGroup,omitempty"` + // ArcApplicationClientID - App id of arc AAD identity. + ArcApplicationClientID *string `json:"arcApplicationClientId,omitempty"` + // ArcApplicationTenantID - Tenant id of arc AAD identity. + ArcApplicationTenantID *string `json:"arcApplicationTenantId,omitempty"` + // ArcServicePrincipalObjectID - Object id of arc AAD service principal. + ArcServicePrincipalObjectID *string `json:"arcServicePrincipalObjectId,omitempty"` + // ArcApplicationObjectID - Object id of arc AAD identity. + ArcApplicationObjectID *string `json:"arcApplicationObjectId,omitempty"` + // AggregateState - READ-ONLY; Aggregate state of Arc agent across the nodes in this HCI cluster. Possible values include: 'NotSpecified', 'Error', 'Succeeded', 'Canceled', 'Failed', 'Connected', 'Disconnected', 'Deleted', 'Creating', 'Updating', 'Deleting', 'Moving', 'PartiallySucceeded', 'PartiallyConnected', 'InProgress' + AggregateState ArcSettingAggregateState `json:"aggregateState,omitempty"` + // PerNodeDetails - READ-ONLY; State of Arc agent in each of the nodes. + PerNodeDetails *[]PerNodeState `json:"perNodeDetails,omitempty"` + // ConnectivityProperties - contains connectivity related configuration for ARC resources + ConnectivityProperties interface{} `json:"connectivityProperties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ArcSettingProperties. +func (asp ArcSettingProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asp.ArcInstanceResourceGroup != nil { + objectMap["arcInstanceResourceGroup"] = asp.ArcInstanceResourceGroup + } + if asp.ArcApplicationClientID != nil { + objectMap["arcApplicationClientId"] = asp.ArcApplicationClientID + } + if asp.ArcApplicationTenantID != nil { + objectMap["arcApplicationTenantId"] = asp.ArcApplicationTenantID + } + if asp.ArcServicePrincipalObjectID != nil { + objectMap["arcServicePrincipalObjectId"] = asp.ArcServicePrincipalObjectID + } + if asp.ArcApplicationObjectID != nil { + objectMap["arcApplicationObjectId"] = asp.ArcApplicationObjectID + } + if asp.ConnectivityProperties != nil { + objectMap["connectivityProperties"] = asp.ConnectivityProperties + } + return json.Marshal(objectMap) +} + +// ArcSettingsCreateIdentityFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ArcSettingsCreateIdentityFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ArcSettingsClient) (ArcIdentityResponse, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ArcSettingsCreateIdentityFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ArcSettingsCreateIdentityFuture.Result. +func (future *ArcSettingsCreateIdentityFuture) result(client ArcSettingsClient) (air ArcIdentityResponse, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsCreateIdentityFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + air.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("azurestackhci.ArcSettingsCreateIdentityFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if air.Response.Response, err = future.GetResult(sender); err == nil && air.Response.Response.StatusCode != http.StatusNoContent { + air, err = client.CreateIdentityResponder(air.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsCreateIdentityFuture", "Result", air.Response.Response, "Failure responding to request") + } + } + return +} + +// ArcSettingsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ArcSettingsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ArcSettingsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ArcSettingsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ArcSettingsDeleteFuture.Result. +func (future *ArcSettingsDeleteFuture) result(client ArcSettingsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ArcSettingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("azurestackhci.ArcSettingsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ArcSettingsPatch arcSetting details to update. +type ArcSettingsPatch struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ArcSettingsPatchProperties - ArcSettings properties. + *ArcSettingsPatchProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ArcSettingsPatch. +func (asp ArcSettingsPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asp.Tags != nil { + objectMap["tags"] = asp.Tags + } + if asp.ArcSettingsPatchProperties != nil { + objectMap["properties"] = asp.ArcSettingsPatchProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ArcSettingsPatch struct. +func (asp *ArcSettingsPatch) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + asp.Tags = tags + } + case "properties": + if v != nil { + var arcSettingsPatchProperties ArcSettingsPatchProperties + err = json.Unmarshal(*v, &arcSettingsPatchProperties) + if err != nil { + return err + } + asp.ArcSettingsPatchProperties = &arcSettingsPatchProperties + } + } + } + + return nil +} + +// ArcSettingsPatchProperties arcSettings properties. +type ArcSettingsPatchProperties struct { + // ConnectivityProperties - contains connectivity related configuration for ARC resources + ConnectivityProperties interface{} `json:"connectivityProperties,omitempty"` +} + +// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. +type AzureEntityResource struct { + // Etag - READ-ONLY; Resource Etag. + Etag *string `json:"etag,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureEntityResource. +func (aer AzureEntityResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// Cluster cluster details. +type Cluster struct { + autorest.Response `json:"-"` + // SystemData - READ-ONLY; System data of Cluster resource + *SystemData `json:"systemData,omitempty"` + // ClusterProperties - Cluster properties. + *ClusterProperties `json:"properties,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Cluster. +func (c Cluster) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.ClusterProperties != nil { + objectMap["properties"] = c.ClusterProperties + } + if c.Tags != nil { + objectMap["tags"] = c.Tags + } + if c.Location != nil { + objectMap["location"] = c.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Cluster struct. +func (c *Cluster) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + c.SystemData = &systemData + } + case "properties": + if v != nil { + var clusterProperties ClusterProperties + err = json.Unmarshal(*v, &clusterProperties) + if err != nil { + return err + } + c.ClusterProperties = &clusterProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + c.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + c.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + c.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + } + } + + return nil +} + +// ClusterDesiredProperties desired properties of the cluster. +type ClusterDesiredProperties struct { + // WindowsServerSubscription - Desired state of Windows Server Subscription. Possible values include: 'WindowsServerSubscriptionDisabled', 'WindowsServerSubscriptionEnabled' + WindowsServerSubscription WindowsServerSubscription `json:"windowsServerSubscription,omitempty"` + // DiagnosticLevel - Desired level of diagnostic data emitted by the cluster. Possible values include: 'Off', 'Basic', 'Enhanced' + DiagnosticLevel DiagnosticLevel `json:"diagnosticLevel,omitempty"` +} + +// ClusterIdentityResponse cluster Identity details. +type ClusterIdentityResponse struct { + autorest.Response `json:"-"` + // ClusterIdentityResponseProperties - Cluster identity properties. + *ClusterIdentityResponseProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ClusterIdentityResponse. +func (cir ClusterIdentityResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cir.ClusterIdentityResponseProperties != nil { + objectMap["properties"] = cir.ClusterIdentityResponseProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ClusterIdentityResponse struct. +func (cir *ClusterIdentityResponse) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var clusterIdentityResponseProperties ClusterIdentityResponseProperties + err = json.Unmarshal(*v, &clusterIdentityResponseProperties) + if err != nil { + return err + } + cir.ClusterIdentityResponseProperties = &clusterIdentityResponseProperties + } + } + } + + return nil +} + +// ClusterIdentityResponseProperties ... +type ClusterIdentityResponseProperties struct { + AadClientID *string `json:"aadClientId,omitempty"` + AadTenantID *string `json:"aadTenantId,omitempty"` + AadServicePrincipalObjectID *string `json:"aadServicePrincipalObjectId,omitempty"` + AadApplicationObjectID *string `json:"aadApplicationObjectId,omitempty"` +} + +// ClusterList list of clusters. +type ClusterList struct { + autorest.Response `json:"-"` + // Value - List of clusters. + Value *[]Cluster `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ClusterList. +func (cl ClusterList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cl.Value != nil { + objectMap["value"] = cl.Value + } + return json.Marshal(objectMap) +} + +// ClusterListIterator provides access to a complete listing of Cluster values. +type ClusterListIterator struct { + i int + page ClusterListPage +} + +// NextWithContext 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 *ClusterListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClusterListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ClusterListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ClusterListIterator) 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 ClusterListIterator) Response() ClusterList { + 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 ClusterListIterator) Value() Cluster { + if !iter.page.NotDone() { + return Cluster{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ClusterListIterator type. +func NewClusterListIterator(page ClusterListPage) ClusterListIterator { + return ClusterListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (cl ClusterList) IsEmpty() bool { + return cl.Value == nil || len(*cl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (cl ClusterList) hasNextLink() bool { + return cl.NextLink != nil && len(*cl.NextLink) != 0 +} + +// clusterListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cl ClusterList) clusterListPreparer(ctx context.Context) (*http.Request, error) { + if !cl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cl.NextLink))) +} + +// ClusterListPage contains a page of Cluster values. +type ClusterListPage struct { + fn func(context.Context, ClusterList) (ClusterList, error) + cl ClusterList +} + +// NextWithContext 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 *ClusterListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClusterListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.cl) + if err != nil { + return err + } + page.cl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *ClusterListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ClusterListPage) NotDone() bool { + return !page.cl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ClusterListPage) Response() ClusterList { + return page.cl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ClusterListPage) Values() []Cluster { + if page.cl.IsEmpty() { + return nil + } + return *page.cl.Value +} + +// Creates a new instance of the ClusterListPage type. +func NewClusterListPage(cur ClusterList, getNextPage func(context.Context, ClusterList) (ClusterList, error)) ClusterListPage { + return ClusterListPage{ + fn: getNextPage, + cl: cur, + } +} + +// ClusterNode cluster node details. +type ClusterNode struct { + // Name - READ-ONLY; Name of the cluster node. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; Id of the node in the cluster. + ID *float64 `json:"id,omitempty"` + // WindowsServerSubscription - READ-ONLY; State of Windows Server Subscription. Possible values include: 'WindowsServerSubscriptionDisabled', 'WindowsServerSubscriptionEnabled' + WindowsServerSubscription WindowsServerSubscription `json:"windowsServerSubscription,omitempty"` + // Manufacturer - READ-ONLY; Manufacturer of the cluster node hardware. + Manufacturer *string `json:"manufacturer,omitempty"` + // Model - READ-ONLY; Model name of the cluster node hardware. + Model *string `json:"model,omitempty"` + // OsName - READ-ONLY; Operating system running on the cluster node. + OsName *string `json:"osName,omitempty"` + // OsVersion - READ-ONLY; Version of the operating system running on the cluster node. + OsVersion *string `json:"osVersion,omitempty"` + // SerialNumber - READ-ONLY; Immutable id of the cluster node. + SerialNumber *string `json:"serialNumber,omitempty"` + // CoreCount - READ-ONLY; Number of physical cores on the cluster node. + CoreCount *float64 `json:"coreCount,omitempty"` + // MemoryInGiB - READ-ONLY; Total available memory on the cluster node (in GiB). + MemoryInGiB *float64 `json:"memoryInGiB,omitempty"` +} + +// MarshalJSON is the custom marshaler for ClusterNode. +func (cn ClusterNode) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ClusterPatch cluster details to update. +type ClusterPatch struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ClusterPatchProperties - Cluster properties. + *ClusterPatchProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ClusterPatch. +func (cp ClusterPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cp.Tags != nil { + objectMap["tags"] = cp.Tags + } + if cp.ClusterPatchProperties != nil { + objectMap["properties"] = cp.ClusterPatchProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ClusterPatch struct. +func (cp *ClusterPatch) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + cp.Tags = tags + } + case "properties": + if v != nil { + var clusterPatchProperties ClusterPatchProperties + err = json.Unmarshal(*v, &clusterPatchProperties) + if err != nil { + return err + } + cp.ClusterPatchProperties = &clusterPatchProperties + } + } + } + + return nil +} + +// ClusterPatchProperties cluster properties. +type ClusterPatchProperties struct { + // CloudManagementEndpoint - Endpoint configured for management from the Azure portal + CloudManagementEndpoint *string `json:"cloudManagementEndpoint,omitempty"` + // AadClientID - App id of cluster AAD identity. + AadClientID *string `json:"aadClientId,omitempty"` + // AadTenantID - Tenant id of cluster AAD identity. + AadTenantID *string `json:"aadTenantId,omitempty"` + // DesiredProperties - Desired properties of the cluster. + DesiredProperties *ClusterDesiredProperties `json:"desiredProperties,omitempty"` +} + +// ClusterProperties cluster properties. +type ClusterProperties struct { + // ProvisioningState - READ-ONLY; Provisioning state. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateAccepted', 'ProvisioningStateProvisioning' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Status - READ-ONLY; Status of the cluster agent. Possible values include: 'StatusNotYetRegistered', 'StatusConnectedRecently', 'StatusNotConnectedRecently', 'StatusDisconnected', 'StatusError' + Status Status `json:"status,omitempty"` + // CloudID - READ-ONLY; Unique, immutable resource id. + CloudID *string `json:"cloudId,omitempty"` + // CloudManagementEndpoint - Endpoint configured for management from the Azure portal. + CloudManagementEndpoint *string `json:"cloudManagementEndpoint,omitempty"` + // AadClientID - App id of cluster AAD identity. + AadClientID *string `json:"aadClientId,omitempty"` + // AadTenantID - Tenant id of cluster AAD identity. + AadTenantID *string `json:"aadTenantId,omitempty"` + // AadApplicationObjectID - Object id of cluster AAD identity. + AadApplicationObjectID *string `json:"aadApplicationObjectId,omitempty"` + // AadServicePrincipalObjectID - Id of cluster identity service principal. + AadServicePrincipalObjectID *string `json:"aadServicePrincipalObjectId,omitempty"` + // DesiredProperties - Desired properties of the cluster. + DesiredProperties *ClusterDesiredProperties `json:"desiredProperties,omitempty"` + // ReportedProperties - READ-ONLY; Properties reported by cluster agent. + ReportedProperties *ClusterReportedProperties `json:"reportedProperties,omitempty"` + // TrialDaysRemaining - READ-ONLY; Number of days remaining in the trial period. + TrialDaysRemaining *float64 `json:"trialDaysRemaining,omitempty"` + // BillingModel - READ-ONLY; Type of billing applied to the resource. + BillingModel *string `json:"billingModel,omitempty"` + // RegistrationTimestamp - READ-ONLY; First cluster sync timestamp. + RegistrationTimestamp *date.Time `json:"registrationTimestamp,omitempty"` + // LastSyncTimestamp - READ-ONLY; Most recent cluster sync timestamp. + LastSyncTimestamp *date.Time `json:"lastSyncTimestamp,omitempty"` + // LastBillingTimestamp - READ-ONLY; Most recent billing meter timestamp. + LastBillingTimestamp *date.Time `json:"lastBillingTimestamp,omitempty"` + // ServiceEndpoint - READ-ONLY; Region specific DataPath Endpoint of the cluster. + ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` +} + +// MarshalJSON is the custom marshaler for ClusterProperties. +func (cp ClusterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cp.CloudManagementEndpoint != nil { + objectMap["cloudManagementEndpoint"] = cp.CloudManagementEndpoint + } + if cp.AadClientID != nil { + objectMap["aadClientId"] = cp.AadClientID + } + if cp.AadTenantID != nil { + objectMap["aadTenantId"] = cp.AadTenantID + } + if cp.AadApplicationObjectID != nil { + objectMap["aadApplicationObjectId"] = cp.AadApplicationObjectID + } + if cp.AadServicePrincipalObjectID != nil { + objectMap["aadServicePrincipalObjectId"] = cp.AadServicePrincipalObjectID + } + if cp.DesiredProperties != nil { + objectMap["desiredProperties"] = cp.DesiredProperties + } + return json.Marshal(objectMap) +} + +// ClusterReportedProperties properties reported by cluster agent. +type ClusterReportedProperties struct { + // ClusterName - READ-ONLY; Name of the on-prem cluster connected to this resource. + ClusterName *string `json:"clusterName,omitempty"` + // ClusterID - READ-ONLY; Unique id generated by the on-prem cluster. + ClusterID *string `json:"clusterId,omitempty"` + // ClusterVersion - READ-ONLY; Version of the cluster software. + ClusterVersion *string `json:"clusterVersion,omitempty"` + // Nodes - READ-ONLY; List of nodes reported by the cluster. + Nodes *[]ClusterNode `json:"nodes,omitempty"` + // LastUpdated - READ-ONLY; Last time the cluster reported the data. + LastUpdated *date.Time `json:"lastUpdated,omitempty"` + // ImdsAttestation - READ-ONLY; IMDS attestation status of the cluster. Possible values include: 'Disabled', 'Enabled' + ImdsAttestation ImdsAttestation `json:"imdsAttestation,omitempty"` + // DiagnosticLevel - Level of diagnostic data emitted by the cluster. Possible values include: 'Off', 'Basic', 'Enhanced' + DiagnosticLevel DiagnosticLevel `json:"diagnosticLevel,omitempty"` +} + +// MarshalJSON is the custom marshaler for ClusterReportedProperties. +func (crp ClusterReportedProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if crp.DiagnosticLevel != "" { + objectMap["diagnosticLevel"] = crp.DiagnosticLevel + } + return json.Marshal(objectMap) +} + +// ClustersCreateIdentityFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ClustersCreateIdentityFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ClustersClient) (ClusterIdentityResponse, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ClustersCreateIdentityFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ClustersCreateIdentityFuture.Result. +func (future *ClustersCreateIdentityFuture) result(client ClustersClient) (cir ClusterIdentityResponse, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersCreateIdentityFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + cir.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("azurestackhci.ClustersCreateIdentityFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cir.Response.Response, err = future.GetResult(sender); err == nil && cir.Response.Response.StatusCode != http.StatusNoContent { + cir, err = client.CreateIdentityResponder(cir.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersCreateIdentityFuture", "Result", cir.Response.Response, "Failure responding to request") + } + } + return +} + +// ClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ClustersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ClustersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ClustersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ClustersDeleteFuture.Result. +func (future *ClustersDeleteFuture) result(client ClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("azurestackhci.ClustersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ClustersUploadCertificateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ClustersUploadCertificateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ClustersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ClustersUploadCertificateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ClustersUploadCertificateFuture.Result. +func (future *ClustersUploadCertificateFuture) result(client ClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ClustersUploadCertificateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("azurestackhci.ClustersUploadCertificateFuture") + return + } + ar.Response = future.Response() + return +} + +// ErrorAdditionalInfo the resource management error additional info. +type ErrorAdditionalInfo struct { + // Type - READ-ONLY; The additional info type. + Type *string `json:"type,omitempty"` + // Info - READ-ONLY; The additional info. + Info interface{} `json:"info,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorAdditionalInfo. +func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ErrorDetail the error detail. +type ErrorDetail struct { + // Code - READ-ONLY; The error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; The error message. + Message *string `json:"message,omitempty"` + // Target - READ-ONLY; The error target. + Target *string `json:"target,omitempty"` + // Details - READ-ONLY; The error details. + Details *[]ErrorDetail `json:"details,omitempty"` + // AdditionalInfo - READ-ONLY; The error additional info. + AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorDetail. +func (ed ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ErrorResponse common error response for all Azure Resource Manager APIs to return error details for +// failed operations. (This also follows the OData error response format.). +type ErrorResponse struct { + // Error - The error object. + Error *ErrorDetail `json:"error,omitempty"` +} + +// Extension details of a particular extension in HCI Cluster. +type Extension struct { + autorest.Response `json:"-"` + // SystemData - READ-ONLY; System data of Extension resource. + *SystemData `json:"systemData,omitempty"` + // ExtensionProperties - Describes Machine Extension Properties. + *ExtensionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Extension. +func (e Extension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if e.ExtensionProperties != nil { + objectMap["properties"] = e.ExtensionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Extension struct. +func (e *Extension) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + e.SystemData = &systemData + } + case "properties": + if v != nil { + var extensionProperties ExtensionProperties + err = json.Unmarshal(*v, &extensionProperties) + if err != nil { + return err + } + e.ExtensionProperties = &extensionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + e.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + e.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + e.Type = &typeVar + } + } + } + + return nil +} + +// ExtensionList list of Extensions in HCI cluster. +type ExtensionList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Extensions in HCI cluster. + Value *[]Extension `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExtensionList. +func (el ExtensionList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ExtensionListIterator provides access to a complete listing of Extension values. +type ExtensionListIterator struct { + i int + page ExtensionListPage +} + +// NextWithContext 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 *ExtensionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtensionListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ExtensionListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ExtensionListIterator) 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 ExtensionListIterator) Response() ExtensionList { + 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 ExtensionListIterator) Value() Extension { + if !iter.page.NotDone() { + return Extension{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ExtensionListIterator type. +func NewExtensionListIterator(page ExtensionListPage) ExtensionListIterator { + return ExtensionListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (el ExtensionList) IsEmpty() bool { + return el.Value == nil || len(*el.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (el ExtensionList) hasNextLink() bool { + return el.NextLink != nil && len(*el.NextLink) != 0 +} + +// extensionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (el ExtensionList) extensionListPreparer(ctx context.Context) (*http.Request, error) { + if !el.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(el.NextLink))) +} + +// ExtensionListPage contains a page of Extension values. +type ExtensionListPage struct { + fn func(context.Context, ExtensionList) (ExtensionList, error) + el ExtensionList +} + +// NextWithContext 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 *ExtensionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtensionListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.el) + if err != nil { + return err + } + page.el = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *ExtensionListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ExtensionListPage) NotDone() bool { + return !page.el.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ExtensionListPage) Response() ExtensionList { + return page.el +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ExtensionListPage) Values() []Extension { + if page.el.IsEmpty() { + return nil + } + return *page.el.Value +} + +// Creates a new instance of the ExtensionListPage type. +func NewExtensionListPage(cur ExtensionList, getNextPage func(context.Context, ExtensionList) (ExtensionList, error)) ExtensionListPage { + return ExtensionListPage{ + fn: getNextPage, + el: cur, + } +} + +// ExtensionParameters describes the properties of a Machine Extension. This object mirrors the definition +// in HybridCompute. +type ExtensionParameters struct { + // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. + ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` + // Publisher - The name of the extension handler publisher. + Publisher *string `json:"publisher,omitempty"` + // Type - Specifies the type of the extension; an example is "CustomScriptExtension". + Type *string `json:"type,omitempty"` + // TypeHandlerVersion - Specifies the version of the script handler. + TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` + // AutoUpgradeMinorVersion - Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` + // Settings - Json formatted public settings for the extension. + Settings interface{} `json:"settings,omitempty"` + // ProtectedSettings - Protected settings (may contain secrets). + ProtectedSettings interface{} `json:"protectedSettings,omitempty"` +} + +// ExtensionProperties status of Arc Extension for a particular node in HCI Cluster. +type ExtensionProperties struct { + // ProvisioningState - READ-ONLY; Provisioning state of the Extension proxy resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateAccepted', 'ProvisioningStateProvisioning' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ExtensionParameters - Parameters specific to this extension type. + *ExtensionParameters `json:"extensionParameters,omitempty"` + // AggregateState - READ-ONLY; Aggregate state of Arc Extensions across the nodes in this HCI cluster. Possible values include: 'ExtensionAggregateStateNotSpecified', 'ExtensionAggregateStateError', 'ExtensionAggregateStateSucceeded', 'ExtensionAggregateStateCanceled', 'ExtensionAggregateStateFailed', 'ExtensionAggregateStateConnected', 'ExtensionAggregateStateDisconnected', 'ExtensionAggregateStateDeleted', 'ExtensionAggregateStateCreating', 'ExtensionAggregateStateUpdating', 'ExtensionAggregateStateDeleting', 'ExtensionAggregateStateMoving', 'ExtensionAggregateStatePartiallySucceeded', 'ExtensionAggregateStatePartiallyConnected', 'ExtensionAggregateStateInProgress' + AggregateState ExtensionAggregateState `json:"aggregateState,omitempty"` + // PerNodeExtensionDetails - READ-ONLY; State of Arc Extension in each of the nodes. + PerNodeExtensionDetails *[]PerNodeExtensionState `json:"perNodeExtensionDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExtensionProperties. +func (ep ExtensionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ep.ExtensionParameters != nil { + objectMap["extensionParameters"] = ep.ExtensionParameters + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ExtensionProperties struct. +func (ep *ExtensionProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "provisioningState": + if v != nil { + var provisioningState ProvisioningState + err = json.Unmarshal(*v, &provisioningState) + if err != nil { + return err + } + ep.ProvisioningState = provisioningState + } + case "extensionParameters": + if v != nil { + var extensionParameters ExtensionParameters + err = json.Unmarshal(*v, &extensionParameters) + if err != nil { + return err + } + ep.ExtensionParameters = &extensionParameters + } + case "aggregateState": + if v != nil { + var aggregateState ExtensionAggregateState + err = json.Unmarshal(*v, &aggregateState) + if err != nil { + return err + } + ep.AggregateState = aggregateState + } + case "perNodeExtensionDetails": + if v != nil { + var perNodeExtensionDetails []PerNodeExtensionState + err = json.Unmarshal(*v, &perNodeExtensionDetails) + if err != nil { + return err + } + ep.PerNodeExtensionDetails = &perNodeExtensionDetails + } + } + } + + return nil +} + +// ExtensionsCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ExtensionsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExtensionsClient) (Extension, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExtensionsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ExtensionsCreateFuture.Result. +func (future *ExtensionsCreateFuture) result(client ExtensionsClient) (e Extension, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + e.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("azurestackhci.ExtensionsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if e.Response.Response, err = future.GetResult(sender); err == nil && e.Response.Response.StatusCode != http.StatusNoContent { + e, err = client.CreateResponder(e.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsCreateFuture", "Result", e.Response.Response, "Failure responding to request") + } + } + return +} + +// ExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ExtensionsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExtensionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ExtensionsDeleteFuture.Result. +func (future *ExtensionsDeleteFuture) result(client ExtensionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("azurestackhci.ExtensionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ExtensionsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExtensionsClient) (Extension, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ExtensionsUpdateFuture.Result. +func (future *ExtensionsUpdateFuture) result(client ExtensionsClient) (e Extension, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + e.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("azurestackhci.ExtensionsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if e.Response.Response, err = future.GetResult(sender); err == nil && e.Response.Response.StatusCode != http.StatusNoContent { + e, err = client.UpdateResponder(e.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "azurestackhci.ExtensionsUpdateFuture", "Result", e.Response.Response, "Failure responding to request") + } + } + return +} + +// Operation details of a REST API operation, returned from the Resource Provider Operations API +type Operation struct { + // Name - READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + Name *string `json:"name,omitempty"` + // IsDataAction - READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. + IsDataAction *bool `json:"isDataAction,omitempty"` + // Display - Localized display information for this particular operation. + Display *OperationDisplay `json:"display,omitempty"` + // Origin - READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system". Possible values include: 'OriginUser', 'OriginSystem', 'OriginUsersystem' + Origin Origin `json:"origin,omitempty"` + // ActionType - READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. Possible values include: 'Internal' + ActionType ActionType `json:"actionType,omitempty"` +} + +// MarshalJSON is the custom marshaler for Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if o.Display != nil { + objectMap["display"] = o.Display + } + return json.Marshal(objectMap) +} + +// OperationDisplay localized display information for this particular operation. +type OperationDisplay struct { + // Provider - READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + Provider *string `json:"provider,omitempty"` + // Resource - READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + Resource *string `json:"resource,omitempty"` + // Operation - READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + Operation *string `json:"operation,omitempty"` + // Description - READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// OperationListResult a list of REST API operations supported by an Azure Resource Provider. It contains +// an URL link to get the next set of results. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of operations supported by the resource provider + Value *[]Operation `json:"value,omitempty"` + // NextLink - READ-ONLY; URL to get the next set of operation list results (if there are any). + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationListResult. +func (olr OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PasswordCredential ... +type PasswordCredential struct { + autorest.Response `json:"-"` + SecretText *string `json:"secretText,omitempty"` + KeyID *string `json:"keyId,omitempty"` + StartDateTime *date.Time `json:"startDateTime,omitempty"` + EndDateTime *date.Time `json:"endDateTime,omitempty"` +} + +// PerNodeExtensionState status of Arc Extension for a particular node in HCI Cluster. +type PerNodeExtensionState struct { + // Name - READ-ONLY; Name of the node in HCI Cluster. + Name *string `json:"name,omitempty"` + // Extension - READ-ONLY; Fully qualified resource ID for the particular Arc Extension on this node. + Extension *string `json:"extension,omitempty"` + // State - READ-ONLY; State of Arc Extension in this node. Possible values include: 'NodeExtensionStateNotSpecified', 'NodeExtensionStateError', 'NodeExtensionStateSucceeded', 'NodeExtensionStateCanceled', 'NodeExtensionStateFailed', 'NodeExtensionStateConnected', 'NodeExtensionStateDisconnected', 'NodeExtensionStateDeleted', 'NodeExtensionStateCreating', 'NodeExtensionStateUpdating', 'NodeExtensionStateDeleting', 'NodeExtensionStateMoving' + State NodeExtensionState `json:"state,omitempty"` +} + +// MarshalJSON is the custom marshaler for PerNodeExtensionState. +func (pnes PerNodeExtensionState) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PerNodeState status of Arc agent for a particular node in HCI Cluster. +type PerNodeState struct { + // Name - READ-ONLY; Name of the Node in HCI Cluster + Name *string `json:"name,omitempty"` + // ArcInstance - READ-ONLY; Fully qualified resource ID for the Arc agent of this node. + ArcInstance *string `json:"arcInstance,omitempty"` + // State - READ-ONLY; State of Arc agent in this node. Possible values include: 'NodeArcStateNotSpecified', 'NodeArcStateError', 'NodeArcStateSucceeded', 'NodeArcStateCanceled', 'NodeArcStateFailed', 'NodeArcStateConnected', 'NodeArcStateDisconnected', 'NodeArcStateDeleted', 'NodeArcStateCreating', 'NodeArcStateUpdating', 'NodeArcStateDeleting', 'NodeArcStateMoving' + State NodeArcState `json:"state,omitempty"` +} + +// MarshalJSON is the custom marshaler for PerNodeState. +func (pns PerNodeState) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not +// have tags and a location +type ProxyResource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProxyResource. +func (pr ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RawCertificateData ... +type RawCertificateData struct { + Certificates *[]string `json:"certificates,omitempty"` +} + +// Resource common fields that are returned in the response for all Azure Resource Manager resources +type Resource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SystemData metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // CreatedBy - The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + // CreatedByType - The type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + CreatedByType CreatedByType `json:"createdByType,omitempty"` + // CreatedAt - The timestamp of resource creation (UTC). + CreatedAt *date.Time `json:"createdAt,omitempty"` + // LastModifiedBy - The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` + // LastModifiedAt - The timestamp of resource last modification (UTC) + LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` +} + +// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource +// which has 'tags' and a 'location' +type TrackedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + return json.Marshal(objectMap) +} + +// UploadCertificateRequest ... +type UploadCertificateRequest struct { + Properties *RawCertificateData `json:"properties,omitempty"` +} diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/operations.go b/services/azurestackhci/mgmt/2022-05-01/azurestackhci/operations.go similarity index 53% rename from services/recoveryservices/mgmt/2019-05-13/backup/operations.go rename to services/azurestackhci/mgmt/2022-05-01/azurestackhci/operations.go index 75e1357de17f..bc9965adb8fe 100644 --- a/services/recoveryservices/mgmt/2019-05-13/backup/operations.go +++ b/services/azurestackhci/mgmt/2022-05-01/azurestackhci/operations.go @@ -1,4 +1,4 @@ -package backup +package azurestackhci // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,7 +14,7 @@ import ( "net/http" ) -// OperationsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +// OperationsClient is the azure Stack HCI management service type OperationsClient struct { BaseClient } @@ -30,39 +30,34 @@ func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) Opera return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List returns the list of available operations. -func (client OperationsClient) List(ctx context.Context) (result ClientDiscoveryResponsePage, err error) { +// List list all available Microsoft.AzureStackHCI provider operations +func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { sc := -1 - if result.cdr.Response.Response != nil { - sc = result.cdr.Response.Response.StatusCode + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } - result.fn = client.listNextResults req, err := client.ListPreparer(ctx) if err != nil { - err = autorest.NewErrorWithError(err, "backup.OperationsClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "azurestackhci.OperationsClient", "List", nil, "Failure preparing request") return } resp, err := client.ListSender(req) if err != nil { - result.cdr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.OperationsClient", "List", resp, "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azurestackhci.OperationsClient", "List", resp, "Failure sending request") return } - result.cdr, err = client.ListResponder(resp) + result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "backup.OperationsClient", "List", resp, "Failure responding to request") - return - } - if result.cdr.hasNextLink() && result.cdr.IsEmpty() { - err = result.NextWithContext(ctx) + err = autorest.NewErrorWithError(err, "azurestackhci.OperationsClient", "List", resp, "Failure responding to request") return } @@ -71,7 +66,7 @@ func (client OperationsClient) List(ctx context.Context) (result ClientDiscovery // ListPreparer prepares the List request. func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2016-08-10" + const APIVersion = "2022-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -79,7 +74,7 @@ func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.RecoveryServices/operations"), + autorest.WithPath("/providers/Microsoft.AzureStackHCI/operations"), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -92,7 +87,7 @@ func (client OperationsClient) ListSender(req *http.Request) (*http.Response, er // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client OperationsClient) ListResponder(resp *http.Response) (result ClientDiscoveryResponse, err error) { +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -101,40 +96,3 @@ func (client OperationsClient) ListResponder(resp *http.Response) (result Client result.Response = autorest.Response{Response: resp} return } - -// listNextResults retrieves the next set of results, if any. -func (client OperationsClient) listNextResults(ctx context.Context, lastResults ClientDiscoveryResponse) (result ClientDiscoveryResponse, err error) { - req, err := lastResults.clientDiscoveryResponsePreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "backup.OperationsClient", "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.OperationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.OperationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client OperationsClient) ListComplete(ctx context.Context) (result ClientDiscoveryResponseIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} diff --git a/services/azurestackhci/mgmt/2022-05-01/azurestackhci/version.go b/services/azurestackhci/mgmt/2022-05-01/azurestackhci/version.go new file mode 100644 index 000000000000..d41d7c6dcae8 --- /dev/null +++ b/services/azurestackhci/mgmt/2022-05-01/azurestackhci/version.go @@ -0,0 +1,19 @@ +package azurestackhci + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " azurestackhci/2022-05-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/preview/aad/mgmt/2020-07-01-preview/aad/CHANGELOG.md b/services/preview/aad/mgmt/2020-07-01-preview/aad/CHANGELOG.md new file mode 100644 index 000000000000..a1ecf841edb0 --- /dev/null +++ b/services/preview/aad/mgmt/2020-07-01-preview/aad/CHANGELOG.md @@ -0,0 +1,2 @@ +# Unreleased + diff --git a/services/preview/aad/mgmt/2020-07-01-preview/aad/_meta.json b/services/preview/aad/mgmt/2020-07-01-preview/aad/_meta.json new file mode 100644 index 000000000000..628f9ea44341 --- /dev/null +++ b/services/preview/aad/mgmt/2020-07-01-preview/aad/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "4742065e8d48160292fbce6790710c6835f8dc4f", + "readme": "/_/azure-rest-api-specs/specification/azureactivedirectory/resource-manager/readme.md", + "tag": "package-preview-2020-07", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-preview-2020-07 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/azureactivedirectory/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/services/preview/aad/mgmt/2020-07-01-preview/aad/aadapi/interfaces.go b/services/preview/aad/mgmt/2020-07-01-preview/aad/aadapi/interfaces.go new file mode 100644 index 000000000000..18f3b58b27d2 --- /dev/null +++ b/services/preview/aad/mgmt/2020-07-01-preview/aad/aadapi/interfaces.go @@ -0,0 +1,50 @@ +package aadapi + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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/azure-sdk-for-go/services/preview/aad/mgmt/2020-07-01-preview/aad" + "github.com/Azure/go-autorest/autorest" +) + +// AzureADMetricsClientAPI contains the set of methods on the AzureADMetricsClient type. +type AzureADMetricsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, azureADMetricsName string, azureADMetricsConfig aad.AzureADMetricsConfig) (result aad.AzureADMetricsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, azureADMetricsName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, azureADMetricsName string) (result aad.AzureADMetricsConfig, err error) + List(ctx context.Context, resourceGroupName string) (result aad.AzureADMetricsListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string) (result aad.AzureADMetricsListResultIterator, err error) + ListBySubscription(ctx context.Context) (result aad.AzureADMetricsListResultPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result aad.AzureADMetricsListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, azureADMetricsName string, azureADMetricsConfig *aad.AzureADMetricsUpdateParameter) (result aad.AzureADMetricsConfig, err error) +} + +var _ AzureADMetricsClientAPI = (*aad.AzureADMetricsClient)(nil) + +// PrivateLinkForAzureAdClientAPI contains the set of methods on the PrivateLinkForAzureAdClient type. +type PrivateLinkForAzureAdClientAPI interface { + Create(ctx context.Context, resourceGroupName string, policyName string, privateLinkPolicy aad.PrivateLinkPolicy) (result aad.PrivateLinkForAzureAdCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, policyName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, policyName string) (result aad.PrivateLinkPolicy, err error) + List(ctx context.Context, resourceGroupName string) (result aad.PrivateLinkPolicyListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string) (result aad.PrivateLinkPolicyListResultIterator, err error) + ListBySubscription(ctx context.Context) (result aad.PrivateLinkPolicyListResultPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result aad.PrivateLinkPolicyListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, policyName string, privateLinkPolicy *aad.PrivateLinkPolicyUpdateParameter) (result aad.PrivateLinkPolicy, err error) +} + +var _ PrivateLinkForAzureAdClientAPI = (*aad.PrivateLinkForAzureAdClient)(nil) + +// PrivateLinkResourcesClientAPI contains the set of methods on the PrivateLinkResourcesClient type. +type PrivateLinkResourcesClientAPI interface { + Get(ctx context.Context, resourceGroupName string, policyName string, groupName string) (result aad.PrivateLinkResource, err error) + ListByPrivateLinkPolicy(ctx context.Context, resourceGroupName string, policyName string) (result aad.PrivateLinkResourceListResultPage, err error) + ListByPrivateLinkPolicyComplete(ctx context.Context, resourceGroupName string, policyName string) (result aad.PrivateLinkResourceListResultIterator, err error) +} + +var _ PrivateLinkResourcesClientAPI = (*aad.PrivateLinkResourcesClient)(nil) diff --git a/services/preview/aad/mgmt/2020-07-01-preview/aad/azureadmetrics.go b/services/preview/aad/mgmt/2020-07-01-preview/aad/azureadmetrics.go new file mode 100644 index 000000000000..680cca94a2d3 --- /dev/null +++ b/services/preview/aad/mgmt/2020-07-01-preview/aad/azureadmetrics.go @@ -0,0 +1,616 @@ +package aad + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// AzureADMetricsClient is the client for the AzureADMetrics methods of the Aad service. +type AzureADMetricsClient struct { + BaseClient +} + +// NewAzureADMetricsClient creates an instance of the AzureADMetricsClient client. +func NewAzureADMetricsClient(subscriptionID string) AzureADMetricsClient { + return NewAzureADMetricsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAzureADMetricsClientWithBaseURI creates an instance of the AzureADMetricsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewAzureADMetricsClientWithBaseURI(baseURI string, subscriptionID string) AzureADMetricsClient { + return AzureADMetricsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a azureADMetrics instance. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// azureADMetricsName - name of the azureADMetrics instance. +// azureADMetricsConfig - azureADMetrics definition supplied to the operation. +func (client AzureADMetricsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, azureADMetricsName string, azureADMetricsConfig AzureADMetricsConfig) (result AzureADMetricsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AzureADMetricsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("aad.AzureADMetricsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, azureADMetricsName, azureADMetricsConfig) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.AzureADMetricsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.AzureADMetricsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client AzureADMetricsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, azureADMetricsName string, azureADMetricsConfig AzureADMetricsConfig) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "azureADMetricsName": autorest.Encode("path", azureADMetricsName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.aadiam/azureADMetrics/{azureADMetricsName}", pathParameters), + autorest.WithJSON(azureADMetricsConfig), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client AzureADMetricsClient) CreateOrUpdateSender(req *http.Request) (future AzureADMetricsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client AzureADMetricsClient) CreateOrUpdateResponder(resp *http.Response) (result AzureADMetricsConfig, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a AzureADMetrics resource. When operation completes, status code 200 returned without content. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// azureADMetricsName - name of the azureADMetrics instance. +func (client AzureADMetricsClient) Delete(ctx context.Context, resourceGroupName string, azureADMetricsName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AzureADMetricsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("aad.AzureADMetricsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, azureADMetricsName) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.AzureADMetricsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "aad.AzureADMetricsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.AzureADMetricsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AzureADMetricsClient) DeletePreparer(ctx context.Context, resourceGroupName string, azureADMetricsName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "azureADMetricsName": autorest.Encode("path", azureADMetricsName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.aadiam/azureADMetrics/{azureADMetricsName}", 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 AzureADMetricsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client AzureADMetricsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a azureADMetrics instance with a given name. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// azureADMetricsName - name of the azureADMetrics instance. +func (client AzureADMetricsClient) Get(ctx context.Context, resourceGroupName string, azureADMetricsName string) (result AzureADMetricsConfig, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AzureADMetricsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("aad.AzureADMetricsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, azureADMetricsName) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.AzureADMetricsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "aad.AzureADMetricsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.AzureADMetricsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client AzureADMetricsClient) GetPreparer(ctx context.Context, resourceGroupName string, azureADMetricsName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "azureADMetricsName": autorest.Encode("path", azureADMetricsName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.aadiam/azureADMetrics/{azureADMetricsName}", 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 AzureADMetricsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AzureADMetricsClient) GetResponder(resp *http.Response) (result AzureADMetricsConfig, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List operation to return the list of AzureADMetrics resources scoped to the resourceGroup. +// Parameters: +// resourceGroupName - name of an Azure resource group. +func (client AzureADMetricsClient) List(ctx context.Context, resourceGroupName string) (result AzureADMetricsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AzureADMetricsClient.List") + defer func() { + sc := -1 + if result.aamlr.Response.Response != nil { + sc = result.aamlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("aad.AzureADMetricsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.AzureADMetricsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.aamlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "aad.AzureADMetricsClient", "List", resp, "Failure sending request") + return + } + + result.aamlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.AzureADMetricsClient", "List", resp, "Failure responding to request") + return + } + if result.aamlr.hasNextLink() && result.aamlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client AzureADMetricsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.aadiam/azureADMetrics", 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 AzureADMetricsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client AzureADMetricsClient) ListResponder(resp *http.Response) (result AzureADMetricsListResult, err error) { + err = autorest.Respond( + resp, + 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 AzureADMetricsClient) listNextResults(ctx context.Context, lastResults AzureADMetricsListResult) (result AzureADMetricsListResult, err error) { + req, err := lastResults.azureADMetricsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "aad.AzureADMetricsClient", "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, "aad.AzureADMetricsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.AzureADMetricsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AzureADMetricsClient) ListComplete(ctx context.Context, resourceGroupName string) (result AzureADMetricsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AzureADMetricsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName) + return +} + +// ListBySubscription lists all AzureADMetrics resources in the given subscription. +func (client AzureADMetricsClient) ListBySubscription(ctx context.Context) (result AzureADMetricsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AzureADMetricsClient.ListBySubscription") + defer func() { + sc := -1 + if result.aamlr.Response.Response != nil { + sc = result.aamlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.AzureADMetricsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.aamlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "aad.AzureADMetricsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.aamlr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.AzureADMetricsClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.aamlr.hasNextLink() && result.aamlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client AzureADMetricsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/microsoft.aadiam/azureADMetrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client AzureADMetricsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client AzureADMetricsClient) ListBySubscriptionResponder(resp *http.Response) (result AzureADMetricsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client AzureADMetricsClient) listBySubscriptionNextResults(ctx context.Context, lastResults AzureADMetricsListResult) (result AzureADMetricsListResult, err error) { + req, err := lastResults.azureADMetricsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "aad.AzureADMetricsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "aad.AzureADMetricsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.AzureADMetricsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client AzureADMetricsClient) ListBySubscriptionComplete(ctx context.Context) (result AzureADMetricsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AzureADMetricsClient.ListBySubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBySubscription(ctx) + return +} + +// Update updates azureADMetrics tags with specified values. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// azureADMetricsName - name of the azureADMetrics instance. +// azureADMetricsConfig - azureADMetrics resource with the tags to be updated. +func (client AzureADMetricsClient) Update(ctx context.Context, resourceGroupName string, azureADMetricsName string, azureADMetricsConfig *AzureADMetricsUpdateParameter) (result AzureADMetricsConfig, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AzureADMetricsClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("aad.AzureADMetricsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, azureADMetricsName, azureADMetricsConfig) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.AzureADMetricsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "aad.AzureADMetricsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.AzureADMetricsClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client AzureADMetricsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, azureADMetricsName string, azureADMetricsConfig *AzureADMetricsUpdateParameter) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "azureADMetricsName": autorest.Encode("path", azureADMetricsName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.aadiam/azureADMetrics/{azureADMetricsName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if azureADMetricsConfig != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(azureADMetricsConfig)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client AzureADMetricsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client AzureADMetricsClient) UpdateResponder(resp *http.Response) (result AzureADMetricsConfig, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/aad/mgmt/2020-07-01-preview/aad/client.go b/services/preview/aad/mgmt/2020-07-01-preview/aad/client.go new file mode 100644 index 000000000000..bbd4f6b34ccd --- /dev/null +++ b/services/preview/aad/mgmt/2020-07-01-preview/aad/client.go @@ -0,0 +1,41 @@ +// Package aad implements the Azure ARM Aad service API version . +// +// +package aad + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Aad + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Aad. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/services/preview/aad/mgmt/2020-07-01-preview/aad/enums.go b/services/preview/aad/mgmt/2020-07-01-preview/aad/enums.go new file mode 100644 index 000000000000..4aa6f528c814 --- /dev/null +++ b/services/preview/aad/mgmt/2020-07-01-preview/aad/enums.go @@ -0,0 +1,24 @@ +package aad + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // Created ... + Created ProvisioningState = "Created" + // Failed ... + Failed ProvisioningState = "Failed" + // Succeeded ... + Succeeded ProvisioningState = "Succeeded" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{Created, Failed, Succeeded} +} diff --git a/services/preview/aad/mgmt/2020-07-01-preview/aad/models.go b/services/preview/aad/mgmt/2020-07-01-preview/aad/models.go new file mode 100644 index 000000000000..b256bbce57f8 --- /dev/null +++ b/services/preview/aad/mgmt/2020-07-01-preview/aad/models.go @@ -0,0 +1,941 @@ +package aad + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/aad/mgmt/2020-07-01-preview/aad" + +// ARMProxyResource the resource model definition for a ARM proxy resource. It will have everything other +// than required location and tags +type ARMProxyResource struct { + // ID - READ-ONLY; The unique resource identifier of the Azure AD PrivateLink Policy. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the Azure AD PrivateLink Policy. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ARMProxyResource. +func (apr ARMProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// AzureADMetricsConfig azureADMetrics resource. +type AzureADMetricsConfig struct { + autorest.Response `json:"-"` + Properties *AzureADMetricsPropertiesFormat `json:"properties,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureADMetricsConfig. +func (amc AzureADMetricsConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if amc.Properties != nil { + objectMap["properties"] = amc.Properties + } + if amc.Tags != nil { + objectMap["tags"] = amc.Tags + } + if amc.Location != nil { + objectMap["location"] = amc.Location + } + return json.Marshal(objectMap) +} + +// AzureADMetricsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AzureADMetricsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AzureADMetricsClient) (AzureADMetricsConfig, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AzureADMetricsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AzureADMetricsCreateOrUpdateFuture.Result. +func (future *AzureADMetricsCreateOrUpdateFuture) result(client AzureADMetricsClient) (aamc AzureADMetricsConfig, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.AzureADMetricsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + aamc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("aad.AzureADMetricsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if aamc.Response.Response, err = future.GetResult(sender); err == nil && aamc.Response.Response.StatusCode != http.StatusNoContent { + aamc, err = client.CreateOrUpdateResponder(aamc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.AzureADMetricsCreateOrUpdateFuture", "Result", aamc.Response.Response, "Failure responding to request") + } + } + return +} + +// AzureADMetricsListResult a list of AzureADMetrics resources +type AzureADMetricsListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of AzureADMetrics resources. + Value *[]AzureADMetricsConfig `json:"value,omitempty"` + // NextLink - READ-ONLY; The link used to get the next page of operations. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureADMetricsListResult. +func (amlr AzureADMetricsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// AzureADMetricsListResultIterator provides access to a complete listing of AzureADMetricsConfig values. +type AzureADMetricsListResultIterator struct { + i int + page AzureADMetricsListResultPage +} + +// NextWithContext 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 *AzureADMetricsListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AzureADMetricsListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AzureADMetricsListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AzureADMetricsListResultIterator) 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 AzureADMetricsListResultIterator) Response() AzureADMetricsListResult { + 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 AzureADMetricsListResultIterator) Value() AzureADMetricsConfig { + if !iter.page.NotDone() { + return AzureADMetricsConfig{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AzureADMetricsListResultIterator type. +func NewAzureADMetricsListResultIterator(page AzureADMetricsListResultPage) AzureADMetricsListResultIterator { + return AzureADMetricsListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (amlr AzureADMetricsListResult) IsEmpty() bool { + return amlr.Value == nil || len(*amlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (amlr AzureADMetricsListResult) hasNextLink() bool { + return amlr.NextLink != nil && len(*amlr.NextLink) != 0 +} + +// azureADMetricsListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (amlr AzureADMetricsListResult) azureADMetricsListResultPreparer(ctx context.Context) (*http.Request, error) { + if !amlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(amlr.NextLink))) +} + +// AzureADMetricsListResultPage contains a page of AzureADMetricsConfig values. +type AzureADMetricsListResultPage struct { + fn func(context.Context, AzureADMetricsListResult) (AzureADMetricsListResult, error) + aamlr AzureADMetricsListResult +} + +// NextWithContext 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 *AzureADMetricsListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AzureADMetricsListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.aamlr) + if err != nil { + return err + } + page.aamlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *AzureADMetricsListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AzureADMetricsListResultPage) NotDone() bool { + return !page.aamlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AzureADMetricsListResultPage) Response() AzureADMetricsListResult { + return page.aamlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AzureADMetricsListResultPage) Values() []AzureADMetricsConfig { + if page.aamlr.IsEmpty() { + return nil + } + return *page.aamlr.Value +} + +// Creates a new instance of the AzureADMetricsListResultPage type. +func NewAzureADMetricsListResultPage(cur AzureADMetricsListResult, getNextPage func(context.Context, AzureADMetricsListResult) (AzureADMetricsListResult, error)) AzureADMetricsListResultPage { + return AzureADMetricsListResultPage{ + fn: getNextPage, + aamlr: cur, + } +} + +// AzureADMetricsPropertiesFormat ... +type AzureADMetricsPropertiesFormat struct { + // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'Succeeded', 'Created', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureADMetricsPropertiesFormat. +func (aampf AzureADMetricsPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// AzureADMetricsUpdateParameter azureADMetrics parameters to be updated. +type AzureADMetricsUpdateParameter struct { + // Tags - Resource tags to be updated. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for AzureADMetricsUpdateParameter. +func (amup AzureADMetricsUpdateParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if amup.Tags != nil { + objectMap["tags"] = amup.Tags + } + return json.Marshal(objectMap) +} + +// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. +type AzureEntityResource struct { + // Etag - READ-ONLY; Resource Etag. + Etag *string `json:"etag,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureEntityResource. +func (aer AzureEntityResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// AzureResourceBase common properties for all Azure resources. +type AzureResourceBase struct { + // ID - READ-ONLY; String Id used to locate any resource on Azure. + ID *string `json:"id,omitempty"` + // Name - Name of this resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of this resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureResourceBase. +func (arb AzureResourceBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if arb.Name != nil { + objectMap["name"] = arb.Name + } + return json.Marshal(objectMap) +} + +// ErrorDefinition error definition. +type ErrorDefinition struct { + // Code - READ-ONLY; Service specific error code which serves as the substatus for the HTTP error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; Description of the error. + Message *string `json:"message,omitempty"` + // Details - READ-ONLY; Internal error details. + Details *[]ErrorDefinition `json:"details,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorDefinition. +func (ed ErrorDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ErrorResponse error response. +type ErrorResponse struct { + // Error - The error details. + Error *ErrorDefinition `json:"error,omitempty"` +} + +// PrivateLinkForAzureAdCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type PrivateLinkForAzureAdCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateLinkForAzureAdClient) (PrivateLinkPolicy, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateLinkForAzureAdCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PrivateLinkForAzureAdCreateFuture.Result. +func (future *PrivateLinkForAzureAdCreateFuture) result(client PrivateLinkForAzureAdClient) (plp PrivateLinkPolicy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + plp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("aad.PrivateLinkForAzureAdCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if plp.Response.Response, err = future.GetResult(sender); err == nil && plp.Response.Response.StatusCode != http.StatusNoContent { + plp, err = client.CreateResponder(plp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdCreateFuture", "Result", plp.Response.Response, "Failure responding to request") + } + } + return +} + +// PrivateLinkPolicy privateLink Policy configuration object. +type PrivateLinkPolicy struct { + autorest.Response `json:"-"` + // OwnerTenantID - Guid of the owner tenant + OwnerTenantID *string `json:"ownerTenantId,omitempty"` + // AllTenants - Flag indicating whether all tenants are allowed + AllTenants *bool `json:"allTenants,omitempty"` + // Tenants - The list of tenantIds. + Tenants *[]string `json:"tenants,omitempty"` + // ResourceName - Name of the private link policy resource + ResourceName *string `json:"resourceName,omitempty"` + // SubscriptionID - Subscription Identifier + SubscriptionID *string `json:"subscriptionId,omitempty"` + // ResourceGroup - Name of the resource group + ResourceGroup *string `json:"resourceGroup,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ID - READ-ONLY; String Id used to locate any resource on Azure. + ID *string `json:"id,omitempty"` + // Name - Name of this resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of this resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkPolicy. +func (plp PrivateLinkPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plp.OwnerTenantID != nil { + objectMap["ownerTenantId"] = plp.OwnerTenantID + } + if plp.AllTenants != nil { + objectMap["allTenants"] = plp.AllTenants + } + if plp.Tenants != nil { + objectMap["tenants"] = plp.Tenants + } + if plp.ResourceName != nil { + objectMap["resourceName"] = plp.ResourceName + } + if plp.SubscriptionID != nil { + objectMap["subscriptionId"] = plp.SubscriptionID + } + if plp.ResourceGroup != nil { + objectMap["resourceGroup"] = plp.ResourceGroup + } + if plp.Tags != nil { + objectMap["tags"] = plp.Tags + } + if plp.Name != nil { + objectMap["name"] = plp.Name + } + return json.Marshal(objectMap) +} + +// PrivateLinkPolicyListResult a list of private link policies +type PrivateLinkPolicyListResult struct { + autorest.Response `json:"-"` + // Value - Array of private link policies + Value *[]PrivateLinkPolicy `json:"value,omitempty"` + // NextLink - The link used to get the next page of operations. + NextLink *string `json:"nextLink,omitempty"` +} + +// PrivateLinkPolicyListResultIterator provides access to a complete listing of PrivateLinkPolicy values. +type PrivateLinkPolicyListResultIterator struct { + i int + page PrivateLinkPolicyListResultPage +} + +// NextWithContext 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 *PrivateLinkPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkPolicyListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PrivateLinkPolicyListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PrivateLinkPolicyListResultIterator) 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 PrivateLinkPolicyListResultIterator) Response() PrivateLinkPolicyListResult { + 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 PrivateLinkPolicyListResultIterator) Value() PrivateLinkPolicy { + if !iter.page.NotDone() { + return PrivateLinkPolicy{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PrivateLinkPolicyListResultIterator type. +func NewPrivateLinkPolicyListResultIterator(page PrivateLinkPolicyListResultPage) PrivateLinkPolicyListResultIterator { + return PrivateLinkPolicyListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (plplr PrivateLinkPolicyListResult) IsEmpty() bool { + return plplr.Value == nil || len(*plplr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (plplr PrivateLinkPolicyListResult) hasNextLink() bool { + return plplr.NextLink != nil && len(*plplr.NextLink) != 0 +} + +// privateLinkPolicyListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (plplr PrivateLinkPolicyListResult) privateLinkPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { + if !plplr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(plplr.NextLink))) +} + +// PrivateLinkPolicyListResultPage contains a page of PrivateLinkPolicy values. +type PrivateLinkPolicyListResultPage struct { + fn func(context.Context, PrivateLinkPolicyListResult) (PrivateLinkPolicyListResult, error) + plplr PrivateLinkPolicyListResult +} + +// NextWithContext 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 *PrivateLinkPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkPolicyListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.plplr) + if err != nil { + return err + } + page.plplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *PrivateLinkPolicyListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PrivateLinkPolicyListResultPage) NotDone() bool { + return !page.plplr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PrivateLinkPolicyListResultPage) Response() PrivateLinkPolicyListResult { + return page.plplr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PrivateLinkPolicyListResultPage) Values() []PrivateLinkPolicy { + if page.plplr.IsEmpty() { + return nil + } + return *page.plplr.Value +} + +// Creates a new instance of the PrivateLinkPolicyListResultPage type. +func NewPrivateLinkPolicyListResultPage(cur PrivateLinkPolicyListResult, getNextPage func(context.Context, PrivateLinkPolicyListResult) (PrivateLinkPolicyListResult, error)) PrivateLinkPolicyListResultPage { + return PrivateLinkPolicyListResultPage{ + fn: getNextPage, + plplr: cur, + } +} + +// PrivateLinkPolicyUpdateParameter private Link policy parameters to be updated. +type PrivateLinkPolicyUpdateParameter struct { + // Tags - Resource tags to be updated. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkPolicyUpdateParameter. +func (plpup PrivateLinkPolicyUpdateParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plpup.Tags != nil { + objectMap["tags"] = plpup.Tags + } + return json.Marshal(objectMap) +} + +// PrivateLinkResource a private link resource +type PrivateLinkResource struct { + autorest.Response `json:"-"` + // PrivateLinkResourceProperties - Resource properties. + *PrivateLinkResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The unique resource identifier of the Azure AD PrivateLink Policy. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the Azure AD PrivateLink Policy. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkResource. +func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plr.PrivateLinkResourceProperties != nil { + objectMap["properties"] = plr.PrivateLinkResourceProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct. +func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var privateLinkResourceProperties PrivateLinkResourceProperties + err = json.Unmarshal(*v, &privateLinkResourceProperties) + if err != nil { + return err + } + plr.PrivateLinkResourceProperties = &privateLinkResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + plr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + plr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + plr.Type = &typeVar + } + } + } + + return nil +} + +// PrivateLinkResourceListResult a list of private link resources +type PrivateLinkResourceListResult struct { + autorest.Response `json:"-"` + // Value - Array of private link resources + Value *[]PrivateLinkResource `json:"value,omitempty"` + // NextLink - The link used to get the next page of operations. + NextLink *string `json:"nextLink,omitempty"` +} + +// PrivateLinkResourceListResultIterator provides access to a complete listing of PrivateLinkResource +// values. +type PrivateLinkResourceListResultIterator struct { + i int + page PrivateLinkResourceListResultPage +} + +// NextWithContext 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 *PrivateLinkResourceListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PrivateLinkResourceListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PrivateLinkResourceListResultIterator) 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 PrivateLinkResourceListResultIterator) Response() PrivateLinkResourceListResult { + 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 PrivateLinkResourceListResultIterator) Value() PrivateLinkResource { + if !iter.page.NotDone() { + return PrivateLinkResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PrivateLinkResourceListResultIterator type. +func NewPrivateLinkResourceListResultIterator(page PrivateLinkResourceListResultPage) PrivateLinkResourceListResultIterator { + return PrivateLinkResourceListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (plrlr PrivateLinkResourceListResult) IsEmpty() bool { + return plrlr.Value == nil || len(*plrlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (plrlr PrivateLinkResourceListResult) hasNextLink() bool { + return plrlr.NextLink != nil && len(*plrlr.NextLink) != 0 +} + +// privateLinkResourceListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (plrlr PrivateLinkResourceListResult) privateLinkResourceListResultPreparer(ctx context.Context) (*http.Request, error) { + if !plrlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(plrlr.NextLink))) +} + +// PrivateLinkResourceListResultPage contains a page of PrivateLinkResource values. +type PrivateLinkResourceListResultPage struct { + fn func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error) + plrlr PrivateLinkResourceListResult +} + +// NextWithContext 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 *PrivateLinkResourceListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.plrlr) + if err != nil { + return err + } + page.plrlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *PrivateLinkResourceListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PrivateLinkResourceListResultPage) NotDone() bool { + return !page.plrlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PrivateLinkResourceListResultPage) Response() PrivateLinkResourceListResult { + return page.plrlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PrivateLinkResourceListResultPage) Values() []PrivateLinkResource { + if page.plrlr.IsEmpty() { + return nil + } + return *page.plrlr.Value +} + +// Creates a new instance of the PrivateLinkResourceListResultPage type. +func NewPrivateLinkResourceListResultPage(cur PrivateLinkResourceListResult, getNextPage func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)) PrivateLinkResourceListResultPage { + return PrivateLinkResourceListResultPage{ + fn: getNextPage, + plrlr: cur, + } +} + +// PrivateLinkResourceProperties properties of a private link resource. +type PrivateLinkResourceProperties struct { + // GroupID - READ-ONLY; The private link resource group id. + GroupID *string `json:"groupId,omitempty"` + // RequiredMembers - READ-ONLY; The private link resource required member names. + RequiredMembers *[]string `json:"requiredMembers,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties. +func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not +// have tags and a location +type ProxyResource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProxyResource. +func (pr ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// Resource common fields that are returned in the response for all Azure Resource Manager resources +type Resource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource +// which has 'tags' and a 'location' +type TrackedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + return json.Marshal(objectMap) +} diff --git a/services/preview/aad/mgmt/2020-07-01-preview/aad/privatelinkforazuread.go b/services/preview/aad/mgmt/2020-07-01-preview/aad/privatelinkforazuread.go new file mode 100644 index 000000000000..501d9c7c2c96 --- /dev/null +++ b/services/preview/aad/mgmt/2020-07-01-preview/aad/privatelinkforazuread.go @@ -0,0 +1,617 @@ +package aad + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PrivateLinkForAzureAdClient is the client for the PrivateLinkForAzureAd methods of the Aad service. +type PrivateLinkForAzureAdClient struct { + BaseClient +} + +// NewPrivateLinkForAzureAdClient creates an instance of the PrivateLinkForAzureAdClient client. +func NewPrivateLinkForAzureAdClient(subscriptionID string) PrivateLinkForAzureAdClient { + return NewPrivateLinkForAzureAdClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateLinkForAzureAdClientWithBaseURI creates an instance of the PrivateLinkForAzureAdClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewPrivateLinkForAzureAdClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkForAzureAdClient { + return PrivateLinkForAzureAdClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a private link policy. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// policyName - the name of the private link policy in Azure AD. +// privateLinkPolicy - private link Policy supplied to the operation. +func (client PrivateLinkForAzureAdClient) Create(ctx context.Context, resourceGroupName string, policyName string, privateLinkPolicy PrivateLinkPolicy) (result PrivateLinkForAzureAdCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkForAzureAdClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("aad.PrivateLinkForAzureAdClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, policyName, privateLinkPolicy) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client PrivateLinkForAzureAdClient) CreatePreparer(ctx context.Context, resourceGroupName string, policyName string, privateLinkPolicy PrivateLinkPolicy) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.aadiam/privateLinkForAzureAd/{policyName}", pathParameters), + autorest.WithJSON(privateLinkPolicy), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateLinkForAzureAdClient) CreateSender(req *http.Request) (future PrivateLinkForAzureAdCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client PrivateLinkForAzureAdClient) CreateResponder(resp *http.Response) (result PrivateLinkPolicy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a private link policy. When operation completes, status code 200 returned without content. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// policyName - the name of the private link policy in Azure AD. +func (client PrivateLinkForAzureAdClient) Delete(ctx context.Context, resourceGroupName string, policyName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkForAzureAdClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("aad.PrivateLinkForAzureAdClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PrivateLinkForAzureAdClient) DeletePreparer(ctx context.Context, resourceGroupName string, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.aadiam/privateLinkForAzureAd/{policyName}", 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 PrivateLinkForAzureAdClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client PrivateLinkForAzureAdClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a private link policy with a given name. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// policyName - the name of the private link policy in Azure AD. +func (client PrivateLinkForAzureAdClient) Get(ctx context.Context, resourceGroupName string, policyName string) (result PrivateLinkPolicy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkForAzureAdClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("aad.PrivateLinkForAzureAdClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateLinkForAzureAdClient) GetPreparer(ctx context.Context, resourceGroupName string, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.aadiam/privateLinkForAzureAd/{policyName}", 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 PrivateLinkForAzureAdClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client PrivateLinkForAzureAdClient) GetResponder(resp *http.Response) (result PrivateLinkPolicy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List operation to return the list of Private Link Policies For AzureAD scoped to the resourceGroup. +// Parameters: +// resourceGroupName - name of an Azure resource group. +func (client PrivateLinkForAzureAdClient) List(ctx context.Context, resourceGroupName string) (result PrivateLinkPolicyListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkForAzureAdClient.List") + defer func() { + sc := -1 + if result.plplr.Response.Response != nil { + sc = result.plplr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("aad.PrivateLinkForAzureAdClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.plplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "List", resp, "Failure sending request") + return + } + + result.plplr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "List", resp, "Failure responding to request") + return + } + if result.plplr.hasNextLink() && result.plplr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client PrivateLinkForAzureAdClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.aadiam/privateLinkForAzureAd", 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 PrivateLinkForAzureAdClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client PrivateLinkForAzureAdClient) ListResponder(resp *http.Response) (result PrivateLinkPolicyListResult, err error) { + err = autorest.Respond( + resp, + 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 PrivateLinkForAzureAdClient) listNextResults(ctx context.Context, lastResults PrivateLinkPolicyListResult) (result PrivateLinkPolicyListResult, err error) { + req, err := lastResults.privateLinkPolicyListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "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, "aad.PrivateLinkForAzureAdClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client PrivateLinkForAzureAdClient) ListComplete(ctx context.Context, resourceGroupName string) (result PrivateLinkPolicyListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkForAzureAdClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName) + return +} + +// ListBySubscription lists all Private Link Policies For AzureAD in the given subscription. +func (client PrivateLinkForAzureAdClient) ListBySubscription(ctx context.Context) (result PrivateLinkPolicyListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkForAzureAdClient.ListBySubscription") + defer func() { + sc := -1 + if result.plplr.Response.Response != nil { + sc = result.plplr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.plplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.plplr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.plplr.hasNextLink() && result.plplr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client PrivateLinkForAzureAdClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/microsoft.aadiam/privateLinkForAzureAd", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateLinkForAzureAdClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client PrivateLinkForAzureAdClient) ListBySubscriptionResponder(resp *http.Response) (result PrivateLinkPolicyListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client PrivateLinkForAzureAdClient) listBySubscriptionNextResults(ctx context.Context, lastResults PrivateLinkPolicyListResult) (result PrivateLinkPolicyListResult, err error) { + req, err := lastResults.privateLinkPolicyListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client PrivateLinkForAzureAdClient) ListBySubscriptionComplete(ctx context.Context) (result PrivateLinkPolicyListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkForAzureAdClient.ListBySubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBySubscription(ctx) + return +} + +// Update updates private link policy tags with specified values. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// policyName - the name of the private link policy in Azure AD. +// privateLinkPolicy - private Link Policy resource with the tags to be updated. +func (client PrivateLinkForAzureAdClient) Update(ctx context.Context, resourceGroupName string, policyName string, privateLinkPolicy *PrivateLinkPolicyUpdateParameter) (result PrivateLinkPolicy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkForAzureAdClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("aad.PrivateLinkForAzureAdClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, policyName, privateLinkPolicy) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkForAzureAdClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client PrivateLinkForAzureAdClient) UpdatePreparer(ctx context.Context, resourceGroupName string, policyName string, privateLinkPolicy *PrivateLinkPolicyUpdateParameter) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.aadiam/privateLinkForAzureAd/{policyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if privateLinkPolicy != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(privateLinkPolicy)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateLinkForAzureAdClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client PrivateLinkForAzureAdClient) UpdateResponder(resp *http.Response) (result PrivateLinkPolicy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/aad/mgmt/2020-07-01-preview/aad/privatelinkresources.go b/services/preview/aad/mgmt/2020-07-01-preview/aad/privatelinkresources.go new file mode 100644 index 000000000000..c96d4bee19d1 --- /dev/null +++ b/services/preview/aad/mgmt/2020-07-01-preview/aad/privatelinkresources.go @@ -0,0 +1,245 @@ +package aad + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PrivateLinkResourcesClient is the client for the PrivateLinkResources methods of the Aad service. +type PrivateLinkResourcesClient struct { + BaseClient +} + +// NewPrivateLinkResourcesClient creates an instance of the PrivateLinkResourcesClient client. +func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { + return NewPrivateLinkResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateLinkResourcesClientWithBaseURI creates an instance of the PrivateLinkResourcesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { + return PrivateLinkResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets the private link resources that need to be created for a policy of AzureAD. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// policyName - the name of the private link policy in Azure AD. +// groupName - the name of the private link resource. +func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, policyName string, groupName string) (result PrivateLinkResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("aad.PrivateLinkResourcesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, policyName, groupName) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkResourcesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "aad.PrivateLinkResourcesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkResourcesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateLinkResourcesClient) GetPreparer(ctx context.Context, resourceGroupName string, policyName string, groupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupName": autorest.Encode("path", groupName), + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.aadiam/privateLinkForAzureAd/{policyName}/privateLinkResources/{groupName}", 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 PrivateLinkResourcesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client PrivateLinkResourcesClient) GetResponder(resp *http.Response) (result PrivateLinkResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByPrivateLinkPolicy gets the private link resources that need to be created for a policy of AzureAD. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// policyName - the name of the private link policy in Azure AD. +func (client PrivateLinkResourcesClient) ListByPrivateLinkPolicy(ctx context.Context, resourceGroupName string, policyName string) (result PrivateLinkResourceListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.ListByPrivateLinkPolicy") + defer func() { + sc := -1 + if result.plrlr.Response.Response != nil { + sc = result.plrlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("aad.PrivateLinkResourcesClient", "ListByPrivateLinkPolicy", err.Error()) + } + + result.fn = client.listByPrivateLinkPolicyNextResults + req, err := client.ListByPrivateLinkPolicyPreparer(ctx, resourceGroupName, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkResourcesClient", "ListByPrivateLinkPolicy", nil, "Failure preparing request") + return + } + + resp, err := client.ListByPrivateLinkPolicySender(req) + if err != nil { + result.plrlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "aad.PrivateLinkResourcesClient", "ListByPrivateLinkPolicy", resp, "Failure sending request") + return + } + + result.plrlr, err = client.ListByPrivateLinkPolicyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkResourcesClient", "ListByPrivateLinkPolicy", resp, "Failure responding to request") + return + } + if result.plrlr.hasNextLink() && result.plrlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByPrivateLinkPolicyPreparer prepares the ListByPrivateLinkPolicy request. +func (client PrivateLinkResourcesClient) ListByPrivateLinkPolicyPreparer(ctx context.Context, resourceGroupName string, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.aadiam/privateLinkForAzureAd/{policyName}/privateLinkResources", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByPrivateLinkPolicySender sends the ListByPrivateLinkPolicy request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateLinkResourcesClient) ListByPrivateLinkPolicySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByPrivateLinkPolicyResponder handles the response to the ListByPrivateLinkPolicy request. The method always +// closes the http.Response Body. +func (client PrivateLinkResourcesClient) ListByPrivateLinkPolicyResponder(resp *http.Response) (result PrivateLinkResourceListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByPrivateLinkPolicyNextResults retrieves the next set of results, if any. +func (client PrivateLinkResourcesClient) listByPrivateLinkPolicyNextResults(ctx context.Context, lastResults PrivateLinkResourceListResult) (result PrivateLinkResourceListResult, err error) { + req, err := lastResults.privateLinkResourceListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "aad.PrivateLinkResourcesClient", "listByPrivateLinkPolicyNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByPrivateLinkPolicySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "aad.PrivateLinkResourcesClient", "listByPrivateLinkPolicyNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByPrivateLinkPolicyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "aad.PrivateLinkResourcesClient", "listByPrivateLinkPolicyNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByPrivateLinkPolicyComplete enumerates all values, automatically crossing page boundaries as required. +func (client PrivateLinkResourcesClient) ListByPrivateLinkPolicyComplete(ctx context.Context, resourceGroupName string, policyName string) (result PrivateLinkResourceListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.ListByPrivateLinkPolicy") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByPrivateLinkPolicy(ctx, resourceGroupName, policyName) + return +} diff --git a/services/preview/aad/mgmt/2020-07-01-preview/aad/version.go b/services/preview/aad/mgmt/2020-07-01-preview/aad/version.go new file mode 100644 index 000000000000..1a2570eb8950 --- /dev/null +++ b/services/preview/aad/mgmt/2020-07-01-preview/aad/version.go @@ -0,0 +1,19 @@ +package aad + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " aad/2020-07-01-preview" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/preview/azurestackhci/mgmt/2020-03-01-preview/azurestackhci/CHANGELOG.md b/services/preview/azurestackhci/mgmt/2020-03-01-preview/azurestackhci/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/preview/azurestackhci/mgmt/2020-03-01-preview/azurestackhci/CHANGELOG.md +++ b/services/preview/azurestackhci/mgmt/2020-03-01-preview/azurestackhci/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/preview/azurestackhci/mgmt/2020-03-01-preview/azurestackhci/_meta.json b/services/preview/azurestackhci/mgmt/2020-03-01-preview/azurestackhci/_meta.json index 5bd781a802a5..c555cd64ddef 100644 --- a/services/preview/azurestackhci/mgmt/2020-03-01-preview/azurestackhci/_meta.json +++ b/services/preview/azurestackhci/mgmt/2020-03-01-preview/azurestackhci/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "4742065e8d48160292fbce6790710c6835f8dc4f", "readme": "/_/azure-rest-api-specs/specification/azurestackhci/resource-manager/readme.md", "tag": "package-2020-03-01-preview", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/preview/azurestackhci/mgmt/2020-03-01-preview/azurestackhci/clusters.go b/services/preview/azurestackhci/mgmt/2020-03-01-preview/azurestackhci/clusters.go index 7af93a1eb29d..96a24d59876e 100644 --- a/services/preview/azurestackhci/mgmt/2020-03-01-preview/azurestackhci/clusters.go +++ b/services/preview/azurestackhci/mgmt/2020-03-01-preview/azurestackhci/clusters.go @@ -52,8 +52,7 @@ func (client ClustersClient) Create(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: cluster, Constraints: []validation.Constraint{{Target: "cluster.ClusterProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "cluster.ClusterProperties.AadClientID", Name: validation.Null, Rule: true, Chain: nil}, @@ -145,8 +144,7 @@ func (client ClustersClient) Delete(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("azurestackhci.ClustersClient", "Delete", err.Error()) } @@ -230,8 +228,7 @@ func (client ClustersClient) Get(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("azurestackhci.ClustersClient", "Get", err.Error()) } @@ -434,8 +431,7 @@ func (client ClustersClient) ListByResourceGroup(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("azurestackhci.ClustersClient", "ListByResourceGroup", err.Error()) } @@ -562,8 +558,7 @@ func (client ClustersClient) Update(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("azurestackhci.ClustersClient", "Update", err.Error()) } diff --git a/services/preview/azurestackhci/mgmt/2021-01-01-preview/azurestackhci/CHANGELOG.md b/services/preview/azurestackhci/mgmt/2021-01-01-preview/azurestackhci/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/preview/azurestackhci/mgmt/2021-01-01-preview/azurestackhci/CHANGELOG.md +++ b/services/preview/azurestackhci/mgmt/2021-01-01-preview/azurestackhci/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/preview/azurestackhci/mgmt/2021-01-01-preview/azurestackhci/_meta.json b/services/preview/azurestackhci/mgmt/2021-01-01-preview/azurestackhci/_meta.json index 88c6a6efb598..d71882aee481 100644 --- a/services/preview/azurestackhci/mgmt/2021-01-01-preview/azurestackhci/_meta.json +++ b/services/preview/azurestackhci/mgmt/2021-01-01-preview/azurestackhci/_meta.json @@ -1,5 +1,5 @@ { - "commit": "8dff86df71bee429af84ea4713288ef3cdd1db2f", + "commit": "4742065e8d48160292fbce6790710c6835f8dc4f", "readme": "/_/azure-rest-api-specs/specification/azurestackhci/resource-manager/readme.md", "tag": "package-preview-2021-01", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/recoveryservices/mgmt/2016-06-01/backup/CHANGELOG.md b/services/recoveryservices/mgmt/2016-06-01/backup/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/recoveryservices/mgmt/2016-06-01/backup/CHANGELOG.md +++ b/services/recoveryservices/mgmt/2016-06-01/backup/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/recoveryservices/mgmt/2016-06-01/backup/_meta.json b/services/recoveryservices/mgmt/2016-06-01/backup/_meta.json index fc64fca97e76..6ea8c1890ba0 100644 --- a/services/recoveryservices/mgmt/2016-06-01/backup/_meta.json +++ b/services/recoveryservices/mgmt/2016-06-01/backup/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "4742065e8d48160292fbce6790710c6835f8dc4f", "readme": "/_/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/readme.md", "tag": "package-2016-06", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/recoveryservices/mgmt/2016-12-01/backup/CHANGELOG.md b/services/recoveryservices/mgmt/2016-12-01/backup/CHANGELOG.md index 52911e4cc5e4..a1ecf841edb0 100644 --- a/services/recoveryservices/mgmt/2016-12-01/backup/CHANGELOG.md +++ b/services/recoveryservices/mgmt/2016-12-01/backup/CHANGELOG.md @@ -1,2 +1,2 @@ -# Change History +# Unreleased diff --git a/services/recoveryservices/mgmt/2016-12-01/backup/_meta.json b/services/recoveryservices/mgmt/2016-12-01/backup/_meta.json index 5aabfa7285b1..7f0d0d7b918d 100644 --- a/services/recoveryservices/mgmt/2016-12-01/backup/_meta.json +++ b/services/recoveryservices/mgmt/2016-12-01/backup/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "4742065e8d48160292fbce6790710c6835f8dc4f", "readme": "/_/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/readme.md", "tag": "package-2016-12", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/CHANGELOG.md b/services/recoveryservices/mgmt/2017-07-01/backup/CHANGELOG.md new file mode 100644 index 000000000000..a1ecf841edb0 --- /dev/null +++ b/services/recoveryservices/mgmt/2017-07-01/backup/CHANGELOG.md @@ -0,0 +1,2 @@ +# Unreleased + diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/_meta.json b/services/recoveryservices/mgmt/2017-07-01/backup/_meta.json new file mode 100644 index 000000000000..8663475e8d16 --- /dev/null +++ b/services/recoveryservices/mgmt/2017-07-01/backup/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "4742065e8d48160292fbce6790710c6835f8dc4f", + "readme": "/_/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/readme.md", + "tag": "package-2017-07", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2017-07 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/backupapi/interfaces.go b/services/recoveryservices/mgmt/2017-07-01/backup/backupapi/interfaces.go new file mode 100644 index 000000000000..9872696fc365 --- /dev/null +++ b/services/recoveryservices/mgmt/2017-07-01/backup/backupapi/interfaces.go @@ -0,0 +1,52 @@ +package backupapi + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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/azure-sdk-for-go/services/recoveryservices/mgmt/2017-07-01/backup" + "github.com/Azure/go-autorest/autorest" +) + +// ProtectionIntentClientAPI contains the set of methods on the ProtectionIntentClient type. +type ProtectionIntentClientAPI interface { + CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string, parameters backup.ProtectionIntentResource) (result backup.ProtectionIntentResource, err error) + Delete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string) (result autorest.Response, err error) + Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string) (result backup.ProtectionIntentResource, err error) + Validate(ctx context.Context, azureRegion string, parameters backup.PreValidateEnableBackupRequest) (result backup.PreValidateEnableBackupResponse, err error) +} + +var _ ProtectionIntentClientAPI = (*backup.ProtectionIntentClient)(nil) + +// StatusClientAPI contains the set of methods on the StatusClient type. +type StatusClientAPI interface { + Get(ctx context.Context, azureRegion string, parameters backup.StatusRequest) (result backup.StatusResponse, err error) +} + +var _ StatusClientAPI = (*backup.StatusClient)(nil) + +// FeatureSupportClientAPI contains the set of methods on the FeatureSupportClient type. +type FeatureSupportClientAPI interface { + Validate(ctx context.Context, azureRegion string, parameters backup.BasicFeatureSupportRequest) (result backup.AzureVMResourceFeatureSupportResponse, err error) +} + +var _ FeatureSupportClientAPI = (*backup.FeatureSupportClient)(nil) + +// ProtectionIntentGroupClientAPI contains the set of methods on the ProtectionIntentGroupClient type. +type ProtectionIntentGroupClientAPI interface { + List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ProtectionIntentResourceListPage, err error) + ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ProtectionIntentResourceListIterator, err error) +} + +var _ ProtectionIntentGroupClientAPI = (*backup.ProtectionIntentGroupClient)(nil) + +// UsageSummariesClientAPI contains the set of methods on the UsageSummariesClient type. +type UsageSummariesClientAPI interface { + List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ManagementUsageList, err error) +} + +var _ UsageSummariesClientAPI = (*backup.UsageSummariesClient)(nil) diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/client.go b/services/recoveryservices/mgmt/2017-07-01/backup/client.go new file mode 100644 index 000000000000..ae6b2a1853fd --- /dev/null +++ b/services/recoveryservices/mgmt/2017-07-01/backup/client.go @@ -0,0 +1,41 @@ +// Package backup implements the Azure ARM Backup service API version 2017-07-01. +// +// Open API 2.0 Specs for Azure RecoveryServices Backup service +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Backup + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Backup. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/enums.go b/services/recoveryservices/mgmt/2017-07-01/backup/enums.go new file mode 100644 index 000000000000..10ed5bae5370 --- /dev/null +++ b/services/recoveryservices/mgmt/2017-07-01/backup/enums.go @@ -0,0 +1,393 @@ +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// DataSourceType enumerates the values for data source type. +type DataSourceType string + +const ( + // AzureFileShare ... + AzureFileShare DataSourceType = "AzureFileShare" + // AzureSQLDb ... + AzureSQLDb DataSourceType = "AzureSqlDb" + // Client ... + Client DataSourceType = "Client" + // Exchange ... + Exchange DataSourceType = "Exchange" + // FileFolder ... + FileFolder DataSourceType = "FileFolder" + // GenericDataSource ... + GenericDataSource DataSourceType = "GenericDataSource" + // Invalid ... + Invalid DataSourceType = "Invalid" + // SAPAseDatabase ... + SAPAseDatabase DataSourceType = "SAPAseDatabase" + // SAPHanaDatabase ... + SAPHanaDatabase DataSourceType = "SAPHanaDatabase" + // Sharepoint ... + Sharepoint DataSourceType = "Sharepoint" + // SQLDataBase ... + SQLDataBase DataSourceType = "SQLDataBase" + // SQLDB ... + SQLDB DataSourceType = "SQLDB" + // SystemState ... + SystemState DataSourceType = "SystemState" + // VM ... + VM DataSourceType = "VM" + // VMwareVM ... + VMwareVM DataSourceType = "VMwareVM" +) + +// PossibleDataSourceTypeValues returns an array of possible values for the DataSourceType const type. +func PossibleDataSourceTypeValues() []DataSourceType { + return []DataSourceType{AzureFileShare, AzureSQLDb, Client, Exchange, FileFolder, GenericDataSource, Invalid, SAPAseDatabase, SAPHanaDatabase, Sharepoint, SQLDataBase, SQLDB, SystemState, VM, VMwareVM} +} + +// FabricName enumerates the values for fabric name. +type FabricName string + +const ( + // FabricNameAzure ... + FabricNameAzure FabricName = "Azure" + // FabricNameInvalid ... + FabricNameInvalid FabricName = "Invalid" +) + +// PossibleFabricNameValues returns an array of possible values for the FabricName const type. +func PossibleFabricNameValues() []FabricName { + return []FabricName{FabricNameAzure, FabricNameInvalid} +} + +// FeatureType enumerates the values for feature type. +type FeatureType string + +const ( + // FeatureTypeAzureBackupGoals ... + FeatureTypeAzureBackupGoals FeatureType = "AzureBackupGoals" + // FeatureTypeAzureVMResourceBackup ... + FeatureTypeAzureVMResourceBackup FeatureType = "AzureVMResourceBackup" + // FeatureTypeFeatureSupportRequest ... + FeatureTypeFeatureSupportRequest FeatureType = "FeatureSupportRequest" +) + +// PossibleFeatureTypeValues returns an array of possible values for the FeatureType const type. +func PossibleFeatureTypeValues() []FeatureType { + return []FeatureType{FeatureTypeAzureBackupGoals, FeatureTypeAzureVMResourceBackup, FeatureTypeFeatureSupportRequest} +} + +// 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} +} + +// JobSupportedAction enumerates the values for job supported action. +type JobSupportedAction string + +const ( + // JobSupportedActionCancellable ... + JobSupportedActionCancellable JobSupportedAction = "Cancellable" + // JobSupportedActionInvalid ... + JobSupportedActionInvalid JobSupportedAction = "Invalid" + // JobSupportedActionRetriable ... + JobSupportedActionRetriable JobSupportedAction = "Retriable" +) + +// PossibleJobSupportedActionValues returns an array of possible values for the JobSupportedAction const type. +func PossibleJobSupportedActionValues() []JobSupportedAction { + return []JobSupportedAction{JobSupportedActionCancellable, JobSupportedActionInvalid, JobSupportedActionRetriable} +} + +// JobType enumerates the values for job type. +type JobType string + +const ( + // JobTypeAzureIaaSVMJob ... + JobTypeAzureIaaSVMJob JobType = "AzureIaaSVMJob" + // JobTypeAzureStorageJob ... + JobTypeAzureStorageJob JobType = "AzureStorageJob" + // JobTypeAzureWorkloadJob ... + JobTypeAzureWorkloadJob JobType = "AzureWorkloadJob" + // JobTypeDpmJob ... + JobTypeDpmJob JobType = "DpmJob" + // JobTypeJob ... + JobTypeJob JobType = "Job" + // JobTypeMabJob ... + JobTypeMabJob JobType = "MabJob" +) + +// PossibleJobTypeValues returns an array of possible values for the JobType const type. +func PossibleJobTypeValues() []JobType { + return []JobType{JobTypeAzureIaaSVMJob, JobTypeAzureStorageJob, JobTypeAzureWorkloadJob, JobTypeDpmJob, JobTypeJob, JobTypeMabJob} +} + +// MabServerType enumerates the values for mab server type. +type MabServerType string + +const ( + // MabServerTypeAzureBackupServerContainer ... + MabServerTypeAzureBackupServerContainer MabServerType = "AzureBackupServerContainer" + // MabServerTypeAzureSQLContainer ... + MabServerTypeAzureSQLContainer MabServerType = "AzureSqlContainer" + // MabServerTypeCluster ... + MabServerTypeCluster MabServerType = "Cluster" + // MabServerTypeDPMContainer ... + MabServerTypeDPMContainer MabServerType = "DPMContainer" + // MabServerTypeGenericContainer ... + MabServerTypeGenericContainer MabServerType = "GenericContainer" + // MabServerTypeIaasVMContainer ... + MabServerTypeIaasVMContainer MabServerType = "IaasVMContainer" + // MabServerTypeIaasVMServiceContainer ... + MabServerTypeIaasVMServiceContainer MabServerType = "IaasVMServiceContainer" + // MabServerTypeInvalid ... + MabServerTypeInvalid MabServerType = "Invalid" + // MabServerTypeMABContainer ... + MabServerTypeMABContainer MabServerType = "MABContainer" + // MabServerTypeSQLAGWorkLoadContainer ... + MabServerTypeSQLAGWorkLoadContainer MabServerType = "SQLAGWorkLoadContainer" + // MabServerTypeStorageContainer ... + MabServerTypeStorageContainer MabServerType = "StorageContainer" + // MabServerTypeUnknown ... + MabServerTypeUnknown MabServerType = "Unknown" + // MabServerTypeVCenter ... + MabServerTypeVCenter MabServerType = "VCenter" + // MabServerTypeVMAppContainer ... + MabServerTypeVMAppContainer MabServerType = "VMAppContainer" + // MabServerTypeWindows ... + MabServerTypeWindows MabServerType = "Windows" +) + +// PossibleMabServerTypeValues returns an array of possible values for the MabServerType const type. +func PossibleMabServerTypeValues() []MabServerType { + return []MabServerType{MabServerTypeAzureBackupServerContainer, MabServerTypeAzureSQLContainer, MabServerTypeCluster, MabServerTypeDPMContainer, MabServerTypeGenericContainer, MabServerTypeIaasVMContainer, MabServerTypeIaasVMServiceContainer, MabServerTypeInvalid, MabServerTypeMABContainer, MabServerTypeSQLAGWorkLoadContainer, MabServerTypeStorageContainer, MabServerTypeUnknown, MabServerTypeVCenter, MabServerTypeVMAppContainer, MabServerTypeWindows} +} + +// ManagementType enumerates the values for management type. +type ManagementType string + +const ( + // ManagementTypeAzureBackupServer ... + ManagementTypeAzureBackupServer ManagementType = "AzureBackupServer" + // ManagementTypeAzureIaasVM ... + ManagementTypeAzureIaasVM ManagementType = "AzureIaasVM" + // ManagementTypeAzureSQL ... + ManagementTypeAzureSQL ManagementType = "AzureSql" + // ManagementTypeAzureStorage ... + ManagementTypeAzureStorage ManagementType = "AzureStorage" + // ManagementTypeAzureWorkload ... + ManagementTypeAzureWorkload ManagementType = "AzureWorkload" + // ManagementTypeDefaultBackup ... + ManagementTypeDefaultBackup ManagementType = "DefaultBackup" + // ManagementTypeDPM ... + ManagementTypeDPM ManagementType = "DPM" + // ManagementTypeInvalid ... + ManagementTypeInvalid ManagementType = "Invalid" + // ManagementTypeMAB ... + ManagementTypeMAB ManagementType = "MAB" +) + +// PossibleManagementTypeValues returns an array of possible values for the ManagementType const type. +func PossibleManagementTypeValues() []ManagementType { + return []ManagementType{ManagementTypeAzureBackupServer, ManagementTypeAzureIaasVM, ManagementTypeAzureSQL, ManagementTypeAzureStorage, ManagementTypeAzureWorkload, ManagementTypeDefaultBackup, ManagementTypeDPM, ManagementTypeInvalid, ManagementTypeMAB} +} + +// ProtectionIntentItemType enumerates the values for protection intent item type. +type ProtectionIntentItemType string + +const ( + // ProtectionIntentItemTypeAzureResourceItem ... + ProtectionIntentItemTypeAzureResourceItem ProtectionIntentItemType = "AzureResourceItem" + // ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent ... + ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent ProtectionIntentItemType = "AzureWorkloadAutoProtectionIntent" + // ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent ... + ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent ProtectionIntentItemType = "AzureWorkloadSQLAutoProtectionIntent" + // ProtectionIntentItemTypeProtectionIntent ... + ProtectionIntentItemTypeProtectionIntent ProtectionIntentItemType = "ProtectionIntent" + // ProtectionIntentItemTypeRecoveryServiceVaultItem ... + ProtectionIntentItemTypeRecoveryServiceVaultItem ProtectionIntentItemType = "RecoveryServiceVaultItem" +) + +// PossibleProtectionIntentItemTypeValues returns an array of possible values for the ProtectionIntentItemType const type. +func PossibleProtectionIntentItemTypeValues() []ProtectionIntentItemType { + return []ProtectionIntentItemType{ProtectionIntentItemTypeAzureResourceItem, ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent, ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent, ProtectionIntentItemTypeProtectionIntent, ProtectionIntentItemTypeRecoveryServiceVaultItem} +} + +// ProtectionStatus enumerates the values for protection status. +type ProtectionStatus string + +const ( + // ProtectionStatusInvalid ... + ProtectionStatusInvalid ProtectionStatus = "Invalid" + // ProtectionStatusNotProtected ... + ProtectionStatusNotProtected ProtectionStatus = "NotProtected" + // ProtectionStatusProtected ... + ProtectionStatusProtected ProtectionStatus = "Protected" + // ProtectionStatusProtecting ... + ProtectionStatusProtecting ProtectionStatus = "Protecting" + // ProtectionStatusProtectionFailed ... + ProtectionStatusProtectionFailed ProtectionStatus = "ProtectionFailed" +) + +// PossibleProtectionStatusValues returns an array of possible values for the ProtectionStatus const type. +func PossibleProtectionStatusValues() []ProtectionStatus { + return []ProtectionStatus{ProtectionStatusInvalid, ProtectionStatusNotProtected, ProtectionStatusProtected, ProtectionStatusProtecting, ProtectionStatusProtectionFailed} +} + +// SupportStatus enumerates the values for support status. +type SupportStatus string + +const ( + // SupportStatusDefaultOFF ... + SupportStatusDefaultOFF SupportStatus = "DefaultOFF" + // SupportStatusDefaultON ... + SupportStatusDefaultON SupportStatus = "DefaultON" + // SupportStatusInvalid ... + SupportStatusInvalid SupportStatus = "Invalid" + // SupportStatusNotSupported ... + SupportStatusNotSupported SupportStatus = "NotSupported" + // SupportStatusSupported ... + SupportStatusSupported SupportStatus = "Supported" +) + +// PossibleSupportStatusValues returns an array of possible values for the SupportStatus const type. +func PossibleSupportStatusValues() []SupportStatus { + return []SupportStatus{SupportStatusDefaultOFF, SupportStatusDefaultON, SupportStatusInvalid, SupportStatusNotSupported, SupportStatusSupported} +} + +// Type enumerates the values for type. +type Type string + +const ( + // TypeBackupProtectedItemCountSummary ... + TypeBackupProtectedItemCountSummary Type = "BackupProtectedItemCountSummary" + // TypeBackupProtectionContainerCountSummary ... + TypeBackupProtectionContainerCountSummary Type = "BackupProtectionContainerCountSummary" + // TypeInvalid ... + TypeInvalid Type = "Invalid" +) + +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{TypeBackupProtectedItemCountSummary, TypeBackupProtectionContainerCountSummary, TypeInvalid} +} + +// UsagesUnit enumerates the values for usages unit. +type UsagesUnit string + +const ( + // Bytes ... + Bytes UsagesUnit = "Bytes" + // BytesPerSecond ... + BytesPerSecond UsagesUnit = "BytesPerSecond" + // Count ... + Count UsagesUnit = "Count" + // CountPerSecond ... + CountPerSecond UsagesUnit = "CountPerSecond" + // Percent ... + Percent UsagesUnit = "Percent" + // Seconds ... + Seconds UsagesUnit = "Seconds" +) + +// PossibleUsagesUnitValues returns an array of possible values for the UsagesUnit const type. +func PossibleUsagesUnitValues() []UsagesUnit { + return []UsagesUnit{Bytes, BytesPerSecond, Count, CountPerSecond, Percent, Seconds} +} + +// ValidationStatus enumerates the values for validation status. +type ValidationStatus string + +const ( + // ValidationStatusFailed ... + ValidationStatusFailed ValidationStatus = "Failed" + // ValidationStatusInvalid ... + ValidationStatusInvalid ValidationStatus = "Invalid" + // ValidationStatusSucceeded ... + ValidationStatusSucceeded ValidationStatus = "Succeeded" +) + +// PossibleValidationStatusValues returns an array of possible values for the ValidationStatus const type. +func PossibleValidationStatusValues() []ValidationStatus { + return []ValidationStatus{ValidationStatusFailed, ValidationStatusInvalid, ValidationStatusSucceeded} +} + +// WorkloadItemType enumerates the values for workload item type. +type WorkloadItemType string + +const ( + // WorkloadItemTypeInvalid ... + WorkloadItemTypeInvalid WorkloadItemType = "Invalid" + // WorkloadItemTypeSAPAseDatabase ... + WorkloadItemTypeSAPAseDatabase WorkloadItemType = "SAPAseDatabase" + // WorkloadItemTypeSAPAseSystem ... + WorkloadItemTypeSAPAseSystem WorkloadItemType = "SAPAseSystem" + // WorkloadItemTypeSAPHanaDatabase ... + WorkloadItemTypeSAPHanaDatabase WorkloadItemType = "SAPHanaDatabase" + // WorkloadItemTypeSAPHanaSystem ... + WorkloadItemTypeSAPHanaSystem WorkloadItemType = "SAPHanaSystem" + // WorkloadItemTypeSQLDataBase ... + WorkloadItemTypeSQLDataBase WorkloadItemType = "SQLDataBase" + // WorkloadItemTypeSQLInstance ... + WorkloadItemTypeSQLInstance WorkloadItemType = "SQLInstance" +) + +// PossibleWorkloadItemTypeValues returns an array of possible values for the WorkloadItemType const type. +func PossibleWorkloadItemTypeValues() []WorkloadItemType { + return []WorkloadItemType{WorkloadItemTypeInvalid, WorkloadItemTypeSAPAseDatabase, WorkloadItemTypeSAPAseSystem, WorkloadItemTypeSAPHanaDatabase, WorkloadItemTypeSAPHanaSystem, WorkloadItemTypeSQLDataBase, WorkloadItemTypeSQLInstance} +} + +// WorkloadType enumerates the values for workload type. +type WorkloadType string + +const ( + // WorkloadTypeAzureFileShare ... + WorkloadTypeAzureFileShare WorkloadType = "AzureFileShare" + // WorkloadTypeAzureSQLDb ... + WorkloadTypeAzureSQLDb WorkloadType = "AzureSqlDb" + // WorkloadTypeClient ... + WorkloadTypeClient WorkloadType = "Client" + // WorkloadTypeExchange ... + WorkloadTypeExchange WorkloadType = "Exchange" + // WorkloadTypeFileFolder ... + WorkloadTypeFileFolder WorkloadType = "FileFolder" + // WorkloadTypeGenericDataSource ... + WorkloadTypeGenericDataSource WorkloadType = "GenericDataSource" + // WorkloadTypeInvalid ... + WorkloadTypeInvalid WorkloadType = "Invalid" + // WorkloadTypeSAPAseDatabase ... + WorkloadTypeSAPAseDatabase WorkloadType = "SAPAseDatabase" + // WorkloadTypeSAPHanaDatabase ... + WorkloadTypeSAPHanaDatabase WorkloadType = "SAPHanaDatabase" + // WorkloadTypeSharepoint ... + WorkloadTypeSharepoint WorkloadType = "Sharepoint" + // WorkloadTypeSQLDataBase ... + WorkloadTypeSQLDataBase WorkloadType = "SQLDataBase" + // WorkloadTypeSQLDB ... + WorkloadTypeSQLDB WorkloadType = "SQLDB" + // WorkloadTypeSystemState ... + WorkloadTypeSystemState WorkloadType = "SystemState" + // WorkloadTypeVM ... + WorkloadTypeVM WorkloadType = "VM" + // WorkloadTypeVMwareVM ... + WorkloadTypeVMwareVM WorkloadType = "VMwareVM" +) + +// PossibleWorkloadTypeValues returns an array of possible values for the WorkloadType const type. +func PossibleWorkloadTypeValues() []WorkloadType { + return []WorkloadType{WorkloadTypeAzureFileShare, WorkloadTypeAzureSQLDb, WorkloadTypeClient, WorkloadTypeExchange, WorkloadTypeFileFolder, WorkloadTypeGenericDataSource, WorkloadTypeInvalid, WorkloadTypeSAPAseDatabase, WorkloadTypeSAPHanaDatabase, WorkloadTypeSharepoint, WorkloadTypeSQLDataBase, WorkloadTypeSQLDB, WorkloadTypeSystemState, WorkloadTypeVM, WorkloadTypeVMwareVM} +} diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/featuresupport.go b/services/recoveryservices/mgmt/2017-07-01/backup/featuresupport.go similarity index 100% rename from services/recoveryservices/mgmt/2019-05-13/backup/featuresupport.go rename to services/recoveryservices/mgmt/2017-07-01/backup/featuresupport.go diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/models.go b/services/recoveryservices/mgmt/2017-07-01/backup/models.go new file mode 100644 index 000000000000..f15e138bbfc3 --- /dev/null +++ b/services/recoveryservices/mgmt/2017-07-01/backup/models.go @@ -0,0 +1,2306 @@ +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2017-07-01/backup" + +// AzureBackupGoalFeatureSupportRequest azure backup goal feature specific request. +type AzureBackupGoalFeatureSupportRequest struct { + // FeatureType - Possible values include: 'FeatureTypeFeatureSupportRequest', 'FeatureTypeAzureBackupGoals', 'FeatureTypeAzureVMResourceBackup' + FeatureType FeatureType `json:"featureType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureBackupGoalFeatureSupportRequest. +func (abgfsr AzureBackupGoalFeatureSupportRequest) MarshalJSON() ([]byte, error) { + abgfsr.FeatureType = FeatureTypeAzureBackupGoals + objectMap := make(map[string]interface{}) + if abgfsr.FeatureType != "" { + objectMap["featureType"] = abgfsr.FeatureType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupGoalFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. +func (abgfsr AzureBackupGoalFeatureSupportRequest) AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) { + return &abgfsr, true +} + +// AsAzureVMResourceFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. +func (abgfsr AzureBackupGoalFeatureSupportRequest) AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) { + return nil, false +} + +// AsFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. +func (abgfsr AzureBackupGoalFeatureSupportRequest) AsFeatureSupportRequest() (*FeatureSupportRequest, bool) { + return nil, false +} + +// AsBasicFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. +func (abgfsr AzureBackupGoalFeatureSupportRequest) AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) { + return &abgfsr, true +} + +// AzureIaaSVMErrorInfo azure IaaS VM workload-specific error information. +type AzureIaaSVMErrorInfo struct { + // ErrorCode - READ-ONLY; Error code. + ErrorCode *int32 `json:"errorCode,omitempty"` + // ErrorTitle - READ-ONLY; Title: Typically, the entity that the error pertains to. + ErrorTitle *string `json:"errorTitle,omitempty"` + // ErrorString - READ-ONLY; Localized error string. + ErrorString *string `json:"errorString,omitempty"` + // Recommendations - READ-ONLY; List of localized recommendations for above error code. + Recommendations *[]string `json:"recommendations,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSVMErrorInfo. +func (aisei AzureIaaSVMErrorInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// AzureIaaSVMJob azure IaaS VM workload-specific job object. +type AzureIaaSVMJob struct { + // Duration - Time elapsed during the execution of this job. + Duration *string `json:"duration,omitempty"` + // ActionsInfo - Gets or sets the state/actions applicable on this job like cancel/retry. + ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` + // ErrorDetails - Error details on execution of this job. + ErrorDetails *[]AzureIaaSVMErrorInfo `json:"errorDetails,omitempty"` + // VirtualMachineVersion - Specifies whether the backup item is a Classic or an Azure Resource Manager VM. + VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` + // ExtendedInfo - Additional information for this job. + ExtendedInfo *AzureIaaSVMJobExtendedInfo `json:"extendedInfo,omitempty"` + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' + JobType JobType `json:"jobType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSVMJob. +func (aisj AzureIaaSVMJob) MarshalJSON() ([]byte, error) { + aisj.JobType = JobTypeAzureIaaSVMJob + objectMap := make(map[string]interface{}) + if aisj.Duration != nil { + objectMap["duration"] = aisj.Duration + } + if aisj.ActionsInfo != nil { + objectMap["actionsInfo"] = aisj.ActionsInfo + } + if aisj.ErrorDetails != nil { + objectMap["errorDetails"] = aisj.ErrorDetails + } + if aisj.VirtualMachineVersion != nil { + objectMap["virtualMachineVersion"] = aisj.VirtualMachineVersion + } + if aisj.ExtendedInfo != nil { + objectMap["extendedInfo"] = aisj.ExtendedInfo + } + if aisj.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = aisj.EntityFriendlyName + } + if aisj.BackupManagementType != "" { + objectMap["backupManagementType"] = aisj.BackupManagementType + } + if aisj.Operation != nil { + objectMap["operation"] = aisj.Operation + } + if aisj.Status != nil { + objectMap["status"] = aisj.Status + } + if aisj.StartTime != nil { + objectMap["startTime"] = aisj.StartTime + } + if aisj.EndTime != nil { + objectMap["endTime"] = aisj.EndTime + } + if aisj.ActivityID != nil { + objectMap["activityId"] = aisj.ActivityID + } + if aisj.JobType != "" { + objectMap["jobType"] = aisj.JobType + } + return json.Marshal(objectMap) +} + +// AsAzureIaaSVMJob is the BasicJob implementation for AzureIaaSVMJob. +func (aisj AzureIaaSVMJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { + return &aisj, true +} + +// AsAzureStorageJob is the BasicJob implementation for AzureIaaSVMJob. +func (aisj AzureIaaSVMJob) AsAzureStorageJob() (*AzureStorageJob, bool) { + return nil, false +} + +// AsAzureWorkloadJob is the BasicJob implementation for AzureIaaSVMJob. +func (aisj AzureIaaSVMJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { + return nil, false +} + +// AsDpmJob is the BasicJob implementation for AzureIaaSVMJob. +func (aisj AzureIaaSVMJob) AsDpmJob() (*DpmJob, bool) { + return nil, false +} + +// AsMabJob is the BasicJob implementation for AzureIaaSVMJob. +func (aisj AzureIaaSVMJob) AsMabJob() (*MabJob, bool) { + return nil, false +} + +// AsJob is the BasicJob implementation for AzureIaaSVMJob. +func (aisj AzureIaaSVMJob) AsJob() (*Job, bool) { + return nil, false +} + +// AsBasicJob is the BasicJob implementation for AzureIaaSVMJob. +func (aisj AzureIaaSVMJob) AsBasicJob() (BasicJob, bool) { + return &aisj, true +} + +// AzureIaaSVMJobExtendedInfo azure IaaS VM workload-specific additional information for job. +type AzureIaaSVMJobExtendedInfo struct { + // TasksList - List of tasks associated with this job. + TasksList *[]AzureIaaSVMJobTaskDetails `json:"tasksList,omitempty"` + // PropertyBag - Job properties. + PropertyBag map[string]*string `json:"propertyBag"` + // InternalPropertyBag - Job internal properties. + InternalPropertyBag map[string]*string `json:"internalPropertyBag"` + // ProgressPercentage - Indicates progress of the job. Null if it has not started or completed. + ProgressPercentage *float64 `json:"progressPercentage,omitempty"` + // EstimatedRemainingDuration - Time remaining for execution of this job. + EstimatedRemainingDuration *string `json:"estimatedRemainingDuration,omitempty"` + // DynamicErrorMessage - Non localized error message on job execution. + DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSVMJobExtendedInfo. +func (aisjei AzureIaaSVMJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aisjei.TasksList != nil { + objectMap["tasksList"] = aisjei.TasksList + } + if aisjei.PropertyBag != nil { + objectMap["propertyBag"] = aisjei.PropertyBag + } + if aisjei.InternalPropertyBag != nil { + objectMap["internalPropertyBag"] = aisjei.InternalPropertyBag + } + if aisjei.ProgressPercentage != nil { + objectMap["progressPercentage"] = aisjei.ProgressPercentage + } + if aisjei.EstimatedRemainingDuration != nil { + objectMap["estimatedRemainingDuration"] = aisjei.EstimatedRemainingDuration + } + if aisjei.DynamicErrorMessage != nil { + objectMap["dynamicErrorMessage"] = aisjei.DynamicErrorMessage + } + return json.Marshal(objectMap) +} + +// AzureIaaSVMJobTaskDetails azure IaaS VM workload-specific job task details. +type AzureIaaSVMJobTaskDetails struct { + // TaskID - The task display name. + TaskID *string `json:"taskId,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // InstanceID - The instanceId. + InstanceID *string `json:"instanceId,omitempty"` + // Duration - Time elapsed for task. + Duration *string `json:"duration,omitempty"` + // Status - The status. + Status *string `json:"status,omitempty"` + // ProgressPercentage - Progress of the task. + ProgressPercentage *float64 `json:"progressPercentage,omitempty"` + // TaskExecutionDetails - Details about execution of the task. + // eg: number of bytes transferred etc + TaskExecutionDetails *string `json:"taskExecutionDetails,omitempty"` +} + +// BasicAzureRecoveryServiceVaultProtectionIntent azure Recovery Services Vault specific protection intent item. +type BasicAzureRecoveryServiceVaultProtectionIntent interface { + AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) + AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) + AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) + AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) +} + +// AzureRecoveryServiceVaultProtectionIntent azure Recovery Services Vault specific protection intent item. +type AzureRecoveryServiceVaultProtectionIntent struct { + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId + ItemID *string `json:"itemId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' + ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` +} + +func unmarshalBasicAzureRecoveryServiceVaultProtectionIntent(body []byte) (BasicAzureRecoveryServiceVaultProtectionIntent, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectionIntentItemType"] { + case string(ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent): + var awapi AzureWorkloadAutoProtectionIntent + err := json.Unmarshal(body, &awapi) + return awapi, err + case string(ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent): + var awsapi AzureWorkloadSQLAutoProtectionIntent + err := json.Unmarshal(body, &awsapi) + return awsapi, err + default: + var arsvpi AzureRecoveryServiceVaultProtectionIntent + err := json.Unmarshal(body, &arsvpi) + return arsvpi, err + } +} +func unmarshalBasicAzureRecoveryServiceVaultProtectionIntentArray(body []byte) ([]BasicAzureRecoveryServiceVaultProtectionIntent, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + arsvpiArray := make([]BasicAzureRecoveryServiceVaultProtectionIntent, len(rawMessages)) + + for index, rawMessage := range rawMessages { + arsvpi, err := unmarshalBasicAzureRecoveryServiceVaultProtectionIntent(*rawMessage) + if err != nil { + return nil, err + } + arsvpiArray[index] = arsvpi + } + return arsvpiArray, nil +} + +// MarshalJSON is the custom marshaler for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) MarshalJSON() ([]byte, error) { + arsvpi.ProtectionIntentItemType = ProtectionIntentItemTypeRecoveryServiceVaultItem + objectMap := make(map[string]interface{}) + if arsvpi.BackupManagementType != "" { + objectMap["backupManagementType"] = arsvpi.BackupManagementType + } + if arsvpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = arsvpi.SourceResourceID + } + if arsvpi.ItemID != nil { + objectMap["itemId"] = arsvpi.ItemID + } + if arsvpi.PolicyID != nil { + objectMap["policyId"] = arsvpi.PolicyID + } + if arsvpi.ProtectionState != "" { + objectMap["protectionState"] = arsvpi.ProtectionState + } + if arsvpi.ProtectionIntentItemType != "" { + objectMap["protectionIntentItemType"] = arsvpi.ProtectionIntentItemType + } + return json.Marshal(objectMap) +} + +// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { + return &arsvpi, true +} + +// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { + return &arsvpi, true +} + +// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { + return nil, false +} + +// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { + return nil, false +} + +// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { + return nil, false +} + +// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { + return nil, false +} + +// AsProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { + return nil, false +} + +// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { + return &arsvpi, true +} + +// AzureResourceProtectionIntent iaaS VM specific backup protection intent item. +type AzureResourceProtectionIntent struct { + // FriendlyName - Friendly name of the VM represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId + ItemID *string `json:"itemId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' + ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureResourceProtectionIntent. +func (arpi AzureResourceProtectionIntent) MarshalJSON() ([]byte, error) { + arpi.ProtectionIntentItemType = ProtectionIntentItemTypeAzureResourceItem + objectMap := make(map[string]interface{}) + if arpi.FriendlyName != nil { + objectMap["friendlyName"] = arpi.FriendlyName + } + if arpi.BackupManagementType != "" { + objectMap["backupManagementType"] = arpi.BackupManagementType + } + if arpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = arpi.SourceResourceID + } + if arpi.ItemID != nil { + objectMap["itemId"] = arpi.ItemID + } + if arpi.PolicyID != nil { + objectMap["policyId"] = arpi.PolicyID + } + if arpi.ProtectionState != "" { + objectMap["protectionState"] = arpi.ProtectionState + } + if arpi.ProtectionIntentItemType != "" { + objectMap["protectionIntentItemType"] = arpi.ProtectionIntentItemType + } + return json.Marshal(objectMap) +} + +// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. +func (arpi AzureResourceProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { + return nil, false +} + +// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. +func (arpi AzureResourceProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { + return nil, false +} + +// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. +func (arpi AzureResourceProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { + return &arpi, true +} + +// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. +func (arpi AzureResourceProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { + return nil, false +} + +// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. +func (arpi AzureResourceProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { + return nil, false +} + +// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. +func (arpi AzureResourceProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { + return nil, false +} + +// AsProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. +func (arpi AzureResourceProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { + return nil, false +} + +// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. +func (arpi AzureResourceProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { + return &arpi, true +} + +// AzureStorageErrorInfo azure storage specific error information +type AzureStorageErrorInfo struct { + // ErrorCode - Error code. + ErrorCode *int32 `json:"errorCode,omitempty"` + // ErrorString - Localized error string. + ErrorString *string `json:"errorString,omitempty"` + // Recommendations - List of localized recommendations for above error code. + Recommendations *[]string `json:"recommendations,omitempty"` +} + +// AzureStorageJob azure storage specific job. +type AzureStorageJob struct { + // Duration - Time elapsed during the execution of this job. + Duration *string `json:"duration,omitempty"` + // ActionsInfo - Gets or sets the state/actions applicable on this job like cancel/retry. + ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` + // ErrorDetails - Error details on execution of this job. + ErrorDetails *[]AzureStorageErrorInfo `json:"errorDetails,omitempty"` + // StorageAccountName - Specifies friendly name of the storage account. + StorageAccountName *string `json:"storageAccountName,omitempty"` + // StorageAccountVersion - Specifies whether the Storage account is a Classic or an Azure Resource Manager Storage account. + StorageAccountVersion *string `json:"storageAccountVersion,omitempty"` + // ExtendedInfo - Additional information about the job. + ExtendedInfo *AzureStorageJobExtendedInfo `json:"extendedInfo,omitempty"` + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' + JobType JobType `json:"jobType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureStorageJob. +func (asj AzureStorageJob) MarshalJSON() ([]byte, error) { + asj.JobType = JobTypeAzureStorageJob + objectMap := make(map[string]interface{}) + if asj.Duration != nil { + objectMap["duration"] = asj.Duration + } + if asj.ActionsInfo != nil { + objectMap["actionsInfo"] = asj.ActionsInfo + } + if asj.ErrorDetails != nil { + objectMap["errorDetails"] = asj.ErrorDetails + } + if asj.StorageAccountName != nil { + objectMap["storageAccountName"] = asj.StorageAccountName + } + if asj.StorageAccountVersion != nil { + objectMap["storageAccountVersion"] = asj.StorageAccountVersion + } + if asj.ExtendedInfo != nil { + objectMap["extendedInfo"] = asj.ExtendedInfo + } + if asj.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = asj.EntityFriendlyName + } + if asj.BackupManagementType != "" { + objectMap["backupManagementType"] = asj.BackupManagementType + } + if asj.Operation != nil { + objectMap["operation"] = asj.Operation + } + if asj.Status != nil { + objectMap["status"] = asj.Status + } + if asj.StartTime != nil { + objectMap["startTime"] = asj.StartTime + } + if asj.EndTime != nil { + objectMap["endTime"] = asj.EndTime + } + if asj.ActivityID != nil { + objectMap["activityId"] = asj.ActivityID + } + if asj.JobType != "" { + objectMap["jobType"] = asj.JobType + } + return json.Marshal(objectMap) +} + +// AsAzureIaaSVMJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { + return nil, false +} + +// AsAzureStorageJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsAzureStorageJob() (*AzureStorageJob, bool) { + return &asj, true +} + +// AsAzureWorkloadJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { + return nil, false +} + +// AsDpmJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsDpmJob() (*DpmJob, bool) { + return nil, false +} + +// AsMabJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsMabJob() (*MabJob, bool) { + return nil, false +} + +// AsJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsJob() (*Job, bool) { + return nil, false +} + +// AsBasicJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsBasicJob() (BasicJob, bool) { + return &asj, true +} + +// AzureStorageJobExtendedInfo azure Storage workload-specific additional information for job. +type AzureStorageJobExtendedInfo struct { + // TasksList - List of tasks for this job + TasksList *[]AzureStorageJobTaskDetails `json:"tasksList,omitempty"` + // PropertyBag - Job properties. + PropertyBag map[string]*string `json:"propertyBag"` + // DynamicErrorMessage - Non localized error message on job execution. + DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureStorageJobExtendedInfo. +func (asjei AzureStorageJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asjei.TasksList != nil { + objectMap["tasksList"] = asjei.TasksList + } + if asjei.PropertyBag != nil { + objectMap["propertyBag"] = asjei.PropertyBag + } + if asjei.DynamicErrorMessage != nil { + objectMap["dynamicErrorMessage"] = asjei.DynamicErrorMessage + } + return json.Marshal(objectMap) +} + +// AzureStorageJobTaskDetails azure storage workload specific job task details. +type AzureStorageJobTaskDetails struct { + // TaskID - The task display name. + TaskID *string `json:"taskId,omitempty"` + // Status - The status. + Status *string `json:"status,omitempty"` +} + +// AzureVMResourceFeatureSupportRequest azureResource(IaaS VM) Specific feature support request +type AzureVMResourceFeatureSupportRequest struct { + // VMSize - Size of the resource: VM size(A/D series etc) in case of IaasVM + VMSize *string `json:"vmSize,omitempty"` + // VMSku - SKUs (Premium/Managed etc) in case of IaasVM + VMSku *string `json:"vmSku,omitempty"` + // FeatureType - Possible values include: 'FeatureTypeFeatureSupportRequest', 'FeatureTypeAzureBackupGoals', 'FeatureTypeAzureVMResourceBackup' + FeatureType FeatureType `json:"featureType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMResourceFeatureSupportRequest. +func (avrfsr AzureVMResourceFeatureSupportRequest) MarshalJSON() ([]byte, error) { + avrfsr.FeatureType = FeatureTypeAzureVMResourceBackup + objectMap := make(map[string]interface{}) + if avrfsr.VMSize != nil { + objectMap["vmSize"] = avrfsr.VMSize + } + if avrfsr.VMSku != nil { + objectMap["vmSku"] = avrfsr.VMSku + } + if avrfsr.FeatureType != "" { + objectMap["featureType"] = avrfsr.FeatureType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupGoalFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureVMResourceFeatureSupportRequest. +func (avrfsr AzureVMResourceFeatureSupportRequest) AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) { + return nil, false +} + +// AsAzureVMResourceFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureVMResourceFeatureSupportRequest. +func (avrfsr AzureVMResourceFeatureSupportRequest) AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) { + return &avrfsr, true +} + +// AsFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureVMResourceFeatureSupportRequest. +func (avrfsr AzureVMResourceFeatureSupportRequest) AsFeatureSupportRequest() (*FeatureSupportRequest, bool) { + return nil, false +} + +// AsBasicFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureVMResourceFeatureSupportRequest. +func (avrfsr AzureVMResourceFeatureSupportRequest) AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) { + return &avrfsr, true +} + +// AzureVMResourceFeatureSupportResponse response for feature support requests for Azure IaasVm +type AzureVMResourceFeatureSupportResponse struct { + autorest.Response `json:"-"` + // SupportStatus - Support status of feature. Possible values include: 'SupportStatusInvalid', 'SupportStatusSupported', 'SupportStatusDefaultOFF', 'SupportStatusDefaultON', 'SupportStatusNotSupported' + SupportStatus SupportStatus `json:"supportStatus,omitempty"` +} + +// BasicAzureWorkloadAutoProtectionIntent azure Recovery Services Vault specific protection intent item. +type BasicAzureWorkloadAutoProtectionIntent interface { + AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) + AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) +} + +// AzureWorkloadAutoProtectionIntent azure Recovery Services Vault specific protection intent item. +type AzureWorkloadAutoProtectionIntent struct { + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId + ItemID *string `json:"itemId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' + ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` +} + +func unmarshalBasicAzureWorkloadAutoProtectionIntent(body []byte) (BasicAzureWorkloadAutoProtectionIntent, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectionIntentItemType"] { + case string(ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent): + var awsapi AzureWorkloadSQLAutoProtectionIntent + err := json.Unmarshal(body, &awsapi) + return awsapi, err + default: + var awapi AzureWorkloadAutoProtectionIntent + err := json.Unmarshal(body, &awapi) + return awapi, err + } +} +func unmarshalBasicAzureWorkloadAutoProtectionIntentArray(body []byte) ([]BasicAzureWorkloadAutoProtectionIntent, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awapiArray := make([]BasicAzureWorkloadAutoProtectionIntent, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awapi, err := unmarshalBasicAzureWorkloadAutoProtectionIntent(*rawMessage) + if err != nil { + return nil, err + } + awapiArray[index] = awapi + } + return awapiArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) MarshalJSON() ([]byte, error) { + awapi.ProtectionIntentItemType = ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent + objectMap := make(map[string]interface{}) + if awapi.BackupManagementType != "" { + objectMap["backupManagementType"] = awapi.BackupManagementType + } + if awapi.SourceResourceID != nil { + objectMap["sourceResourceId"] = awapi.SourceResourceID + } + if awapi.ItemID != nil { + objectMap["itemId"] = awapi.ItemID + } + if awapi.PolicyID != nil { + objectMap["policyId"] = awapi.PolicyID + } + if awapi.ProtectionState != "" { + objectMap["protectionState"] = awapi.ProtectionState + } + if awapi.ProtectionIntentItemType != "" { + objectMap["protectionIntentItemType"] = awapi.ProtectionIntentItemType + } + return json.Marshal(objectMap) +} + +// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { + return nil, false +} + +// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { + return &awapi, true +} + +// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { + return nil, false +} + +// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { + return &awapi, true +} + +// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { + return &awapi, true +} + +// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { + return nil, false +} + +// AsProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { + return nil, false +} + +// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { + return &awapi, true +} + +// AzureWorkloadErrorInfo azure storage specific error information +type AzureWorkloadErrorInfo struct { + // ErrorCode - Error code. + ErrorCode *int32 `json:"errorCode,omitempty"` + // ErrorString - Localized error string. + ErrorString *string `json:"errorString,omitempty"` + // ErrorTitle - Title: Typically, the entity that the error pertains to. + ErrorTitle *string `json:"errorTitle,omitempty"` + // Recommendations - List of localized recommendations for above error code. + Recommendations *[]string `json:"recommendations,omitempty"` + // AdditionalDetails - Additional details for above error code. + AdditionalDetails *string `json:"additionalDetails,omitempty"` +} + +// AzureWorkloadJob azure storage specific job. +type AzureWorkloadJob struct { + // WorkloadType - Workload type of the job + WorkloadType *string `json:"workloadType,omitempty"` + // Duration - Time elapsed during the execution of this job. + Duration *string `json:"duration,omitempty"` + // ActionsInfo - Gets or sets the state/actions applicable on this job like cancel/retry. + ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` + // ErrorDetails - Error details on execution of this job. + ErrorDetails *[]AzureWorkloadErrorInfo `json:"errorDetails,omitempty"` + // ExtendedInfo - Additional information about the job. + ExtendedInfo *AzureWorkloadJobExtendedInfo `json:"extendedInfo,omitempty"` + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' + JobType JobType `json:"jobType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadJob. +func (awj AzureWorkloadJob) MarshalJSON() ([]byte, error) { + awj.JobType = JobTypeAzureWorkloadJob + objectMap := make(map[string]interface{}) + if awj.WorkloadType != nil { + objectMap["workloadType"] = awj.WorkloadType + } + if awj.Duration != nil { + objectMap["duration"] = awj.Duration + } + if awj.ActionsInfo != nil { + objectMap["actionsInfo"] = awj.ActionsInfo + } + if awj.ErrorDetails != nil { + objectMap["errorDetails"] = awj.ErrorDetails + } + if awj.ExtendedInfo != nil { + objectMap["extendedInfo"] = awj.ExtendedInfo + } + if awj.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = awj.EntityFriendlyName + } + if awj.BackupManagementType != "" { + objectMap["backupManagementType"] = awj.BackupManagementType + } + if awj.Operation != nil { + objectMap["operation"] = awj.Operation + } + if awj.Status != nil { + objectMap["status"] = awj.Status + } + if awj.StartTime != nil { + objectMap["startTime"] = awj.StartTime + } + if awj.EndTime != nil { + objectMap["endTime"] = awj.EndTime + } + if awj.ActivityID != nil { + objectMap["activityId"] = awj.ActivityID + } + if awj.JobType != "" { + objectMap["jobType"] = awj.JobType + } + return json.Marshal(objectMap) +} + +// AsAzureIaaSVMJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { + return nil, false +} + +// AsAzureStorageJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsAzureStorageJob() (*AzureStorageJob, bool) { + return nil, false +} + +// AsAzureWorkloadJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { + return &awj, true +} + +// AsDpmJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsDpmJob() (*DpmJob, bool) { + return nil, false +} + +// AsMabJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsMabJob() (*MabJob, bool) { + return nil, false +} + +// AsJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsJob() (*Job, bool) { + return nil, false +} + +// AsBasicJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsBasicJob() (BasicJob, bool) { + return &awj, true +} + +// AzureWorkloadJobExtendedInfo azure VM workload-specific additional information for job. +type AzureWorkloadJobExtendedInfo struct { + // TasksList - List of tasks for this job + TasksList *[]AzureWorkloadJobTaskDetails `json:"tasksList,omitempty"` + // PropertyBag - Job properties. + PropertyBag map[string]*string `json:"propertyBag"` + // DynamicErrorMessage - Non localized error message on job execution. + DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadJobExtendedInfo. +func (awjei AzureWorkloadJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if awjei.TasksList != nil { + objectMap["tasksList"] = awjei.TasksList + } + if awjei.PropertyBag != nil { + objectMap["propertyBag"] = awjei.PropertyBag + } + if awjei.DynamicErrorMessage != nil { + objectMap["dynamicErrorMessage"] = awjei.DynamicErrorMessage + } + return json.Marshal(objectMap) +} + +// AzureWorkloadJobTaskDetails azure VM workload specific job task details. +type AzureWorkloadJobTaskDetails struct { + // TaskID - The task display name. + TaskID *string `json:"taskId,omitempty"` + // Status - The status. + Status *string `json:"status,omitempty"` +} + +// AzureWorkloadSQLAutoProtectionIntent azure Workload SQL Auto Protection intent item. +type AzureWorkloadSQLAutoProtectionIntent struct { + // WorkloadItemType - Workload item type of the item for which intent is to be set. Possible values include: 'WorkloadItemTypeInvalid', 'WorkloadItemTypeSQLInstance', 'WorkloadItemTypeSQLDataBase', 'WorkloadItemTypeSAPHanaSystem', 'WorkloadItemTypeSAPHanaDatabase', 'WorkloadItemTypeSAPAseSystem', 'WorkloadItemTypeSAPAseDatabase' + WorkloadItemType WorkloadItemType `json:"workloadItemType,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId + ItemID *string `json:"itemId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' + ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) MarshalJSON() ([]byte, error) { + awsapi.ProtectionIntentItemType = ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent + objectMap := make(map[string]interface{}) + if awsapi.WorkloadItemType != "" { + objectMap["workloadItemType"] = awsapi.WorkloadItemType + } + if awsapi.BackupManagementType != "" { + objectMap["backupManagementType"] = awsapi.BackupManagementType + } + if awsapi.SourceResourceID != nil { + objectMap["sourceResourceId"] = awsapi.SourceResourceID + } + if awsapi.ItemID != nil { + objectMap["itemId"] = awsapi.ItemID + } + if awsapi.PolicyID != nil { + objectMap["policyId"] = awsapi.PolicyID + } + if awsapi.ProtectionState != "" { + objectMap["protectionState"] = awsapi.ProtectionState + } + if awsapi.ProtectionIntentItemType != "" { + objectMap["protectionIntentItemType"] = awsapi.ProtectionIntentItemType + } + return json.Marshal(objectMap) +} + +// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { + return nil, false +} + +// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { + return &awsapi, true +} + +// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { + return nil, false +} + +// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { + return nil, false +} + +// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { + return &awsapi, true +} + +// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { + return &awsapi, true +} + +// AsProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { + return nil, false +} + +// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { + return &awsapi, true +} + +// BMSBackupSummariesQueryObject query parameters to fetch backup summaries. +type BMSBackupSummariesQueryObject struct { + // Type - Backup management type for this container. Possible values include: 'TypeInvalid', 'TypeBackupProtectedItemCountSummary', 'TypeBackupProtectionContainerCountSummary' + Type Type `json:"type,omitempty"` +} + +// DpmErrorInfo DPM workload-specific error information. +type DpmErrorInfo struct { + // ErrorString - Localized error string. + ErrorString *string `json:"errorString,omitempty"` + // Recommendations - List of localized recommendations for above error code. + Recommendations *[]string `json:"recommendations,omitempty"` +} + +// DpmJob DPM workload-specific job object. +type DpmJob struct { + // Duration - Time elapsed for job. + Duration *string `json:"duration,omitempty"` + // DpmServerName - DPM server name managing the backup item or backup job. + DpmServerName *string `json:"dpmServerName,omitempty"` + // ContainerName - Name of cluster/server protecting current backup item, if any. + ContainerName *string `json:"containerName,omitempty"` + // ContainerType - Type of container. + ContainerType *string `json:"containerType,omitempty"` + // WorkloadType - Type of backup item. + WorkloadType *string `json:"workloadType,omitempty"` + // ActionsInfo - The state/actions applicable on this job like cancel/retry. + ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` + // ErrorDetails - The errors. + ErrorDetails *[]DpmErrorInfo `json:"errorDetails,omitempty"` + // ExtendedInfo - Additional information for this job. + ExtendedInfo *DpmJobExtendedInfo `json:"extendedInfo,omitempty"` + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' + JobType JobType `json:"jobType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DpmJob. +func (dj DpmJob) MarshalJSON() ([]byte, error) { + dj.JobType = JobTypeDpmJob + objectMap := make(map[string]interface{}) + if dj.Duration != nil { + objectMap["duration"] = dj.Duration + } + if dj.DpmServerName != nil { + objectMap["dpmServerName"] = dj.DpmServerName + } + if dj.ContainerName != nil { + objectMap["containerName"] = dj.ContainerName + } + if dj.ContainerType != nil { + objectMap["containerType"] = dj.ContainerType + } + if dj.WorkloadType != nil { + objectMap["workloadType"] = dj.WorkloadType + } + if dj.ActionsInfo != nil { + objectMap["actionsInfo"] = dj.ActionsInfo + } + if dj.ErrorDetails != nil { + objectMap["errorDetails"] = dj.ErrorDetails + } + if dj.ExtendedInfo != nil { + objectMap["extendedInfo"] = dj.ExtendedInfo + } + if dj.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = dj.EntityFriendlyName + } + if dj.BackupManagementType != "" { + objectMap["backupManagementType"] = dj.BackupManagementType + } + if dj.Operation != nil { + objectMap["operation"] = dj.Operation + } + if dj.Status != nil { + objectMap["status"] = dj.Status + } + if dj.StartTime != nil { + objectMap["startTime"] = dj.StartTime + } + if dj.EndTime != nil { + objectMap["endTime"] = dj.EndTime + } + if dj.ActivityID != nil { + objectMap["activityId"] = dj.ActivityID + } + if dj.JobType != "" { + objectMap["jobType"] = dj.JobType + } + return json.Marshal(objectMap) +} + +// AsAzureIaaSVMJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { + return nil, false +} + +// AsAzureStorageJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsAzureStorageJob() (*AzureStorageJob, bool) { + return nil, false +} + +// AsAzureWorkloadJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { + return nil, false +} + +// AsDpmJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsDpmJob() (*DpmJob, bool) { + return &dj, true +} + +// AsMabJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsMabJob() (*MabJob, bool) { + return nil, false +} + +// AsJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsJob() (*Job, bool) { + return nil, false +} + +// AsBasicJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsBasicJob() (BasicJob, bool) { + return &dj, true +} + +// DpmJobExtendedInfo additional information on the DPM workload-specific job. +type DpmJobExtendedInfo struct { + // TasksList - List of tasks associated with this job. + TasksList *[]DpmJobTaskDetails `json:"tasksList,omitempty"` + // PropertyBag - The job properties. + PropertyBag map[string]*string `json:"propertyBag"` + // DynamicErrorMessage - Non localized error message on job execution. + DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` +} + +// MarshalJSON is the custom marshaler for DpmJobExtendedInfo. +func (djei DpmJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if djei.TasksList != nil { + objectMap["tasksList"] = djei.TasksList + } + if djei.PropertyBag != nil { + objectMap["propertyBag"] = djei.PropertyBag + } + if djei.DynamicErrorMessage != nil { + objectMap["dynamicErrorMessage"] = djei.DynamicErrorMessage + } + return json.Marshal(objectMap) +} + +// DpmJobTaskDetails DPM workload-specific job task details. +type DpmJobTaskDetails struct { + // TaskID - The task display name. + TaskID *string `json:"taskId,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // Duration - Time elapsed for task. + Duration *string `json:"duration,omitempty"` + // Status - The status. + Status *string `json:"status,omitempty"` +} + +// BasicFeatureSupportRequest base class for feature request +type BasicFeatureSupportRequest interface { + AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) + AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) + AsFeatureSupportRequest() (*FeatureSupportRequest, bool) +} + +// FeatureSupportRequest base class for feature request +type FeatureSupportRequest struct { + // FeatureType - Possible values include: 'FeatureTypeFeatureSupportRequest', 'FeatureTypeAzureBackupGoals', 'FeatureTypeAzureVMResourceBackup' + FeatureType FeatureType `json:"featureType,omitempty"` +} + +func unmarshalBasicFeatureSupportRequest(body []byte) (BasicFeatureSupportRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["featureType"] { + case string(FeatureTypeAzureBackupGoals): + var abgfsr AzureBackupGoalFeatureSupportRequest + err := json.Unmarshal(body, &abgfsr) + return abgfsr, err + case string(FeatureTypeAzureVMResourceBackup): + var avrfsr AzureVMResourceFeatureSupportRequest + err := json.Unmarshal(body, &avrfsr) + return avrfsr, err + default: + var fsr FeatureSupportRequest + err := json.Unmarshal(body, &fsr) + return fsr, err + } +} +func unmarshalBasicFeatureSupportRequestArray(body []byte) ([]BasicFeatureSupportRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fsrArray := make([]BasicFeatureSupportRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fsr, err := unmarshalBasicFeatureSupportRequest(*rawMessage) + if err != nil { + return nil, err + } + fsrArray[index] = fsr + } + return fsrArray, nil +} + +// MarshalJSON is the custom marshaler for FeatureSupportRequest. +func (fsr FeatureSupportRequest) MarshalJSON() ([]byte, error) { + fsr.FeatureType = FeatureTypeFeatureSupportRequest + objectMap := make(map[string]interface{}) + if fsr.FeatureType != "" { + objectMap["featureType"] = fsr.FeatureType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupGoalFeatureSupportRequest is the BasicFeatureSupportRequest implementation for FeatureSupportRequest. +func (fsr FeatureSupportRequest) AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) { + return nil, false +} + +// AsAzureVMResourceFeatureSupportRequest is the BasicFeatureSupportRequest implementation for FeatureSupportRequest. +func (fsr FeatureSupportRequest) AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) { + return nil, false +} + +// AsFeatureSupportRequest is the BasicFeatureSupportRequest implementation for FeatureSupportRequest. +func (fsr FeatureSupportRequest) AsFeatureSupportRequest() (*FeatureSupportRequest, bool) { + return &fsr, true +} + +// AsBasicFeatureSupportRequest is the BasicFeatureSupportRequest implementation for FeatureSupportRequest. +func (fsr FeatureSupportRequest) AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) { + return &fsr, true +} + +// InstantRPAdditionalDetails ... +type InstantRPAdditionalDetails struct { + AzureBackupRGNamePrefix *string `json:"azureBackupRGNamePrefix,omitempty"` + AzureBackupRGNameSuffix *string `json:"azureBackupRGNameSuffix,omitempty"` +} + +// BasicJob defines workload agnostic properties for a job. +type BasicJob interface { + AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) + AsAzureStorageJob() (*AzureStorageJob, bool) + AsAzureWorkloadJob() (*AzureWorkloadJob, bool) + AsDpmJob() (*DpmJob, bool) + AsMabJob() (*MabJob, bool) + AsJob() (*Job, bool) +} + +// Job defines workload agnostic properties for a job. +type Job struct { + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' + JobType JobType `json:"jobType,omitempty"` +} + +func unmarshalBasicJob(body []byte) (BasicJob, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["jobType"] { + case string(JobTypeAzureIaaSVMJob): + var aisj AzureIaaSVMJob + err := json.Unmarshal(body, &aisj) + return aisj, err + case string(JobTypeAzureStorageJob): + var asj AzureStorageJob + err := json.Unmarshal(body, &asj) + return asj, err + case string(JobTypeAzureWorkloadJob): + var awj AzureWorkloadJob + err := json.Unmarshal(body, &awj) + return awj, err + case string(JobTypeDpmJob): + var dj DpmJob + err := json.Unmarshal(body, &dj) + return dj, err + case string(JobTypeMabJob): + var mj MabJob + err := json.Unmarshal(body, &mj) + return mj, err + default: + var j Job + err := json.Unmarshal(body, &j) + return j, err + } +} +func unmarshalBasicJobArray(body []byte) ([]BasicJob, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + jArray := make([]BasicJob, len(rawMessages)) + + for index, rawMessage := range rawMessages { + j, err := unmarshalBasicJob(*rawMessage) + if err != nil { + return nil, err + } + jArray[index] = j + } + return jArray, nil +} + +// MarshalJSON is the custom marshaler for Job. +func (j Job) MarshalJSON() ([]byte, error) { + j.JobType = JobTypeJob + objectMap := make(map[string]interface{}) + if j.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = j.EntityFriendlyName + } + if j.BackupManagementType != "" { + objectMap["backupManagementType"] = j.BackupManagementType + } + if j.Operation != nil { + objectMap["operation"] = j.Operation + } + if j.Status != nil { + objectMap["status"] = j.Status + } + if j.StartTime != nil { + objectMap["startTime"] = j.StartTime + } + if j.EndTime != nil { + objectMap["endTime"] = j.EndTime + } + if j.ActivityID != nil { + objectMap["activityId"] = j.ActivityID + } + if j.JobType != "" { + objectMap["jobType"] = j.JobType + } + return json.Marshal(objectMap) +} + +// AsAzureIaaSVMJob is the BasicJob implementation for Job. +func (j Job) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { + return nil, false +} + +// AsAzureStorageJob is the BasicJob implementation for Job. +func (j Job) AsAzureStorageJob() (*AzureStorageJob, bool) { + return nil, false +} + +// AsAzureWorkloadJob is the BasicJob implementation for Job. +func (j Job) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { + return nil, false +} + +// AsDpmJob is the BasicJob implementation for Job. +func (j Job) AsDpmJob() (*DpmJob, bool) { + return nil, false +} + +// AsMabJob is the BasicJob implementation for Job. +func (j Job) AsMabJob() (*MabJob, bool) { + return nil, false +} + +// AsJob is the BasicJob implementation for Job. +func (j Job) AsJob() (*Job, bool) { + return &j, true +} + +// AsBasicJob is the BasicJob implementation for Job. +func (j Job) AsBasicJob() (BasicJob, bool) { + return &j, true +} + +// JobResource defines workload agnostic properties for a job. +type JobResource struct { + // Properties - JobResource properties + Properties BasicJob `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobResource. +func (jr JobResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = jr.Properties + if jr.Location != nil { + objectMap["location"] = jr.Location + } + if jr.Tags != nil { + objectMap["tags"] = jr.Tags + } + if jr.ETag != nil { + objectMap["eTag"] = jr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for JobResource struct. +func (jr *JobResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicJob(*v) + if err != nil { + return err + } + jr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + jr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + jr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + jr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + jr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + jr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + jr.ETag = &eTag + } + } + } + + return nil +} + +// MabErrorInfo MAB workload-specific error information. +type MabErrorInfo struct { + // ErrorString - READ-ONLY; Localized error string. + ErrorString *string `json:"errorString,omitempty"` + // Recommendations - READ-ONLY; List of localized recommendations. + Recommendations *[]string `json:"recommendations,omitempty"` +} + +// MarshalJSON is the custom marshaler for MabErrorInfo. +func (mei MabErrorInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MabJob MAB workload-specific job. +type MabJob struct { + // Duration - Time taken by job to run. + Duration *string `json:"duration,omitempty"` + // ActionsInfo - The state/actions applicable on jobs like cancel/retry. + ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` + // MabServerName - Name of server protecting the DS. + MabServerName *string `json:"mabServerName,omitempty"` + // MabServerType - Server type of MAB container. Possible values include: 'MabServerTypeInvalid', 'MabServerTypeUnknown', 'MabServerTypeIaasVMContainer', 'MabServerTypeIaasVMServiceContainer', 'MabServerTypeDPMContainer', 'MabServerTypeAzureBackupServerContainer', 'MabServerTypeMABContainer', 'MabServerTypeCluster', 'MabServerTypeAzureSQLContainer', 'MabServerTypeWindows', 'MabServerTypeVCenter', 'MabServerTypeVMAppContainer', 'MabServerTypeSQLAGWorkLoadContainer', 'MabServerTypeStorageContainer', 'MabServerTypeGenericContainer' + MabServerType MabServerType `json:"mabServerType,omitempty"` + // WorkloadType - Workload type of backup item. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` + // ErrorDetails - The errors. + ErrorDetails *[]MabErrorInfo `json:"errorDetails,omitempty"` + // ExtendedInfo - Additional information on the job. + ExtendedInfo *MabJobExtendedInfo `json:"extendedInfo,omitempty"` + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' + JobType JobType `json:"jobType,omitempty"` +} + +// MarshalJSON is the custom marshaler for MabJob. +func (mj MabJob) MarshalJSON() ([]byte, error) { + mj.JobType = JobTypeMabJob + objectMap := make(map[string]interface{}) + if mj.Duration != nil { + objectMap["duration"] = mj.Duration + } + if mj.ActionsInfo != nil { + objectMap["actionsInfo"] = mj.ActionsInfo + } + if mj.MabServerName != nil { + objectMap["mabServerName"] = mj.MabServerName + } + if mj.MabServerType != "" { + objectMap["mabServerType"] = mj.MabServerType + } + if mj.WorkloadType != "" { + objectMap["workloadType"] = mj.WorkloadType + } + if mj.ErrorDetails != nil { + objectMap["errorDetails"] = mj.ErrorDetails + } + if mj.ExtendedInfo != nil { + objectMap["extendedInfo"] = mj.ExtendedInfo + } + if mj.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = mj.EntityFriendlyName + } + if mj.BackupManagementType != "" { + objectMap["backupManagementType"] = mj.BackupManagementType + } + if mj.Operation != nil { + objectMap["operation"] = mj.Operation + } + if mj.Status != nil { + objectMap["status"] = mj.Status + } + if mj.StartTime != nil { + objectMap["startTime"] = mj.StartTime + } + if mj.EndTime != nil { + objectMap["endTime"] = mj.EndTime + } + if mj.ActivityID != nil { + objectMap["activityId"] = mj.ActivityID + } + if mj.JobType != "" { + objectMap["jobType"] = mj.JobType + } + return json.Marshal(objectMap) +} + +// AsAzureIaaSVMJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { + return nil, false +} + +// AsAzureStorageJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsAzureStorageJob() (*AzureStorageJob, bool) { + return nil, false +} + +// AsAzureWorkloadJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { + return nil, false +} + +// AsDpmJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsDpmJob() (*DpmJob, bool) { + return nil, false +} + +// AsMabJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsMabJob() (*MabJob, bool) { + return &mj, true +} + +// AsJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsJob() (*Job, bool) { + return nil, false +} + +// AsBasicJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsBasicJob() (BasicJob, bool) { + return &mj, true +} + +// MabJobExtendedInfo additional information for the MAB workload-specific job. +type MabJobExtendedInfo struct { + // TasksList - List of tasks for this job. + TasksList *[]MabJobTaskDetails `json:"tasksList,omitempty"` + // PropertyBag - The job properties. + PropertyBag map[string]*string `json:"propertyBag"` + // DynamicErrorMessage - Non localized error message specific to this job. + DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` +} + +// MarshalJSON is the custom marshaler for MabJobExtendedInfo. +func (mjei MabJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mjei.TasksList != nil { + objectMap["tasksList"] = mjei.TasksList + } + if mjei.PropertyBag != nil { + objectMap["propertyBag"] = mjei.PropertyBag + } + if mjei.DynamicErrorMessage != nil { + objectMap["dynamicErrorMessage"] = mjei.DynamicErrorMessage + } + return json.Marshal(objectMap) +} + +// MabJobTaskDetails MAB workload-specific job task details. +type MabJobTaskDetails struct { + // TaskID - The task display name. + TaskID *string `json:"taskId,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // Duration - Time elapsed for task. + Duration *string `json:"duration,omitempty"` + // Status - The status. + Status *string `json:"status,omitempty"` +} + +// ManagementUsage backup management usages of a vault. +type ManagementUsage struct { + // Unit - Unit of the usage. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond' + Unit UsagesUnit `json:"unit,omitempty"` + // QuotaPeriod - Quota period of usage. + QuotaPeriod *string `json:"quotaPeriod,omitempty"` + // NextResetTime - Next reset time of usage. + NextResetTime *date.Time `json:"nextResetTime,omitempty"` + // CurrentValue - Current value of usage. + CurrentValue *int64 `json:"currentValue,omitempty"` + // Limit - Limit of usage. + Limit *int64 `json:"limit,omitempty"` + // Name - Name of usage. + Name *NameInfo `json:"name,omitempty"` +} + +// ManagementUsageList backup management usage for vault. +type ManagementUsageList struct { + autorest.Response `json:"-"` + // Value - The list of backup management usages for the given vault. + Value *[]ManagementUsage `json:"value,omitempty"` +} + +// NameInfo the name of usage. +type NameInfo struct { + // Value - Value of usage. + Value *string `json:"value,omitempty"` + // LocalizedValue - Localized value of usage. + LocalizedValue *string `json:"localizedValue,omitempty"` +} + +// PreValidateEnableBackupRequest contract to validate if backup can be enabled on the given resource in a +// given vault and given configuration. +// It will validate followings +// 1. Vault capacity +// 2. VM is already protected +// 3. Any VM related configuration passed in properties. +type PreValidateEnableBackupRequest struct { + // ResourceType - ProtectedItem Type- VM, SqlDataBase, AzureFileShare etc. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSQLDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' + ResourceType DataSourceType `json:"resourceType,omitempty"` + // ResourceID - ARM Virtual Machine Id + ResourceID *string `json:"resourceId,omitempty"` + // VaultID - ARM id of the Recovery Services Vault + VaultID *string `json:"vaultId,omitempty"` + // Properties - Configuration of VM if any needs to be validated like OS type etc + Properties *string `json:"properties,omitempty"` +} + +// PreValidateEnableBackupResponse response contract for enable backup validation request +type PreValidateEnableBackupResponse struct { + autorest.Response `json:"-"` + // Status - Validation Status. Possible values include: 'ValidationStatusInvalid', 'ValidationStatusSucceeded', 'ValidationStatusFailed' + Status ValidationStatus `json:"status,omitempty"` + // ErrorCode - Response error code + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - Response error message + ErrorMessage *string `json:"errorMessage,omitempty"` + // Recommendation - Recommended action for user + Recommendation *string `json:"recommendation,omitempty"` + // ContainerName - Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is required + // for portal + ContainerName *string `json:"containerName,omitempty"` + // ProtectedItemName - Specifies the product specific ds name. E.g. vm;iaasvmcontainer;rgname;vmname. This is required for portal + ProtectedItemName *string `json:"protectedItemName,omitempty"` +} + +// BasicProtectionIntent base class for backup ProtectionIntent. +type BasicProtectionIntent interface { + AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) + AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) + AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) + AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) + AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) + AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) + AsProtectionIntent() (*ProtectionIntent, bool) +} + +// ProtectionIntent base class for backup ProtectionIntent. +type ProtectionIntent struct { + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId + ItemID *string `json:"itemId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' + ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` +} + +func unmarshalBasicProtectionIntent(body []byte) (BasicProtectionIntent, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectionIntentItemType"] { + case string(ProtectionIntentItemTypeRecoveryServiceVaultItem): + var arsvpi AzureRecoveryServiceVaultProtectionIntent + err := json.Unmarshal(body, &arsvpi) + return arsvpi, err + case string(ProtectionIntentItemTypeAzureResourceItem): + var arpi AzureResourceProtectionIntent + err := json.Unmarshal(body, &arpi) + return arpi, err + case string(ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent): + var awapi AzureWorkloadAutoProtectionIntent + err := json.Unmarshal(body, &awapi) + return awapi, err + case string(ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent): + var awsapi AzureWorkloadSQLAutoProtectionIntent + err := json.Unmarshal(body, &awsapi) + return awsapi, err + default: + var pi ProtectionIntent + err := json.Unmarshal(body, &pi) + return pi, err + } +} +func unmarshalBasicProtectionIntentArray(body []byte) ([]BasicProtectionIntent, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + piArray := make([]BasicProtectionIntent, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pi, err := unmarshalBasicProtectionIntent(*rawMessage) + if err != nil { + return nil, err + } + piArray[index] = pi + } + return piArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectionIntent. +func (pi ProtectionIntent) MarshalJSON() ([]byte, error) { + pi.ProtectionIntentItemType = ProtectionIntentItemTypeProtectionIntent + objectMap := make(map[string]interface{}) + if pi.BackupManagementType != "" { + objectMap["backupManagementType"] = pi.BackupManagementType + } + if pi.SourceResourceID != nil { + objectMap["sourceResourceId"] = pi.SourceResourceID + } + if pi.ItemID != nil { + objectMap["itemId"] = pi.ItemID + } + if pi.PolicyID != nil { + objectMap["policyId"] = pi.PolicyID + } + if pi.ProtectionState != "" { + objectMap["protectionState"] = pi.ProtectionState + } + if pi.ProtectionIntentItemType != "" { + objectMap["protectionIntentItemType"] = pi.ProtectionIntentItemType + } + return json.Marshal(objectMap) +} + +// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. +func (pi ProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { + return nil, false +} + +// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. +func (pi ProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { + return nil, false +} + +// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. +func (pi ProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { + return nil, false +} + +// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. +func (pi ProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { + return nil, false +} + +// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. +func (pi ProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { + return nil, false +} + +// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. +func (pi ProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { + return nil, false +} + +// AsProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. +func (pi ProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { + return &pi, true +} + +// AsBasicProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. +func (pi ProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { + 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:"-"` + // Properties - ProtectionIntentResource properties + Properties BasicProtectionIntent `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionIntentResource. +func (pir ProtectionIntentResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = pir.Properties + if pir.Location != nil { + objectMap["location"] = pir.Location + } + if pir.Tags != nil { + objectMap["tags"] = pir.Tags + } + if pir.ETag != nil { + objectMap["eTag"] = pir.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ProtectionIntentResource struct. +func (pir *ProtectionIntentResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicProtectionIntent(*v) + if err != nil { + return err + } + pir.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pir.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pir.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pir.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + pir.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + pir.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + pir.ETag = &eTag + } + } + } + + 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 +} + +// NextWithContext 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) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionIntentResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectionIntentResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// 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] +} + +// Creates a new instance of the ProtectionIntentResourceListIterator type. +func NewProtectionIntentResourceListIterator(page ProtectionIntentResourceListPage) ProtectionIntentResourceListIterator { + return ProtectionIntentResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pirl ProtectionIntentResourceList) IsEmpty() bool { + return pirl.Value == nil || len(*pirl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pirl ProtectionIntentResourceList) hasNextLink() bool { + return pirl.NextLink != nil && len(*pirl.NextLink) != 0 +} + +// protectionIntentResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pirl ProtectionIntentResourceList) protectionIntentResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !pirl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pirl.NextLink))) +} + +// ProtectionIntentResourceListPage contains a page of ProtectionIntentResource values. +type ProtectionIntentResourceListPage struct { + fn func(context.Context, ProtectionIntentResourceList) (ProtectionIntentResourceList, error) + pirl ProtectionIntentResourceList +} + +// NextWithContext 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) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionIntentResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pirl) + if err != nil { + return err + } + page.pirl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectionIntentResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// 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 +} + +// Creates a new instance of the ProtectionIntentResourceListPage type. +func NewProtectionIntentResourceListPage(cur ProtectionIntentResourceList, getNextPage func(context.Context, ProtectionIntentResourceList) (ProtectionIntentResourceList, error)) ProtectionIntentResourceListPage { + return ProtectionIntentResourceListPage{ + fn: getNextPage, + pirl: cur, + } +} + +// Resource ARM Resource. +type Resource struct { + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + if r.ETag != nil { + objectMap["eTag"] = r.ETag + } + return json.Marshal(objectMap) +} + +// ResourceList base for all lists of resources. +type ResourceList struct { + // NextLink - The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// StatusRequest backupStatus request. +type StatusRequest struct { + // ResourceType - Container Type - VM, SQLPaaS, DPM, AzureFileShare. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSQLDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' + ResourceType DataSourceType `json:"resourceType,omitempty"` + // ResourceID - Entire ARM resource id of the resource + ResourceID *string `json:"resourceId,omitempty"` + // PoLogicalName - Protectable Item Logical Name + PoLogicalName *string `json:"poLogicalName,omitempty"` +} + +// StatusResponse backupStatus response. +type StatusResponse struct { + autorest.Response `json:"-"` + // ProtectionStatus - Specifies whether the container is registered or not. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionStatus ProtectionStatus `json:"protectionStatus,omitempty"` + // VaultID - Specifies the arm resource id of the vault + VaultID *string `json:"vaultId,omitempty"` + // FabricName - Specifies the fabric name - Azure or AD. Possible values include: 'FabricNameInvalid', 'FabricNameAzure' + FabricName FabricName `json:"fabricName,omitempty"` + // ContainerName - Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;csname;vmname. + ContainerName *string `json:"containerName,omitempty"` + // ProtectedItemName - Specifies the product specific ds name. E.g. vm;iaasvmcontainer;csname;vmname. + ProtectedItemName *string `json:"protectedItemName,omitempty"` + // ErrorCode - ErrorCode in case of intent failed + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - ErrorMessage in case of intent failed. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PolicyName - Specifies the policy name which is used for protection + PolicyName *string `json:"policyName,omitempty"` + // RegistrationStatus - Container registration status + RegistrationStatus *string `json:"registrationStatus,omitempty"` +} diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/protectionintent.go b/services/recoveryservices/mgmt/2017-07-01/backup/protectionintent.go similarity index 100% rename from services/recoveryservices/mgmt/2019-05-13/backup/protectionintent.go rename to services/recoveryservices/mgmt/2017-07-01/backup/protectionintent.go diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/protectionintentgroup.go b/services/recoveryservices/mgmt/2017-07-01/backup/protectionintentgroup.go similarity index 100% rename from services/recoveryservices/mgmt/2019-05-13/backup/protectionintentgroup.go rename to services/recoveryservices/mgmt/2017-07-01/backup/protectionintentgroup.go diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/status.go b/services/recoveryservices/mgmt/2017-07-01/backup/status.go similarity index 100% rename from services/recoveryservices/mgmt/2019-05-13/backup/status.go rename to services/recoveryservices/mgmt/2017-07-01/backup/status.go diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/usagesummaries.go b/services/recoveryservices/mgmt/2017-07-01/backup/usagesummaries.go similarity index 100% rename from services/recoveryservices/mgmt/2019-05-13/backup/usagesummaries.go rename to services/recoveryservices/mgmt/2017-07-01/backup/usagesummaries.go diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/version.go b/services/recoveryservices/mgmt/2017-07-01/backup/version.go new file mode 100644 index 000000000000..456211efffa4 --- /dev/null +++ b/services/recoveryservices/mgmt/2017-07-01/backup/version.go @@ -0,0 +1,19 @@ +package backup + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " backup/2017-07-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/CHANGELOG.md b/services/recoveryservices/mgmt/2019-05-13/backup/CHANGELOG.md index 52911e4cc5e4..b9cae421e5db 100644 --- a/services/recoveryservices/mgmt/2019-05-13/backup/CHANGELOG.md +++ b/services/recoveryservices/mgmt/2019-05-13/backup/CHANGELOG.md @@ -1,2 +1,1315 @@ -# Change History +# Unreleased +## Breaking Changes + +### Removed Constants + +1. AzureFileShareType.XSMB +1. AzureFileShareType.XSync +1. ContainerType.ContainerTypeAzureBackupServerContainer +1. ContainerType.ContainerTypeAzureSQLContainer +1. ContainerType.ContainerTypeCluster +1. ContainerType.ContainerTypeDPMContainer +1. ContainerType.ContainerTypeGenericContainer +1. ContainerType.ContainerTypeIaasVMContainer +1. ContainerType.ContainerTypeIaasVMServiceContainer +1. ContainerType.ContainerTypeInvalid +1. ContainerType.ContainerTypeMABContainer +1. ContainerType.ContainerTypeSQLAGWorkLoadContainer +1. ContainerType.ContainerTypeStorageContainer +1. ContainerType.ContainerTypeUnknown +1. ContainerType.ContainerTypeVCenter +1. ContainerType.ContainerTypeVMAppContainer +1. ContainerType.ContainerTypeWindows +1. ContainerTypeBasicProtectionContainer.ContainerTypeAzureBackupServerContainer1 +1. ContainerTypeBasicProtectionContainer.ContainerTypeAzureSQLContainer1 +1. ContainerTypeBasicProtectionContainer.ContainerTypeAzureWorkloadContainer +1. ContainerTypeBasicProtectionContainer.ContainerTypeDPMContainer1 +1. ContainerTypeBasicProtectionContainer.ContainerTypeGenericContainer1 +1. ContainerTypeBasicProtectionContainer.ContainerTypeIaaSVMContainer +1. ContainerTypeBasicProtectionContainer.ContainerTypeMicrosoftClassicComputevirtualMachines +1. ContainerTypeBasicProtectionContainer.ContainerTypeMicrosoftComputevirtualMachines +1. ContainerTypeBasicProtectionContainer.ContainerTypeProtectionContainer +1. ContainerTypeBasicProtectionContainer.ContainerTypeSQLAGWorkLoadContainer1 +1. ContainerTypeBasicProtectionContainer.ContainerTypeStorageContainer1 +1. ContainerTypeBasicProtectionContainer.ContainerTypeVMAppContainer1 +1. ContainerTypeBasicProtectionContainer.ContainerTypeWindows1 +1. CopyOptions.CopyOptionsCreateCopy +1. CopyOptions.CopyOptionsFailOnConflict +1. CopyOptions.CopyOptionsInvalid +1. CopyOptions.CopyOptionsOverwrite +1. CopyOptions.CopyOptionsSkip +1. EngineType.BackupEngineTypeAzureBackupServerEngine +1. EngineType.BackupEngineTypeBackupEngineBase +1. EngineType.BackupEngineTypeDpmBackupEngine +1. FabricName.FabricNameAzure +1. FabricName.FabricNameInvalid +1. FeatureType.FeatureTypeAzureBackupGoals +1. FeatureType.FeatureTypeAzureVMResourceBackup +1. FeatureType.FeatureTypeFeatureSupportRequest +1. InquiryStatus.InquiryStatusFailed +1. InquiryStatus.InquiryStatusInvalid +1. InquiryStatus.InquiryStatusSuccess +1. IntentItemType.IntentItemTypeInvalid +1. IntentItemType.IntentItemTypeSQLAvailabilityGroupContainer +1. IntentItemType.IntentItemTypeSQLInstance +1. ItemType.ItemTypeAzureFileShare +1. ItemType.ItemTypeAzureSQLDb +1. ItemType.ItemTypeClient +1. ItemType.ItemTypeExchange +1. ItemType.ItemTypeFileFolder +1. ItemType.ItemTypeGenericDataSource +1. ItemType.ItemTypeInvalid +1. ItemType.ItemTypeSAPAseDatabase +1. ItemType.ItemTypeSAPHanaDatabase +1. ItemType.ItemTypeSQLDB +1. ItemType.ItemTypeSQLDataBase +1. ItemType.ItemTypeSharepoint +1. ItemType.ItemTypeSystemState +1. ItemType.ItemTypeVM +1. ItemType.ItemTypeVMwareVM +1. ObjectTypeBasicILRRequest.ObjectTypeAzureFileShareProvisionILRRequest +1. ObjectTypeBasicILRRequest.ObjectTypeILRRequest +1. ObjectTypeBasicILRRequest.ObjectTypeIaasVMILRRegistrationRequest +1. ObjectTypeBasicOperationStatusExtendedInfo.ObjectTypeOperationStatusExtendedInfo +1. ObjectTypeBasicOperationStatusExtendedInfo.ObjectTypeOperationStatusJobExtendedInfo +1. ObjectTypeBasicOperationStatusExtendedInfo.ObjectTypeOperationStatusJobsExtendedInfo +1. ObjectTypeBasicOperationStatusExtendedInfo.ObjectTypeOperationStatusProvisionILRExtendedInfo +1. ObjectTypeBasicRequest.ObjectTypeAzureFileShareBackupRequest +1. ObjectTypeBasicRequest.ObjectTypeAzureWorkloadBackupRequest +1. ObjectTypeBasicRequest.ObjectTypeBackupRequest +1. ObjectTypeBasicRequest.ObjectTypeIaasVMBackupRequest +1. OperationStatusValues.OperationStatusValuesCanceled +1. OperationStatusValues.OperationStatusValuesFailed +1. OperationStatusValues.OperationStatusValuesInProgress +1. OperationStatusValues.OperationStatusValuesInvalid +1. OperationStatusValues.OperationStatusValuesSucceeded +1. OperationType.OperationTypeInvalid +1. OperationType.OperationTypeRegister +1. OperationType.OperationTypeReregister +1. ProtectableContainerType.ProtectableContainerTypeProtectableContainer +1. ProtectableContainerType.ProtectableContainerTypeStorageContainer +1. ProtectableContainerType.ProtectableContainerTypeVMAppContainer +1. ProtectableItemType.ProtectableItemTypeAzureFileShare +1. ProtectableItemType.ProtectableItemTypeAzureVMWorkloadProtectableItem +1. ProtectableItemType.ProtectableItemTypeIaaSVMProtectableItem +1. ProtectableItemType.ProtectableItemTypeMicrosoftClassicComputevirtualMachines +1. ProtectableItemType.ProtectableItemTypeMicrosoftComputevirtualMachines +1. ProtectableItemType.ProtectableItemTypeSAPAseSystem +1. ProtectableItemType.ProtectableItemTypeSAPHanaDatabase +1. ProtectableItemType.ProtectableItemTypeSAPHanaSystem +1. ProtectableItemType.ProtectableItemTypeSQLAvailabilityGroupContainer +1. ProtectableItemType.ProtectableItemTypeSQLDataBase +1. ProtectableItemType.ProtectableItemTypeSQLInstance +1. ProtectableItemType.ProtectableItemTypeWorkloadProtectableItem +1. ProtectionIntentItemType.ProtectionIntentItemTypeAzureResourceItem +1. ProtectionIntentItemType.ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent +1. ProtectionIntentItemType.ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent +1. ProtectionIntentItemType.ProtectionIntentItemTypeProtectionIntent +1. ProtectionIntentItemType.ProtectionIntentItemTypeRecoveryServiceVaultItem +1. ProtectionStatus.ProtectionStatusInvalid +1. ProtectionStatus.ProtectionStatusNotProtected +1. ProtectionStatus.ProtectionStatusProtected +1. ProtectionStatus.ProtectionStatusProtecting +1. ProtectionStatus.ProtectionStatusProtectionFailed +1. SupportStatus.SupportStatusDefaultOFF +1. SupportStatus.SupportStatusDefaultON +1. SupportStatus.SupportStatusInvalid +1. SupportStatus.SupportStatusNotSupported +1. SupportStatus.SupportStatusSupported +1. Type.TypeBackupProtectedItemCountSummary +1. Type.TypeBackupProtectionContainerCountSummary +1. Type.TypeInvalid +1. TypeEnum.TypeEnumCopyOnlyFull +1. TypeEnum.TypeEnumDifferential +1. TypeEnum.TypeEnumFull +1. TypeEnum.TypeEnumInvalid +1. TypeEnum.TypeEnumLog +1. UsagesUnit.Bytes +1. UsagesUnit.BytesPerSecond +1. UsagesUnit.Count +1. UsagesUnit.CountPerSecond +1. UsagesUnit.Percent +1. UsagesUnit.Seconds +1. ValidationStatus.ValidationStatusFailed +1. ValidationStatus.ValidationStatusInvalid +1. ValidationStatus.ValidationStatusSucceeded +1. WorkloadItemType.WorkloadItemTypeInvalid +1. WorkloadItemType.WorkloadItemTypeSAPAseDatabase +1. WorkloadItemType.WorkloadItemTypeSAPAseSystem +1. WorkloadItemType.WorkloadItemTypeSAPHanaDatabase +1. WorkloadItemType.WorkloadItemTypeSAPHanaSystem +1. WorkloadItemType.WorkloadItemTypeSQLDataBase +1. WorkloadItemType.WorkloadItemTypeSQLInstance +1. WorkloadItemTypeBasicWorkloadItem.WorkloadItemTypeAzureVMWorkloadItem +1. WorkloadItemTypeBasicWorkloadItem.WorkloadItemTypeSAPAseDatabase1 +1. WorkloadItemTypeBasicWorkloadItem.WorkloadItemTypeSAPAseSystem1 +1. WorkloadItemTypeBasicWorkloadItem.WorkloadItemTypeSAPHanaDatabase1 +1. WorkloadItemTypeBasicWorkloadItem.WorkloadItemTypeSAPHanaSystem1 +1. WorkloadItemTypeBasicWorkloadItem.WorkloadItemTypeSQLDataBase1 +1. WorkloadItemTypeBasicWorkloadItem.WorkloadItemTypeSQLInstance1 +1. WorkloadItemTypeBasicWorkloadItem.WorkloadItemTypeWorkloadItem + +### Removed Funcs + +1. *ClientDiscoveryResponseIterator.Next() error +1. *ClientDiscoveryResponseIterator.NextWithContext(context.Context) error +1. *ClientDiscoveryResponsePage.Next() error +1. *ClientDiscoveryResponsePage.NextWithContext(context.Context) error +1. *EngineBaseResource.UnmarshalJSON([]byte) error +1. *EngineBaseResourceListIterator.Next() error +1. *EngineBaseResourceListIterator.NextWithContext(context.Context) error +1. *EngineBaseResourceListPage.Next() error +1. *EngineBaseResourceListPage.NextWithContext(context.Context) error +1. *ILRRequestResource.UnmarshalJSON([]byte) error +1. *OperationStatus.UnmarshalJSON([]byte) error +1. *ProtectableContainerResource.UnmarshalJSON([]byte) error +1. *ProtectableContainerResourceListIterator.Next() error +1. *ProtectableContainerResourceListIterator.NextWithContext(context.Context) error +1. *ProtectableContainerResourceListPage.Next() error +1. *ProtectableContainerResourceListPage.NextWithContext(context.Context) error +1. *ProtectionContainerResource.UnmarshalJSON([]byte) error +1. *ProtectionContainerResourceListIterator.Next() error +1. *ProtectionContainerResourceListIterator.NextWithContext(context.Context) error +1. *ProtectionContainerResourceListPage.Next() error +1. *ProtectionContainerResourceListPage.NextWithContext(context.Context) error +1. *ProtectionIntentResource.UnmarshalJSON([]byte) error +1. *ProtectionIntentResourceListIterator.Next() error +1. *ProtectionIntentResourceListIterator.NextWithContext(context.Context) error +1. *ProtectionIntentResourceListPage.Next() error +1. *ProtectionIntentResourceListPage.NextWithContext(context.Context) error +1. *RequestResource.UnmarshalJSON([]byte) error +1. *WorkloadItemResource.UnmarshalJSON([]byte) error +1. *WorkloadItemResourceListIterator.Next() error +1. *WorkloadItemResourceListIterator.NextWithContext(context.Context) error +1. *WorkloadItemResourceListPage.Next() error +1. *WorkloadItemResourceListPage.NextWithContext(context.Context) error +1. *WorkloadProtectableItemResource.UnmarshalJSON([]byte) error +1. *WorkloadProtectableItemResourceListIterator.Next() error +1. *WorkloadProtectableItemResourceListIterator.NextWithContext(context.Context) error +1. *WorkloadProtectableItemResourceListPage.Next() error +1. *WorkloadProtectableItemResourceListPage.NextWithContext(context.Context) error +1. AzureBackupGoalFeatureSupportRequest.AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) +1. AzureBackupGoalFeatureSupportRequest.AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) +1. AzureBackupGoalFeatureSupportRequest.AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) +1. AzureBackupGoalFeatureSupportRequest.AsFeatureSupportRequest() (*FeatureSupportRequest, bool) +1. AzureBackupGoalFeatureSupportRequest.MarshalJSON() ([]byte, error) +1. AzureBackupServerContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. AzureBackupServerContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. AzureBackupServerContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. AzureBackupServerContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. AzureBackupServerContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. AzureBackupServerContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. AzureBackupServerContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. AzureBackupServerContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. AzureBackupServerContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. AzureBackupServerContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. AzureBackupServerContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. AzureBackupServerContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. AzureBackupServerContainer.AsDpmContainer() (*DpmContainer, bool) +1. AzureBackupServerContainer.AsGenericContainer() (*GenericContainer, bool) +1. AzureBackupServerContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. AzureBackupServerContainer.AsMabContainer() (*MabContainer, bool) +1. AzureBackupServerContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. AzureBackupServerContainer.MarshalJSON() ([]byte, error) +1. AzureBackupServerEngine.AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) +1. AzureBackupServerEngine.AsBasicEngineBase() (BasicEngineBase, bool) +1. AzureBackupServerEngine.AsDpmBackupEngine() (*DpmBackupEngine, bool) +1. AzureBackupServerEngine.AsEngineBase() (*EngineBase, bool) +1. AzureBackupServerEngine.MarshalJSON() ([]byte, error) +1. AzureFileShareBackupRequest.AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) +1. AzureFileShareBackupRequest.AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) +1. AzureFileShareBackupRequest.AsBasicRequest() (BasicRequest, bool) +1. AzureFileShareBackupRequest.AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) +1. AzureFileShareBackupRequest.AsRequest() (*Request, bool) +1. AzureFileShareBackupRequest.MarshalJSON() ([]byte, error) +1. AzureFileShareProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureFileShareProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureFileShareProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureFileShareProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureFileShareProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureFileShareProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureFileShareProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureFileShareProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureFileShareProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureFileShareProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureFileShareProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureFileShareProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureFileShareProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureFileShareProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureFileShareProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureFileShareProtectableItem.MarshalJSON() ([]byte, error) +1. AzureFileShareProvisionILRRequest.AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) +1. AzureFileShareProvisionILRRequest.AsBasicILRRequest() (BasicILRRequest, bool) +1. AzureFileShareProvisionILRRequest.AsILRRequest() (*ILRRequest, bool) +1. AzureFileShareProvisionILRRequest.AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) +1. AzureFileShareProvisionILRRequest.MarshalJSON() ([]byte, error) +1. AzureIaaSClassicComputeVMContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsDpmContainer() (*DpmContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsGenericContainer() (*GenericContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsMabContainer() (*MabContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. AzureIaaSClassicComputeVMContainer.MarshalJSON() ([]byte, error) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.MarshalJSON() ([]byte, error) +1. AzureIaaSComputeVMContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. AzureIaaSComputeVMContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. AzureIaaSComputeVMContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. AzureIaaSComputeVMContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. AzureIaaSComputeVMContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. AzureIaaSComputeVMContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. AzureIaaSComputeVMContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. AzureIaaSComputeVMContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. AzureIaaSComputeVMContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. AzureIaaSComputeVMContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. AzureIaaSComputeVMContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. AzureIaaSComputeVMContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. AzureIaaSComputeVMContainer.AsDpmContainer() (*DpmContainer, bool) +1. AzureIaaSComputeVMContainer.AsGenericContainer() (*GenericContainer, bool) +1. AzureIaaSComputeVMContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. AzureIaaSComputeVMContainer.AsMabContainer() (*MabContainer, bool) +1. AzureIaaSComputeVMContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. AzureIaaSComputeVMContainer.MarshalJSON() ([]byte, error) +1. AzureIaaSComputeVMProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.MarshalJSON() ([]byte, error) +1. AzureRecoveryServiceVaultProtectionIntent.AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsBasicProtectionIntent() (BasicProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsProtectionIntent() (*ProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.MarshalJSON() ([]byte, error) +1. AzureResourceProtectionIntent.AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsBasicProtectionIntent() (BasicProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsProtectionIntent() (*ProtectionIntent, bool) +1. AzureResourceProtectionIntent.MarshalJSON() ([]byte, error) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsDpmContainer() (*DpmContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsGenericContainer() (*GenericContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsMabContainer() (*MabContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.MarshalJSON() ([]byte, error) +1. AzureSQLContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. AzureSQLContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. AzureSQLContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. AzureSQLContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. AzureSQLContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. AzureSQLContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. AzureSQLContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. AzureSQLContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. AzureSQLContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. AzureSQLContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. AzureSQLContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. AzureSQLContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. AzureSQLContainer.AsDpmContainer() (*DpmContainer, bool) +1. AzureSQLContainer.AsGenericContainer() (*GenericContainer, bool) +1. AzureSQLContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. AzureSQLContainer.AsMabContainer() (*MabContainer, bool) +1. AzureSQLContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. AzureSQLContainer.MarshalJSON() ([]byte, error) +1. AzureStorageContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. AzureStorageContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. AzureStorageContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. AzureStorageContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. AzureStorageContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. AzureStorageContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. AzureStorageContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. AzureStorageContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. AzureStorageContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. AzureStorageContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. AzureStorageContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. AzureStorageContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. AzureStorageContainer.AsDpmContainer() (*DpmContainer, bool) +1. AzureStorageContainer.AsGenericContainer() (*GenericContainer, bool) +1. AzureStorageContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. AzureStorageContainer.AsMabContainer() (*MabContainer, bool) +1. AzureStorageContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. AzureStorageContainer.MarshalJSON() ([]byte, error) +1. AzureStorageProtectableContainer.AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) +1. AzureStorageProtectableContainer.AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) +1. AzureStorageProtectableContainer.AsBasicProtectableContainer() (BasicProtectableContainer, bool) +1. AzureStorageProtectableContainer.AsProtectableContainer() (*ProtectableContainer, bool) +1. AzureStorageProtectableContainer.MarshalJSON() ([]byte, error) +1. AzureVMAppContainerProtectableContainer.AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) +1. AzureVMAppContainerProtectableContainer.AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) +1. AzureVMAppContainerProtectableContainer.AsBasicProtectableContainer() (BasicProtectableContainer, bool) +1. AzureVMAppContainerProtectableContainer.AsProtectableContainer() (*ProtectableContainer, bool) +1. AzureVMAppContainerProtectableContainer.MarshalJSON() ([]byte, error) +1. AzureVMAppContainerProtectionContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsDpmContainer() (*DpmContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsGenericContainer() (*GenericContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsMabContainer() (*MabContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. AzureVMAppContainerProtectionContainer.MarshalJSON() ([]byte, error) +1. AzureVMResourceFeatureSupportRequest.AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) +1. AzureVMResourceFeatureSupportRequest.AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) +1. AzureVMResourceFeatureSupportRequest.AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) +1. AzureVMResourceFeatureSupportRequest.AsFeatureSupportRequest() (*FeatureSupportRequest, bool) +1. AzureVMResourceFeatureSupportRequest.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadItem.AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +1. AzureVMWorkloadItem.AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) +1. AzureVMWorkloadItem.AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) +1. AzureVMWorkloadItem.AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) +1. AzureVMWorkloadItem.AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) +1. AzureVMWorkloadItem.AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) +1. AzureVMWorkloadItem.AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) +1. AzureVMWorkloadItem.AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) +1. AzureVMWorkloadItem.AsBasicWorkloadItem() (BasicWorkloadItem, bool) +1. AzureVMWorkloadItem.AsWorkloadItem() (*WorkloadItem, bool) +1. AzureVMWorkloadItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsBasicWorkloadItem() (BasicWorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsWorkloadItem() (*WorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsBasicWorkloadItem() (BasicWorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsWorkloadItem() (*WorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsBasicWorkloadItem() (BasicWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsWorkloadItem() (*WorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsBasicWorkloadItem() (BasicWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsWorkloadItem() (*WorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsBasicWorkloadItem() (BasicWorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsWorkloadItem() (*WorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsBasicWorkloadItem() (BasicWorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsWorkloadItem() (*WorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.MarshalJSON() ([]byte, error) +1. AzureWorkloadAutoProtectionIntent.AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsBasicProtectionIntent() (BasicProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsProtectionIntent() (*ProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.MarshalJSON() ([]byte, error) +1. AzureWorkloadBackupRequest.AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) +1. AzureWorkloadBackupRequest.AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) +1. AzureWorkloadBackupRequest.AsBasicRequest() (BasicRequest, bool) +1. AzureWorkloadBackupRequest.AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) +1. AzureWorkloadBackupRequest.AsRequest() (*Request, bool) +1. AzureWorkloadBackupRequest.MarshalJSON() ([]byte, error) +1. AzureWorkloadContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. AzureWorkloadContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. AzureWorkloadContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. AzureWorkloadContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. AzureWorkloadContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. AzureWorkloadContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. AzureWorkloadContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. AzureWorkloadContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. AzureWorkloadContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. AzureWorkloadContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. AzureWorkloadContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. AzureWorkloadContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. AzureWorkloadContainer.AsDpmContainer() (*DpmContainer, bool) +1. AzureWorkloadContainer.AsGenericContainer() (*GenericContainer, bool) +1. AzureWorkloadContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. AzureWorkloadContainer.AsMabContainer() (*MabContainer, bool) +1. AzureWorkloadContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. AzureWorkloadContainer.MarshalJSON() ([]byte, error) +1. AzureWorkloadSQLAutoProtectionIntent.AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsBasicProtectionIntent() (BasicProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsProtectionIntent() (*ProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.MarshalJSON() ([]byte, error) +1. BackupsClient.Trigger(context.Context, string, string, string, string, string, RequestResource) (autorest.Response, error) +1. BackupsClient.TriggerPreparer(context.Context, string, string, string, string, string, RequestResource) (*http.Request, error) +1. BackupsClient.TriggerResponder(*http.Response) (autorest.Response, error) +1. BackupsClient.TriggerSender(*http.Request) (*http.Response, error) +1. ClientDiscoveryResponse.IsEmpty() bool +1. ClientDiscoveryResponseIterator.NotDone() bool +1. ClientDiscoveryResponseIterator.Response() ClientDiscoveryResponse +1. ClientDiscoveryResponseIterator.Value() ClientDiscoveryValueForSingleAPI +1. ClientDiscoveryResponsePage.NotDone() bool +1. ClientDiscoveryResponsePage.Response() ClientDiscoveryResponse +1. ClientDiscoveryResponsePage.Values() []ClientDiscoveryValueForSingleAPI +1. DpmBackupEngine.AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) +1. DpmBackupEngine.AsBasicEngineBase() (BasicEngineBase, bool) +1. DpmBackupEngine.AsDpmBackupEngine() (*DpmBackupEngine, bool) +1. DpmBackupEngine.AsEngineBase() (*EngineBase, bool) +1. DpmBackupEngine.MarshalJSON() ([]byte, error) +1. DpmContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. DpmContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. DpmContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. DpmContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. DpmContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. DpmContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. DpmContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. DpmContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. DpmContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. DpmContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. DpmContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. DpmContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. DpmContainer.AsDpmContainer() (*DpmContainer, bool) +1. DpmContainer.AsGenericContainer() (*GenericContainer, bool) +1. DpmContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. DpmContainer.AsMabContainer() (*MabContainer, bool) +1. DpmContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. DpmContainer.MarshalJSON() ([]byte, error) +1. EngineBase.AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) +1. EngineBase.AsBasicEngineBase() (BasicEngineBase, bool) +1. EngineBase.AsDpmBackupEngine() (*DpmBackupEngine, bool) +1. EngineBase.AsEngineBase() (*EngineBase, bool) +1. EngineBase.MarshalJSON() ([]byte, error) +1. EngineBaseResource.MarshalJSON() ([]byte, error) +1. EngineBaseResourceList.IsEmpty() bool +1. EngineBaseResourceListIterator.NotDone() bool +1. EngineBaseResourceListIterator.Response() EngineBaseResourceList +1. EngineBaseResourceListIterator.Value() EngineBaseResource +1. EngineBaseResourceListPage.NotDone() bool +1. EngineBaseResourceListPage.Response() EngineBaseResourceList +1. EngineBaseResourceListPage.Values() []EngineBaseResource +1. EnginesClient.Get(context.Context, string, string, string, string, string) (EngineBaseResource, error) +1. EnginesClient.GetPreparer(context.Context, string, string, string, string, string) (*http.Request, error) +1. EnginesClient.GetResponder(*http.Response) (EngineBaseResource, error) +1. EnginesClient.GetSender(*http.Request) (*http.Response, error) +1. EnginesClient.List(context.Context, string, string, string, string) (EngineBaseResourceListPage, error) +1. EnginesClient.ListComplete(context.Context, string, string, string, string) (EngineBaseResourceListIterator, error) +1. EnginesClient.ListPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. EnginesClient.ListResponder(*http.Response) (EngineBaseResourceList, error) +1. EnginesClient.ListSender(*http.Request) (*http.Response, error) +1. FeatureSupportClient.Validate(context.Context, string, BasicFeatureSupportRequest) (AzureVMResourceFeatureSupportResponse, error) +1. FeatureSupportClient.ValidatePreparer(context.Context, string, BasicFeatureSupportRequest) (*http.Request, error) +1. FeatureSupportClient.ValidateResponder(*http.Response) (AzureVMResourceFeatureSupportResponse, error) +1. FeatureSupportClient.ValidateSender(*http.Request) (*http.Response, error) +1. FeatureSupportRequest.AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) +1. FeatureSupportRequest.AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) +1. FeatureSupportRequest.AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) +1. FeatureSupportRequest.AsFeatureSupportRequest() (*FeatureSupportRequest, bool) +1. FeatureSupportRequest.MarshalJSON() ([]byte, error) +1. GenericContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. GenericContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. GenericContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. GenericContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. GenericContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. GenericContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. GenericContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. GenericContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. GenericContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. GenericContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. GenericContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. GenericContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. GenericContainer.AsDpmContainer() (*DpmContainer, bool) +1. GenericContainer.AsGenericContainer() (*GenericContainer, bool) +1. GenericContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. GenericContainer.AsMabContainer() (*MabContainer, bool) +1. GenericContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. GenericContainer.MarshalJSON() ([]byte, error) +1. GenericContainerExtendedInfo.MarshalJSON() ([]byte, error) +1. ILRRequest.AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) +1. ILRRequest.AsBasicILRRequest() (BasicILRRequest, bool) +1. ILRRequest.AsILRRequest() (*ILRRequest, bool) +1. ILRRequest.AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) +1. ILRRequest.MarshalJSON() ([]byte, error) +1. ILRRequestResource.MarshalJSON() ([]byte, error) +1. IaaSVMContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. IaaSVMContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. IaaSVMContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. IaaSVMContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. IaaSVMContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. IaaSVMContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. IaaSVMContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. IaaSVMContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. IaaSVMContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. IaaSVMContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. IaaSVMContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. IaaSVMContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. IaaSVMContainer.AsDpmContainer() (*DpmContainer, bool) +1. IaaSVMContainer.AsGenericContainer() (*GenericContainer, bool) +1. IaaSVMContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. IaaSVMContainer.AsMabContainer() (*MabContainer, bool) +1. IaaSVMContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. IaaSVMContainer.MarshalJSON() ([]byte, error) +1. IaaSVMProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. IaaSVMProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. IaaSVMProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. IaaSVMProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. IaaSVMProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. IaaSVMProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. IaaSVMProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. IaaSVMProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. IaaSVMProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. IaaSVMProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. IaaSVMProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. IaaSVMProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. IaaSVMProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. IaaSVMProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. IaaSVMProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. IaaSVMProtectableItem.MarshalJSON() ([]byte, error) +1. IaasVMBackupRequest.AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) +1. IaasVMBackupRequest.AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) +1. IaasVMBackupRequest.AsBasicRequest() (BasicRequest, bool) +1. IaasVMBackupRequest.AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) +1. IaasVMBackupRequest.AsRequest() (*Request, bool) +1. IaasVMBackupRequest.MarshalJSON() ([]byte, error) +1. IaasVMILRRegistrationRequest.AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) +1. IaasVMILRRegistrationRequest.AsBasicILRRequest() (BasicILRRequest, bool) +1. IaasVMILRRegistrationRequest.AsILRRequest() (*ILRRequest, bool) +1. IaasVMILRRegistrationRequest.AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) +1. IaasVMILRRegistrationRequest.MarshalJSON() ([]byte, error) +1. InquiryValidation.MarshalJSON() ([]byte, error) +1. ItemLevelRecoveryConnectionsClient.Provision(context.Context, string, string, string, string, string, string, ILRRequestResource) (autorest.Response, error) +1. ItemLevelRecoveryConnectionsClient.ProvisionPreparer(context.Context, string, string, string, string, string, string, ILRRequestResource) (*http.Request, error) +1. ItemLevelRecoveryConnectionsClient.ProvisionResponder(*http.Response) (autorest.Response, error) +1. ItemLevelRecoveryConnectionsClient.ProvisionSender(*http.Request) (*http.Response, error) +1. ItemLevelRecoveryConnectionsClient.Revoke(context.Context, string, string, string, string, string, string) (autorest.Response, error) +1. ItemLevelRecoveryConnectionsClient.RevokePreparer(context.Context, string, string, string, string, string, string) (*http.Request, error) +1. ItemLevelRecoveryConnectionsClient.RevokeResponder(*http.Response) (autorest.Response, error) +1. ItemLevelRecoveryConnectionsClient.RevokeSender(*http.Request) (*http.Response, error) +1. MabContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. MabContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. MabContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. MabContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. MabContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. MabContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. MabContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. MabContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. MabContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. MabContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. MabContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. MabContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. MabContainer.AsDpmContainer() (*DpmContainer, bool) +1. MabContainer.AsGenericContainer() (*GenericContainer, bool) +1. MabContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. MabContainer.AsMabContainer() (*MabContainer, bool) +1. MabContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. MabContainer.MarshalJSON() ([]byte, error) +1. NewBackupsClient(string) BackupsClient +1. NewBackupsClientWithBaseURI(string, string) BackupsClient +1. NewClientDiscoveryResponseIterator(ClientDiscoveryResponsePage) ClientDiscoveryResponseIterator +1. NewClientDiscoveryResponsePage(ClientDiscoveryResponse, func(context.Context, ClientDiscoveryResponse) (ClientDiscoveryResponse, error)) ClientDiscoveryResponsePage +1. NewEngineBaseResourceListIterator(EngineBaseResourceListPage) EngineBaseResourceListIterator +1. NewEngineBaseResourceListPage(EngineBaseResourceList, func(context.Context, EngineBaseResourceList) (EngineBaseResourceList, error)) EngineBaseResourceListPage +1. NewEnginesClient(string) EnginesClient +1. NewEnginesClientWithBaseURI(string, string) EnginesClient +1. NewFeatureSupportClient(string) FeatureSupportClient +1. NewFeatureSupportClientWithBaseURI(string, string) FeatureSupportClient +1. NewItemLevelRecoveryConnectionsClient(string) ItemLevelRecoveryConnectionsClient +1. NewItemLevelRecoveryConnectionsClientWithBaseURI(string, string) ItemLevelRecoveryConnectionsClient +1. NewOperationResultsClient(string) OperationResultsClient +1. NewOperationResultsClientWithBaseURI(string, string) OperationResultsClient +1. NewOperationStatusesClient(string) OperationStatusesClient +1. NewOperationStatusesClientWithBaseURI(string, string) OperationStatusesClient +1. NewOperationsClient(string) OperationsClient +1. NewOperationsClientWithBaseURI(string, string) OperationsClient +1. NewProtectableContainerResourceListIterator(ProtectableContainerResourceListPage) ProtectableContainerResourceListIterator +1. NewProtectableContainerResourceListPage(ProtectableContainerResourceList, func(context.Context, ProtectableContainerResourceList) (ProtectableContainerResourceList, error)) ProtectableContainerResourceListPage +1. NewProtectableContainersClient(string) ProtectableContainersClient +1. NewProtectableContainersClientWithBaseURI(string, string) ProtectableContainersClient +1. NewProtectableItemsClient(string) ProtectableItemsClient +1. NewProtectableItemsClientWithBaseURI(string, string) ProtectableItemsClient +1. NewProtectedItemOperationStatusesClient(string) ProtectedItemOperationStatusesClient +1. NewProtectedItemOperationStatusesClientWithBaseURI(string, string) ProtectedItemOperationStatusesClient +1. NewProtectionContainerOperationResultsClient(string) ProtectionContainerOperationResultsClient +1. NewProtectionContainerOperationResultsClientWithBaseURI(string, string) ProtectionContainerOperationResultsClient +1. NewProtectionContainerRefreshOperationResultsClient(string) ProtectionContainerRefreshOperationResultsClient +1. NewProtectionContainerRefreshOperationResultsClientWithBaseURI(string, string) ProtectionContainerRefreshOperationResultsClient +1. NewProtectionContainerResourceListIterator(ProtectionContainerResourceListPage) ProtectionContainerResourceListIterator +1. NewProtectionContainerResourceListPage(ProtectionContainerResourceList, func(context.Context, ProtectionContainerResourceList) (ProtectionContainerResourceList, error)) ProtectionContainerResourceListPage +1. NewProtectionContainersClient(string) ProtectionContainersClient +1. NewProtectionContainersClientWithBaseURI(string, string) ProtectionContainersClient +1. NewProtectionContainersGroupClient(string) ProtectionContainersGroupClient +1. NewProtectionContainersGroupClientWithBaseURI(string, string) ProtectionContainersGroupClient +1. NewProtectionIntentClient(string) ProtectionIntentClient +1. NewProtectionIntentClientWithBaseURI(string, string) ProtectionIntentClient +1. NewProtectionIntentGroupClient(string) ProtectionIntentGroupClient +1. NewProtectionIntentGroupClientWithBaseURI(string, string) ProtectionIntentGroupClient +1. NewProtectionIntentResourceListIterator(ProtectionIntentResourceListPage) ProtectionIntentResourceListIterator +1. NewProtectionIntentResourceListPage(ProtectionIntentResourceList, func(context.Context, ProtectionIntentResourceList) (ProtectionIntentResourceList, error)) ProtectionIntentResourceListPage +1. NewProtectionPolicyOperationStatusesClient(string) ProtectionPolicyOperationStatusesClient +1. NewProtectionPolicyOperationStatusesClientWithBaseURI(string, string) ProtectionPolicyOperationStatusesClient +1. NewResourceStorageConfigsClient(string) ResourceStorageConfigsClient +1. NewResourceStorageConfigsClientWithBaseURI(string, string) ResourceStorageConfigsClient +1. NewSecurityPINsClient(string) SecurityPINsClient +1. NewSecurityPINsClientWithBaseURI(string, string) SecurityPINsClient +1. NewStatusClient(string) StatusClient +1. NewStatusClientWithBaseURI(string, string) StatusClient +1. NewUsageSummariesClient(string) UsageSummariesClient +1. NewUsageSummariesClientWithBaseURI(string, string) UsageSummariesClient +1. NewWorkloadItemResourceListIterator(WorkloadItemResourceListPage) WorkloadItemResourceListIterator +1. NewWorkloadItemResourceListPage(WorkloadItemResourceList, func(context.Context, WorkloadItemResourceList) (WorkloadItemResourceList, error)) WorkloadItemResourceListPage +1. NewWorkloadItemsClient(string) WorkloadItemsClient +1. NewWorkloadItemsClientWithBaseURI(string, string) WorkloadItemsClient +1. NewWorkloadProtectableItemResourceListIterator(WorkloadProtectableItemResourceListPage) WorkloadProtectableItemResourceListIterator +1. NewWorkloadProtectableItemResourceListPage(WorkloadProtectableItemResourceList, func(context.Context, WorkloadProtectableItemResourceList) (WorkloadProtectableItemResourceList, error)) WorkloadProtectableItemResourceListPage +1. OperationResultsClient.Get(context.Context, string, string, string) (autorest.Response, error) +1. OperationResultsClient.GetPreparer(context.Context, string, string, string) (*http.Request, error) +1. OperationResultsClient.GetResponder(*http.Response) (autorest.Response, error) +1. OperationResultsClient.GetSender(*http.Request) (*http.Response, error) +1. OperationStatusExtendedInfo.AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) +1. OperationStatusExtendedInfo.AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) +1. OperationStatusExtendedInfo.AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) +1. OperationStatusExtendedInfo.AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) +1. OperationStatusExtendedInfo.AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) +1. OperationStatusExtendedInfo.MarshalJSON() ([]byte, error) +1. OperationStatusJobExtendedInfo.AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) +1. OperationStatusJobExtendedInfo.AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) +1. OperationStatusJobExtendedInfo.AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) +1. OperationStatusJobExtendedInfo.AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) +1. OperationStatusJobExtendedInfo.AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) +1. OperationStatusJobExtendedInfo.MarshalJSON() ([]byte, error) +1. OperationStatusJobsExtendedInfo.AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) +1. OperationStatusJobsExtendedInfo.AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) +1. OperationStatusJobsExtendedInfo.AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) +1. OperationStatusJobsExtendedInfo.AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) +1. OperationStatusJobsExtendedInfo.AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) +1. OperationStatusJobsExtendedInfo.MarshalJSON() ([]byte, error) +1. OperationStatusProvisionILRExtendedInfo.AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) +1. OperationStatusProvisionILRExtendedInfo.AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) +1. OperationStatusProvisionILRExtendedInfo.AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) +1. OperationStatusProvisionILRExtendedInfo.AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) +1. OperationStatusProvisionILRExtendedInfo.AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) +1. OperationStatusProvisionILRExtendedInfo.MarshalJSON() ([]byte, error) +1. OperationStatusesClient.Get(context.Context, string, string, string) (OperationStatus, error) +1. OperationStatusesClient.GetPreparer(context.Context, string, string, string) (*http.Request, error) +1. OperationStatusesClient.GetResponder(*http.Response) (OperationStatus, error) +1. OperationStatusesClient.GetSender(*http.Request) (*http.Response, error) +1. OperationsClient.List(context.Context) (ClientDiscoveryResponsePage, error) +1. OperationsClient.ListComplete(context.Context) (ClientDiscoveryResponseIterator, error) +1. OperationsClient.ListPreparer(context.Context) (*http.Request, error) +1. OperationsClient.ListResponder(*http.Response) (ClientDiscoveryResponse, error) +1. OperationsClient.ListSender(*http.Request) (*http.Response, error) +1. PossibleAzureFileShareTypeValues() []AzureFileShareType +1. PossibleContainerTypeBasicProtectionContainerValues() []ContainerTypeBasicProtectionContainer +1. PossibleContainerTypeValues() []ContainerType +1. PossibleEngineTypeValues() []EngineType +1. PossibleFabricNameValues() []FabricName +1. PossibleFeatureTypeValues() []FeatureType +1. PossibleInquiryStatusValues() []InquiryStatus +1. PossibleIntentItemTypeValues() []IntentItemType +1. PossibleItemTypeValues() []ItemType +1. PossibleObjectTypeBasicILRRequestValues() []ObjectTypeBasicILRRequest +1. PossibleObjectTypeBasicOperationStatusExtendedInfoValues() []ObjectTypeBasicOperationStatusExtendedInfo +1. PossibleObjectTypeBasicRequestValues() []ObjectTypeBasicRequest +1. PossibleOperationStatusValuesValues() []OperationStatusValues +1. PossibleOperationTypeValues() []OperationType +1. PossibleProtectableContainerTypeValues() []ProtectableContainerType +1. PossibleProtectableItemTypeValues() []ProtectableItemType +1. PossibleProtectionIntentItemTypeValues() []ProtectionIntentItemType +1. PossibleProtectionStatusValues() []ProtectionStatus +1. PossibleSupportStatusValues() []SupportStatus +1. PossibleTypeEnumValues() []TypeEnum +1. PossibleTypeValues() []Type +1. PossibleUsagesUnitValues() []UsagesUnit +1. PossibleValidationStatusValues() []ValidationStatus +1. PossibleWorkloadItemTypeBasicWorkloadItemValues() []WorkloadItemTypeBasicWorkloadItem +1. PossibleWorkloadItemTypeValues() []WorkloadItemType +1. ProtectableContainer.AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) +1. ProtectableContainer.AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) +1. ProtectableContainer.AsBasicProtectableContainer() (BasicProtectableContainer, bool) +1. ProtectableContainer.AsProtectableContainer() (*ProtectableContainer, bool) +1. ProtectableContainer.MarshalJSON() ([]byte, error) +1. ProtectableContainerResource.MarshalJSON() ([]byte, error) +1. ProtectableContainerResourceList.IsEmpty() bool +1. ProtectableContainerResourceListIterator.NotDone() bool +1. ProtectableContainerResourceListIterator.Response() ProtectableContainerResourceList +1. ProtectableContainerResourceListIterator.Value() ProtectableContainerResource +1. ProtectableContainerResourceListPage.NotDone() bool +1. ProtectableContainerResourceListPage.Response() ProtectableContainerResourceList +1. ProtectableContainerResourceListPage.Values() []ProtectableContainerResource +1. ProtectableContainersClient.List(context.Context, string, string, string, string) (ProtectableContainerResourceListPage, error) +1. ProtectableContainersClient.ListComplete(context.Context, string, string, string, string) (ProtectableContainerResourceListIterator, error) +1. ProtectableContainersClient.ListPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectableContainersClient.ListResponder(*http.Response) (ProtectableContainerResourceList, error) +1. ProtectableContainersClient.ListSender(*http.Request) (*http.Response, error) +1. ProtectableItemsClient.List(context.Context, string, string, string, string) (WorkloadProtectableItemResourceListPage, error) +1. ProtectableItemsClient.ListComplete(context.Context, string, string, string, string) (WorkloadProtectableItemResourceListIterator, error) +1. ProtectableItemsClient.ListPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectableItemsClient.ListResponder(*http.Response) (WorkloadProtectableItemResourceList, error) +1. ProtectableItemsClient.ListSender(*http.Request) (*http.Response, error) +1. ProtectedItemOperationStatusesClient.Get(context.Context, string, string, string, string, string, string) (OperationStatus, error) +1. ProtectedItemOperationStatusesClient.GetPreparer(context.Context, string, string, string, string, string, string) (*http.Request, error) +1. ProtectedItemOperationStatusesClient.GetResponder(*http.Response) (OperationStatus, error) +1. ProtectedItemOperationStatusesClient.GetSender(*http.Request) (*http.Response, error) +1. ProtectionContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. ProtectionContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. ProtectionContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. ProtectionContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. ProtectionContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. ProtectionContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. ProtectionContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. ProtectionContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. ProtectionContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. ProtectionContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. ProtectionContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. ProtectionContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. ProtectionContainer.AsDpmContainer() (*DpmContainer, bool) +1. ProtectionContainer.AsGenericContainer() (*GenericContainer, bool) +1. ProtectionContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. ProtectionContainer.AsMabContainer() (*MabContainer, bool) +1. ProtectionContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. ProtectionContainer.MarshalJSON() ([]byte, error) +1. ProtectionContainerOperationResultsClient.Get(context.Context, string, string, string, string, string) (ProtectionContainerResource, error) +1. ProtectionContainerOperationResultsClient.GetPreparer(context.Context, string, string, string, string, string) (*http.Request, error) +1. ProtectionContainerOperationResultsClient.GetResponder(*http.Response) (ProtectionContainerResource, error) +1. ProtectionContainerOperationResultsClient.GetSender(*http.Request) (*http.Response, error) +1. ProtectionContainerRefreshOperationResultsClient.Get(context.Context, string, string, string, string) (autorest.Response, error) +1. ProtectionContainerRefreshOperationResultsClient.GetPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionContainerRefreshOperationResultsClient.GetResponder(*http.Response) (autorest.Response, error) +1. ProtectionContainerRefreshOperationResultsClient.GetSender(*http.Request) (*http.Response, error) +1. ProtectionContainerResource.MarshalJSON() ([]byte, error) +1. ProtectionContainerResourceList.IsEmpty() bool +1. ProtectionContainerResourceListIterator.NotDone() bool +1. ProtectionContainerResourceListIterator.Response() ProtectionContainerResourceList +1. ProtectionContainerResourceListIterator.Value() ProtectionContainerResource +1. ProtectionContainerResourceListPage.NotDone() bool +1. ProtectionContainerResourceListPage.Response() ProtectionContainerResourceList +1. ProtectionContainerResourceListPage.Values() []ProtectionContainerResource +1. ProtectionContainersClient.Get(context.Context, string, string, string, string) (ProtectionContainerResource, error) +1. ProtectionContainersClient.GetPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionContainersClient.GetResponder(*http.Response) (ProtectionContainerResource, error) +1. ProtectionContainersClient.GetSender(*http.Request) (*http.Response, error) +1. ProtectionContainersClient.Inquire(context.Context, string, string, string, string, string) (autorest.Response, error) +1. ProtectionContainersClient.InquirePreparer(context.Context, string, string, string, string, string) (*http.Request, error) +1. ProtectionContainersClient.InquireResponder(*http.Response) (autorest.Response, error) +1. ProtectionContainersClient.InquireSender(*http.Request) (*http.Response, error) +1. ProtectionContainersClient.Refresh(context.Context, string, string, string, string) (autorest.Response, error) +1. ProtectionContainersClient.RefreshPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionContainersClient.RefreshResponder(*http.Response) (autorest.Response, error) +1. ProtectionContainersClient.RefreshSender(*http.Request) (*http.Response, error) +1. ProtectionContainersClient.Register(context.Context, string, string, string, string, ProtectionContainerResource) (ProtectionContainerResource, error) +1. ProtectionContainersClient.RegisterPreparer(context.Context, string, string, string, string, ProtectionContainerResource) (*http.Request, error) +1. ProtectionContainersClient.RegisterResponder(*http.Response) (ProtectionContainerResource, error) +1. ProtectionContainersClient.RegisterSender(*http.Request) (*http.Response, error) +1. ProtectionContainersClient.Unregister(context.Context, string, string, string, string) (autorest.Response, error) +1. ProtectionContainersClient.UnregisterPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionContainersClient.UnregisterResponder(*http.Response) (autorest.Response, error) +1. ProtectionContainersClient.UnregisterSender(*http.Request) (*http.Response, error) +1. ProtectionContainersGroupClient.List(context.Context, string, string, string) (ProtectionContainerResourceListPage, error) +1. ProtectionContainersGroupClient.ListComplete(context.Context, string, string, string) (ProtectionContainerResourceListIterator, error) +1. ProtectionContainersGroupClient.ListPreparer(context.Context, string, string, string) (*http.Request, error) +1. ProtectionContainersGroupClient.ListResponder(*http.Response) (ProtectionContainerResourceList, error) +1. ProtectionContainersGroupClient.ListSender(*http.Request) (*http.Response, error) +1. ProtectionIntent.AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) +1. ProtectionIntent.AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) +1. ProtectionIntent.AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) +1. ProtectionIntent.AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) +1. ProtectionIntent.AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) +1. ProtectionIntent.AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) +1. ProtectionIntent.AsBasicProtectionIntent() (BasicProtectionIntent, bool) +1. ProtectionIntent.AsProtectionIntent() (*ProtectionIntent, bool) +1. ProtectionIntent.MarshalJSON() ([]byte, error) +1. ProtectionIntentClient.CreateOrUpdate(context.Context, string, string, string, string, ProtectionIntentResource) (ProtectionIntentResource, error) +1. ProtectionIntentClient.CreateOrUpdatePreparer(context.Context, string, string, string, string, ProtectionIntentResource) (*http.Request, error) +1. ProtectionIntentClient.CreateOrUpdateResponder(*http.Response) (ProtectionIntentResource, error) +1. ProtectionIntentClient.CreateOrUpdateSender(*http.Request) (*http.Response, error) +1. ProtectionIntentClient.Delete(context.Context, string, string, string, string) (autorest.Response, error) +1. ProtectionIntentClient.DeletePreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionIntentClient.DeleteResponder(*http.Response) (autorest.Response, error) +1. ProtectionIntentClient.DeleteSender(*http.Request) (*http.Response, error) +1. ProtectionIntentClient.Get(context.Context, string, string, string, string) (ProtectionIntentResource, error) +1. ProtectionIntentClient.GetPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionIntentClient.GetResponder(*http.Response) (ProtectionIntentResource, error) +1. ProtectionIntentClient.GetSender(*http.Request) (*http.Response, error) +1. ProtectionIntentClient.Validate(context.Context, string, PreValidateEnableBackupRequest) (PreValidateEnableBackupResponse, error) +1. ProtectionIntentClient.ValidatePreparer(context.Context, string, PreValidateEnableBackupRequest) (*http.Request, error) +1. ProtectionIntentClient.ValidateResponder(*http.Response) (PreValidateEnableBackupResponse, error) +1. ProtectionIntentClient.ValidateSender(*http.Request) (*http.Response, error) +1. ProtectionIntentGroupClient.List(context.Context, string, string, string, string) (ProtectionIntentResourceListPage, error) +1. ProtectionIntentGroupClient.ListComplete(context.Context, string, string, string, string) (ProtectionIntentResourceListIterator, error) +1. ProtectionIntentGroupClient.ListPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionIntentGroupClient.ListResponder(*http.Response) (ProtectionIntentResourceList, error) +1. ProtectionIntentGroupClient.ListSender(*http.Request) (*http.Response, error) +1. ProtectionIntentResource.MarshalJSON() ([]byte, error) +1. ProtectionIntentResourceList.IsEmpty() bool +1. ProtectionIntentResourceListIterator.NotDone() bool +1. ProtectionIntentResourceListIterator.Response() ProtectionIntentResourceList +1. ProtectionIntentResourceListIterator.Value() ProtectionIntentResource +1. ProtectionIntentResourceListPage.NotDone() bool +1. ProtectionIntentResourceListPage.Response() ProtectionIntentResourceList +1. ProtectionIntentResourceListPage.Values() []ProtectionIntentResource +1. ProtectionPoliciesClient.Delete(context.Context, string, string, string) (autorest.Response, error) +1. ProtectionPoliciesClient.DeletePreparer(context.Context, string, string, string) (*http.Request, error) +1. ProtectionPoliciesClient.DeleteResponder(*http.Response) (autorest.Response, error) +1. ProtectionPoliciesClient.DeleteSender(*http.Request) (*http.Response, error) +1. ProtectionPolicyOperationStatusesClient.Get(context.Context, string, string, string, string) (OperationStatus, error) +1. ProtectionPolicyOperationStatusesClient.GetPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionPolicyOperationStatusesClient.GetResponder(*http.Response) (OperationStatus, error) +1. ProtectionPolicyOperationStatusesClient.GetSender(*http.Request) (*http.Response, error) +1. Request.AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) +1. Request.AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) +1. Request.AsBasicRequest() (BasicRequest, bool) +1. Request.AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) +1. Request.AsRequest() (*Request, bool) +1. Request.MarshalJSON() ([]byte, error) +1. RequestResource.MarshalJSON() ([]byte, error) +1. ResourceConfigResource.MarshalJSON() ([]byte, error) +1. ResourceStorageConfigsClient.Get(context.Context, string, string) (ResourceConfigResource, error) +1. ResourceStorageConfigsClient.GetPreparer(context.Context, string, string) (*http.Request, error) +1. ResourceStorageConfigsClient.GetResponder(*http.Response) (ResourceConfigResource, error) +1. ResourceStorageConfigsClient.GetSender(*http.Request) (*http.Response, error) +1. ResourceStorageConfigsClient.Patch(context.Context, string, string, ResourceConfigResource) (autorest.Response, error) +1. ResourceStorageConfigsClient.PatchPreparer(context.Context, string, string, ResourceConfigResource) (*http.Request, error) +1. ResourceStorageConfigsClient.PatchResponder(*http.Response) (autorest.Response, error) +1. ResourceStorageConfigsClient.PatchSender(*http.Request) (*http.Response, error) +1. ResourceStorageConfigsClient.Update(context.Context, string, string, ResourceConfigResource) (ResourceConfigResource, error) +1. ResourceStorageConfigsClient.UpdatePreparer(context.Context, string, string, ResourceConfigResource) (*http.Request, error) +1. ResourceStorageConfigsClient.UpdateResponder(*http.Response) (ResourceConfigResource, error) +1. ResourceStorageConfigsClient.UpdateSender(*http.Request) (*http.Response, error) +1. SecurityPINsClient.Get(context.Context, string, string) (TokenInformation, error) +1. SecurityPINsClient.GetPreparer(context.Context, string, string) (*http.Request, error) +1. SecurityPINsClient.GetResponder(*http.Response) (TokenInformation, error) +1. SecurityPINsClient.GetSender(*http.Request) (*http.Response, error) +1. StatusClient.Get(context.Context, string, StatusRequest) (StatusResponse, error) +1. StatusClient.GetPreparer(context.Context, string, StatusRequest) (*http.Request, error) +1. StatusClient.GetResponder(*http.Response) (StatusResponse, error) +1. StatusClient.GetSender(*http.Request) (*http.Response, error) +1. UsageSummariesClient.List(context.Context, string, string, string, string) (ManagementUsageList, error) +1. UsageSummariesClient.ListPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. UsageSummariesClient.ListResponder(*http.Response) (ManagementUsageList, error) +1. UsageSummariesClient.ListSender(*http.Request) (*http.Response, error) +1. WorkloadItem.AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +1. WorkloadItem.AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) +1. WorkloadItem.AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) +1. WorkloadItem.AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) +1. WorkloadItem.AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) +1. WorkloadItem.AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) +1. WorkloadItem.AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) +1. WorkloadItem.AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) +1. WorkloadItem.AsBasicWorkloadItem() (BasicWorkloadItem, bool) +1. WorkloadItem.AsWorkloadItem() (*WorkloadItem, bool) +1. WorkloadItem.MarshalJSON() ([]byte, error) +1. WorkloadItemResource.MarshalJSON() ([]byte, error) +1. WorkloadItemResourceList.IsEmpty() bool +1. WorkloadItemResourceListIterator.NotDone() bool +1. WorkloadItemResourceListIterator.Response() WorkloadItemResourceList +1. WorkloadItemResourceListIterator.Value() WorkloadItemResource +1. WorkloadItemResourceListPage.NotDone() bool +1. WorkloadItemResourceListPage.Response() WorkloadItemResourceList +1. WorkloadItemResourceListPage.Values() []WorkloadItemResource +1. WorkloadItemsClient.List(context.Context, string, string, string, string, string, string) (WorkloadItemResourceListPage, error) +1. WorkloadItemsClient.ListComplete(context.Context, string, string, string, string, string, string) (WorkloadItemResourceListIterator, error) +1. WorkloadItemsClient.ListPreparer(context.Context, string, string, string, string, string, string) (*http.Request, error) +1. WorkloadItemsClient.ListResponder(*http.Response) (WorkloadItemResourceList, error) +1. WorkloadItemsClient.ListSender(*http.Request) (*http.Response, error) +1. WorkloadProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. WorkloadProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. WorkloadProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. WorkloadProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. WorkloadProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. WorkloadProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. WorkloadProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. WorkloadProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. WorkloadProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. WorkloadProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. WorkloadProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. WorkloadProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. WorkloadProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. WorkloadProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. WorkloadProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. WorkloadProtectableItem.MarshalJSON() ([]byte, error) +1. WorkloadProtectableItemResource.MarshalJSON() ([]byte, error) +1. WorkloadProtectableItemResourceList.IsEmpty() bool +1. WorkloadProtectableItemResourceListIterator.NotDone() bool +1. WorkloadProtectableItemResourceListIterator.Response() WorkloadProtectableItemResourceList +1. WorkloadProtectableItemResourceListIterator.Value() WorkloadProtectableItemResource +1. WorkloadProtectableItemResourceListPage.NotDone() bool +1. WorkloadProtectableItemResourceListPage.Response() WorkloadProtectableItemResourceList +1. WorkloadProtectableItemResourceListPage.Values() []WorkloadProtectableItemResource + +### Struct Changes + +#### Removed Structs + +1. AzureBackupGoalFeatureSupportRequest +1. AzureBackupServerContainer +1. AzureBackupServerEngine +1. AzureFileShareBackupRequest +1. AzureFileShareProtectableItem +1. AzureFileShareProvisionILRRequest +1. AzureIaaSClassicComputeVMContainer +1. AzureIaaSClassicComputeVMProtectableItem +1. AzureIaaSComputeVMContainer +1. AzureIaaSComputeVMProtectableItem +1. AzureRecoveryServiceVaultProtectionIntent +1. AzureResourceProtectionIntent +1. AzureSQLAGWorkloadContainerProtectionContainer +1. AzureSQLContainer +1. AzureStorageContainer +1. AzureStorageProtectableContainer +1. AzureVMAppContainerProtectableContainer +1. AzureVMAppContainerProtectionContainer +1. AzureVMResourceFeatureSupportRequest +1. AzureVMResourceFeatureSupportResponse +1. AzureVMWorkloadItem +1. AzureVMWorkloadProtectableItem +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem +1. AzureVMWorkloadSAPAseSystemProtectableItem +1. AzureVMWorkloadSAPAseSystemWorkloadItem +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem +1. AzureVMWorkloadSAPHanaSystemProtectableItem +1. AzureVMWorkloadSAPHanaSystemWorkloadItem +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem +1. AzureVMWorkloadSQLDatabaseProtectableItem +1. AzureVMWorkloadSQLDatabaseWorkloadItem +1. AzureVMWorkloadSQLInstanceProtectableItem +1. AzureVMWorkloadSQLInstanceWorkloadItem +1. AzureWorkloadAutoProtectionIntent +1. AzureWorkloadBackupRequest +1. AzureWorkloadContainer +1. AzureWorkloadContainerExtendedInfo +1. AzureWorkloadSQLAutoProtectionIntent +1. BMSBackupEngineQueryObject +1. BMSBackupEnginesQueryObject +1. BMSBackupSummariesQueryObject +1. BMSContainerQueryObject +1. BMSContainersInquiryQueryObject +1. BMSPOQueryObject +1. BMSRefreshContainersQueryObject +1. BMSWorkloadItemQueryObject +1. BackupsClient +1. ClientDiscoveryDisplay +1. ClientDiscoveryForLogSpecification +1. ClientDiscoveryForProperties +1. ClientDiscoveryForServiceSpecification +1. ClientDiscoveryResponse +1. ClientDiscoveryResponseIterator +1. ClientDiscoveryResponsePage +1. ClientDiscoveryValueForSingleAPI +1. ClientScriptForConnect +1. ContainerIdentityInfo +1. DPMContainerExtendedInfo +1. DistributedNodesInfo +1. DpmBackupEngine +1. DpmContainer +1. EngineBase +1. EngineBaseResource +1. EngineBaseResourceList +1. EngineBaseResourceListIterator +1. EngineBaseResourceListPage +1. EngineExtendedInfo +1. EnginesClient +1. FeatureSupportClient +1. FeatureSupportRequest +1. GenericContainer +1. GenericContainerExtendedInfo +1. ILRRequest +1. ILRRequestResource +1. IaaSVMContainer +1. IaaSVMProtectableItem +1. IaasVMBackupRequest +1. IaasVMILRRegistrationRequest +1. InquiryInfo +1. InquiryValidation +1. InstantItemRecoveryTarget +1. InstantRPAdditionalDetails +1. ItemLevelRecoveryConnectionsClient +1. MABContainerHealthDetails +1. MabContainer +1. MabContainerExtendedInfo +1. ManagementUsage +1. ManagementUsageList +1. NameInfo +1. OperationResultsClient +1. OperationStatus +1. OperationStatusError +1. OperationStatusExtendedInfo +1. OperationStatusJobExtendedInfo +1. OperationStatusJobsExtendedInfo +1. OperationStatusProvisionILRExtendedInfo +1. OperationStatusesClient +1. OperationsClient +1. PreBackupValidation +1. PreValidateEnableBackupRequest +1. PreValidateEnableBackupResponse +1. ProtectableContainer +1. ProtectableContainerResource +1. ProtectableContainerResourceList +1. ProtectableContainerResourceListIterator +1. ProtectableContainerResourceListPage +1. ProtectableContainersClient +1. ProtectableItemsClient +1. ProtectedItemOperationStatusesClient +1. ProtectionContainer +1. ProtectionContainerOperationResultsClient +1. ProtectionContainerRefreshOperationResultsClient +1. ProtectionContainerResource +1. ProtectionContainerResourceList +1. ProtectionContainerResourceListIterator +1. ProtectionContainerResourceListPage +1. ProtectionContainersClient +1. ProtectionContainersGroupClient +1. ProtectionIntent +1. ProtectionIntentClient +1. ProtectionIntentGroupClient +1. ProtectionIntentQueryObject +1. ProtectionIntentResource +1. ProtectionIntentResourceList +1. ProtectionIntentResourceListIterator +1. ProtectionIntentResourceListPage +1. ProtectionPolicyOperationStatusesClient +1. Request +1. RequestResource +1. ResourceConfig +1. ResourceConfigResource +1. ResourceStorageConfigsClient +1. SecurityPINsClient +1. StatusClient +1. StatusRequest +1. StatusResponse +1. TokenInformation +1. UsageSummariesClient +1. WorkloadInquiryDetails +1. WorkloadItem +1. WorkloadItemResource +1. WorkloadItemResourceList +1. WorkloadItemResourceListIterator +1. WorkloadItemResourceListPage +1. WorkloadItemsClient +1. WorkloadProtectableItem +1. WorkloadProtectableItemResource +1. WorkloadProtectableItemResourceList +1. WorkloadProtectableItemResourceListIterator +1. WorkloadProtectableItemResourceListPage + +### Signature Changes + +#### Const Types + +1. Invalid changed type from AzureFileShareType to CopyOptions + +## Additive Changes + +### New Constants + +1. CopyOptions.CreateCopy +1. CopyOptions.FailOnConflict +1. CopyOptions.Overwrite +1. CopyOptions.Skip diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/_meta.json b/services/recoveryservices/mgmt/2019-05-13/backup/_meta.json index 52709a09812e..73c5b5350708 100644 --- a/services/recoveryservices/mgmt/2019-05-13/backup/_meta.json +++ b/services/recoveryservices/mgmt/2019-05-13/backup/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "4742065e8d48160292fbce6790710c6835f8dc4f", "readme": "/_/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/readme.md", "tag": "package-2019-05", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/backupapi/interfaces.go b/services/recoveryservices/mgmt/2019-05-13/backup/backupapi/interfaces.go index fdf0e13e7d13..30f2e32bc0a5 100644 --- a/services/recoveryservices/mgmt/2019-05-13/backup/backupapi/interfaces.go +++ b/services/recoveryservices/mgmt/2019-05-13/backup/backupapi/interfaces.go @@ -63,7 +63,6 @@ var _ PoliciesClientAPI = (*backup.PoliciesClient)(nil) // ProtectionPoliciesClientAPI contains the set of methods on the ProtectionPoliciesClient type. type ProtectionPoliciesClientAPI interface { CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, policyName string, parameters backup.ProtectionPolicyResource) (result backup.ProtectionPolicyResource, err error) - Delete(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (result autorest.Response, err error) Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (result backup.ProtectionPolicyResource, err error) } @@ -133,175 +132,3 @@ type OperationClientAPI interface { } var _ OperationClientAPI = (*backup.OperationClient)(nil) - -// ProtectionIntentClientAPI contains the set of methods on the ProtectionIntentClient type. -type ProtectionIntentClientAPI interface { - CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string, parameters backup.ProtectionIntentResource) (result backup.ProtectionIntentResource, err error) - Delete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string) (result autorest.Response, err error) - Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string) (result backup.ProtectionIntentResource, err error) - Validate(ctx context.Context, azureRegion string, parameters backup.PreValidateEnableBackupRequest) (result backup.PreValidateEnableBackupResponse, err error) -} - -var _ ProtectionIntentClientAPI = (*backup.ProtectionIntentClient)(nil) - -// StatusClientAPI contains the set of methods on the StatusClient type. -type StatusClientAPI interface { - Get(ctx context.Context, azureRegion string, parameters backup.StatusRequest) (result backup.StatusResponse, err error) -} - -var _ StatusClientAPI = (*backup.StatusClient)(nil) - -// FeatureSupportClientAPI contains the set of methods on the FeatureSupportClient type. -type FeatureSupportClientAPI interface { - Validate(ctx context.Context, azureRegion string, parameters backup.BasicFeatureSupportRequest) (result backup.AzureVMResourceFeatureSupportResponse, err error) -} - -var _ FeatureSupportClientAPI = (*backup.FeatureSupportClient)(nil) - -// ProtectionIntentGroupClientAPI contains the set of methods on the ProtectionIntentGroupClient type. -type ProtectionIntentGroupClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ProtectionIntentResourceListPage, err error) - ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ProtectionIntentResourceListIterator, err error) -} - -var _ ProtectionIntentGroupClientAPI = (*backup.ProtectionIntentGroupClient)(nil) - -// UsageSummariesClientAPI contains the set of methods on the UsageSummariesClient type. -type UsageSummariesClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ManagementUsageList, err error) -} - -var _ UsageSummariesClientAPI = (*backup.UsageSummariesClient)(nil) - -// EnginesClientAPI contains the set of methods on the EnginesClient type. -type EnginesClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, backupEngineName string, filter string, skipToken string) (result backup.EngineBaseResource, err error) - List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.EngineBaseResourceListPage, err error) - ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.EngineBaseResourceListIterator, err error) -} - -var _ EnginesClientAPI = (*backup.EnginesClient)(nil) - -// ProtectionContainerRefreshOperationResultsClientAPI contains the set of methods on the ProtectionContainerRefreshOperationResultsClient type. -type ProtectionContainerRefreshOperationResultsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, operationID string) (result autorest.Response, err error) -} - -var _ ProtectionContainerRefreshOperationResultsClientAPI = (*backup.ProtectionContainerRefreshOperationResultsClient)(nil) - -// ProtectableContainersClientAPI contains the set of methods on the ProtectableContainersClient type. -type ProtectableContainersClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, filter string) (result backup.ProtectableContainerResourceListPage, err error) - ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, filter string) (result backup.ProtectableContainerResourceListIterator, err error) -} - -var _ ProtectableContainersClientAPI = (*backup.ProtectableContainersClient)(nil) - -// ProtectionContainersClientAPI contains the set of methods on the ProtectionContainersClient type. -type ProtectionContainersClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string) (result backup.ProtectionContainerResource, err error) - Inquire(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, filter string) (result autorest.Response, err error) - Refresh(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, filter string) (result autorest.Response, err error) - Register(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, parameters backup.ProtectionContainerResource) (result backup.ProtectionContainerResource, err error) - Unregister(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string) (result autorest.Response, err error) -} - -var _ ProtectionContainersClientAPI = (*backup.ProtectionContainersClient)(nil) - -// WorkloadItemsClientAPI contains the set of methods on the WorkloadItemsClient type. -type WorkloadItemsClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, filter string, skipToken string) (result backup.WorkloadItemResourceListPage, err error) - ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, filter string, skipToken string) (result backup.WorkloadItemResourceListIterator, err error) -} - -var _ WorkloadItemsClientAPI = (*backup.WorkloadItemsClient)(nil) - -// ProtectionContainerOperationResultsClientAPI contains the set of methods on the ProtectionContainerOperationResultsClient type. -type ProtectionContainerOperationResultsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, operationID string) (result backup.ProtectionContainerResource, err error) -} - -var _ ProtectionContainerOperationResultsClientAPI = (*backup.ProtectionContainerOperationResultsClient)(nil) - -// BackupsClientAPI contains the set of methods on the BackupsClient type. -type BackupsClientAPI interface { - Trigger(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters backup.RequestResource) (result autorest.Response, err error) -} - -var _ BackupsClientAPI = (*backup.BackupsClient)(nil) - -// ProtectedItemOperationStatusesClientAPI contains the set of methods on the ProtectedItemOperationStatusesClient type. -type ProtectedItemOperationStatusesClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, operationID string) (result backup.OperationStatus, err error) -} - -var _ ProtectedItemOperationStatusesClientAPI = (*backup.ProtectedItemOperationStatusesClient)(nil) - -// ItemLevelRecoveryConnectionsClientAPI contains the set of methods on the ItemLevelRecoveryConnectionsClient type. -type ItemLevelRecoveryConnectionsClientAPI interface { - Provision(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters backup.ILRRequestResource) (result autorest.Response, err error) - Revoke(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string) (result autorest.Response, err error) -} - -var _ ItemLevelRecoveryConnectionsClientAPI = (*backup.ItemLevelRecoveryConnectionsClient)(nil) - -// OperationResultsClientAPI contains the set of methods on the OperationResultsClient type. -type OperationResultsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result autorest.Response, err error) -} - -var _ OperationResultsClientAPI = (*backup.OperationResultsClient)(nil) - -// OperationStatusesClientAPI contains the set of methods on the OperationStatusesClient type. -type OperationStatusesClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result backup.OperationStatus, err error) -} - -var _ OperationStatusesClientAPI = (*backup.OperationStatusesClient)(nil) - -// ProtectionPolicyOperationStatusesClientAPI contains the set of methods on the ProtectionPolicyOperationStatusesClient type. -type ProtectionPolicyOperationStatusesClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string) (result backup.OperationStatus, err error) -} - -var _ ProtectionPolicyOperationStatusesClientAPI = (*backup.ProtectionPolicyOperationStatusesClient)(nil) - -// ProtectableItemsClientAPI contains the set of methods on the ProtectableItemsClient type. -type ProtectableItemsClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.WorkloadProtectableItemResourceListPage, err error) - ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.WorkloadProtectableItemResourceListIterator, err error) -} - -var _ ProtectableItemsClientAPI = (*backup.ProtectableItemsClient)(nil) - -// ProtectionContainersGroupClientAPI contains the set of methods on the ProtectionContainersGroupClient type. -type ProtectionContainersGroupClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result backup.ProtectionContainerResourceListPage, err error) - ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result backup.ProtectionContainerResourceListIterator, err error) -} - -var _ ProtectionContainersGroupClientAPI = (*backup.ProtectionContainersGroupClient)(nil) - -// SecurityPINsClientAPI contains the set of methods on the SecurityPINsClient type. -type SecurityPINsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string) (result backup.TokenInformation, err error) -} - -var _ SecurityPINsClientAPI = (*backup.SecurityPINsClient)(nil) - -// ResourceStorageConfigsClientAPI contains the set of methods on the ResourceStorageConfigsClient type. -type ResourceStorageConfigsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string) (result backup.ResourceConfigResource, err error) - Patch(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.ResourceConfigResource) (result autorest.Response, err error) - Update(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.ResourceConfigResource) (result backup.ResourceConfigResource, err error) -} - -var _ ResourceStorageConfigsClientAPI = (*backup.ResourceStorageConfigsClient)(nil) - -// OperationsClientAPI contains the set of methods on the OperationsClient type. -type OperationsClientAPI interface { - List(ctx context.Context) (result backup.ClientDiscoveryResponsePage, err error) - ListComplete(ctx context.Context) (result backup.ClientDiscoveryResponseIterator, err error) -} - -var _ OperationsClientAPI = (*backup.OperationsClient)(nil) diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/client.go b/services/recoveryservices/mgmt/2019-05-13/backup/client.go index da72c8e24482..115ba1c86ff1 100644 --- a/services/recoveryservices/mgmt/2019-05-13/backup/client.go +++ b/services/recoveryservices/mgmt/2019-05-13/backup/client.go @@ -1,4 +1,4 @@ -// Package backup implements the Azure ARM Backup service API version . +// Package backup implements the Azure ARM Backup service API version 2019-05-13. // // Open API 2.0 Specs for Azure RecoveryServices Backup service package backup diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/enums.go b/services/recoveryservices/mgmt/2019-05-13/backup/enums.go index 47abed4fdb86..bef7c3f7e156 100644 --- a/services/recoveryservices/mgmt/2019-05-13/backup/enums.go +++ b/services/recoveryservices/mgmt/2019-05-13/backup/enums.go @@ -6,120 +6,25 @@ package backup // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// AzureFileShareType enumerates the values for azure file share type. -type AzureFileShareType string - -const ( - // Invalid ... - Invalid AzureFileShareType = "Invalid" - // XSMB ... - XSMB AzureFileShareType = "XSMB" - // XSync ... - XSync AzureFileShareType = "XSync" -) - -// PossibleAzureFileShareTypeValues returns an array of possible values for the AzureFileShareType const type. -func PossibleAzureFileShareTypeValues() []AzureFileShareType { - return []AzureFileShareType{Invalid, XSMB, XSync} -} - -// ContainerType enumerates the values for container type. -type ContainerType string - -const ( - // ContainerTypeAzureBackupServerContainer ... - ContainerTypeAzureBackupServerContainer ContainerType = "AzureBackupServerContainer" - // ContainerTypeAzureSQLContainer ... - ContainerTypeAzureSQLContainer ContainerType = "AzureSqlContainer" - // ContainerTypeCluster ... - ContainerTypeCluster ContainerType = "Cluster" - // ContainerTypeDPMContainer ... - ContainerTypeDPMContainer ContainerType = "DPMContainer" - // ContainerTypeGenericContainer ... - ContainerTypeGenericContainer ContainerType = "GenericContainer" - // ContainerTypeIaasVMContainer ... - ContainerTypeIaasVMContainer ContainerType = "IaasVMContainer" - // ContainerTypeIaasVMServiceContainer ... - ContainerTypeIaasVMServiceContainer ContainerType = "IaasVMServiceContainer" - // ContainerTypeInvalid ... - ContainerTypeInvalid ContainerType = "Invalid" - // ContainerTypeMABContainer ... - ContainerTypeMABContainer ContainerType = "MABContainer" - // ContainerTypeSQLAGWorkLoadContainer ... - ContainerTypeSQLAGWorkLoadContainer ContainerType = "SQLAGWorkLoadContainer" - // ContainerTypeStorageContainer ... - ContainerTypeStorageContainer ContainerType = "StorageContainer" - // ContainerTypeUnknown ... - ContainerTypeUnknown ContainerType = "Unknown" - // ContainerTypeVCenter ... - ContainerTypeVCenter ContainerType = "VCenter" - // ContainerTypeVMAppContainer ... - ContainerTypeVMAppContainer ContainerType = "VMAppContainer" - // ContainerTypeWindows ... - ContainerTypeWindows ContainerType = "Windows" -) - -// PossibleContainerTypeValues returns an array of possible values for the ContainerType const type. -func PossibleContainerTypeValues() []ContainerType { - return []ContainerType{ContainerTypeAzureBackupServerContainer, ContainerTypeAzureSQLContainer, ContainerTypeCluster, ContainerTypeDPMContainer, ContainerTypeGenericContainer, ContainerTypeIaasVMContainer, ContainerTypeIaasVMServiceContainer, ContainerTypeInvalid, ContainerTypeMABContainer, ContainerTypeSQLAGWorkLoadContainer, ContainerTypeStorageContainer, ContainerTypeUnknown, ContainerTypeVCenter, ContainerTypeVMAppContainer, ContainerTypeWindows} -} - -// ContainerTypeBasicProtectionContainer enumerates the values for container type basic protection container. -type ContainerTypeBasicProtectionContainer string - -const ( - // ContainerTypeAzureBackupServerContainer1 ... - ContainerTypeAzureBackupServerContainer1 ContainerTypeBasicProtectionContainer = "AzureBackupServerContainer" - // ContainerTypeAzureSQLContainer1 ... - ContainerTypeAzureSQLContainer1 ContainerTypeBasicProtectionContainer = "AzureSqlContainer" - // ContainerTypeAzureWorkloadContainer ... - ContainerTypeAzureWorkloadContainer ContainerTypeBasicProtectionContainer = "AzureWorkloadContainer" - // ContainerTypeDPMContainer1 ... - ContainerTypeDPMContainer1 ContainerTypeBasicProtectionContainer = "DPMContainer" - // ContainerTypeGenericContainer1 ... - ContainerTypeGenericContainer1 ContainerTypeBasicProtectionContainer = "GenericContainer" - // ContainerTypeIaaSVMContainer ... - ContainerTypeIaaSVMContainer ContainerTypeBasicProtectionContainer = "IaaSVMContainer" - // ContainerTypeMicrosoftClassicComputevirtualMachines ... - ContainerTypeMicrosoftClassicComputevirtualMachines ContainerTypeBasicProtectionContainer = "Microsoft.ClassicCompute/virtualMachines" - // ContainerTypeMicrosoftComputevirtualMachines ... - ContainerTypeMicrosoftComputevirtualMachines ContainerTypeBasicProtectionContainer = "Microsoft.Compute/virtualMachines" - // ContainerTypeProtectionContainer ... - ContainerTypeProtectionContainer ContainerTypeBasicProtectionContainer = "ProtectionContainer" - // ContainerTypeSQLAGWorkLoadContainer1 ... - ContainerTypeSQLAGWorkLoadContainer1 ContainerTypeBasicProtectionContainer = "SQLAGWorkLoadContainer" - // ContainerTypeStorageContainer1 ... - ContainerTypeStorageContainer1 ContainerTypeBasicProtectionContainer = "StorageContainer" - // ContainerTypeVMAppContainer1 ... - ContainerTypeVMAppContainer1 ContainerTypeBasicProtectionContainer = "VMAppContainer" - // ContainerTypeWindows1 ... - ContainerTypeWindows1 ContainerTypeBasicProtectionContainer = "Windows" -) - -// PossibleContainerTypeBasicProtectionContainerValues returns an array of possible values for the ContainerTypeBasicProtectionContainer const type. -func PossibleContainerTypeBasicProtectionContainerValues() []ContainerTypeBasicProtectionContainer { - return []ContainerTypeBasicProtectionContainer{ContainerTypeAzureBackupServerContainer1, ContainerTypeAzureSQLContainer1, ContainerTypeAzureWorkloadContainer, ContainerTypeDPMContainer1, ContainerTypeGenericContainer1, ContainerTypeIaaSVMContainer, ContainerTypeMicrosoftClassicComputevirtualMachines, ContainerTypeMicrosoftComputevirtualMachines, ContainerTypeProtectionContainer, ContainerTypeSQLAGWorkLoadContainer1, ContainerTypeStorageContainer1, ContainerTypeVMAppContainer1, ContainerTypeWindows1} -} - // CopyOptions enumerates the values for copy options. type CopyOptions string const ( - // CopyOptionsCreateCopy ... - CopyOptionsCreateCopy CopyOptions = "CreateCopy" - // CopyOptionsFailOnConflict ... - CopyOptionsFailOnConflict CopyOptions = "FailOnConflict" - // CopyOptionsInvalid ... - CopyOptionsInvalid CopyOptions = "Invalid" - // CopyOptionsOverwrite ... - CopyOptionsOverwrite CopyOptions = "Overwrite" - // CopyOptionsSkip ... - CopyOptionsSkip CopyOptions = "Skip" + // CreateCopy ... + CreateCopy CopyOptions = "CreateCopy" + // FailOnConflict ... + FailOnConflict CopyOptions = "FailOnConflict" + // Invalid ... + Invalid CopyOptions = "Invalid" + // Overwrite ... + Overwrite CopyOptions = "Overwrite" + // Skip ... + Skip CopyOptions = "Skip" ) // PossibleCopyOptionsValues returns an array of possible values for the CopyOptions const type. func PossibleCopyOptionsValues() []CopyOptions { - return []CopyOptions{CopyOptionsCreateCopy, CopyOptionsFailOnConflict, CopyOptionsInvalid, CopyOptionsOverwrite, CopyOptionsSkip} + return []CopyOptions{CreateCopy, FailOnConflict, Invalid, Overwrite, Skip} } // CreateMode enumerates the values for create mode. @@ -205,23 +110,6 @@ func PossibleDayOfWeekValues() []DayOfWeek { return []DayOfWeek{Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday} } -// EngineType enumerates the values for engine type. -type EngineType string - -const ( - // BackupEngineTypeAzureBackupServerEngine ... - BackupEngineTypeAzureBackupServerEngine EngineType = "AzureBackupServerEngine" - // BackupEngineTypeBackupEngineBase ... - BackupEngineTypeBackupEngineBase EngineType = "BackupEngineBase" - // BackupEngineTypeDpmBackupEngine ... - BackupEngineTypeDpmBackupEngine EngineType = "DpmBackupEngine" -) - -// PossibleEngineTypeValues returns an array of possible values for the EngineType const type. -func PossibleEngineTypeValues() []EngineType { - return []EngineType{BackupEngineTypeAzureBackupServerEngine, BackupEngineTypeBackupEngineBase, BackupEngineTypeDpmBackupEngine} -} - // EnhancedSecurityState enumerates the values for enhanced security state. type EnhancedSecurityState string @@ -239,38 +127,6 @@ func PossibleEnhancedSecurityStateValues() []EnhancedSecurityState { return []EnhancedSecurityState{EnhancedSecurityStateDisabled, EnhancedSecurityStateEnabled, EnhancedSecurityStateInvalid} } -// FabricName enumerates the values for fabric name. -type FabricName string - -const ( - // FabricNameAzure ... - FabricNameAzure FabricName = "Azure" - // FabricNameInvalid ... - FabricNameInvalid FabricName = "Invalid" -) - -// PossibleFabricNameValues returns an array of possible values for the FabricName const type. -func PossibleFabricNameValues() []FabricName { - return []FabricName{FabricNameAzure, FabricNameInvalid} -} - -// FeatureType enumerates the values for feature type. -type FeatureType string - -const ( - // FeatureTypeAzureBackupGoals ... - FeatureTypeAzureBackupGoals FeatureType = "AzureBackupGoals" - // FeatureTypeAzureVMResourceBackup ... - FeatureTypeAzureVMResourceBackup FeatureType = "AzureVMResourceBackup" - // FeatureTypeFeatureSupportRequest ... - FeatureTypeFeatureSupportRequest FeatureType = "FeatureSupportRequest" -) - -// PossibleFeatureTypeValues returns an array of possible values for the FeatureType const type. -func PossibleFeatureTypeValues() []FeatureType { - return []FeatureType{FeatureTypeAzureBackupGoals, FeatureTypeAzureVMResourceBackup, FeatureTypeFeatureSupportRequest} -} - // HealthState enumerates the values for health state. type HealthState string @@ -414,81 +270,6 @@ func PossibleHTTPStatusCodeValues() []HTTPStatusCode { 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} } -// InquiryStatus enumerates the values for inquiry status. -type InquiryStatus string - -const ( - // InquiryStatusFailed ... - InquiryStatusFailed InquiryStatus = "Failed" - // InquiryStatusInvalid ... - InquiryStatusInvalid InquiryStatus = "Invalid" - // InquiryStatusSuccess ... - InquiryStatusSuccess InquiryStatus = "Success" -) - -// PossibleInquiryStatusValues returns an array of possible values for the InquiryStatus const type. -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 - -const ( - // ItemTypeAzureFileShare ... - ItemTypeAzureFileShare ItemType = "AzureFileShare" - // ItemTypeAzureSQLDb ... - ItemTypeAzureSQLDb ItemType = "AzureSqlDb" - // ItemTypeClient ... - ItemTypeClient ItemType = "Client" - // ItemTypeExchange ... - ItemTypeExchange ItemType = "Exchange" - // ItemTypeFileFolder ... - ItemTypeFileFolder ItemType = "FileFolder" - // ItemTypeGenericDataSource ... - ItemTypeGenericDataSource ItemType = "GenericDataSource" - // ItemTypeInvalid ... - ItemTypeInvalid ItemType = "Invalid" - // ItemTypeSAPAseDatabase ... - ItemTypeSAPAseDatabase ItemType = "SAPAseDatabase" - // ItemTypeSAPHanaDatabase ... - ItemTypeSAPHanaDatabase ItemType = "SAPHanaDatabase" - // ItemTypeSharepoint ... - ItemTypeSharepoint ItemType = "Sharepoint" - // ItemTypeSQLDataBase ... - ItemTypeSQLDataBase ItemType = "SQLDataBase" - // ItemTypeSQLDB ... - ItemTypeSQLDB ItemType = "SQLDB" - // ItemTypeSystemState ... - ItemTypeSystemState ItemType = "SystemState" - // ItemTypeVM ... - ItemTypeVM ItemType = "VM" - // ItemTypeVMwareVM ... - ItemTypeVMwareVM ItemType = "VMwareVM" -) - -// PossibleItemTypeValues returns an array of possible values for the ItemType const type. -func PossibleItemTypeValues() []ItemType { - return []ItemType{ItemTypeAzureFileShare, ItemTypeAzureSQLDb, ItemTypeClient, ItemTypeExchange, ItemTypeFileFolder, ItemTypeGenericDataSource, ItemTypeInvalid, ItemTypeSAPAseDatabase, ItemTypeSAPHanaDatabase, ItemTypeSharepoint, ItemTypeSQLDataBase, ItemTypeSQLDB, ItemTypeSystemState, ItemTypeVM, ItemTypeVMwareVM} -} - // JobOperationType enumerates the values for job operation type. type JobOperationType string @@ -753,43 +534,6 @@ func PossibleObjectTypeValues() []ObjectType { return []ObjectType{ObjectTypeExportJobsOperationResultInfo, ObjectTypeOperationResultInfo, ObjectTypeOperationResultInfoBase} } -// ObjectTypeBasicILRRequest enumerates the values for object type basic ilr request. -type ObjectTypeBasicILRRequest string - -const ( - // ObjectTypeAzureFileShareProvisionILRRequest ... - ObjectTypeAzureFileShareProvisionILRRequest ObjectTypeBasicILRRequest = "AzureFileShareProvisionILRRequest" - // ObjectTypeIaasVMILRRegistrationRequest ... - ObjectTypeIaasVMILRRegistrationRequest ObjectTypeBasicILRRequest = "IaasVMILRRegistrationRequest" - // ObjectTypeILRRequest ... - ObjectTypeILRRequest ObjectTypeBasicILRRequest = "ILRRequest" -) - -// PossibleObjectTypeBasicILRRequestValues returns an array of possible values for the ObjectTypeBasicILRRequest const type. -func PossibleObjectTypeBasicILRRequestValues() []ObjectTypeBasicILRRequest { - return []ObjectTypeBasicILRRequest{ObjectTypeAzureFileShareProvisionILRRequest, ObjectTypeIaasVMILRRegistrationRequest, ObjectTypeILRRequest} -} - -// ObjectTypeBasicOperationStatusExtendedInfo enumerates the values for object type basic operation status -// extended info. -type ObjectTypeBasicOperationStatusExtendedInfo string - -const ( - // ObjectTypeOperationStatusExtendedInfo ... - ObjectTypeOperationStatusExtendedInfo ObjectTypeBasicOperationStatusExtendedInfo = "OperationStatusExtendedInfo" - // ObjectTypeOperationStatusJobExtendedInfo ... - ObjectTypeOperationStatusJobExtendedInfo ObjectTypeBasicOperationStatusExtendedInfo = "OperationStatusJobExtendedInfo" - // ObjectTypeOperationStatusJobsExtendedInfo ... - ObjectTypeOperationStatusJobsExtendedInfo ObjectTypeBasicOperationStatusExtendedInfo = "OperationStatusJobsExtendedInfo" - // ObjectTypeOperationStatusProvisionILRExtendedInfo ... - ObjectTypeOperationStatusProvisionILRExtendedInfo ObjectTypeBasicOperationStatusExtendedInfo = "OperationStatusProvisionILRExtendedInfo" -) - -// PossibleObjectTypeBasicOperationStatusExtendedInfoValues returns an array of possible values for the ObjectTypeBasicOperationStatusExtendedInfo const type. -func PossibleObjectTypeBasicOperationStatusExtendedInfoValues() []ObjectTypeBasicOperationStatusExtendedInfo { - return []ObjectTypeBasicOperationStatusExtendedInfo{ObjectTypeOperationStatusExtendedInfo, ObjectTypeOperationStatusJobExtendedInfo, ObjectTypeOperationStatusJobsExtendedInfo, ObjectTypeOperationStatusProvisionILRExtendedInfo} -} - // ObjectTypeBasicRecoveryPoint enumerates the values for object type basic recovery point. type ObjectTypeBasicRecoveryPoint string @@ -821,25 +565,6 @@ func PossibleObjectTypeBasicRecoveryPointValues() []ObjectTypeBasicRecoveryPoint return []ObjectTypeBasicRecoveryPoint{ObjectTypeAzureFileShareRecoveryPoint, ObjectTypeAzureWorkloadPointInTimeRecoveryPoint, ObjectTypeAzureWorkloadRecoveryPoint, ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint, ObjectTypeAzureWorkloadSAPHanaRecoveryPoint, ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint, ObjectTypeAzureWorkloadSQLRecoveryPoint, ObjectTypeGenericRecoveryPoint, ObjectTypeIaasVMRecoveryPoint, ObjectTypeRecoveryPoint} } -// ObjectTypeBasicRequest enumerates the values for object type basic request. -type ObjectTypeBasicRequest string - -const ( - // ObjectTypeAzureFileShareBackupRequest ... - ObjectTypeAzureFileShareBackupRequest ObjectTypeBasicRequest = "AzureFileShareBackupRequest" - // ObjectTypeAzureWorkloadBackupRequest ... - ObjectTypeAzureWorkloadBackupRequest ObjectTypeBasicRequest = "AzureWorkloadBackupRequest" - // ObjectTypeBackupRequest ... - ObjectTypeBackupRequest ObjectTypeBasicRequest = "BackupRequest" - // ObjectTypeIaasVMBackupRequest ... - ObjectTypeIaasVMBackupRequest ObjectTypeBasicRequest = "IaasVMBackupRequest" -) - -// PossibleObjectTypeBasicRequestValues returns an array of possible values for the ObjectTypeBasicRequest const type. -func PossibleObjectTypeBasicRequestValues() []ObjectTypeBasicRequest { - return []ObjectTypeBasicRequest{ObjectTypeAzureFileShareBackupRequest, ObjectTypeAzureWorkloadBackupRequest, ObjectTypeBackupRequest, ObjectTypeIaasVMBackupRequest} -} - // ObjectTypeBasicRestoreRequest enumerates the values for object type basic restore request. type ObjectTypeBasicRestoreRequest string @@ -887,44 +612,6 @@ func PossibleObjectTypeBasicValidateOperationRequestValues() []ObjectTypeBasicVa return []ObjectTypeBasicValidateOperationRequest{ObjectTypeValidateIaasVMRestoreOperationRequest, ObjectTypeValidateOperationRequest, ObjectTypeValidateRestoreOperationRequest} } -// OperationStatusValues enumerates the values for operation status values. -type OperationStatusValues string - -const ( - // OperationStatusValuesCanceled ... - OperationStatusValuesCanceled OperationStatusValues = "Canceled" - // OperationStatusValuesFailed ... - OperationStatusValuesFailed OperationStatusValues = "Failed" - // OperationStatusValuesInProgress ... - OperationStatusValuesInProgress OperationStatusValues = "InProgress" - // OperationStatusValuesInvalid ... - OperationStatusValuesInvalid OperationStatusValues = "Invalid" - // OperationStatusValuesSucceeded ... - OperationStatusValuesSucceeded OperationStatusValues = "Succeeded" -) - -// PossibleOperationStatusValuesValues returns an array of possible values for the OperationStatusValues const type. -func PossibleOperationStatusValuesValues() []OperationStatusValues { - return []OperationStatusValues{OperationStatusValuesCanceled, OperationStatusValuesFailed, OperationStatusValuesInProgress, OperationStatusValuesInvalid, OperationStatusValuesSucceeded} -} - -// OperationType enumerates the values for operation type. -type OperationType string - -const ( - // OperationTypeInvalid ... - OperationTypeInvalid OperationType = "Invalid" - // OperationTypeRegister ... - OperationTypeRegister OperationType = "Register" - // OperationTypeReregister ... - OperationTypeReregister OperationType = "Reregister" -) - -// PossibleOperationTypeValues returns an array of possible values for the OperationType const type. -func PossibleOperationTypeValues() []OperationType { - return []OperationType{OperationTypeInvalid, OperationTypeRegister, OperationTypeReregister} -} - // OverwriteOptions enumerates the values for overwrite options. type OverwriteOptions string @@ -963,58 +650,6 @@ func PossiblePolicyTypeValues() []PolicyType { return []PolicyType{PolicyTypeCopyOnlyFull, PolicyTypeDifferential, PolicyTypeFull, PolicyTypeInvalid, PolicyTypeLog} } -// ProtectableContainerType enumerates the values for protectable container type. -type ProtectableContainerType string - -const ( - // ProtectableContainerTypeProtectableContainer ... - ProtectableContainerTypeProtectableContainer ProtectableContainerType = "ProtectableContainer" - // ProtectableContainerTypeStorageContainer ... - ProtectableContainerTypeStorageContainer ProtectableContainerType = "StorageContainer" - // ProtectableContainerTypeVMAppContainer ... - ProtectableContainerTypeVMAppContainer ProtectableContainerType = "VMAppContainer" -) - -// PossibleProtectableContainerTypeValues returns an array of possible values for the ProtectableContainerType const type. -func PossibleProtectableContainerTypeValues() []ProtectableContainerType { - return []ProtectableContainerType{ProtectableContainerTypeProtectableContainer, ProtectableContainerTypeStorageContainer, ProtectableContainerTypeVMAppContainer} -} - -// ProtectableItemType enumerates the values for protectable item type. -type ProtectableItemType string - -const ( - // ProtectableItemTypeAzureFileShare ... - ProtectableItemTypeAzureFileShare ProtectableItemType = "AzureFileShare" - // ProtectableItemTypeAzureVMWorkloadProtectableItem ... - ProtectableItemTypeAzureVMWorkloadProtectableItem ProtectableItemType = "AzureVmWorkloadProtectableItem" - // ProtectableItemTypeIaaSVMProtectableItem ... - ProtectableItemTypeIaaSVMProtectableItem ProtectableItemType = "IaaSVMProtectableItem" - // ProtectableItemTypeMicrosoftClassicComputevirtualMachines ... - ProtectableItemTypeMicrosoftClassicComputevirtualMachines ProtectableItemType = "Microsoft.ClassicCompute/virtualMachines" - // ProtectableItemTypeMicrosoftComputevirtualMachines ... - ProtectableItemTypeMicrosoftComputevirtualMachines ProtectableItemType = "Microsoft.Compute/virtualMachines" - // ProtectableItemTypeSAPAseSystem ... - ProtectableItemTypeSAPAseSystem ProtectableItemType = "SAPAseSystem" - // ProtectableItemTypeSAPHanaDatabase ... - ProtectableItemTypeSAPHanaDatabase ProtectableItemType = "SAPHanaDatabase" - // ProtectableItemTypeSAPHanaSystem ... - ProtectableItemTypeSAPHanaSystem ProtectableItemType = "SAPHanaSystem" - // ProtectableItemTypeSQLAvailabilityGroupContainer ... - ProtectableItemTypeSQLAvailabilityGroupContainer ProtectableItemType = "SQLAvailabilityGroupContainer" - // ProtectableItemTypeSQLDataBase ... - ProtectableItemTypeSQLDataBase ProtectableItemType = "SQLDataBase" - // ProtectableItemTypeSQLInstance ... - ProtectableItemTypeSQLInstance ProtectableItemType = "SQLInstance" - // ProtectableItemTypeWorkloadProtectableItem ... - ProtectableItemTypeWorkloadProtectableItem ProtectableItemType = "WorkloadProtectableItem" -) - -// PossibleProtectableItemTypeValues returns an array of possible values for the ProtectableItemType const type. -func PossibleProtectableItemTypeValues() []ProtectableItemType { - return []ProtectableItemType{ProtectableItemTypeAzureFileShare, ProtectableItemTypeAzureVMWorkloadProtectableItem, ProtectableItemTypeIaaSVMProtectableItem, ProtectableItemTypeMicrosoftClassicComputevirtualMachines, ProtectableItemTypeMicrosoftComputevirtualMachines, ProtectableItemTypeSAPAseSystem, ProtectableItemTypeSAPHanaDatabase, ProtectableItemTypeSAPHanaSystem, ProtectableItemTypeSQLAvailabilityGroupContainer, ProtectableItemTypeSQLDataBase, ProtectableItemTypeSQLInstance, ProtectableItemTypeWorkloadProtectableItem} -} - // ProtectedItemHealthStatus enumerates the values for protected item health status. type ProtectedItemHealthStatus string @@ -1096,27 +731,6 @@ func PossibleProtectedItemTypeValues() []ProtectedItemType { return []ProtectedItemType{ProtectedItemTypeAzureFileShareProtectedItem, ProtectedItemTypeAzureIaaSVMProtectedItem, ProtectedItemTypeAzureVMWorkloadProtectedItem, ProtectedItemTypeAzureVMWorkloadSAPAseDatabase, ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase, ProtectedItemTypeAzureVMWorkloadSQLDatabase, ProtectedItemTypeDPMProtectedItem, ProtectedItemTypeGenericProtectedItem, ProtectedItemTypeMabFileFolderProtectedItem, ProtectedItemTypeMicrosoftClassicComputevirtualMachines, ProtectedItemTypeMicrosoftComputevirtualMachines, ProtectedItemTypeMicrosoftSqlserversdatabases, ProtectedItemTypeProtectedItem} } -// ProtectionIntentItemType enumerates the values for protection intent item type. -type ProtectionIntentItemType string - -const ( - // ProtectionIntentItemTypeAzureResourceItem ... - ProtectionIntentItemTypeAzureResourceItem ProtectionIntentItemType = "AzureResourceItem" - // ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent ... - ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent ProtectionIntentItemType = "AzureWorkloadAutoProtectionIntent" - // ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent ... - ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent ProtectionIntentItemType = "AzureWorkloadSQLAutoProtectionIntent" - // ProtectionIntentItemTypeProtectionIntent ... - ProtectionIntentItemTypeProtectionIntent ProtectionIntentItemType = "ProtectionIntent" - // ProtectionIntentItemTypeRecoveryServiceVaultItem ... - ProtectionIntentItemTypeRecoveryServiceVaultItem ProtectionIntentItemType = "RecoveryServiceVaultItem" -) - -// PossibleProtectionIntentItemTypeValues returns an array of possible values for the ProtectionIntentItemType const type. -func PossibleProtectionIntentItemTypeValues() []ProtectionIntentItemType { - return []ProtectionIntentItemType{ProtectionIntentItemTypeAzureResourceItem, ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent, ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent, ProtectionIntentItemTypeProtectionIntent, ProtectionIntentItemTypeRecoveryServiceVaultItem} -} - // ProtectionState enumerates the values for protection state. type ProtectionState string @@ -1140,27 +754,6 @@ func PossibleProtectionStateValues() []ProtectionState { return []ProtectionState{ProtectionStateInvalid, ProtectionStateIRPending, ProtectionStateProtected, ProtectionStateProtectionError, ProtectionStateProtectionPaused, ProtectionStateProtectionStopped} } -// ProtectionStatus enumerates the values for protection status. -type ProtectionStatus string - -const ( - // ProtectionStatusInvalid ... - ProtectionStatusInvalid ProtectionStatus = "Invalid" - // ProtectionStatusNotProtected ... - ProtectionStatusNotProtected ProtectionStatus = "NotProtected" - // ProtectionStatusProtected ... - ProtectionStatusProtected ProtectionStatus = "Protected" - // ProtectionStatusProtecting ... - ProtectionStatusProtecting ProtectionStatus = "Protecting" - // ProtectionStatusProtectionFailed ... - ProtectionStatusProtectionFailed ProtectionStatus = "ProtectionFailed" -) - -// PossibleProtectionStatusValues returns an array of possible values for the ProtectionStatus const type. -func PossibleProtectionStatusValues() []ProtectionStatus { - return []ProtectionStatus{ProtectionStatusInvalid, ProtectionStatusNotProtected, ProtectionStatusProtected, ProtectionStatusProtecting, ProtectionStatusProtectionFailed} -} - // RecoveryMode enumerates the values for recovery mode. type RecoveryMode string @@ -1453,105 +1046,6 @@ func PossibleStorageTypeStateValues() []StorageTypeState { return []StorageTypeState{StorageTypeStateInvalid, StorageTypeStateLocked, StorageTypeStateUnlocked} } -// SupportStatus enumerates the values for support status. -type SupportStatus string - -const ( - // SupportStatusDefaultOFF ... - SupportStatusDefaultOFF SupportStatus = "DefaultOFF" - // SupportStatusDefaultON ... - SupportStatusDefaultON SupportStatus = "DefaultON" - // SupportStatusInvalid ... - SupportStatusInvalid SupportStatus = "Invalid" - // SupportStatusNotSupported ... - SupportStatusNotSupported SupportStatus = "NotSupported" - // SupportStatusSupported ... - SupportStatusSupported SupportStatus = "Supported" -) - -// PossibleSupportStatusValues returns an array of possible values for the SupportStatus const type. -func PossibleSupportStatusValues() []SupportStatus { - return []SupportStatus{SupportStatusDefaultOFF, SupportStatusDefaultON, SupportStatusInvalid, SupportStatusNotSupported, SupportStatusSupported} -} - -// Type enumerates the values for type. -type Type string - -const ( - // TypeBackupProtectedItemCountSummary ... - TypeBackupProtectedItemCountSummary Type = "BackupProtectedItemCountSummary" - // TypeBackupProtectionContainerCountSummary ... - TypeBackupProtectionContainerCountSummary Type = "BackupProtectionContainerCountSummary" - // TypeInvalid ... - TypeInvalid Type = "Invalid" -) - -// PossibleTypeValues returns an array of possible values for the Type const type. -func PossibleTypeValues() []Type { - return []Type{TypeBackupProtectedItemCountSummary, TypeBackupProtectionContainerCountSummary, TypeInvalid} -} - -// TypeEnum enumerates the values for type enum. -type TypeEnum string - -const ( - // TypeEnumCopyOnlyFull ... - TypeEnumCopyOnlyFull TypeEnum = "CopyOnlyFull" - // TypeEnumDifferential ... - TypeEnumDifferential TypeEnum = "Differential" - // TypeEnumFull ... - TypeEnumFull TypeEnum = "Full" - // TypeEnumInvalid ... - TypeEnumInvalid TypeEnum = "Invalid" - // TypeEnumLog ... - TypeEnumLog TypeEnum = "Log" -) - -// PossibleTypeEnumValues returns an array of possible values for the TypeEnum const type. -func PossibleTypeEnumValues() []TypeEnum { - return []TypeEnum{TypeEnumCopyOnlyFull, TypeEnumDifferential, TypeEnumFull, TypeEnumInvalid, TypeEnumLog} -} - -// UsagesUnit enumerates the values for usages unit. -type UsagesUnit string - -const ( - // Bytes ... - Bytes UsagesUnit = "Bytes" - // BytesPerSecond ... - BytesPerSecond UsagesUnit = "BytesPerSecond" - // Count ... - Count UsagesUnit = "Count" - // CountPerSecond ... - CountPerSecond UsagesUnit = "CountPerSecond" - // Percent ... - Percent UsagesUnit = "Percent" - // Seconds ... - Seconds UsagesUnit = "Seconds" -) - -// PossibleUsagesUnitValues returns an array of possible values for the UsagesUnit const type. -func PossibleUsagesUnitValues() []UsagesUnit { - return []UsagesUnit{Bytes, BytesPerSecond, Count, CountPerSecond, Percent, Seconds} -} - -// ValidationStatus enumerates the values for validation status. -type ValidationStatus string - -const ( - // ValidationStatusFailed ... - ValidationStatusFailed ValidationStatus = "Failed" - // ValidationStatusInvalid ... - ValidationStatusInvalid ValidationStatus = "Invalid" - // ValidationStatusSucceeded ... - ValidationStatusSucceeded ValidationStatus = "Succeeded" -) - -// PossibleValidationStatusValues returns an array of possible values for the ValidationStatus const type. -func PossibleValidationStatusValues() []ValidationStatus { - return []ValidationStatus{ValidationStatusFailed, ValidationStatusInvalid, ValidationStatusSucceeded} -} - // WeekOfMonth enumerates the values for week of month. type WeekOfMonth string @@ -1575,58 +1069,6 @@ func PossibleWeekOfMonthValues() []WeekOfMonth { return []WeekOfMonth{WeekOfMonthFirst, WeekOfMonthFourth, WeekOfMonthInvalid, WeekOfMonthLast, WeekOfMonthSecond, WeekOfMonthThird} } -// WorkloadItemType enumerates the values for workload item type. -type WorkloadItemType string - -const ( - // WorkloadItemTypeInvalid ... - WorkloadItemTypeInvalid WorkloadItemType = "Invalid" - // WorkloadItemTypeSAPAseDatabase ... - WorkloadItemTypeSAPAseDatabase WorkloadItemType = "SAPAseDatabase" - // WorkloadItemTypeSAPAseSystem ... - WorkloadItemTypeSAPAseSystem WorkloadItemType = "SAPAseSystem" - // WorkloadItemTypeSAPHanaDatabase ... - WorkloadItemTypeSAPHanaDatabase WorkloadItemType = "SAPHanaDatabase" - // WorkloadItemTypeSAPHanaSystem ... - WorkloadItemTypeSAPHanaSystem WorkloadItemType = "SAPHanaSystem" - // WorkloadItemTypeSQLDataBase ... - WorkloadItemTypeSQLDataBase WorkloadItemType = "SQLDataBase" - // WorkloadItemTypeSQLInstance ... - WorkloadItemTypeSQLInstance WorkloadItemType = "SQLInstance" -) - -// PossibleWorkloadItemTypeValues returns an array of possible values for the WorkloadItemType const type. -func PossibleWorkloadItemTypeValues() []WorkloadItemType { - return []WorkloadItemType{WorkloadItemTypeInvalid, WorkloadItemTypeSAPAseDatabase, WorkloadItemTypeSAPAseSystem, WorkloadItemTypeSAPHanaDatabase, WorkloadItemTypeSAPHanaSystem, WorkloadItemTypeSQLDataBase, WorkloadItemTypeSQLInstance} -} - -// WorkloadItemTypeBasicWorkloadItem enumerates the values for workload item type basic workload item. -type WorkloadItemTypeBasicWorkloadItem string - -const ( - // WorkloadItemTypeAzureVMWorkloadItem ... - WorkloadItemTypeAzureVMWorkloadItem WorkloadItemTypeBasicWorkloadItem = "AzureVmWorkloadItem" - // WorkloadItemTypeSAPAseDatabase1 ... - WorkloadItemTypeSAPAseDatabase1 WorkloadItemTypeBasicWorkloadItem = "SAPAseDatabase" - // WorkloadItemTypeSAPAseSystem1 ... - WorkloadItemTypeSAPAseSystem1 WorkloadItemTypeBasicWorkloadItem = "SAPAseSystem" - // WorkloadItemTypeSAPHanaDatabase1 ... - WorkloadItemTypeSAPHanaDatabase1 WorkloadItemTypeBasicWorkloadItem = "SAPHanaDatabase" - // WorkloadItemTypeSAPHanaSystem1 ... - WorkloadItemTypeSAPHanaSystem1 WorkloadItemTypeBasicWorkloadItem = "SAPHanaSystem" - // WorkloadItemTypeSQLDataBase1 ... - WorkloadItemTypeSQLDataBase1 WorkloadItemTypeBasicWorkloadItem = "SQLDataBase" - // WorkloadItemTypeSQLInstance1 ... - WorkloadItemTypeSQLInstance1 WorkloadItemTypeBasicWorkloadItem = "SQLInstance" - // WorkloadItemTypeWorkloadItem ... - WorkloadItemTypeWorkloadItem WorkloadItemTypeBasicWorkloadItem = "WorkloadItem" -) - -// PossibleWorkloadItemTypeBasicWorkloadItemValues returns an array of possible values for the WorkloadItemTypeBasicWorkloadItem const type. -func PossibleWorkloadItemTypeBasicWorkloadItemValues() []WorkloadItemTypeBasicWorkloadItem { - return []WorkloadItemTypeBasicWorkloadItem{WorkloadItemTypeAzureVMWorkloadItem, WorkloadItemTypeSAPAseDatabase1, WorkloadItemTypeSAPAseSystem1, WorkloadItemTypeSAPHanaDatabase1, WorkloadItemTypeSAPHanaSystem1, WorkloadItemTypeSQLDataBase1, WorkloadItemTypeSQLInstance1, WorkloadItemTypeWorkloadItem} -} - // WorkloadType enumerates the values for workload type. type WorkloadType string diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/itemlevelrecoveryconnections.go b/services/recoveryservices/mgmt/2019-05-13/backup/itemlevelrecoveryconnections.go deleted file mode 100644 index 4e4704664221..000000000000 --- a/services/recoveryservices/mgmt/2019-05-13/backup/itemlevelrecoveryconnections.go +++ /dev/null @@ -1,208 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ItemLevelRecoveryConnectionsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type ItemLevelRecoveryConnectionsClient struct { - BaseClient -} - -// NewItemLevelRecoveryConnectionsClient creates an instance of the ItemLevelRecoveryConnectionsClient client. -func NewItemLevelRecoveryConnectionsClient(subscriptionID string) ItemLevelRecoveryConnectionsClient { - return NewItemLevelRecoveryConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewItemLevelRecoveryConnectionsClientWithBaseURI creates an instance of the ItemLevelRecoveryConnectionsClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewItemLevelRecoveryConnectionsClientWithBaseURI(baseURI string, subscriptionID string) ItemLevelRecoveryConnectionsClient { - return ItemLevelRecoveryConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Provision provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens a -// file -// explorer displaying all the recoverable files and folders. This is an asynchronous operation. To know the status of -// provisioning, call GetProtectedItemOperationResult 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 items. -// containerName - container name associated with the backed up items. -// protectedItemName - backed up item name whose files/folders are to be restored. -// recoveryPointID - recovery point ID which represents backed up data. iSCSI connection will be provisioned -// for this backed up data. -// parameters - resource ILR request -func (client ItemLevelRecoveryConnectionsClient) Provision(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters ILRRequestResource) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ItemLevelRecoveryConnectionsClient.Provision") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ProvisionPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointID, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ItemLevelRecoveryConnectionsClient", "Provision", nil, "Failure preparing request") - return - } - - resp, err := client.ProvisionSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "backup.ItemLevelRecoveryConnectionsClient", "Provision", resp, "Failure sending request") - return - } - - result, err = client.ProvisionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ItemLevelRecoveryConnectionsClient", "Provision", resp, "Failure responding to request") - return - } - - return -} - -// ProvisionPreparer prepares the Provision request. -func (client ItemLevelRecoveryConnectionsClient) ProvisionPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters ILRRequestResource) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "containerName": autorest.Encode("path", containerName), - "fabricName": autorest.Encode("path", fabricName), - "protectedItemName": autorest.Encode("path", protectedItemName), - "recoveryPointId": autorest.Encode("path", recoveryPointID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/provisionInstantItemRecovery", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ProvisionSender sends the Provision request. The method will close the -// http.Response Body if it receives an error. -func (client ItemLevelRecoveryConnectionsClient) ProvisionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ProvisionResponder handles the response to the Provision request. The method always -// closes the http.Response Body. -func (client ItemLevelRecoveryConnectionsClient) ProvisionResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Revoke revokes an iSCSI connection which can be used to download a script. Executing this script opens a file -// explorer -// displaying all recoverable files and folders. This is an asynchronous operation. -// 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 items. -// containerName - container name associated with the backed up items. -// protectedItemName - backed up item name whose files/folders are to be restored. -// recoveryPointID - recovery point ID which represents backed up data. iSCSI connection will be revoked for -// this backed up data. -func (client ItemLevelRecoveryConnectionsClient) Revoke(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ItemLevelRecoveryConnectionsClient.Revoke") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RevokePreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointID) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ItemLevelRecoveryConnectionsClient", "Revoke", nil, "Failure preparing request") - return - } - - resp, err := client.RevokeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "backup.ItemLevelRecoveryConnectionsClient", "Revoke", resp, "Failure sending request") - return - } - - result, err = client.RevokeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ItemLevelRecoveryConnectionsClient", "Revoke", resp, "Failure responding to request") - return - } - - return -} - -// RevokePreparer prepares the Revoke request. -func (client ItemLevelRecoveryConnectionsClient) RevokePreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "containerName": autorest.Encode("path", containerName), - "fabricName": autorest.Encode("path", fabricName), - "protectedItemName": autorest.Encode("path", protectedItemName), - "recoveryPointId": autorest.Encode("path", recoveryPointID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/revokeInstantItemRecovery", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RevokeSender sends the Revoke request. The method will close the -// http.Response Body if it receives an error. -func (client ItemLevelRecoveryConnectionsClient) RevokeSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// RevokeResponder handles the response to the Revoke request. The method always -// closes the http.Response Body. -func (client ItemLevelRecoveryConnectionsClient) RevokeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/models.go b/services/recoveryservices/mgmt/2019-05-13/backup/models.go index 90243c3982df..f686e59c3ba0 100644 --- a/services/recoveryservices/mgmt/2019-05-13/backup/models.go +++ b/services/recoveryservices/mgmt/2019-05-13/backup/models.go @@ -19,471 +19,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2019-05-13/backup" -// AzureBackupGoalFeatureSupportRequest azure backup goal feature specific request. -type AzureBackupGoalFeatureSupportRequest struct { - // FeatureType - Possible values include: 'FeatureTypeFeatureSupportRequest', 'FeatureTypeAzureBackupGoals', 'FeatureTypeAzureVMResourceBackup' - FeatureType FeatureType `json:"featureType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureBackupGoalFeatureSupportRequest. -func (abgfsr AzureBackupGoalFeatureSupportRequest) MarshalJSON() ([]byte, error) { - abgfsr.FeatureType = FeatureTypeAzureBackupGoals - objectMap := make(map[string]interface{}) - if abgfsr.FeatureType != "" { - objectMap["featureType"] = abgfsr.FeatureType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupGoalFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. -func (abgfsr AzureBackupGoalFeatureSupportRequest) AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) { - return &abgfsr, true -} - -// AsAzureVMResourceFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. -func (abgfsr AzureBackupGoalFeatureSupportRequest) AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) { - return nil, false -} - -// AsFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. -func (abgfsr AzureBackupGoalFeatureSupportRequest) AsFeatureSupportRequest() (*FeatureSupportRequest, bool) { - return nil, false -} - -// AsBasicFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. -func (abgfsr AzureBackupGoalFeatureSupportRequest) AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) { - return &abgfsr, true -} - -// AzureBackupServerContainer azureBackupServer (DPMVenus) workload-specific protection container. -type AzureBackupServerContainer struct { - // CanReRegister - Specifies whether the container is re-registrable. - CanReRegister *bool `json:"canReRegister,omitempty"` - // ContainerID - ID of container. - ContainerID *string `json:"containerId,omitempty"` - // ProtectedItemCount - Number of protected items in the BackupEngine - ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` - // DpmAgentVersion - Backup engine Agent version - DpmAgentVersion *string `json:"dpmAgentVersion,omitempty"` - // DpmServers - List of BackupEngines protecting the container - DpmServers *[]string `json:"dpmServers,omitempty"` - // UpgradeAvailable - To check if upgrade available - UpgradeAvailable *bool `json:"upgradeAvailable,omitempty"` - // ProtectionStatus - Protection status of the container. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ExtendedInfo - Extended Info of the container. - ExtendedInfo *DPMContainerExtendedInfo `json:"extendedInfo,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) MarshalJSON() ([]byte, error) { - absc.ContainerType = ContainerTypeAzureBackupServerContainer1 - objectMap := make(map[string]interface{}) - if absc.CanReRegister != nil { - objectMap["canReRegister"] = absc.CanReRegister - } - if absc.ContainerID != nil { - objectMap["containerId"] = absc.ContainerID - } - if absc.ProtectedItemCount != nil { - objectMap["protectedItemCount"] = absc.ProtectedItemCount - } - if absc.DpmAgentVersion != nil { - objectMap["dpmAgentVersion"] = absc.DpmAgentVersion - } - if absc.DpmServers != nil { - objectMap["dpmServers"] = absc.DpmServers - } - if absc.UpgradeAvailable != nil { - objectMap["upgradeAvailable"] = absc.UpgradeAvailable - } - if absc.ProtectionStatus != nil { - objectMap["protectionStatus"] = absc.ProtectionStatus - } - if absc.ExtendedInfo != nil { - objectMap["extendedInfo"] = absc.ExtendedInfo - } - if absc.FriendlyName != nil { - objectMap["friendlyName"] = absc.FriendlyName - } - if absc.BackupManagementType != "" { - objectMap["backupManagementType"] = absc.BackupManagementType - } - if absc.RegistrationStatus != nil { - objectMap["registrationStatus"] = absc.RegistrationStatus - } - if absc.HealthStatus != nil { - objectMap["healthStatus"] = absc.HealthStatus - } - if absc.ContainerType != "" { - objectMap["containerType"] = absc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return &absc, true -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return &absc, true -} - -// AsGenericContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false -} - -// AsMabContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &absc, true -} - -// AzureBackupServerEngine backup engine type when Azure Backup Server is used to manage the backups. -type AzureBackupServerEngine struct { - // FriendlyName - Friendly name of the backup engine. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Registration status of the backup engine with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // BackupEngineState - Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} - BackupEngineState *string `json:"backupEngineState,omitempty"` - // HealthStatus - Backup status of the backup engine. - HealthStatus *string `json:"healthStatus,omitempty"` - // CanReRegister - Flag indicating if the backup engine be registered, once already registered. - CanReRegister *bool `json:"canReRegister,omitempty"` - // BackupEngineID - ID of the backup engine. - BackupEngineID *string `json:"backupEngineId,omitempty"` - // DpmVersion - Backup engine version - DpmVersion *string `json:"dpmVersion,omitempty"` - // AzureBackupAgentVersion - Backup agent version - AzureBackupAgentVersion *string `json:"azureBackupAgentVersion,omitempty"` - // IsAzureBackupAgentUpgradeAvailable - To check if backup agent upgrade available - IsAzureBackupAgentUpgradeAvailable *bool `json:"isAzureBackupAgentUpgradeAvailable,omitempty"` - // IsDpmUpgradeAvailable - To check if backup engine upgrade available - IsDpmUpgradeAvailable *bool `json:"isDpmUpgradeAvailable,omitempty"` - // ExtendedInfo - Extended info of the backupengine - ExtendedInfo *EngineExtendedInfo `json:"extendedInfo,omitempty"` - // BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine' - BackupEngineType EngineType `json:"backupEngineType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureBackupServerEngine. -func (abse AzureBackupServerEngine) MarshalJSON() ([]byte, error) { - abse.BackupEngineType = BackupEngineTypeAzureBackupServerEngine - objectMap := make(map[string]interface{}) - if abse.FriendlyName != nil { - objectMap["friendlyName"] = abse.FriendlyName - } - if abse.BackupManagementType != "" { - objectMap["backupManagementType"] = abse.BackupManagementType - } - if abse.RegistrationStatus != nil { - objectMap["registrationStatus"] = abse.RegistrationStatus - } - if abse.BackupEngineState != nil { - objectMap["backupEngineState"] = abse.BackupEngineState - } - if abse.HealthStatus != nil { - objectMap["healthStatus"] = abse.HealthStatus - } - if abse.CanReRegister != nil { - objectMap["canReRegister"] = abse.CanReRegister - } - if abse.BackupEngineID != nil { - objectMap["backupEngineId"] = abse.BackupEngineID - } - if abse.DpmVersion != nil { - objectMap["dpmVersion"] = abse.DpmVersion - } - if abse.AzureBackupAgentVersion != nil { - objectMap["azureBackupAgentVersion"] = abse.AzureBackupAgentVersion - } - if abse.IsAzureBackupAgentUpgradeAvailable != nil { - objectMap["isAzureBackupAgentUpgradeAvailable"] = abse.IsAzureBackupAgentUpgradeAvailable - } - if abse.IsDpmUpgradeAvailable != nil { - objectMap["isDpmUpgradeAvailable"] = abse.IsDpmUpgradeAvailable - } - if abse.ExtendedInfo != nil { - objectMap["extendedInfo"] = abse.ExtendedInfo - } - if abse.BackupEngineType != "" { - objectMap["backupEngineType"] = abse.BackupEngineType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerEngine is the BasicEngineBase implementation for AzureBackupServerEngine. -func (abse AzureBackupServerEngine) AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) { - return &abse, true -} - -// AsDpmBackupEngine is the BasicEngineBase implementation for AzureBackupServerEngine. -func (abse AzureBackupServerEngine) AsDpmBackupEngine() (*DpmBackupEngine, bool) { - return nil, false -} - -// AsEngineBase is the BasicEngineBase implementation for AzureBackupServerEngine. -func (abse AzureBackupServerEngine) AsEngineBase() (*EngineBase, bool) { - return nil, false -} - -// AsBasicEngineBase is the BasicEngineBase implementation for AzureBackupServerEngine. -func (abse AzureBackupServerEngine) AsBasicEngineBase() (BasicEngineBase, bool) { - return &abse, true -} - -// AzureFileShareBackupRequest azureFileShare workload-specific backup request. -type AzureFileShareBackupRequest struct { - // RecoveryPointExpiryTimeInUTC - Backup copy will expire after the time specified (UTC). - RecoveryPointExpiryTimeInUTC *date.Time `json:"recoveryPointExpiryTimeInUTC,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' - ObjectType ObjectTypeBasicRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFileShareBackupRequest. -func (afsbr AzureFileShareBackupRequest) MarshalJSON() ([]byte, error) { - afsbr.ObjectType = ObjectTypeAzureFileShareBackupRequest - objectMap := make(map[string]interface{}) - if afsbr.RecoveryPointExpiryTimeInUTC != nil { - objectMap["recoveryPointExpiryTimeInUTC"] = afsbr.RecoveryPointExpiryTimeInUTC - } - if afsbr.ObjectType != "" { - objectMap["objectType"] = afsbr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareBackupRequest is the BasicRequest implementation for AzureFileShareBackupRequest. -func (afsbr AzureFileShareBackupRequest) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { - return &afsbr, true -} - -// AsAzureWorkloadBackupRequest is the BasicRequest implementation for AzureFileShareBackupRequest. -func (afsbr AzureFileShareBackupRequest) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { - return nil, false -} - -// AsIaasVMBackupRequest is the BasicRequest implementation for AzureFileShareBackupRequest. -func (afsbr AzureFileShareBackupRequest) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { - return nil, false -} - -// AsRequest is the BasicRequest implementation for AzureFileShareBackupRequest. -func (afsbr AzureFileShareBackupRequest) AsRequest() (*Request, bool) { - return nil, false -} - -// AsBasicRequest is the BasicRequest implementation for AzureFileShareBackupRequest. -func (afsbr AzureFileShareBackupRequest) AsBasicRequest() (BasicRequest, bool) { - return &afsbr, true -} - -// AzureFileShareProtectableItem protectable item for Azure Fileshare workloads. -type AzureFileShareProtectableItem struct { - // ParentContainerFabricID - Full Fabric ID of container to which this protectable item belongs. For example, ARM ID. - ParentContainerFabricID *string `json:"parentContainerFabricId,omitempty"` - // ParentContainerFriendlyName - Friendly name of container to which this protectable item belongs. - ParentContainerFriendlyName *string `json:"parentContainerFriendlyName,omitempty"` - // AzureFileShareType - File Share type XSync or XSMB. Possible values include: 'Invalid', 'XSMB', 'XSync' - AzureFileShareType AzureFileShareType `json:"azureFileShareType,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) MarshalJSON() ([]byte, error) { - afspi.ProtectableItemType = ProtectableItemTypeAzureFileShare - objectMap := make(map[string]interface{}) - if afspi.ParentContainerFabricID != nil { - objectMap["parentContainerFabricId"] = afspi.ParentContainerFabricID - } - if afspi.ParentContainerFriendlyName != nil { - objectMap["parentContainerFriendlyName"] = afspi.ParentContainerFriendlyName - } - if afspi.AzureFileShareType != "" { - objectMap["azureFileShareType"] = afspi.AzureFileShareType - } - if afspi.BackupManagementType != nil { - objectMap["backupManagementType"] = afspi.BackupManagementType - } - if afspi.WorkloadType != nil { - objectMap["workloadType"] = afspi.WorkloadType - } - if afspi.FriendlyName != nil { - objectMap["friendlyName"] = afspi.FriendlyName - } - if afspi.ProtectionState != "" { - objectMap["protectionState"] = afspi.ProtectionState - } - if afspi.ProtectableItemType != "" { - objectMap["protectableItemType"] = afspi.ProtectableItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return &afspi, true -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false -} - -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return nil, false -} - -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return nil, false -} - -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &afspi, true -} - // AzureFileshareProtectedItem azure File Share workload-specific backup item. type AzureFileshareProtectedItem struct { // FriendlyName - Friendly name of the fileshare represented by this backup item. @@ -853,53 +388,6 @@ func (afspp *AzureFileShareProtectionPolicy) UnmarshalJSON(body []byte) error { return nil } -// AzureFileShareProvisionILRRequest update snapshot Uri with the correct friendly Name of the source Azure -// file share. -type AzureFileShareProvisionILRRequest struct { - // RecoveryPointID - Recovery point ID. - RecoveryPointID *string `json:"recoveryPointId,omitempty"` - // SourceResourceID - Source Storage account ARM Id - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeAzureFileShareProvisionILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest' - ObjectType ObjectTypeBasicILRRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFileShareProvisionILRRequest. -func (afspir AzureFileShareProvisionILRRequest) MarshalJSON() ([]byte, error) { - afspir.ObjectType = ObjectTypeAzureFileShareProvisionILRRequest - objectMap := make(map[string]interface{}) - if afspir.RecoveryPointID != nil { - objectMap["recoveryPointId"] = afspir.RecoveryPointID - } - if afspir.SourceResourceID != nil { - objectMap["sourceResourceId"] = afspir.SourceResourceID - } - if afspir.ObjectType != "" { - objectMap["objectType"] = afspir.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProvisionILRRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. -func (afspir AzureFileShareProvisionILRRequest) AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) { - return &afspir, true -} - -// AsIaasVMILRRegistrationRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. -func (afspir AzureFileShareProvisionILRRequest) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) { - return nil, false -} - -// AsILRRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. -func (afspir AzureFileShareProvisionILRRequest) AsILRRequest() (*ILRRequest, bool) { - return nil, false -} - -// AsBasicILRRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. -func (afspir AzureFileShareProvisionILRRequest) AsBasicILRRequest() (BasicILRRequest, bool) { - return &afspir, true -} - // AzureFileShareRecoveryPoint azure File Share workload specific backup copy. type AzureFileShareRecoveryPoint struct { // RecoveryPointType - READ-ONLY; Type of the backup copy. Specifies whether it is a crash consistent backup or app consistent. @@ -1000,7 +488,7 @@ type AzureFileShareRestoreRequest struct { RecoveryType RecoveryType `json:"recoveryType,omitempty"` // SourceResourceID - Source storage account ARM Id SourceResourceID *string `json:"sourceResourceId,omitempty"` - // CopyOptions - Options to resolve copy conflicts. Possible values include: 'CopyOptionsInvalid', 'CopyOptionsCreateCopy', 'CopyOptionsSkip', 'CopyOptionsOverwrite', 'CopyOptionsFailOnConflict' + // CopyOptions - Options to resolve copy conflicts. Possible values include: 'Invalid', 'CreateCopy', 'Skip', 'Overwrite', 'FailOnConflict' CopyOptions CopyOptions `json:"copyOptions,omitempty"` // RestoreRequestType - Restore Type (FullShareRestore or ItemLevelRestore). Possible values include: 'RestoreRequestTypeInvalid', 'RestoreRequestTypeFullShareRestore', 'RestoreRequestTypeItemLevelRestore' RestoreRequestType RestoreRequestType `json:"restoreRequestType,omitempty"` @@ -1105,285 +593,31 @@ func (afsrr AzureFileShareRestoreRequest) AsBasicRestoreRequest() (BasicRestoreR return &afsrr, true } -// AzureIaaSClassicComputeVMContainer iaaS VM workload-specific backup item representing a classic virtual -// machine. -type AzureIaaSClassicComputeVMContainer struct { - // VirtualMachineID - Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // VirtualMachineVersion - Specifies whether the container represents a Classic or an Azure Resource Manager VM. - VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` - // ResourceGroup - Resource group name of Recovery Services Vault. - ResourceGroup *string `json:"resourceGroup,omitempty"` - // FriendlyName - Friendly name of the container. +// AzureIaaSClassicComputeVMProtectedItem iaaS VM workload-specific backup item representing the Classic +// Compute VM. +type AzureIaaSClassicComputeVMProtectedItem struct { + // FriendlyName - Friendly name of the VM represented by this backup item. FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) MarshalJSON() ([]byte, error) { - aisccvc.ContainerType = ContainerTypeMicrosoftClassicComputevirtualMachines - objectMap := make(map[string]interface{}) - if aisccvc.VirtualMachineID != nil { - objectMap["virtualMachineId"] = aisccvc.VirtualMachineID - } - if aisccvc.VirtualMachineVersion != nil { - objectMap["virtualMachineVersion"] = aisccvc.VirtualMachineVersion - } - if aisccvc.ResourceGroup != nil { - objectMap["resourceGroup"] = aisccvc.ResourceGroup - } - if aisccvc.FriendlyName != nil { - objectMap["friendlyName"] = aisccvc.FriendlyName - } - if aisccvc.BackupManagementType != "" { - objectMap["backupManagementType"] = aisccvc.BackupManagementType - } - if aisccvc.RegistrationStatus != nil { - objectMap["registrationStatus"] = aisccvc.RegistrationStatus - } - if aisccvc.HealthStatus != nil { - objectMap["healthStatus"] = aisccvc.HealthStatus - } - if aisccvc.ContainerType != "" { - objectMap["containerType"] = aisccvc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return &aisccvc, true -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return &aisccvc, true -} - -// AsMabContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &aisccvc, true -} - -// AzureIaaSClassicComputeVMProtectableItem iaaS VM workload-specific backup item representing the Classic -// Compute VM. -type AzureIaaSClassicComputeVMProtectableItem struct { - // VirtualMachineID - Fully qualified ARM ID of the virtual machine. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) MarshalJSON() ([]byte, error) { - aisccvpi.ProtectableItemType = ProtectableItemTypeMicrosoftClassicComputevirtualMachines - objectMap := make(map[string]interface{}) - if aisccvpi.VirtualMachineID != nil { - objectMap["virtualMachineId"] = aisccvpi.VirtualMachineID - } - if aisccvpi.BackupManagementType != nil { - objectMap["backupManagementType"] = aisccvpi.BackupManagementType - } - if aisccvpi.WorkloadType != nil { - objectMap["workloadType"] = aisccvpi.WorkloadType - } - if aisccvpi.FriendlyName != nil { - objectMap["friendlyName"] = aisccvpi.FriendlyName - } - if aisccvpi.ProtectionState != "" { - objectMap["protectionState"] = aisccvpi.ProtectionState - } - if aisccvpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = aisccvpi.ProtectableItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return &aisccvpi, true -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false -} - -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return nil, false -} - -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return &aisccvpi, true -} - -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &aisccvpi, true -} - -// AzureIaaSClassicComputeVMProtectedItem iaaS VM workload-specific backup item representing the Classic -// Compute VM. -type AzureIaaSClassicComputeVMProtectedItem struct { - // FriendlyName - Friendly name of the VM represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // VirtualMachineID - Fully qualified ARM ID of the virtual machine represented by this item. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // ProtectionStatus - Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // HealthStatus - Health status of protected item. Possible values include: 'HealthStatusPassed', 'HealthStatusActionRequired', 'HealthStatusActionSuggested', 'HealthStatusInvalid' - HealthStatus HealthStatus `json:"healthStatus,omitempty"` - // HealthDetails - Health details on this backup item. - HealthDetails *[]AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` - // LastBackupStatus - Last backup operation status. - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // ProtectedItemDataID - Data ID of the protected item. - ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` - // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + // VirtualMachineID - Fully qualified ARM ID of the virtual machine represented by this item. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // HealthStatus - Health status of protected item. Possible values include: 'HealthStatusPassed', 'HealthStatusActionRequired', 'HealthStatusActionSuggested', 'HealthStatusInvalid' + HealthStatus HealthStatus `json:"healthStatus,omitempty"` + // HealthDetails - Health details on this backup item. + HealthDetails *[]AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` + // LastBackupStatus - Last backup operation status. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // ProtectedItemDataID - Data ID of the protected item. + ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' WorkloadType DataSourceType `json:"workloadType,omitempty"` @@ -1575,341 +809,87 @@ func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsBasicProtectedItem() (B return &aisccvpi, true } -// AzureIaaSComputeVMContainer iaaS VM workload-specific backup item representing an Azure Resource Manager -// virtual machine. -type AzureIaaSComputeVMContainer struct { - // VirtualMachineID - Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // VirtualMachineVersion - Specifies whether the container represents a Classic or an Azure Resource Manager VM. - VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` - // ResourceGroup - Resource group name of Recovery Services Vault. - ResourceGroup *string `json:"resourceGroup,omitempty"` - // FriendlyName - Friendly name of the container. +// AzureIaaSComputeVMProtectedItem iaaS VM workload-specific backup item representing the Azure Resource +// Manager VM. +type AzureIaaSComputeVMProtectedItem struct { + // FriendlyName - Friendly name of the VM represented by this backup item. FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + // VirtualMachineID - Fully qualified ARM ID of the virtual machine represented by this item. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // HealthStatus - Health status of protected item. Possible values include: 'HealthStatusPassed', 'HealthStatusActionRequired', 'HealthStatusActionSuggested', 'HealthStatusInvalid' + HealthStatus HealthStatus `json:"healthStatus,omitempty"` + // HealthDetails - Health details on this backup item. + HealthDetails *[]AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` + // LastBackupStatus - Last backup operation status. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // ProtectedItemDataID - Data ID of the protected item. + ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) MarshalJSON() ([]byte, error) { - aiscvc.ContainerType = ContainerTypeMicrosoftComputevirtualMachines +// MarshalJSON is the custom marshaler for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) MarshalJSON() ([]byte, error) { + aiscvpi.ProtectedItemType = ProtectedItemTypeMicrosoftComputevirtualMachines objectMap := make(map[string]interface{}) - if aiscvc.VirtualMachineID != nil { - objectMap["virtualMachineId"] = aiscvc.VirtualMachineID + if aiscvpi.FriendlyName != nil { + objectMap["friendlyName"] = aiscvpi.FriendlyName } - if aiscvc.VirtualMachineVersion != nil { - objectMap["virtualMachineVersion"] = aiscvc.VirtualMachineVersion + if aiscvpi.VirtualMachineID != nil { + objectMap["virtualMachineId"] = aiscvpi.VirtualMachineID } - if aiscvc.ResourceGroup != nil { - objectMap["resourceGroup"] = aiscvc.ResourceGroup + if aiscvpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = aiscvpi.ProtectionStatus } - if aiscvc.FriendlyName != nil { - objectMap["friendlyName"] = aiscvc.FriendlyName + if aiscvpi.ProtectionState != "" { + objectMap["protectionState"] = aiscvpi.ProtectionState } - if aiscvc.BackupManagementType != "" { - objectMap["backupManagementType"] = aiscvc.BackupManagementType + if aiscvpi.HealthStatus != "" { + objectMap["healthStatus"] = aiscvpi.HealthStatus } - if aiscvc.RegistrationStatus != nil { - objectMap["registrationStatus"] = aiscvc.RegistrationStatus + if aiscvpi.HealthDetails != nil { + objectMap["healthDetails"] = aiscvpi.HealthDetails } - if aiscvc.HealthStatus != nil { - objectMap["healthStatus"] = aiscvc.HealthStatus + if aiscvpi.LastBackupStatus != nil { + objectMap["lastBackupStatus"] = aiscvpi.LastBackupStatus } - if aiscvc.ContainerType != "" { - objectMap["containerType"] = aiscvc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return &aiscvc, true -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return &aiscvc, true -} - -// AsMabContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &aiscvc, true -} - -// AzureIaaSComputeVMProtectableItem iaaS VM workload-specific backup item representing the Azure Resource -// Manager VM. -type AzureIaaSComputeVMProtectableItem struct { - // VirtualMachineID - Fully qualified ARM ID of the virtual machine. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) MarshalJSON() ([]byte, error) { - aiscvpi.ProtectableItemType = ProtectableItemTypeMicrosoftComputevirtualMachines - objectMap := make(map[string]interface{}) - if aiscvpi.VirtualMachineID != nil { - objectMap["virtualMachineId"] = aiscvpi.VirtualMachineID - } - if aiscvpi.BackupManagementType != nil { - objectMap["backupManagementType"] = aiscvpi.BackupManagementType - } - if aiscvpi.WorkloadType != nil { - objectMap["workloadType"] = aiscvpi.WorkloadType - } - if aiscvpi.FriendlyName != nil { - objectMap["friendlyName"] = aiscvpi.FriendlyName - } - if aiscvpi.ProtectionState != "" { - objectMap["protectionState"] = aiscvpi.ProtectionState - } - if aiscvpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = aiscvpi.ProtectableItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return &aiscvpi, true -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false -} - -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return nil, false -} - -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return &aiscvpi, true -} - -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &aiscvpi, true -} - -// AzureIaaSComputeVMProtectedItem iaaS VM workload-specific backup item representing the Azure Resource -// Manager VM. -type AzureIaaSComputeVMProtectedItem struct { - // FriendlyName - Friendly name of the VM represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // VirtualMachineID - Fully qualified ARM ID of the virtual machine represented by this item. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // ProtectionStatus - Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // HealthStatus - Health status of protected item. Possible values include: 'HealthStatusPassed', 'HealthStatusActionRequired', 'HealthStatusActionSuggested', 'HealthStatusInvalid' - HealthStatus HealthStatus `json:"healthStatus,omitempty"` - // HealthDetails - Health details on this backup item. - HealthDetails *[]AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` - // LastBackupStatus - Last backup operation status. - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // ProtectedItemDataID - Data ID of the protected item. - ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` - // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) MarshalJSON() ([]byte, error) { - aiscvpi.ProtectedItemType = ProtectedItemTypeMicrosoftComputevirtualMachines - objectMap := make(map[string]interface{}) - if aiscvpi.FriendlyName != nil { - objectMap["friendlyName"] = aiscvpi.FriendlyName - } - if aiscvpi.VirtualMachineID != nil { - objectMap["virtualMachineId"] = aiscvpi.VirtualMachineID - } - if aiscvpi.ProtectionStatus != nil { - objectMap["protectionStatus"] = aiscvpi.ProtectionStatus - } - if aiscvpi.ProtectionState != "" { - objectMap["protectionState"] = aiscvpi.ProtectionState - } - if aiscvpi.HealthStatus != "" { - objectMap["healthStatus"] = aiscvpi.HealthStatus - } - if aiscvpi.HealthDetails != nil { - objectMap["healthDetails"] = aiscvpi.HealthDetails - } - if aiscvpi.LastBackupStatus != nil { - objectMap["lastBackupStatus"] = aiscvpi.LastBackupStatus - } - if aiscvpi.LastBackupTime != nil { - objectMap["lastBackupTime"] = aiscvpi.LastBackupTime + if aiscvpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = aiscvpi.LastBackupTime } if aiscvpi.ProtectedItemDataID != nil { objectMap["protectedItemDataId"] = aiscvpi.ProtectedItemDataID @@ -2670,560 +1650,77 @@ func (aispp *AzureIaaSVMProtectionPolicy) UnmarshalJSON(body []byte) error { return nil } -// BasicAzureRecoveryServiceVaultProtectionIntent azure Recovery Services Vault specific protection intent item. -type BasicAzureRecoveryServiceVaultProtectionIntent interface { - AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) - AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) - AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) - AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) -} - -// AzureRecoveryServiceVaultProtectionIntent azure Recovery Services Vault specific protection intent item. -type AzureRecoveryServiceVaultProtectionIntent struct { +// AzureSQLProtectedItem azure SQL workload-specific backup item. +type AzureSQLProtectedItem struct { + // ProtectedItemDataID - Internal ID of a backup item. Used by Azure SQL Backup engine to contact Recovery Services. + ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` + // ProtectionState - Backup state of the backed up item. Possible values include: 'ProtectedItemStateInvalid', 'ProtectedItemStateIRPending', 'ProtectedItemStateProtected', 'ProtectedItemStateProtectionError', 'ProtectedItemStateProtectionStopped', 'ProtectedItemStateProtectionPaused' + ProtectionState ProtectedItemState `json:"protectionState,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureSQLProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` // SourceResourceID - ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId - ItemID *string `json:"itemId,omitempty"` // PolicyID - ID of the backup policy with which this item is backed up. PolicyID *string `json:"policyId,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' - ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } -func unmarshalBasicAzureRecoveryServiceVaultProtectionIntent(body []byte) (BasicAzureRecoveryServiceVaultProtectionIntent, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err +// MarshalJSON is the custom marshaler for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) MarshalJSON() ([]byte, error) { + aspi.ProtectedItemType = ProtectedItemTypeMicrosoftSqlserversdatabases + objectMap := make(map[string]interface{}) + if aspi.ProtectedItemDataID != nil { + objectMap["protectedItemDataId"] = aspi.ProtectedItemDataID } - - switch m["protectionIntentItemType"] { - case string(ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent): - var awapi AzureWorkloadAutoProtectionIntent - err := json.Unmarshal(body, &awapi) - return awapi, err - case string(ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent): - var awsapi AzureWorkloadSQLAutoProtectionIntent - err := json.Unmarshal(body, &awsapi) - return awsapi, err - default: - var arsvpi AzureRecoveryServiceVaultProtectionIntent - err := json.Unmarshal(body, &arsvpi) - return arsvpi, err + if aspi.ProtectionState != "" { + objectMap["protectionState"] = aspi.ProtectionState } -} -func unmarshalBasicAzureRecoveryServiceVaultProtectionIntentArray(body []byte) ([]BasicAzureRecoveryServiceVaultProtectionIntent, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err + if aspi.ExtendedInfo != nil { + objectMap["extendedInfo"] = aspi.ExtendedInfo } - - arsvpiArray := make([]BasicAzureRecoveryServiceVaultProtectionIntent, len(rawMessages)) - - for index, rawMessage := range rawMessages { - arsvpi, err := unmarshalBasicAzureRecoveryServiceVaultProtectionIntent(*rawMessage) - if err != nil { - return nil, err - } - arsvpiArray[index] = arsvpi + if aspi.BackupManagementType != "" { + objectMap["backupManagementType"] = aspi.BackupManagementType } - return arsvpiArray, nil -} - -// MarshalJSON is the custom marshaler for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) MarshalJSON() ([]byte, error) { - arsvpi.ProtectionIntentItemType = ProtectionIntentItemTypeRecoveryServiceVaultItem - objectMap := make(map[string]interface{}) - if arsvpi.BackupManagementType != "" { - objectMap["backupManagementType"] = arsvpi.BackupManagementType + if aspi.WorkloadType != "" { + objectMap["workloadType"] = aspi.WorkloadType } - if arsvpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = arsvpi.SourceResourceID + if aspi.ContainerName != nil { + objectMap["containerName"] = aspi.ContainerName } - if arsvpi.ItemID != nil { - objectMap["itemId"] = arsvpi.ItemID + if aspi.SourceResourceID != nil { + objectMap["sourceResourceId"] = aspi.SourceResourceID } - if arsvpi.PolicyID != nil { - objectMap["policyId"] = arsvpi.PolicyID + if aspi.PolicyID != nil { + objectMap["policyId"] = aspi.PolicyID } - if arsvpi.ProtectionState != "" { - objectMap["protectionState"] = arsvpi.ProtectionState + if aspi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = aspi.LastRecoveryPoint } - if arsvpi.ProtectionIntentItemType != "" { - objectMap["protectionIntentItemType"] = arsvpi.ProtectionIntentItemType - } - return json.Marshal(objectMap) -} - -// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { - return &arsvpi, true -} - -// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { - return &arsvpi, true -} - -// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { - return nil, false -} - -// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { - return nil, false -} - -// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { - return nil, false -} - -// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { - return nil, false -} - -// AsProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { - return nil, false -} - -// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { - return &arsvpi, true -} - -// AzureResourceProtectionIntent iaaS VM specific backup protection intent item. -type AzureResourceProtectionIntent struct { - // FriendlyName - Friendly name of the VM represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId - ItemID *string `json:"itemId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' - ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) MarshalJSON() ([]byte, error) { - arpi.ProtectionIntentItemType = ProtectionIntentItemTypeAzureResourceItem - objectMap := make(map[string]interface{}) - if arpi.FriendlyName != nil { - objectMap["friendlyName"] = arpi.FriendlyName - } - if arpi.BackupManagementType != "" { - objectMap["backupManagementType"] = arpi.BackupManagementType - } - if arpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = arpi.SourceResourceID - } - if arpi.ItemID != nil { - objectMap["itemId"] = arpi.ItemID - } - if arpi.PolicyID != nil { - objectMap["policyId"] = arpi.PolicyID - } - if arpi.ProtectionState != "" { - objectMap["protectionState"] = arpi.ProtectionState - } - if arpi.ProtectionIntentItemType != "" { - objectMap["protectionIntentItemType"] = arpi.ProtectionIntentItemType - } - return json.Marshal(objectMap) -} - -// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { - return nil, false -} - -// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { - return nil, false -} - -// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { - return &arpi, true -} - -// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { - return nil, false -} - -// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { - return nil, false -} - -// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { - return nil, false -} - -// AsProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { - return nil, false -} - -// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { - return &arpi, true -} - -// AzureSQLAGWorkloadContainerProtectionContainer container for SQL workloads under SQL Availability Group. -type AzureSQLAGWorkloadContainerProtectionContainer struct { - // SourceResourceID - ARM ID of the virtual machine represented by this Azure Workload Container - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // LastUpdatedTime - Time stamp when this container was updated. - LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` - // ExtendedInfo - Additional details of a workload container. - ExtendedInfo *AzureWorkloadContainerExtendedInfo `json:"extendedInfo,omitempty"` - // WorkloadType - Workload type for which registration was sent. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` - // OperationType - Re-Do Operation. Possible values include: 'OperationTypeInvalid', 'OperationTypeRegister', 'OperationTypeReregister' - OperationType OperationType `json:"operationType,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) MarshalJSON() ([]byte, error) { - aswcpc.ContainerType = ContainerTypeSQLAGWorkLoadContainer1 - objectMap := make(map[string]interface{}) - if aswcpc.SourceResourceID != nil { - objectMap["sourceResourceId"] = aswcpc.SourceResourceID - } - if aswcpc.LastUpdatedTime != nil { - objectMap["lastUpdatedTime"] = aswcpc.LastUpdatedTime - } - if aswcpc.ExtendedInfo != nil { - objectMap["extendedInfo"] = aswcpc.ExtendedInfo - } - if aswcpc.WorkloadType != "" { - objectMap["workloadType"] = aswcpc.WorkloadType - } - if aswcpc.OperationType != "" { - objectMap["operationType"] = aswcpc.OperationType - } - if aswcpc.FriendlyName != nil { - objectMap["friendlyName"] = aswcpc.FriendlyName - } - if aswcpc.BackupManagementType != "" { - objectMap["backupManagementType"] = aswcpc.BackupManagementType - } - if aswcpc.RegistrationStatus != nil { - objectMap["registrationStatus"] = aswcpc.RegistrationStatus - } - if aswcpc.HealthStatus != nil { - objectMap["healthStatus"] = aswcpc.HealthStatus - } - if aswcpc.ContainerType != "" { - objectMap["containerType"] = aswcpc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return &aswcpc, true -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return &aswcpc, true -} - -// AsDpmContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false -} - -// AsMabContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &aswcpc, true -} - -// AzureSQLContainer azure Sql workload-specific container. -type AzureSQLContainer struct { - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureSQLContainer. -func (asc AzureSQLContainer) MarshalJSON() ([]byte, error) { - asc.ContainerType = ContainerTypeAzureSQLContainer1 - objectMap := make(map[string]interface{}) - if asc.FriendlyName != nil { - objectMap["friendlyName"] = asc.FriendlyName - } - if asc.BackupManagementType != "" { - objectMap["backupManagementType"] = asc.BackupManagementType - } - if asc.RegistrationStatus != nil { - objectMap["registrationStatus"] = asc.RegistrationStatus - } - if asc.HealthStatus != nil { - objectMap["healthStatus"] = asc.HealthStatus - } - if asc.ContainerType != "" { - objectMap["containerType"] = asc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return &asc, true -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false -} - -// AsMabContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &asc, true -} - -// AzureSQLProtectedItem azure SQL workload-specific backup item. -type AzureSQLProtectedItem struct { - // ProtectedItemDataID - Internal ID of a backup item. Used by Azure SQL Backup engine to contact Recovery Services. - ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` - // ProtectionState - Backup state of the backed up item. Possible values include: 'ProtectedItemStateInvalid', 'ProtectedItemStateIRPending', 'ProtectedItemStateProtected', 'ProtectedItemStateProtectionError', 'ProtectedItemStateProtectionStopped', 'ProtectedItemStateProtectionPaused' - ProtectionState ProtectedItemState `json:"protectionState,omitempty"` - // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureSQLProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) MarshalJSON() ([]byte, error) { - aspi.ProtectedItemType = ProtectedItemTypeMicrosoftSqlserversdatabases - objectMap := make(map[string]interface{}) - if aspi.ProtectedItemDataID != nil { - objectMap["protectedItemDataId"] = aspi.ProtectedItemDataID - } - if aspi.ProtectionState != "" { - objectMap["protectionState"] = aspi.ProtectionState - } - if aspi.ExtendedInfo != nil { - objectMap["extendedInfo"] = aspi.ExtendedInfo - } - if aspi.BackupManagementType != "" { - objectMap["backupManagementType"] = aspi.BackupManagementType - } - if aspi.WorkloadType != "" { - objectMap["workloadType"] = aspi.WorkloadType - } - if aspi.ContainerName != nil { - objectMap["containerName"] = aspi.ContainerName - } - if aspi.SourceResourceID != nil { - objectMap["sourceResourceId"] = aspi.SourceResourceID - } - if aspi.PolicyID != nil { - objectMap["policyId"] = aspi.PolicyID - } - if aspi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = aspi.LastRecoveryPoint - } - if aspi.BackupSetName != nil { - objectMap["backupSetName"] = aspi.BackupSetName + if aspi.BackupSetName != nil { + objectMap["backupSetName"] = aspi.BackupSetName } if aspi.CreateMode != "" { objectMap["createMode"] = aspi.CreateMode @@ -3444,147 +1941,6 @@ func (aspp *AzureSQLProtectionPolicy) UnmarshalJSON(body []byte) error { return nil } -// AzureStorageContainer azure Storage Account workload-specific container. -type AzureStorageContainer struct { - // SourceResourceID - Fully qualified ARM url. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // StorageAccountVersion - Storage account version. - StorageAccountVersion *string `json:"storageAccountVersion,omitempty"` - // ResourceGroup - Resource group name of Recovery Services Vault. - ResourceGroup *string `json:"resourceGroup,omitempty"` - // ProtectedItemCount - Number of items backed up in this container. - ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureStorageContainer. -func (asc AzureStorageContainer) MarshalJSON() ([]byte, error) { - asc.ContainerType = ContainerTypeStorageContainer1 - objectMap := make(map[string]interface{}) - if asc.SourceResourceID != nil { - objectMap["sourceResourceId"] = asc.SourceResourceID - } - if asc.StorageAccountVersion != nil { - objectMap["storageAccountVersion"] = asc.StorageAccountVersion - } - if asc.ResourceGroup != nil { - objectMap["resourceGroup"] = asc.ResourceGroup - } - if asc.ProtectedItemCount != nil { - objectMap["protectedItemCount"] = asc.ProtectedItemCount - } - if asc.FriendlyName != nil { - objectMap["friendlyName"] = asc.FriendlyName - } - if asc.BackupManagementType != "" { - objectMap["backupManagementType"] = asc.BackupManagementType - } - if asc.RegistrationStatus != nil { - objectMap["registrationStatus"] = asc.RegistrationStatus - } - if asc.HealthStatus != nil { - objectMap["healthStatus"] = asc.HealthStatus - } - if asc.ContainerType != "" { - objectMap["containerType"] = asc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return &asc, true -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false -} - -// AsMabContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &asc, true -} - // AzureStorageErrorInfo azure storage specific error information type AzureStorageErrorInfo struct { // ErrorCode - Error code. @@ -3744,726 +2100,597 @@ type AzureStorageJobTaskDetails struct { Status *string `json:"status,omitempty"` } -// AzureStorageProtectableContainer azure Storage-specific protectable containers -type AzureStorageProtectableContainer struct { - // FriendlyName - Friendly name of the container. +// BasicAzureVMWorkloadProtectedItem azure VM workload-specific protected item. +type BasicAzureVMWorkloadProtectedItem interface { + AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) + AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) + AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) + AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) +} + +// AzureVMWorkloadProtectedItem azure VM workload-specific protected item. +type AzureVMWorkloadProtectedItem struct { + // FriendlyName - Friendly name of the DB represented by this backup item. FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // ParentName - Parent name of the DB such as Instance or Availability Group. + ParentName *string `json:"parentName,omitempty"` + // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed + ParentType *string `json:"parentType,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' + LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // LastBackupErrorDetail - Error details in last backup + LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` + // ProtectedItemDataSourceID - Data ID of the protected item. + ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` + // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' + ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerID - Fabric Id of the container such as ARM Id. - ContainerID *string `json:"containerId,omitempty"` - // ProtectableContainerType - Possible values include: 'ProtectableContainerTypeProtectableContainer', 'ProtectableContainerTypeStorageContainer', 'ProtectableContainerTypeVMAppContainer' - ProtectableContainerType ProtectableContainerType `json:"protectableContainerType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureStorageProtectableContainer. -func (aspc AzureStorageProtectableContainer) MarshalJSON() ([]byte, error) { - aspc.ProtectableContainerType = ProtectableContainerTypeStorageContainer - objectMap := make(map[string]interface{}) - if aspc.FriendlyName != nil { - objectMap["friendlyName"] = aspc.FriendlyName - } - if aspc.BackupManagementType != "" { - objectMap["backupManagementType"] = aspc.BackupManagementType - } - if aspc.HealthStatus != nil { - objectMap["healthStatus"] = aspc.HealthStatus - } - if aspc.ContainerID != nil { - objectMap["containerId"] = aspc.ContainerID - } - if aspc.ProtectableContainerType != "" { - objectMap["protectableContainerType"] = aspc.ProtectableContainerType +func unmarshalBasicAzureVMWorkloadProtectedItem(body []byte) (BasicAzureVMWorkloadProtectedItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err } - return json.Marshal(objectMap) -} - -// AsAzureStorageProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. -func (aspc AzureStorageProtectableContainer) AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) { - return &aspc, true -} - -// AsAzureVMAppContainerProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. -func (aspc AzureStorageProtectableContainer) AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) { - return nil, false -} -// AsProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. -func (aspc AzureStorageProtectableContainer) AsProtectableContainer() (*ProtectableContainer, bool) { - return nil, false + switch m["protectedItemType"] { + case string(ProtectedItemTypeAzureVMWorkloadSAPAseDatabase): + var avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem + err := json.Unmarshal(body, &avwsadpi) + return avwsadpi, err + case string(ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase): + var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem + err := json.Unmarshal(body, &avwshdpi) + return avwshdpi, err + case string(ProtectedItemTypeAzureVMWorkloadSQLDatabase): + var avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem + err := json.Unmarshal(body, &avwsdpi) + return avwsdpi, err + default: + var avwpi AzureVMWorkloadProtectedItem + err := json.Unmarshal(body, &avwpi) + return avwpi, err + } } +func unmarshalBasicAzureVMWorkloadProtectedItemArray(body []byte) ([]BasicAzureVMWorkloadProtectedItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } -// AsBasicProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. -func (aspc AzureStorageProtectableContainer) AsBasicProtectableContainer() (BasicProtectableContainer, bool) { - return &aspc, true -} + avwpiArray := make([]BasicAzureVMWorkloadProtectedItem, len(rawMessages)) -// AzureVMAppContainerProtectableContainer azure workload-specific container -type AzureVMAppContainerProtectableContainer struct { - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerID - Fabric Id of the container such as ARM Id. - ContainerID *string `json:"containerId,omitempty"` - // ProtectableContainerType - Possible values include: 'ProtectableContainerTypeProtectableContainer', 'ProtectableContainerTypeStorageContainer', 'ProtectableContainerTypeVMAppContainer' - ProtectableContainerType ProtectableContainerType `json:"protectableContainerType,omitempty"` + for index, rawMessage := range rawMessages { + avwpi, err := unmarshalBasicAzureVMWorkloadProtectedItem(*rawMessage) + if err != nil { + return nil, err + } + avwpiArray[index] = avwpi + } + return avwpiArray, nil } -// MarshalJSON is the custom marshaler for AzureVMAppContainerProtectableContainer. -func (avacpc AzureVMAppContainerProtectableContainer) MarshalJSON() ([]byte, error) { - avacpc.ProtectableContainerType = ProtectableContainerTypeVMAppContainer +// MarshalJSON is the custom marshaler for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) MarshalJSON() ([]byte, error) { + avwpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadProtectedItem objectMap := make(map[string]interface{}) - if avacpc.FriendlyName != nil { - objectMap["friendlyName"] = avacpc.FriendlyName + if avwpi.FriendlyName != nil { + objectMap["friendlyName"] = avwpi.FriendlyName } - if avacpc.BackupManagementType != "" { - objectMap["backupManagementType"] = avacpc.BackupManagementType + if avwpi.ServerName != nil { + objectMap["serverName"] = avwpi.ServerName } - if avacpc.HealthStatus != nil { - objectMap["healthStatus"] = avacpc.HealthStatus + if avwpi.ParentName != nil { + objectMap["parentName"] = avwpi.ParentName } - if avacpc.ContainerID != nil { - objectMap["containerId"] = avacpc.ContainerID + if avwpi.ParentType != nil { + objectMap["parentType"] = avwpi.ParentType } - if avacpc.ProtectableContainerType != "" { - objectMap["protectableContainerType"] = avacpc.ProtectableContainerType + if avwpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = avwpi.ProtectionStatus } - return json.Marshal(objectMap) -} - -// AsAzureStorageProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. -func (avacpc AzureVMAppContainerProtectableContainer) AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. -func (avacpc AzureVMAppContainerProtectableContainer) AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) { - return &avacpc, true -} - -// AsProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. -func (avacpc AzureVMAppContainerProtectableContainer) AsProtectableContainer() (*ProtectableContainer, bool) { - return nil, false -} - -// AsBasicProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. -func (avacpc AzureVMAppContainerProtectableContainer) AsBasicProtectableContainer() (BasicProtectableContainer, bool) { - return &avacpc, true -} - -// AzureVMAppContainerProtectionContainer container for SQL workloads under Azure Virtual Machines. -type AzureVMAppContainerProtectionContainer struct { - // SourceResourceID - ARM ID of the virtual machine represented by this Azure Workload Container - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // LastUpdatedTime - Time stamp when this container was updated. - LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` - // ExtendedInfo - Additional details of a workload container. - ExtendedInfo *AzureWorkloadContainerExtendedInfo `json:"extendedInfo,omitempty"` - // WorkloadType - Workload type for which registration was sent. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` - // OperationType - Re-Do Operation. Possible values include: 'OperationTypeInvalid', 'OperationTypeRegister', 'OperationTypeReregister' - OperationType OperationType `json:"operationType,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) MarshalJSON() ([]byte, error) { - avacpc.ContainerType = ContainerTypeVMAppContainer1 - objectMap := make(map[string]interface{}) - if avacpc.SourceResourceID != nil { - objectMap["sourceResourceId"] = avacpc.SourceResourceID + if avwpi.ProtectionState != "" { + objectMap["protectionState"] = avwpi.ProtectionState } - if avacpc.LastUpdatedTime != nil { - objectMap["lastUpdatedTime"] = avacpc.LastUpdatedTime + if avwpi.LastBackupStatus != "" { + objectMap["lastBackupStatus"] = avwpi.LastBackupStatus } - if avacpc.ExtendedInfo != nil { - objectMap["extendedInfo"] = avacpc.ExtendedInfo + if avwpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = avwpi.LastBackupTime } - if avacpc.WorkloadType != "" { - objectMap["workloadType"] = avacpc.WorkloadType + if avwpi.LastBackupErrorDetail != nil { + objectMap["lastBackupErrorDetail"] = avwpi.LastBackupErrorDetail } - if avacpc.OperationType != "" { - objectMap["operationType"] = avacpc.OperationType + if avwpi.ProtectedItemDataSourceID != nil { + objectMap["protectedItemDataSourceId"] = avwpi.ProtectedItemDataSourceID } - if avacpc.FriendlyName != nil { - objectMap["friendlyName"] = avacpc.FriendlyName + if avwpi.ProtectedItemHealthStatus != "" { + objectMap["protectedItemHealthStatus"] = avwpi.ProtectedItemHealthStatus } - if avacpc.BackupManagementType != "" { - objectMap["backupManagementType"] = avacpc.BackupManagementType + if avwpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = avwpi.ExtendedInfo } - if avacpc.RegistrationStatus != nil { - objectMap["registrationStatus"] = avacpc.RegistrationStatus + if avwpi.BackupManagementType != "" { + objectMap["backupManagementType"] = avwpi.BackupManagementType } - if avacpc.HealthStatus != nil { - objectMap["healthStatus"] = avacpc.HealthStatus + if avwpi.WorkloadType != "" { + objectMap["workloadType"] = avwpi.WorkloadType } - if avacpc.ContainerType != "" { - objectMap["containerType"] = avacpc.ContainerType + if avwpi.ContainerName != nil { + objectMap["containerName"] = avwpi.ContainerName } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false + if avwpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = avwpi.SourceResourceID + } + if avwpi.PolicyID != nil { + objectMap["policyId"] = avwpi.PolicyID + } + if avwpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = avwpi.LastRecoveryPoint + } + if avwpi.BackupSetName != nil { + objectMap["backupSetName"] = avwpi.BackupSetName + } + if avwpi.CreateMode != "" { + objectMap["createMode"] = avwpi.CreateMode + } + if avwpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = avwpi.DeferredDeleteTimeInUTC + } + if avwpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = avwpi.IsScheduledForDeferredDelete + } + if avwpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = avwpi.DeferredDeleteTimeRemaining + } + if avwpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = avwpi.IsDeferredDeleteScheduleUpcoming + } + if avwpi.IsRehydrate != nil { + objectMap["isRehydrate"] = avwpi.IsRehydrate + } + if avwpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = avwpi.ProtectedItemType + } + return json.Marshal(objectMap) } -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { return nil, false } -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return &avacpc, true -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { return nil, false } -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return &avacpc, true -} - -// AsDpmContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsDpmContainer() (*DpmContainer, bool) { +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { return nil, false } -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { return nil, false } -// AsGenericContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsGenericContainer() (*GenericContainer, bool) { +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { return nil, false } -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { return nil, false } -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return &avwpi, true } -// AsMabContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return &avwpi, true } -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsProtectionContainer() (*ProtectionContainer, bool) { +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { return nil, false } -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &avacpc, true -} - -// AzureVMResourceFeatureSupportRequest azureResource(IaaS VM) Specific feature support request -type AzureVMResourceFeatureSupportRequest struct { - // VMSize - Size of the resource: VM size(A/D series etc) in case of IaasVM - VMSize *string `json:"vmSize,omitempty"` - // VMSku - SKUs (Premium/Managed etc) in case of IaasVM - VMSku *string `json:"vmSku,omitempty"` - // FeatureType - Possible values include: 'FeatureTypeFeatureSupportRequest', 'FeatureTypeAzureBackupGoals', 'FeatureTypeAzureVMResourceBackup' - FeatureType FeatureType `json:"featureType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMResourceFeatureSupportRequest. -func (avrfsr AzureVMResourceFeatureSupportRequest) MarshalJSON() ([]byte, error) { - avrfsr.FeatureType = FeatureTypeAzureVMResourceBackup - objectMap := make(map[string]interface{}) - if avrfsr.VMSize != nil { - objectMap["vmSize"] = avrfsr.VMSize - } - if avrfsr.VMSku != nil { - objectMap["vmSku"] = avrfsr.VMSku - } - if avrfsr.FeatureType != "" { - objectMap["featureType"] = avrfsr.FeatureType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupGoalFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureVMResourceFeatureSupportRequest. -func (avrfsr AzureVMResourceFeatureSupportRequest) AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) { +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { return nil, false } -// AsAzureVMResourceFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureVMResourceFeatureSupportRequest. -func (avrfsr AzureVMResourceFeatureSupportRequest) AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) { - return &avrfsr, true +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false } -// AsFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureVMResourceFeatureSupportRequest. -func (avrfsr AzureVMResourceFeatureSupportRequest) AsFeatureSupportRequest() (*FeatureSupportRequest, bool) { +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { return nil, false } -// AsBasicFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureVMResourceFeatureSupportRequest. -func (avrfsr AzureVMResourceFeatureSupportRequest) AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) { - return &avrfsr, true +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false } -// AzureVMResourceFeatureSupportResponse response for feature support requests for Azure IaasVm -type AzureVMResourceFeatureSupportResponse struct { - autorest.Response `json:"-"` - // SupportStatus - Support status of feature. Possible values include: 'SupportStatusInvalid', 'SupportStatusSupported', 'SupportStatusDefaultOFF', 'SupportStatusDefaultON', 'SupportStatusNotSupported' - SupportStatus SupportStatus `json:"supportStatus,omitempty"` +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false } -// BasicAzureVMWorkloadItem azure VM workload-specific workload item. -type BasicAzureVMWorkloadItem interface { - AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) - AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) - AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) - AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) - AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) - AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) - AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false } -// AzureVMWorkloadItem azure VM workload-specific workload item. -type AzureVMWorkloadItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if workload item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DB's present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected - SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &avwpi, true } -func unmarshalBasicAzureVMWorkloadItem(body []byte) (BasicAzureVMWorkloadItem, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["workloadItemType"] { - case string(WorkloadItemTypeSAPAseDatabase1): - var avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem - err := json.Unmarshal(body, &avwsadwi) - return avwsadwi, err - case string(WorkloadItemTypeSAPAseSystem1): - var avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem - err := json.Unmarshal(body, &avwsaswi) - return avwsaswi, err - case string(WorkloadItemTypeSAPHanaDatabase1): - var avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem - err := json.Unmarshal(body, &avwshdwi) - return avwshdwi, err - case string(WorkloadItemTypeSAPHanaSystem1): - var avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem - err := json.Unmarshal(body, &avwshswi) - return avwshswi, err - case string(WorkloadItemTypeSQLDataBase1): - var avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem - err := json.Unmarshal(body, &avwsdwi) - return avwsdwi, err - case string(WorkloadItemTypeSQLInstance1): - var avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem - err := json.Unmarshal(body, &avwsiwi) - return avwsiwi, err - default: - var avwi AzureVMWorkloadItem - err := json.Unmarshal(body, &avwi) - return avwi, err - } +// AzureVMWorkloadProtectedItemExtendedInfo additional information on Azure Workload for SQL specific +// backup item. +type AzureVMWorkloadProtectedItemExtendedInfo struct { + // OldestRecoveryPoint - The oldest backup copy available for this backup item. + OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` + // RecoveryPointCount - Number of backup copies available for this backup item. + RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` + // PolicyState - Indicates consistency of policy object and policy applied to this backup item. + PolicyState *string `json:"policyState,omitempty"` } -func unmarshalBasicAzureVMWorkloadItemArray(body []byte) ([]BasicAzureVMWorkloadItem, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - avwiArray := make([]BasicAzureVMWorkloadItem, len(rawMessages)) - for index, rawMessage := range rawMessages { - avwi, err := unmarshalBasicAzureVMWorkloadItem(*rawMessage) - if err != nil { - return nil, err - } - avwiArray[index] = avwi - } - return avwiArray, nil +// AzureVMWorkloadProtectionPolicy azure VM (Mercury) workload-specific backup policy. +type AzureVMWorkloadProtectionPolicy struct { + // 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', 'WorkloadTypeSAPAseDatabase' + 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 + SubProtectionPolicy *[]SubProtectionPolicy `json:"subProtectionPolicy,omitempty"` + // MakePolicyConsistent - Fix the policy inconsistency + MakePolicyConsistent *bool `json:"makePolicyConsistent,omitempty"` + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) MarshalJSON() ([]byte, error) { - avwi.WorkloadItemType = WorkloadItemTypeAzureVMWorkloadItem +// MarshalJSON is the custom marshaler for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) MarshalJSON() ([]byte, error) { + avwpp.BackupManagementType = BackupManagementTypeAzureWorkload objectMap := make(map[string]interface{}) - if avwi.ParentName != nil { - objectMap["parentName"] = avwi.ParentName - } - if avwi.ServerName != nil { - objectMap["serverName"] = avwi.ServerName - } - if avwi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwi.IsAutoProtectable - } - if avwi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwi.Subinquireditemcount - } - if avwi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwi.SubWorkloadItemCount + if avwpp.WorkLoadType != "" { + objectMap["workLoadType"] = avwpp.WorkLoadType } - if avwi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwi.BackupManagementType + if avwpp.Settings != nil { + objectMap["settings"] = avwpp.Settings } - if avwi.WorkloadType != nil { - objectMap["workloadType"] = avwi.WorkloadType + if avwpp.SubProtectionPolicy != nil { + objectMap["subProtectionPolicy"] = avwpp.SubProtectionPolicy } - if avwi.FriendlyName != nil { - objectMap["friendlyName"] = avwi.FriendlyName + if avwpp.MakePolicyConsistent != nil { + objectMap["makePolicyConsistent"] = avwpp.MakePolicyConsistent } - if avwi.ProtectionState != "" { - objectMap["protectionState"] = avwi.ProtectionState + if avwpp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = avwpp.ProtectedItemsCount } - if avwi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwi.WorkloadItemType + if avwpp.BackupManagementType != "" { + objectMap["backupManagementType"] = avwpp.BackupManagementType } return json.Marshal(objectMap) } -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { - return &avwi, true -} - -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { - return nil, false +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return &avwpp, true } -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { return nil, false } -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { return nil, false } -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { +// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { return nil, false } -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwi, true -} - -// BasicAzureVMWorkloadProtectableItem azure VM workload-specific protectable item. -type BasicAzureVMWorkloadProtectableItem interface { - AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) - AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) - AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) - AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) - AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) - AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) - AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &avwpp, true } -// AzureVMWorkloadProtectableItem azure VM workload-specific protectable item. -type AzureVMWorkloadProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` +// AzureVMWorkloadSAPAseDatabaseProtectedItem azure VM workload-specific protected item representing SAP +// ASE Database. +type AzureVMWorkloadSAPAseDatabaseProtectedItem struct { + // FriendlyName - Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` // ServerName - Host/Cluster Name for instance or AG 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 - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` + // ParentName - Parent name of the DB such as Instance or Availability Group. + ParentName *string `json:"parentName,omitempty"` + // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed + ParentType *string `json:"parentType,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' + LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // LastBackupErrorDetail - Error details in last backup + LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` + // ProtectedItemDataSourceID - Data ID of the protected item. + ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` + // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' + ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } -func unmarshalBasicAzureVMWorkloadProtectableItem(body []byte) (BasicAzureVMWorkloadProtectableItem, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) MarshalJSON() ([]byte, error) { + avwsadpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadSAPAseDatabase + objectMap := make(map[string]interface{}) + if avwsadpi.FriendlyName != nil { + objectMap["friendlyName"] = avwsadpi.FriendlyName } - - switch m["protectableItemType"] { - case string(ProtectableItemTypeSAPAseSystem): - var avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem - err := json.Unmarshal(body, &avwsaspi) - return avwsaspi, err - case string(ProtectableItemTypeSAPHanaDatabase): - var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem - err := json.Unmarshal(body, &avwshdpi) - return avwshdpi, err - case string(ProtectableItemTypeSAPHanaSystem): - var avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem - err := json.Unmarshal(body, &avwshspi) - return avwshspi, err - case string(ProtectableItemTypeSQLAvailabilityGroupContainer): - var avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem - err := json.Unmarshal(body, &avwsagpi) - return avwsagpi, err - case string(ProtectableItemTypeSQLDataBase): - var avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem - err := json.Unmarshal(body, &avwsdpi) - return avwsdpi, err - case string(ProtectableItemTypeSQLInstance): - var avwsipi AzureVMWorkloadSQLInstanceProtectableItem - err := json.Unmarshal(body, &avwsipi) - return avwsipi, err - default: - var avwpi AzureVMWorkloadProtectableItem - err := json.Unmarshal(body, &avwpi) - return avwpi, err + if avwsadpi.ServerName != nil { + objectMap["serverName"] = avwsadpi.ServerName } -} -func unmarshalBasicAzureVMWorkloadProtectableItemArray(body []byte) ([]BasicAzureVMWorkloadProtectableItem, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err + if avwsadpi.ParentName != nil { + objectMap["parentName"] = avwsadpi.ParentName } - - avwpiArray := make([]BasicAzureVMWorkloadProtectableItem, len(rawMessages)) - - for index, rawMessage := range rawMessages { - avwpi, err := unmarshalBasicAzureVMWorkloadProtectableItem(*rawMessage) - if err != nil { - return nil, err - } - avwpiArray[index] = avwpi + if avwsadpi.ParentType != nil { + objectMap["parentType"] = avwsadpi.ParentType } - return avwpiArray, nil -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) MarshalJSON() ([]byte, error) { - avwpi.ProtectableItemType = ProtectableItemTypeAzureVMWorkloadProtectableItem - objectMap := make(map[string]interface{}) - if avwpi.ParentName != nil { - objectMap["parentName"] = avwpi.ParentName + if avwsadpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = avwsadpi.ProtectionStatus } - if avwpi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwpi.ParentUniqueName + if avwsadpi.ProtectionState != "" { + objectMap["protectionState"] = avwsadpi.ProtectionState } - if avwpi.ServerName != nil { - objectMap["serverName"] = avwpi.ServerName + if avwsadpi.LastBackupStatus != "" { + objectMap["lastBackupStatus"] = avwsadpi.LastBackupStatus } - if avwpi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwpi.IsAutoProtectable + if avwsadpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = avwsadpi.LastBackupTime } - if avwpi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwpi.IsAutoProtected + if avwsadpi.LastBackupErrorDetail != nil { + objectMap["lastBackupErrorDetail"] = avwsadpi.LastBackupErrorDetail } - if avwpi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwpi.Subinquireditemcount + if avwsadpi.ProtectedItemDataSourceID != nil { + objectMap["protectedItemDataSourceId"] = avwsadpi.ProtectedItemDataSourceID } - if avwpi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwpi.Subprotectableitemcount + if avwsadpi.ProtectedItemHealthStatus != "" { + objectMap["protectedItemHealthStatus"] = avwsadpi.ProtectedItemHealthStatus } - if avwpi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwpi.Prebackupvalidation + if avwsadpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = avwsadpi.ExtendedInfo } - if avwpi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwpi.BackupManagementType + if avwsadpi.BackupManagementType != "" { + objectMap["backupManagementType"] = avwsadpi.BackupManagementType } - if avwpi.WorkloadType != nil { - objectMap["workloadType"] = avwpi.WorkloadType + if avwsadpi.WorkloadType != "" { + objectMap["workloadType"] = avwsadpi.WorkloadType } - if avwpi.FriendlyName != nil { - objectMap["friendlyName"] = avwpi.FriendlyName + if avwsadpi.ContainerName != nil { + objectMap["containerName"] = avwsadpi.ContainerName } - if avwpi.ProtectionState != "" { - objectMap["protectionState"] = avwpi.ProtectionState + if avwsadpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = avwsadpi.SourceResourceID + } + if avwsadpi.PolicyID != nil { + objectMap["policyId"] = avwsadpi.PolicyID + } + if avwsadpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = avwsadpi.LastRecoveryPoint + } + if avwsadpi.BackupSetName != nil { + objectMap["backupSetName"] = avwsadpi.BackupSetName + } + if avwsadpi.CreateMode != "" { + objectMap["createMode"] = avwsadpi.CreateMode + } + if avwsadpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = avwsadpi.DeferredDeleteTimeInUTC + } + if avwsadpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = avwsadpi.IsScheduledForDeferredDelete + } + if avwsadpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = avwsadpi.DeferredDeleteTimeRemaining + } + if avwsadpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = avwsadpi.IsDeferredDeleteScheduleUpcoming + } + if avwsadpi.IsRehydrate != nil { + objectMap["isRehydrate"] = avwsadpi.IsRehydrate } - if avwpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwpi.ProtectableItemType + if avwsadpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = avwsadpi.ProtectedItemType } return json.Marshal(objectMap) } -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { return nil, false } -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { return nil, false } -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return &avwpi, true +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false } -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwpi, true +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false } -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return &avwsadpi, true } -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return &avwsadpi, true } -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { return nil, false } -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { return nil, false } -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { return nil, false } -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { return nil, false } -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { return nil, false } -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwpi, true +// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false } -// BasicAzureVMWorkloadProtectedItem azure VM workload-specific protected item. -type BasicAzureVMWorkloadProtectedItem interface { - AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) - AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) - AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) - AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &avwsadpi, true } -// AzureVMWorkloadProtectedItem azure VM workload-specific protected item. -type AzureVMWorkloadProtectedItem struct { +// AzureVMWorkloadSAPHanaDatabaseProtectedItem azure VM workload-specific protected item representing SAP +// HANA Database. +type AzureVMWorkloadSAPHanaDatabaseProtectedItem struct { // FriendlyName - Friendly name of the DB represented by this backup item. FriendlyName *string `json:"friendlyName,omitempty"` // ServerName - Host/Cluster Name for instance or AG @@ -4518,311 +2745,174 @@ type AzureVMWorkloadProtectedItem struct { ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } -func unmarshalBasicAzureVMWorkloadProtectedItem(body []byte) (BasicAzureVMWorkloadProtectedItem, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["protectedItemType"] { - case string(ProtectedItemTypeAzureVMWorkloadSAPAseDatabase): - var avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem - err := json.Unmarshal(body, &avwsadpi) - return avwsadpi, err - case string(ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase): - var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem - err := json.Unmarshal(body, &avwshdpi) - return avwshdpi, err - case string(ProtectedItemTypeAzureVMWorkloadSQLDatabase): - var avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem - err := json.Unmarshal(body, &avwsdpi) - return avwsdpi, err - default: - var avwpi AzureVMWorkloadProtectedItem - err := json.Unmarshal(body, &avwpi) - return avwpi, err +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) MarshalJSON() ([]byte, error) { + avwshdpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase + objectMap := make(map[string]interface{}) + if avwshdpi.FriendlyName != nil { + objectMap["friendlyName"] = avwshdpi.FriendlyName } -} -func unmarshalBasicAzureVMWorkloadProtectedItemArray(body []byte) ([]BasicAzureVMWorkloadProtectedItem, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err + if avwshdpi.ServerName != nil { + objectMap["serverName"] = avwshdpi.ServerName } - - avwpiArray := make([]BasicAzureVMWorkloadProtectedItem, len(rawMessages)) - - for index, rawMessage := range rawMessages { - avwpi, err := unmarshalBasicAzureVMWorkloadProtectedItem(*rawMessage) - if err != nil { - return nil, err - } - avwpiArray[index] = avwpi + if avwshdpi.ParentName != nil { + objectMap["parentName"] = avwshdpi.ParentName } - return avwpiArray, nil -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) MarshalJSON() ([]byte, error) { - avwpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadProtectedItem - objectMap := make(map[string]interface{}) - if avwpi.FriendlyName != nil { - objectMap["friendlyName"] = avwpi.FriendlyName + if avwshdpi.ParentType != nil { + objectMap["parentType"] = avwshdpi.ParentType } - if avwpi.ServerName != nil { - objectMap["serverName"] = avwpi.ServerName + if avwshdpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = avwshdpi.ProtectionStatus } - if avwpi.ParentName != nil { - objectMap["parentName"] = avwpi.ParentName + if avwshdpi.ProtectionState != "" { + objectMap["protectionState"] = avwshdpi.ProtectionState } - if avwpi.ParentType != nil { - objectMap["parentType"] = avwpi.ParentType + if avwshdpi.LastBackupStatus != "" { + objectMap["lastBackupStatus"] = avwshdpi.LastBackupStatus } - if avwpi.ProtectionStatus != nil { - objectMap["protectionStatus"] = avwpi.ProtectionStatus + if avwshdpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = avwshdpi.LastBackupTime } - if avwpi.ProtectionState != "" { - objectMap["protectionState"] = avwpi.ProtectionState + if avwshdpi.LastBackupErrorDetail != nil { + objectMap["lastBackupErrorDetail"] = avwshdpi.LastBackupErrorDetail } - if avwpi.LastBackupStatus != "" { - objectMap["lastBackupStatus"] = avwpi.LastBackupStatus + if avwshdpi.ProtectedItemDataSourceID != nil { + objectMap["protectedItemDataSourceId"] = avwshdpi.ProtectedItemDataSourceID } - if avwpi.LastBackupTime != nil { - objectMap["lastBackupTime"] = avwpi.LastBackupTime + if avwshdpi.ProtectedItemHealthStatus != "" { + objectMap["protectedItemHealthStatus"] = avwshdpi.ProtectedItemHealthStatus } - if avwpi.LastBackupErrorDetail != nil { - objectMap["lastBackupErrorDetail"] = avwpi.LastBackupErrorDetail + if avwshdpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = avwshdpi.ExtendedInfo } - if avwpi.ProtectedItemDataSourceID != nil { - objectMap["protectedItemDataSourceId"] = avwpi.ProtectedItemDataSourceID + if avwshdpi.BackupManagementType != "" { + objectMap["backupManagementType"] = avwshdpi.BackupManagementType } - if avwpi.ProtectedItemHealthStatus != "" { - objectMap["protectedItemHealthStatus"] = avwpi.ProtectedItemHealthStatus + if avwshdpi.WorkloadType != "" { + objectMap["workloadType"] = avwshdpi.WorkloadType } - if avwpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = avwpi.ExtendedInfo + if avwshdpi.ContainerName != nil { + objectMap["containerName"] = avwshdpi.ContainerName } - if avwpi.BackupManagementType != "" { - objectMap["backupManagementType"] = avwpi.BackupManagementType + if avwshdpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = avwshdpi.SourceResourceID } - if avwpi.WorkloadType != "" { - objectMap["workloadType"] = avwpi.WorkloadType + if avwshdpi.PolicyID != nil { + objectMap["policyId"] = avwshdpi.PolicyID } - if avwpi.ContainerName != nil { - objectMap["containerName"] = avwpi.ContainerName + if avwshdpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = avwshdpi.LastRecoveryPoint } - if avwpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = avwpi.SourceResourceID - } - if avwpi.PolicyID != nil { - objectMap["policyId"] = avwpi.PolicyID - } - if avwpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = avwpi.LastRecoveryPoint - } - if avwpi.BackupSetName != nil { - objectMap["backupSetName"] = avwpi.BackupSetName + if avwshdpi.BackupSetName != nil { + objectMap["backupSetName"] = avwshdpi.BackupSetName } - if avwpi.CreateMode != "" { - objectMap["createMode"] = avwpi.CreateMode + if avwshdpi.CreateMode != "" { + objectMap["createMode"] = avwshdpi.CreateMode } - if avwpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = avwpi.DeferredDeleteTimeInUTC + if avwshdpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = avwshdpi.DeferredDeleteTimeInUTC } - if avwpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = avwpi.IsScheduledForDeferredDelete + if avwshdpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = avwshdpi.IsScheduledForDeferredDelete } - if avwpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = avwpi.DeferredDeleteTimeRemaining + if avwshdpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = avwshdpi.DeferredDeleteTimeRemaining } - if avwpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = avwpi.IsDeferredDeleteScheduleUpcoming + if avwshdpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = avwshdpi.IsDeferredDeleteScheduleUpcoming } - if avwpi.IsRehydrate != nil { - objectMap["isRehydrate"] = avwpi.IsRehydrate + if avwshdpi.IsRehydrate != nil { + objectMap["isRehydrate"] = avwshdpi.IsRehydrate } - if avwpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = avwpi.ProtectedItemType + if avwshdpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = avwshdpi.ProtectedItemType } return json.Marshal(objectMap) } -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { return nil, false } -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { return nil, false } -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return &avwpi, true -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return &avwpi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { return nil, false } -// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { return nil, false } -// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { return nil, false } -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return nil, false +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return &avwshdpi, true } -// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { return nil, false } -// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &avwpi, true -} - -// AzureVMWorkloadProtectedItemExtendedInfo additional information on Azure Workload for SQL specific -// backup item. -type AzureVMWorkloadProtectedItemExtendedInfo struct { - // OldestRecoveryPoint - The oldest backup copy available for this backup item. - OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` - // RecoveryPointCount - Number of backup copies available for this backup item. - RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` - // PolicyState - Indicates consistency of policy object and policy applied to this backup item. - PolicyState *string `json:"policyState,omitempty"` -} - -// AzureVMWorkloadProtectionPolicy azure VM (Mercury) workload-specific backup policy. -type AzureVMWorkloadProtectionPolicy struct { - // 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', 'WorkloadTypeSAPAseDatabase' - 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 - SubProtectionPolicy *[]SubProtectionPolicy `json:"subProtectionPolicy,omitempty"` - // MakePolicyConsistent - Fix the policy inconsistency - MakePolicyConsistent *bool `json:"makePolicyConsistent,omitempty"` - // ProtectedItemsCount - Number of items associated with this policy. - ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' - BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) MarshalJSON() ([]byte, error) { - avwpp.BackupManagementType = BackupManagementTypeAzureWorkload - objectMap := make(map[string]interface{}) - if avwpp.WorkLoadType != "" { - objectMap["workLoadType"] = avwpp.WorkLoadType - } - if avwpp.Settings != nil { - objectMap["settings"] = avwpp.Settings - } - if avwpp.SubProtectionPolicy != nil { - objectMap["subProtectionPolicy"] = avwpp.SubProtectionPolicy - } - if avwpp.MakePolicyConsistent != nil { - objectMap["makePolicyConsistent"] = avwpp.MakePolicyConsistent - } - if avwpp.ProtectedItemsCount != nil { - objectMap["protectedItemsCount"] = avwpp.ProtectedItemsCount - } - if avwpp.BackupManagementType != "" { - objectMap["backupManagementType"] = avwpp.BackupManagementType - } - return json.Marshal(objectMap) -} - -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { - return &avwpp, true -} - -// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { - return nil, false +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return &avwshdpi, true } -// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { return nil, false } -// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { return nil, false } -// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { return nil, false } -// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { return nil, false } -// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { +// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { return nil, false } -// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { - return &avwpp, true +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &avwshdpi, true } -// AzureVMWorkloadSAPAseDatabaseProtectedItem azure VM workload-specific protected item representing SAP -// ASE Database. -type AzureVMWorkloadSAPAseDatabaseProtectedItem struct { +// AzureVMWorkloadSQLDatabaseProtectedItem azure VM workload-specific protected item representing SQL +// Database. +type AzureVMWorkloadSQLDatabaseProtectedItem struct { // FriendlyName - Friendly name of the DB represented by this backup item. FriendlyName *string `json:"friendlyName,omitempty"` // ServerName - Host/Cluster Name for instance or AG @@ -4877,2620 +2967,1986 @@ type AzureVMWorkloadSAPAseDatabaseProtectedItem struct { ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) MarshalJSON() ([]byte, error) { - avwsadpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadSAPAseDatabase +// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) MarshalJSON() ([]byte, error) { + avwsdpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadSQLDatabase objectMap := make(map[string]interface{}) - if avwsadpi.FriendlyName != nil { - objectMap["friendlyName"] = avwsadpi.FriendlyName + if avwsdpi.FriendlyName != nil { + objectMap["friendlyName"] = avwsdpi.FriendlyName } - if avwsadpi.ServerName != nil { - objectMap["serverName"] = avwsadpi.ServerName + if avwsdpi.ServerName != nil { + objectMap["serverName"] = avwsdpi.ServerName } - if avwsadpi.ParentName != nil { - objectMap["parentName"] = avwsadpi.ParentName + if avwsdpi.ParentName != nil { + objectMap["parentName"] = avwsdpi.ParentName } - if avwsadpi.ParentType != nil { - objectMap["parentType"] = avwsadpi.ParentType + if avwsdpi.ParentType != nil { + objectMap["parentType"] = avwsdpi.ParentType } - if avwsadpi.ProtectionStatus != nil { - objectMap["protectionStatus"] = avwsadpi.ProtectionStatus + if avwsdpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = avwsdpi.ProtectionStatus } - if avwsadpi.ProtectionState != "" { - objectMap["protectionState"] = avwsadpi.ProtectionState + if avwsdpi.ProtectionState != "" { + objectMap["protectionState"] = avwsdpi.ProtectionState } - if avwsadpi.LastBackupStatus != "" { - objectMap["lastBackupStatus"] = avwsadpi.LastBackupStatus + if avwsdpi.LastBackupStatus != "" { + objectMap["lastBackupStatus"] = avwsdpi.LastBackupStatus } - if avwsadpi.LastBackupTime != nil { - objectMap["lastBackupTime"] = avwsadpi.LastBackupTime + if avwsdpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = avwsdpi.LastBackupTime } - if avwsadpi.LastBackupErrorDetail != nil { - objectMap["lastBackupErrorDetail"] = avwsadpi.LastBackupErrorDetail + if avwsdpi.LastBackupErrorDetail != nil { + objectMap["lastBackupErrorDetail"] = avwsdpi.LastBackupErrorDetail } - if avwsadpi.ProtectedItemDataSourceID != nil { - objectMap["protectedItemDataSourceId"] = avwsadpi.ProtectedItemDataSourceID + if avwsdpi.ProtectedItemDataSourceID != nil { + objectMap["protectedItemDataSourceId"] = avwsdpi.ProtectedItemDataSourceID } - if avwsadpi.ProtectedItemHealthStatus != "" { - objectMap["protectedItemHealthStatus"] = avwsadpi.ProtectedItemHealthStatus + if avwsdpi.ProtectedItemHealthStatus != "" { + objectMap["protectedItemHealthStatus"] = avwsdpi.ProtectedItemHealthStatus } - if avwsadpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = avwsadpi.ExtendedInfo + if avwsdpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = avwsdpi.ExtendedInfo } - if avwsadpi.BackupManagementType != "" { - objectMap["backupManagementType"] = avwsadpi.BackupManagementType + if avwsdpi.BackupManagementType != "" { + objectMap["backupManagementType"] = avwsdpi.BackupManagementType } - if avwsadpi.WorkloadType != "" { - objectMap["workloadType"] = avwsadpi.WorkloadType + if avwsdpi.WorkloadType != "" { + objectMap["workloadType"] = avwsdpi.WorkloadType } - if avwsadpi.ContainerName != nil { - objectMap["containerName"] = avwsadpi.ContainerName + if avwsdpi.ContainerName != nil { + objectMap["containerName"] = avwsdpi.ContainerName } - if avwsadpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = avwsadpi.SourceResourceID + if avwsdpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = avwsdpi.SourceResourceID } - if avwsadpi.PolicyID != nil { - objectMap["policyId"] = avwsadpi.PolicyID + if avwsdpi.PolicyID != nil { + objectMap["policyId"] = avwsdpi.PolicyID } - if avwsadpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = avwsadpi.LastRecoveryPoint + if avwsdpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = avwsdpi.LastRecoveryPoint } - if avwsadpi.BackupSetName != nil { - objectMap["backupSetName"] = avwsadpi.BackupSetName + if avwsdpi.BackupSetName != nil { + objectMap["backupSetName"] = avwsdpi.BackupSetName } - if avwsadpi.CreateMode != "" { - objectMap["createMode"] = avwsadpi.CreateMode + if avwsdpi.CreateMode != "" { + objectMap["createMode"] = avwsdpi.CreateMode } - if avwsadpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = avwsadpi.DeferredDeleteTimeInUTC + if avwsdpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = avwsdpi.DeferredDeleteTimeInUTC } - if avwsadpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = avwsadpi.IsScheduledForDeferredDelete + if avwsdpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = avwsdpi.IsScheduledForDeferredDelete } - if avwsadpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = avwsadpi.DeferredDeleteTimeRemaining + if avwsdpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = avwsdpi.DeferredDeleteTimeRemaining } - if avwsadpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = avwsadpi.IsDeferredDeleteScheduleUpcoming + if avwsdpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = avwsdpi.IsDeferredDeleteScheduleUpcoming } - if avwsadpi.IsRehydrate != nil { - objectMap["isRehydrate"] = avwsadpi.IsRehydrate + if avwsdpi.IsRehydrate != nil { + objectMap["isRehydrate"] = avwsdpi.IsRehydrate } - if avwsadpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = avwsadpi.ProtectedItemType + if avwsdpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = avwsdpi.ProtectedItemType } return json.Marshal(objectMap) } -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { return nil, false } -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { return nil, false } -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { return nil, false } -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { return nil, false } -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { return nil, false } -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { return nil, false } -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return &avwsadpi, true +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return &avwsdpi, true } -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return &avwsadpi, true +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return nil, false +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return &avwsdpi, true } -// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { return nil, false } -// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { return nil, false } -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { return nil, false } -// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { +// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { return nil, false } -// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &avwsadpi, true +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &avwsdpi, true } -// AzureVMWorkloadSAPAseDatabaseWorkloadItem azure VM workload-specific workload item representing SAP ASE -// Database. -type AzureVMWorkloadSAPAseDatabaseWorkloadItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if workload item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DB's present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected - SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management +// AzureWorkloadErrorInfo azure storage specific error information +type AzureWorkloadErrorInfo struct { + // ErrorCode - Error code. + ErrorCode *int32 `json:"errorCode,omitempty"` + // ErrorString - Localized error string. + ErrorString *string `json:"errorString,omitempty"` + // ErrorTitle - Title: Typically, the entity that the error pertains to. + ErrorTitle *string `json:"errorTitle,omitempty"` + // Recommendations - List of localized recommendations for above error code. + Recommendations *[]string `json:"recommendations,omitempty"` + // AdditionalDetails - Additional details for above error code. + AdditionalDetails *string `json:"additionalDetails,omitempty"` +} + +// AzureWorkloadJob azure storage specific job. +type AzureWorkloadJob struct { + // WorkloadType - Workload type of the job WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` + // Duration - Time elapsed during the execution of this job. + Duration *string `json:"duration,omitempty"` + // ActionsInfo - Gets or sets the state/actions applicable on this job like cancel/retry. + ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` + // ErrorDetails - Error details on execution of this job. + ErrorDetails *[]AzureWorkloadErrorInfo `json:"errorDetails,omitempty"` + // ExtendedInfo - Additional information about the job. + ExtendedInfo *AzureWorkloadJobExtendedInfo `json:"extendedInfo,omitempty"` + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' + JobType JobType `json:"jobType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { - avwsadwi.WorkloadItemType = WorkloadItemTypeSAPAseDatabase1 +// MarshalJSON is the custom marshaler for AzureWorkloadJob. +func (awj AzureWorkloadJob) MarshalJSON() ([]byte, error) { + awj.JobType = JobTypeAzureWorkloadJob objectMap := make(map[string]interface{}) - if avwsadwi.ParentName != nil { - objectMap["parentName"] = avwsadwi.ParentName + if awj.WorkloadType != nil { + objectMap["workloadType"] = awj.WorkloadType + } + if awj.Duration != nil { + objectMap["duration"] = awj.Duration + } + if awj.ActionsInfo != nil { + objectMap["actionsInfo"] = awj.ActionsInfo } - if avwsadwi.ServerName != nil { - objectMap["serverName"] = avwsadwi.ServerName + if awj.ErrorDetails != nil { + objectMap["errorDetails"] = awj.ErrorDetails + } + if awj.ExtendedInfo != nil { + objectMap["extendedInfo"] = awj.ExtendedInfo } - if avwsadwi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsadwi.IsAutoProtectable + if awj.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = awj.EntityFriendlyName } - if avwsadwi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsadwi.Subinquireditemcount + if awj.BackupManagementType != "" { + objectMap["backupManagementType"] = awj.BackupManagementType } - if avwsadwi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwsadwi.SubWorkloadItemCount + if awj.Operation != nil { + objectMap["operation"] = awj.Operation } - if avwsadwi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsadwi.BackupManagementType + if awj.Status != nil { + objectMap["status"] = awj.Status } - if avwsadwi.WorkloadType != nil { - objectMap["workloadType"] = avwsadwi.WorkloadType + if awj.StartTime != nil { + objectMap["startTime"] = awj.StartTime } - if avwsadwi.FriendlyName != nil { - objectMap["friendlyName"] = avwsadwi.FriendlyName + if awj.EndTime != nil { + objectMap["endTime"] = awj.EndTime } - if avwsadwi.ProtectionState != "" { - objectMap["protectionState"] = avwsadwi.ProtectionState + if awj.ActivityID != nil { + objectMap["activityId"] = awj.ActivityID } - if avwsadwi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwsadwi.WorkloadItemType + if awj.JobType != "" { + objectMap["jobType"] = awj.JobType } return json.Marshal(objectMap) } -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwsadwi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { - return &avwsadwi, true -} - -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { +// AsAzureIaaSVMJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { +// AsAzureStorageJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsAzureStorageJob() (*AzureStorageJob, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { - return nil, false +// AsAzureWorkloadJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { + return &awj, true } -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { +// AsDpmJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsDpmJob() (*DpmJob, bool) { return nil, false } -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { +// AsMabJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsMabJob() (*MabJob, bool) { return nil, false } -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { +// AsJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsJob() (*Job, bool) { return nil, false } -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwsadwi, true +// AsBasicJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsBasicJob() (BasicJob, bool) { + return &awj, true } -// AzureVMWorkloadSAPAseSystemProtectableItem azure VM workload-specific protectable item representing SAP -// ASE System. -type AzureVMWorkloadSAPAseSystemProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - 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 - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +// AzureWorkloadJobExtendedInfo azure VM workload-specific additional information for job. +type AzureWorkloadJobExtendedInfo struct { + // TasksList - List of tasks for this job + TasksList *[]AzureWorkloadJobTaskDetails `json:"tasksList,omitempty"` + // PropertyBag - Job properties. + PropertyBag map[string]*string `json:"propertyBag"` + // DynamicErrorMessage - Non localized error message on job execution. + DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` } -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) MarshalJSON() ([]byte, error) { - avwsaspi.ProtectableItemType = ProtectableItemTypeSAPAseSystem +// MarshalJSON is the custom marshaler for AzureWorkloadJobExtendedInfo. +func (awjei AzureWorkloadJobExtendedInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if avwsaspi.ParentName != nil { - objectMap["parentName"] = avwsaspi.ParentName + if awjei.TasksList != nil { + objectMap["tasksList"] = awjei.TasksList } - if avwsaspi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwsaspi.ParentUniqueName + if awjei.PropertyBag != nil { + objectMap["propertyBag"] = awjei.PropertyBag } - if avwsaspi.ServerName != nil { - objectMap["serverName"] = avwsaspi.ServerName - } - if avwsaspi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsaspi.IsAutoProtectable - } - if avwsaspi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwsaspi.IsAutoProtected - } - if avwsaspi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsaspi.Subinquireditemcount - } - if avwsaspi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwsaspi.Subprotectableitemcount - } - if avwsaspi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwsaspi.Prebackupvalidation - } - if avwsaspi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsaspi.BackupManagementType - } - if avwsaspi.WorkloadType != nil { - objectMap["workloadType"] = avwsaspi.WorkloadType - } - if avwsaspi.FriendlyName != nil { - objectMap["friendlyName"] = avwsaspi.FriendlyName - } - if avwsaspi.ProtectionState != "" { - objectMap["protectionState"] = avwsaspi.ProtectionState - } - if avwsaspi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwsaspi.ProtectableItemType + if awjei.DynamicErrorMessage != nil { + objectMap["dynamicErrorMessage"] = awjei.DynamicErrorMessage } return json.Marshal(objectMap) } -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false +// AzureWorkloadJobTaskDetails azure VM workload specific job task details. +type AzureWorkloadJobTaskDetails struct { + // TaskID - The task display name. + TaskID *string `json:"taskId,omitempty"` + // Status - The status. + Status *string `json:"status,omitempty"` } -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false +// BasicAzureWorkloadPointInTimeRecoveryPoint recovery point specific to PointInTime +type BasicAzureWorkloadPointInTimeRecoveryPoint interface { + AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) + AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) } -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false +// AzureWorkloadPointInTimeRecoveryPoint recovery point specific to PointInTime +type AzureWorkloadPointInTimeRecoveryPoint struct { + // TimeRanges - List of log ranges + TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` + // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' + Type RestorePointType `json:"type,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` } -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} +func unmarshalBasicAzureWorkloadPointInTimeRecoveryPoint(body []byte) (BasicAzureWorkloadPointInTimeRecoveryPoint, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwsaspi, true + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): + var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awshpitrp) + return awshpitrp, err + default: + var awpitrp AzureWorkloadPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awpitrp) + return awpitrp, err + } } +func unmarshalBasicAzureWorkloadPointInTimeRecoveryPointArray(body []byte) ([]BasicAzureWorkloadPointInTimeRecoveryPoint, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return &avwsaspi, true -} + awpitrpArray := make([]BasicAzureWorkloadPointInTimeRecoveryPoint, len(rawMessages)) -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false + for index, rawMessage := range rawMessages { + awpitrp, err := unmarshalBasicAzureWorkloadPointInTimeRecoveryPoint(*rawMessage) + if err != nil { + return nil, err + } + awpitrpArray[index] = awpitrp + } + return awpitrpArray, nil } -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false +// MarshalJSON is the custom marshaler for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { + awpitrp.ObjectType = ObjectTypeAzureWorkloadPointInTimeRecoveryPoint + objectMap := make(map[string]interface{}) + if awpitrp.TimeRanges != nil { + objectMap["timeRanges"] = awpitrp.TimeRanges + } + if awpitrp.ObjectType != "" { + objectMap["objectType"] = awpitrp.ObjectType + } + return json.Marshal(objectMap) } -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { + return &awpitrp, true } -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { + return &awpitrp, true } -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { return nil, false } -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return nil, false +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return &awpitrp, true } -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { return nil, false } -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwsaspi, true -} - -// AzureVMWorkloadSAPAseSystemWorkloadItem azure VM workload-specific workload item representing SAP ASE -// System. -type AzureVMWorkloadSAPAseSystemWorkloadItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if workload item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DB's present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected - SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) MarshalJSON() ([]byte, error) { - avwsaswi.WorkloadItemType = WorkloadItemTypeSAPAseSystem1 - objectMap := make(map[string]interface{}) - if avwsaswi.ParentName != nil { - objectMap["parentName"] = avwsaswi.ParentName - } - if avwsaswi.ServerName != nil { - objectMap["serverName"] = avwsaswi.ServerName - } - if avwsaswi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsaswi.IsAutoProtectable - } - if avwsaswi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsaswi.Subinquireditemcount - } - if avwsaswi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwsaswi.SubWorkloadItemCount - } - if avwsaswi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsaswi.BackupManagementType - } - if avwsaswi.WorkloadType != nil { - objectMap["workloadType"] = avwsaswi.WorkloadType - } - if avwsaswi.FriendlyName != nil { - objectMap["friendlyName"] = avwsaswi.FriendlyName - } - if avwsaswi.ProtectionState != "" { - objectMap["protectionState"] = avwsaswi.ProtectionState - } - if avwsaswi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwsaswi.WorkloadItemType - } - return json.Marshal(objectMap) -} - -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { return nil, false } -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwsaswi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { - return &avwsaswi, true -} - -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { return nil, false } -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { return nil, false } -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwsaswi, true +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awpitrp, true } -// AzureVMWorkloadSAPHanaDatabaseProtectableItem azure VM workload-specific protectable item representing -// SAP HANA Database. -type AzureVMWorkloadSAPHanaDatabaseProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - 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 - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +// AzureWorkloadPointInTimeRestoreRequest azureWorkload SAP Hana -specific restore. Specifically for +// PointInTime/Log restore +type AzureWorkloadPointInTimeRestoreRequest struct { + // PointInTime - PointInTime value + PointInTime *date.Time `json:"pointInTime,omitempty"` + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) MarshalJSON() ([]byte, error) { - avwshdpi.ProtectableItemType = ProtectableItemTypeSAPHanaDatabase +// MarshalJSON is the custom marshaler for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { + awpitrr.ObjectType = ObjectTypeAzureWorkloadPointInTimeRestoreRequest objectMap := make(map[string]interface{}) - if avwshdpi.ParentName != nil { - objectMap["parentName"] = avwshdpi.ParentName - } - if avwshdpi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwshdpi.ParentUniqueName - } - if avwshdpi.ServerName != nil { - objectMap["serverName"] = avwshdpi.ServerName - } - if avwshdpi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwshdpi.IsAutoProtectable - } - if avwshdpi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwshdpi.IsAutoProtected - } - if avwshdpi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwshdpi.Subinquireditemcount - } - if avwshdpi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwshdpi.Subprotectableitemcount + if awpitrr.PointInTime != nil { + objectMap["pointInTime"] = awpitrr.PointInTime } - if avwshdpi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwshdpi.Prebackupvalidation + if awpitrr.RecoveryType != "" { + objectMap["recoveryType"] = awpitrr.RecoveryType } - if avwshdpi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwshdpi.BackupManagementType + if awpitrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awpitrr.SourceResourceID } - if avwshdpi.WorkloadType != nil { - objectMap["workloadType"] = avwshdpi.WorkloadType + if awpitrr.PropertyBag != nil { + objectMap["propertyBag"] = awpitrr.PropertyBag } - if avwshdpi.FriendlyName != nil { - objectMap["friendlyName"] = avwshdpi.FriendlyName + if awpitrr.TargetInfo != nil { + objectMap["targetInfo"] = awpitrr.TargetInfo } - if avwshdpi.ProtectionState != "" { - objectMap["protectionState"] = avwshdpi.ProtectionState + if awpitrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awpitrr.RecoveryMode } - if avwshdpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwshdpi.ProtectableItemType + if awpitrr.ObjectType != "" { + objectMap["objectType"] = awpitrr.ObjectType } return json.Marshal(objectMap) } -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return &awpitrr, true } -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awpitrr, true } -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwshdpi, true +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false } -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return &avwshdpi, true +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false } -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { return nil, false } -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { return nil, false } -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return nil, false +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awpitrr, true } -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false +// BasicAzureWorkloadRecoveryPoint workload specific recovery point, specifically encapsulates full/diff recovery point +type BasicAzureWorkloadRecoveryPoint interface { + AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) + AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) + AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) + AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) + AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) } -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwshdpi, true +// AzureWorkloadRecoveryPoint workload specific recovery point, specifically encapsulates full/diff recovery +// point +type AzureWorkloadRecoveryPoint struct { + // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' + Type RestorePointType `json:"type,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` } -// AzureVMWorkloadSAPHanaDatabaseProtectedItem azure VM workload-specific protected item representing SAP -// HANA Database. -type AzureVMWorkloadSAPHanaDatabaseProtectedItem struct { - // FriendlyName - Friendly name of the DB represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // ParentName - Parent name of the DB such as Instance or Availability Group. - ParentName *string `json:"parentName,omitempty"` - // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed - ParentType *string `json:"parentType,omitempty"` - // ProtectionStatus - Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' - LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // LastBackupErrorDetail - Error details in last backup - LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` - // ProtectedItemDataSourceID - Data ID of the protected item. - ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` - // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' - ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` - // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) MarshalJSON() ([]byte, error) { - avwshdpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase - objectMap := make(map[string]interface{}) - if avwshdpi.FriendlyName != nil { - objectMap["friendlyName"] = avwshdpi.FriendlyName - } - if avwshdpi.ServerName != nil { - objectMap["serverName"] = avwshdpi.ServerName - } - if avwshdpi.ParentName != nil { - objectMap["parentName"] = avwshdpi.ParentName - } - if avwshdpi.ParentType != nil { - objectMap["parentType"] = avwshdpi.ParentType - } - if avwshdpi.ProtectionStatus != nil { - objectMap["protectionStatus"] = avwshdpi.ProtectionStatus - } - if avwshdpi.ProtectionState != "" { - objectMap["protectionState"] = avwshdpi.ProtectionState - } - if avwshdpi.LastBackupStatus != "" { - objectMap["lastBackupStatus"] = avwshdpi.LastBackupStatus - } - if avwshdpi.LastBackupTime != nil { - objectMap["lastBackupTime"] = avwshdpi.LastBackupTime - } - if avwshdpi.LastBackupErrorDetail != nil { - objectMap["lastBackupErrorDetail"] = avwshdpi.LastBackupErrorDetail - } - if avwshdpi.ProtectedItemDataSourceID != nil { - objectMap["protectedItemDataSourceId"] = avwshdpi.ProtectedItemDataSourceID - } - if avwshdpi.ProtectedItemHealthStatus != "" { - objectMap["protectedItemHealthStatus"] = avwshdpi.ProtectedItemHealthStatus - } - if avwshdpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = avwshdpi.ExtendedInfo - } - if avwshdpi.BackupManagementType != "" { - objectMap["backupManagementType"] = avwshdpi.BackupManagementType - } - if avwshdpi.WorkloadType != "" { - objectMap["workloadType"] = avwshdpi.WorkloadType - } - if avwshdpi.ContainerName != nil { - objectMap["containerName"] = avwshdpi.ContainerName - } - if avwshdpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = avwshdpi.SourceResourceID - } - if avwshdpi.PolicyID != nil { - objectMap["policyId"] = avwshdpi.PolicyID - } - if avwshdpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = avwshdpi.LastRecoveryPoint - } - if avwshdpi.BackupSetName != nil { - objectMap["backupSetName"] = avwshdpi.BackupSetName - } - if avwshdpi.CreateMode != "" { - objectMap["createMode"] = avwshdpi.CreateMode - } - if avwshdpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = avwshdpi.DeferredDeleteTimeInUTC - } - if avwshdpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = avwshdpi.IsScheduledForDeferredDelete +func unmarshalBasicAzureWorkloadRecoveryPoint(body []byte) (BasicAzureWorkloadRecoveryPoint, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err } - if avwshdpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = avwshdpi.DeferredDeleteTimeRemaining + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadPointInTimeRecoveryPoint): + var awpitrp AzureWorkloadPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awpitrp) + return awpitrp, err + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): + var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awshpitrp) + return awshpitrp, err + case string(ObjectTypeAzureWorkloadSAPHanaRecoveryPoint): + var awshrp AzureWorkloadSAPHanaRecoveryPoint + err := json.Unmarshal(body, &awshrp) + return awshrp, err + case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): + var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awspitrp) + return awspitrp, err + case string(ObjectTypeAzureWorkloadSQLRecoveryPoint): + var awsrp AzureWorkloadSQLRecoveryPoint + err := json.Unmarshal(body, &awsrp) + return awsrp, err + default: + var awrp AzureWorkloadRecoveryPoint + err := json.Unmarshal(body, &awrp) + return awrp, err } - if avwshdpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = avwshdpi.IsDeferredDeleteScheduleUpcoming +} +func unmarshalBasicAzureWorkloadRecoveryPointArray(body []byte) ([]BasicAzureWorkloadRecoveryPoint, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err } - if avwshdpi.IsRehydrate != nil { - objectMap["isRehydrate"] = avwshdpi.IsRehydrate + + awrpArray := make([]BasicAzureWorkloadRecoveryPoint, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awrp, err := unmarshalBasicAzureWorkloadRecoveryPoint(*rawMessage) + if err != nil { + return nil, err + } + awrpArray[index] = awrp } - if avwshdpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = avwshdpi.ProtectedItemType + return awrpArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) MarshalJSON() ([]byte, error) { + awrp.ObjectType = ObjectTypeAzureWorkloadRecoveryPoint + objectMap := make(map[string]interface{}) + if awrp.ObjectType != "" { + objectMap["objectType"] = awrp.ObjectType } return json.Marshal(objectMap) } -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return &awrp, true } -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return &awrp, true } -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { return nil, false } -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return &avwshdpi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return &avwshdpi, true -} - -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { return nil, false } -// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { return nil, false } -// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { return nil, false } -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { return nil, false } -// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { return nil, false } -// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &avwshdpi, true +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awrp, true } -// AzureVMWorkloadSAPHanaDatabaseWorkloadItem azure VM workload-specific workload item representing SAP -// HANA Database. -type AzureVMWorkloadSAPHanaDatabaseWorkloadItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if workload item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DB's present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected - SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +// BasicAzureWorkloadRestoreRequest azureWorkload-specific restore. +type BasicAzureWorkloadRestoreRequest interface { + AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) + AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) + AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) + AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) + AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) + AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) + AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) + AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) } -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { - avwshdwi.WorkloadItemType = WorkloadItemTypeSAPHanaDatabase1 - objectMap := make(map[string]interface{}) - if avwshdwi.ParentName != nil { - objectMap["parentName"] = avwshdwi.ParentName +// AzureWorkloadRestoreRequest azureWorkload-specific restore. +type AzureWorkloadRestoreRequest struct { + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicAzureWorkloadRestoreRequest(body []byte) (BasicAzureWorkloadRestoreRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err } - if avwshdwi.ServerName != nil { - objectMap["serverName"] = avwshdwi.ServerName + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadPointInTimeRestoreRequest): + var awpitrr AzureWorkloadPointInTimeRestoreRequest + err := json.Unmarshal(body, &awpitrr) + return awpitrr, err + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): + var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest + err := json.Unmarshal(body, &awshpitrr) + return awshpitrr, err + case string(ObjectTypeAzureWorkloadSAPHanaRestoreRequest): + var awshrr AzureWorkloadSAPHanaRestoreRequest + err := json.Unmarshal(body, &awshrr) + return awshrr, err + case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): + var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest + err := json.Unmarshal(body, &awspitrr) + return awspitrr, err + case string(ObjectTypeAzureWorkloadSQLRestoreRequest): + var awsrr AzureWorkloadSQLRestoreRequest + err := json.Unmarshal(body, &awsrr) + return awsrr, err + default: + var awrr AzureWorkloadRestoreRequest + err := json.Unmarshal(body, &awrr) + return awrr, err } - if avwshdwi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwshdwi.IsAutoProtectable +} +func unmarshalBasicAzureWorkloadRestoreRequestArray(body []byte) ([]BasicAzureWorkloadRestoreRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err } - if avwshdwi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwshdwi.Subinquireditemcount + + awrrArray := make([]BasicAzureWorkloadRestoreRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awrr, err := unmarshalBasicAzureWorkloadRestoreRequest(*rawMessage) + if err != nil { + return nil, err + } + awrrArray[index] = awrr } - if avwshdwi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwshdwi.SubWorkloadItemCount + return awrrArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) MarshalJSON() ([]byte, error) { + awrr.ObjectType = ObjectTypeAzureWorkloadRestoreRequest + objectMap := make(map[string]interface{}) + if awrr.RecoveryType != "" { + objectMap["recoveryType"] = awrr.RecoveryType } - if avwshdwi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwshdwi.BackupManagementType + if awrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awrr.SourceResourceID } - if avwshdwi.WorkloadType != nil { - objectMap["workloadType"] = avwshdwi.WorkloadType + if awrr.PropertyBag != nil { + objectMap["propertyBag"] = awrr.PropertyBag } - if avwshdwi.FriendlyName != nil { - objectMap["friendlyName"] = avwshdwi.FriendlyName + if awrr.TargetInfo != nil { + objectMap["targetInfo"] = awrr.TargetInfo } - if avwshdwi.ProtectionState != "" { - objectMap["protectionState"] = avwshdwi.ProtectionState + if awrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awrr.RecoveryMode } - if avwshdwi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwshdwi.WorkloadItemType + if awrr.ObjectType != "" { + objectMap["objectType"] = awrr.ObjectType } return json.Marshal(objectMap) } -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { return nil, false } -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwshdwi, true +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return &awrr, true +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awrr, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false } -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { - return &avwshdwi, true +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false } -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { return nil, false } -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { return nil, false } -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwshdwi, true +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awrr, true } -// AzureVMWorkloadSAPHanaSystemProtectableItem azure VM workload-specific protectable item representing SAP -// HANA System. -type AzureVMWorkloadSAPHanaSystemProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - 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 - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +// AzureWorkloadSAPHanaPointInTimeRecoveryPoint recovery point specific to PointInTime in SAPHana +type AzureWorkloadSAPHanaPointInTimeRecoveryPoint struct { + // TimeRanges - List of log ranges + TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` + // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' + Type RestorePointType `json:"type,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) MarshalJSON() ([]byte, error) { - avwshspi.ProtectableItemType = ProtectableItemTypeSAPHanaSystem +// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { + awshpitrp.ObjectType = ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint objectMap := make(map[string]interface{}) - if avwshspi.ParentName != nil { - objectMap["parentName"] = avwshspi.ParentName - } - if avwshspi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwshspi.ParentUniqueName - } - if avwshspi.ServerName != nil { - objectMap["serverName"] = avwshspi.ServerName - } - if avwshspi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwshspi.IsAutoProtectable - } - if avwshspi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwshspi.IsAutoProtected - } - if avwshspi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwshspi.Subinquireditemcount - } - if avwshspi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwshspi.Subprotectableitemcount - } - if avwshspi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwshspi.Prebackupvalidation - } - if avwshspi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwshspi.BackupManagementType - } - if avwshspi.WorkloadType != nil { - objectMap["workloadType"] = avwshspi.WorkloadType - } - if avwshspi.FriendlyName != nil { - objectMap["friendlyName"] = avwshspi.FriendlyName - } - if avwshspi.ProtectionState != "" { - objectMap["protectionState"] = avwshspi.ProtectionState + if awshpitrp.TimeRanges != nil { + objectMap["timeRanges"] = awshpitrp.TimeRanges } - if avwshspi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwshspi.ProtectableItemType + if awshpitrp.ObjectType != "" { + objectMap["objectType"] = awshpitrp.ObjectType } return json.Marshal(objectMap) } -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { + return &awshpitrp, true } -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { return nil, false } -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwshspi, true +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return &awshpitrp, true } -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return &awshpitrp, true } -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return &avwshspi, true -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { return nil, false } -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { return nil, false } -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { return nil, false } -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { return nil, false } -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwshspi, true +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awshpitrp, true } -// AzureVMWorkloadSAPHanaSystemWorkloadItem azure VM workload-specific workload item representing SAP HANA -// System. -type AzureVMWorkloadSAPHanaSystemWorkloadItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if workload item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DB's present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected - SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +// AzureWorkloadSAPHanaPointInTimeRestoreRequest azureWorkload SAP Hana -specific restore. Specifically for +// PointInTime/Log restore +type AzureWorkloadSAPHanaPointInTimeRestoreRequest struct { + // PointInTime - PointInTime value + PointInTime *date.Time `json:"pointInTime,omitempty"` + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) MarshalJSON() ([]byte, error) { - avwshswi.WorkloadItemType = WorkloadItemTypeSAPHanaSystem1 +// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { + awshpitrr.ObjectType = ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest objectMap := make(map[string]interface{}) - if avwshswi.ParentName != nil { - objectMap["parentName"] = avwshswi.ParentName - } - if avwshswi.ServerName != nil { - objectMap["serverName"] = avwshswi.ServerName - } - if avwshswi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwshswi.IsAutoProtectable - } - if avwshswi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwshswi.Subinquireditemcount + if awshpitrr.PointInTime != nil { + objectMap["pointInTime"] = awshpitrr.PointInTime } - if avwshswi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwshswi.SubWorkloadItemCount + if awshpitrr.RecoveryType != "" { + objectMap["recoveryType"] = awshpitrr.RecoveryType } - if avwshswi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwshswi.BackupManagementType + if awshpitrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awshpitrr.SourceResourceID } - if avwshswi.WorkloadType != nil { - objectMap["workloadType"] = avwshswi.WorkloadType + if awshpitrr.PropertyBag != nil { + objectMap["propertyBag"] = awshpitrr.PropertyBag } - if avwshswi.FriendlyName != nil { - objectMap["friendlyName"] = avwshswi.FriendlyName + if awshpitrr.TargetInfo != nil { + objectMap["targetInfo"] = awshpitrr.TargetInfo } - if avwshswi.ProtectionState != "" { - objectMap["protectionState"] = avwshswi.ProtectionState + if awshpitrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awshpitrr.RecoveryMode } - if avwshswi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwshswi.WorkloadItemType + if awshpitrr.ObjectType != "" { + objectMap["objectType"] = awshpitrr.ObjectType } return json.Marshal(objectMap) } -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { return nil, false } -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwshswi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awshpitrr, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return &awshpitrr, true +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { - return &avwshswi, true +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return &awshpitrr, true } -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { return nil, false } -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { return nil, false } -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwshswi, true +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false } -// AzureVMWorkloadSQLAvailabilityGroupProtectableItem azure VM workload-specific protectable item -// representing SQL Availability Group. -type AzureVMWorkloadSQLAvailabilityGroupProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - 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 - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awshpitrr, true +} + +// AzureWorkloadSAPHanaRecoveryPoint sAPHana specific recoverypoint, specifically encapsulates full/diff +// recoverypoints +type AzureWorkloadSAPHanaRecoveryPoint struct { + // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' + Type RestorePointType `json:"type,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) MarshalJSON() ([]byte, error) { - avwsagpi.ProtectableItemType = ProtectableItemTypeSQLAvailabilityGroupContainer +// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) MarshalJSON() ([]byte, error) { + awshrp.ObjectType = ObjectTypeAzureWorkloadSAPHanaRecoveryPoint objectMap := make(map[string]interface{}) - if avwsagpi.ParentName != nil { - objectMap["parentName"] = avwsagpi.ParentName - } - if avwsagpi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwsagpi.ParentUniqueName - } - if avwsagpi.ServerName != nil { - objectMap["serverName"] = avwsagpi.ServerName - } - if avwsagpi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsagpi.IsAutoProtectable - } - if avwsagpi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwsagpi.IsAutoProtected - } - if avwsagpi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsagpi.Subinquireditemcount - } - if avwsagpi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwsagpi.Subprotectableitemcount - } - if avwsagpi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwsagpi.Prebackupvalidation - } - if avwsagpi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsagpi.BackupManagementType - } - if avwsagpi.WorkloadType != nil { - objectMap["workloadType"] = avwsagpi.WorkloadType - } - if avwsagpi.FriendlyName != nil { - objectMap["friendlyName"] = avwsagpi.FriendlyName - } - if avwsagpi.ProtectionState != "" { - objectMap["protectionState"] = avwsagpi.ProtectionState - } - if avwsagpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwsagpi.ProtectableItemType + if awshrp.ObjectType != "" { + objectMap["objectType"] = awshrp.ObjectType } return json.Marshal(objectMap) } -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { return nil, false } -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwsagpi, true +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return &awshrp, true } -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return &awshrp, true } -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return &avwsagpi, true +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { return nil, false } -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { return nil, false } -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { return nil, false } -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awshrp, true } -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwsagpi, true +// BasicAzureWorkloadSAPHanaRestoreRequest azureWorkload SAP Hana-specific restore. +type BasicAzureWorkloadSAPHanaRestoreRequest interface { + AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) + AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) } -// AzureVMWorkloadSQLDatabaseProtectableItem azure VM workload-specific protectable item representing SQL -// Database. -type AzureVMWorkloadSQLDatabaseProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - 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 - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +// AzureWorkloadSAPHanaRestoreRequest azureWorkload SAP Hana-specific restore. +type AzureWorkloadSAPHanaRestoreRequest struct { + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) MarshalJSON() ([]byte, error) { - avwsdpi.ProtectableItemType = ProtectableItemTypeSQLDataBase - objectMap := make(map[string]interface{}) - if avwsdpi.ParentName != nil { - objectMap["parentName"] = avwsdpi.ParentName - } - if avwsdpi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwsdpi.ParentUniqueName - } - if avwsdpi.ServerName != nil { - objectMap["serverName"] = avwsdpi.ServerName - } - if avwsdpi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsdpi.IsAutoProtectable +func unmarshalBasicAzureWorkloadSAPHanaRestoreRequest(body []byte) (BasicAzureWorkloadSAPHanaRestoreRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err } - if avwsdpi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwsdpi.IsAutoProtected + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): + var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest + err := json.Unmarshal(body, &awshpitrr) + return awshpitrr, err + default: + var awshrr AzureWorkloadSAPHanaRestoreRequest + err := json.Unmarshal(body, &awshrr) + return awshrr, err } - if avwsdpi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsdpi.Subinquireditemcount +} +func unmarshalBasicAzureWorkloadSAPHanaRestoreRequestArray(body []byte) ([]BasicAzureWorkloadSAPHanaRestoreRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err } - if avwsdpi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwsdpi.Subprotectableitemcount + + awshrrArray := make([]BasicAzureWorkloadSAPHanaRestoreRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awshrr, err := unmarshalBasicAzureWorkloadSAPHanaRestoreRequest(*rawMessage) + if err != nil { + return nil, err + } + awshrrArray[index] = awshrr } - if avwsdpi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwsdpi.Prebackupvalidation + return awshrrArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) MarshalJSON() ([]byte, error) { + awshrr.ObjectType = ObjectTypeAzureWorkloadSAPHanaRestoreRequest + objectMap := make(map[string]interface{}) + if awshrr.RecoveryType != "" { + objectMap["recoveryType"] = awshrr.RecoveryType } - if avwsdpi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsdpi.BackupManagementType + if awshrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awshrr.SourceResourceID } - if avwsdpi.WorkloadType != nil { - objectMap["workloadType"] = avwsdpi.WorkloadType + if awshrr.PropertyBag != nil { + objectMap["propertyBag"] = awshrr.PropertyBag } - if avwsdpi.FriendlyName != nil { - objectMap["friendlyName"] = avwsdpi.FriendlyName + if awshrr.TargetInfo != nil { + objectMap["targetInfo"] = awshrr.TargetInfo } - if avwsdpi.ProtectionState != "" { - objectMap["protectionState"] = avwsdpi.ProtectionState + if awshrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awshrr.RecoveryMode } - if avwsdpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwsdpi.ProtectableItemType + if awshrr.ObjectType != "" { + objectMap["objectType"] = awshrr.ObjectType } return json.Marshal(objectMap) } -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { return nil, false } -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { return nil, false } -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwsdpi, true +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awshrr, true } -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return &awshrr, true } -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return &awshrr, true } -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return &avwsdpi, true +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false } -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { return nil, false } -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { return nil, false } -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { return nil, false } -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awshrr, true } -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwsdpi, true +// AzureWorkloadSQLPointInTimeRecoveryPoint recovery point specific to PointInTime +type AzureWorkloadSQLPointInTimeRecoveryPoint struct { + // TimeRanges - List of log ranges + TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` + // ExtendedInfo - Extended Info that provides data directory details. Will be populated in two cases: + // When a specific recovery point is accessed using GetRecoveryPoint + // Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter + ExtendedInfo *AzureWorkloadSQLRecoveryPointExtendedInfo `json:"extendedInfo,omitempty"` + // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' + Type RestorePointType `json:"type,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` } -// AzureVMWorkloadSQLDatabaseProtectedItem azure VM workload-specific protected item representing SQL -// Database. -type AzureVMWorkloadSQLDatabaseProtectedItem struct { - // FriendlyName - Friendly name of the DB represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // ParentName - Parent name of the DB such as Instance or Availability Group. - ParentName *string `json:"parentName,omitempty"` - // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed - ParentType *string `json:"parentType,omitempty"` - // ProtectionStatus - Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' - LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // LastBackupErrorDetail - Error details in last backup - LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` - // ProtectedItemDataSourceID - Data ID of the protected item. - ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` - // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' - ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` - // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) MarshalJSON() ([]byte, error) { - avwsdpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadSQLDatabase +// MarshalJSON is the custom marshaler for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { + awspitrp.ObjectType = ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint objectMap := make(map[string]interface{}) - if avwsdpi.FriendlyName != nil { - objectMap["friendlyName"] = avwsdpi.FriendlyName - } - if avwsdpi.ServerName != nil { - objectMap["serverName"] = avwsdpi.ServerName - } - if avwsdpi.ParentName != nil { - objectMap["parentName"] = avwsdpi.ParentName - } - if avwsdpi.ParentType != nil { - objectMap["parentType"] = avwsdpi.ParentType - } - if avwsdpi.ProtectionStatus != nil { - objectMap["protectionStatus"] = avwsdpi.ProtectionStatus - } - if avwsdpi.ProtectionState != "" { - objectMap["protectionState"] = avwsdpi.ProtectionState - } - if avwsdpi.LastBackupStatus != "" { - objectMap["lastBackupStatus"] = avwsdpi.LastBackupStatus - } - if avwsdpi.LastBackupTime != nil { - objectMap["lastBackupTime"] = avwsdpi.LastBackupTime - } - if avwsdpi.LastBackupErrorDetail != nil { - objectMap["lastBackupErrorDetail"] = avwsdpi.LastBackupErrorDetail - } - if avwsdpi.ProtectedItemDataSourceID != nil { - objectMap["protectedItemDataSourceId"] = avwsdpi.ProtectedItemDataSourceID - } - if avwsdpi.ProtectedItemHealthStatus != "" { - objectMap["protectedItemHealthStatus"] = avwsdpi.ProtectedItemHealthStatus - } - if avwsdpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = avwsdpi.ExtendedInfo - } - if avwsdpi.BackupManagementType != "" { - objectMap["backupManagementType"] = avwsdpi.BackupManagementType - } - if avwsdpi.WorkloadType != "" { - objectMap["workloadType"] = avwsdpi.WorkloadType - } - if avwsdpi.ContainerName != nil { - objectMap["containerName"] = avwsdpi.ContainerName - } - if avwsdpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = avwsdpi.SourceResourceID - } - if avwsdpi.PolicyID != nil { - objectMap["policyId"] = avwsdpi.PolicyID - } - if avwsdpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = avwsdpi.LastRecoveryPoint - } - if avwsdpi.BackupSetName != nil { - objectMap["backupSetName"] = avwsdpi.BackupSetName - } - if avwsdpi.CreateMode != "" { - objectMap["createMode"] = avwsdpi.CreateMode - } - if avwsdpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = avwsdpi.DeferredDeleteTimeInUTC - } - if avwsdpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = avwsdpi.IsScheduledForDeferredDelete - } - if avwsdpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = avwsdpi.DeferredDeleteTimeRemaining - } - if avwsdpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = avwsdpi.IsDeferredDeleteScheduleUpcoming + if awspitrp.TimeRanges != nil { + objectMap["timeRanges"] = awspitrp.TimeRanges } - if avwsdpi.IsRehydrate != nil { - objectMap["isRehydrate"] = avwsdpi.IsRehydrate + if awspitrp.ExtendedInfo != nil { + objectMap["extendedInfo"] = awspitrp.ExtendedInfo } - if avwsdpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = avwsdpi.ProtectedItemType + if awspitrp.ObjectType != "" { + objectMap["objectType"] = awspitrp.ObjectType } return json.Marshal(objectMap) } -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { return nil, false } -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return &awspitrp, true } -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { return nil, false } -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return &avwsdpi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return &awspitrp, true } -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return &avwsdpi, true -} - -// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return nil, false +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return &awspitrp, true } -// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { return nil, false } -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { return nil, false } -// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { return nil, false } -// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &avwsdpi, true +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awspitrp, true } -// AzureVMWorkloadSQLDatabaseWorkloadItem azure VM workload-specific workload item representing SQL -// Database. -type AzureVMWorkloadSQLDatabaseWorkloadItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if workload item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DB's present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected - SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +// AzureWorkloadSQLPointInTimeRestoreRequest azureWorkload SQL -specific restore. Specifically for +// PointInTime/Log restore +type AzureWorkloadSQLPointInTimeRestoreRequest struct { + // PointInTime - PointInTime value + PointInTime *date.Time `json:"pointInTime,omitempty"` + // ShouldUseAlternateTargetLocation - Default option set to true. If this is set to false, alternate data directory must be provided + ShouldUseAlternateTargetLocation *bool `json:"shouldUseAlternateTargetLocation,omitempty"` + // IsNonRecoverable - SQL specific property where user can chose to set no-recovery when restore operation is tried + IsNonRecoverable *bool `json:"isNonRecoverable,omitempty"` + // AlternateDirectoryPaths - Data directory details + AlternateDirectoryPaths *[]SQLDataDirectoryMapping `json:"alternateDirectoryPaths,omitempty"` + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { - avwsdwi.WorkloadItemType = WorkloadItemTypeSQLDataBase1 +// MarshalJSON is the custom marshaler for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { + awspitrr.ObjectType = ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest objectMap := make(map[string]interface{}) - if avwsdwi.ParentName != nil { - objectMap["parentName"] = avwsdwi.ParentName + if awspitrr.PointInTime != nil { + objectMap["pointInTime"] = awspitrr.PointInTime } - if avwsdwi.ServerName != nil { - objectMap["serverName"] = avwsdwi.ServerName + if awspitrr.ShouldUseAlternateTargetLocation != nil { + objectMap["shouldUseAlternateTargetLocation"] = awspitrr.ShouldUseAlternateTargetLocation } - if avwsdwi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsdwi.IsAutoProtectable + if awspitrr.IsNonRecoverable != nil { + objectMap["isNonRecoverable"] = awspitrr.IsNonRecoverable } - if avwsdwi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsdwi.Subinquireditemcount + if awspitrr.AlternateDirectoryPaths != nil { + objectMap["alternateDirectoryPaths"] = awspitrr.AlternateDirectoryPaths } - if avwsdwi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwsdwi.SubWorkloadItemCount + if awspitrr.RecoveryType != "" { + objectMap["recoveryType"] = awspitrr.RecoveryType } - if avwsdwi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsdwi.BackupManagementType + if awspitrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awspitrr.SourceResourceID } - if avwsdwi.WorkloadType != nil { - objectMap["workloadType"] = avwsdwi.WorkloadType + if awspitrr.PropertyBag != nil { + objectMap["propertyBag"] = awspitrr.PropertyBag } - if avwsdwi.FriendlyName != nil { - objectMap["friendlyName"] = avwsdwi.FriendlyName + if awspitrr.TargetInfo != nil { + objectMap["targetInfo"] = awspitrr.TargetInfo } - if avwsdwi.ProtectionState != "" { - objectMap["protectionState"] = avwsdwi.ProtectionState + if awspitrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awspitrr.RecoveryMode } - if avwsdwi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwsdwi.WorkloadItemType + if awspitrr.ObjectType != "" { + objectMap["objectType"] = awspitrr.ObjectType } return json.Marshal(objectMap) } -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { return nil, false } -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwsdwi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { - return nil, false +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awspitrr, true } -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { - return &avwsdwi, true -} - -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { return nil, false } -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { return nil, false } -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwsdwi, true -} - -// AzureVMWorkloadSQLInstanceProtectableItem azure VM workload-specific protectable item representing SQL -// Instance. -type AzureVMWorkloadSQLInstanceProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - 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 - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) MarshalJSON() ([]byte, error) { - avwsipi.ProtectableItemType = ProtectableItemTypeSQLInstance - objectMap := make(map[string]interface{}) - if avwsipi.ParentName != nil { - objectMap["parentName"] = avwsipi.ParentName - } - if avwsipi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwsipi.ParentUniqueName - } - if avwsipi.ServerName != nil { - objectMap["serverName"] = avwsipi.ServerName - } - if avwsipi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsipi.IsAutoProtectable - } - if avwsipi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwsipi.IsAutoProtected - } - if avwsipi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsipi.Subinquireditemcount - } - if avwsipi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwsipi.Subprotectableitemcount - } - if avwsipi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwsipi.Prebackupvalidation - } - if avwsipi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsipi.BackupManagementType - } - if avwsipi.WorkloadType != nil { - objectMap["workloadType"] = avwsipi.WorkloadType - } - if avwsipi.FriendlyName != nil { - objectMap["friendlyName"] = avwsipi.FriendlyName - } - if avwsipi.ProtectionState != "" { - objectMap["protectionState"] = avwsipi.ProtectionState - } - if avwsipi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwsipi.ProtectableItemType - } - return json.Marshal(objectMap) +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return &awspitrr, true } -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return &awspitrr, true } -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { return nil, false } -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwsipi, true +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awspitrr, true } -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false +// BasicAzureWorkloadSQLRecoveryPoint SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint +// along with extended info +type BasicAzureWorkloadSQLRecoveryPoint interface { + AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) } -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false +// AzureWorkloadSQLRecoveryPoint SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint +// along with extended info +type AzureWorkloadSQLRecoveryPoint struct { + // ExtendedInfo - Extended Info that provides data directory details. Will be populated in two cases: + // When a specific recovery point is accessed using GetRecoveryPoint + // Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter + ExtendedInfo *AzureWorkloadSQLRecoveryPointExtendedInfo `json:"extendedInfo,omitempty"` + // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' + Type RestorePointType `json:"type,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` } -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} +func unmarshalBasicAzureWorkloadSQLRecoveryPoint(body []byte) (BasicAzureWorkloadSQLRecoveryPoint, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): + var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awspitrp) + return awspitrp, err + default: + var awsrp AzureWorkloadSQLRecoveryPoint + err := json.Unmarshal(body, &awsrp) + return awsrp, err + } } +func unmarshalBasicAzureWorkloadSQLRecoveryPointArray(body []byte) ([]BasicAzureWorkloadSQLRecoveryPoint, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false + awsrpArray := make([]BasicAzureWorkloadSQLRecoveryPoint, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awsrp, err := unmarshalBasicAzureWorkloadSQLRecoveryPoint(*rawMessage) + if err != nil { + return nil, err + } + awsrpArray[index] = awsrp + } + return awsrpArray, nil } -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return &avwsipi, true +// MarshalJSON is the custom marshaler for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) MarshalJSON() ([]byte, error) { + awsrp.ObjectType = ObjectTypeAzureWorkloadSQLRecoveryPoint + objectMap := make(map[string]interface{}) + if awsrp.ExtendedInfo != nil { + objectMap["extendedInfo"] = awsrp.ExtendedInfo + } + if awsrp.ObjectType != "" { + objectMap["objectType"] = awsrp.ObjectType + } + return json.Marshal(objectMap) } -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { return nil, false } -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { return nil, false } -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { return nil, false } -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwsipi, true +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false } -// AzureVMWorkloadSQLInstanceWorkloadItem azure VM workload-specific workload item representing SQL -// Instance. -type AzureVMWorkloadSQLInstanceWorkloadItem struct { - // DataDirectoryPaths - Data Directory Paths for default directories - DataDirectoryPaths *[]SQLDataDirectory `json:"dataDirectoryPaths,omitempty"` - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if workload item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DB's present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected - SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return &awsrp, true } -// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) MarshalJSON() ([]byte, error) { - avwsiwi.WorkloadItemType = WorkloadItemTypeSQLInstance1 - objectMap := make(map[string]interface{}) - if avwsiwi.DataDirectoryPaths != nil { - objectMap["dataDirectoryPaths"] = avwsiwi.DataDirectoryPaths - } - if avwsiwi.ParentName != nil { - objectMap["parentName"] = avwsiwi.ParentName - } - if avwsiwi.ServerName != nil { - objectMap["serverName"] = avwsiwi.ServerName - } - if avwsiwi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsiwi.IsAutoProtectable - } - if avwsiwi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsiwi.Subinquireditemcount - } - if avwsiwi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwsiwi.SubWorkloadItemCount - } - if avwsiwi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsiwi.BackupManagementType - } - if avwsiwi.WorkloadType != nil { - objectMap["workloadType"] = avwsiwi.WorkloadType - } - if avwsiwi.FriendlyName != nil { - objectMap["friendlyName"] = avwsiwi.FriendlyName - } - if avwsiwi.ProtectionState != "" { - objectMap["protectionState"] = avwsiwi.ProtectionState - } - if avwsiwi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwsiwi.WorkloadItemType - } - return json.Marshal(objectMap) +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false } -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { return nil, false } -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwsiwi, true +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false } -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { - return nil, false +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return &awsrp, true } -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { - return nil, false +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return &awsrp, true } -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { - return &avwsiwi, true +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awsrp, true } -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { - return nil, false +// AzureWorkloadSQLRecoveryPointExtendedInfo extended info class details +type AzureWorkloadSQLRecoveryPointExtendedInfo struct { + // DataDirectoryTimeInUTC - READ-ONLY; UTC time at which data directory info was captured + DataDirectoryTimeInUTC *date.Time `json:"dataDirectoryTimeInUTC,omitempty"` + // DataDirectoryPaths - READ-ONLY; List of data directory paths during restore operation. + DataDirectoryPaths *[]SQLDataDirectory `json:"dataDirectoryPaths,omitempty"` } -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwsiwi, true +// MarshalJSON is the custom marshaler for AzureWorkloadSQLRecoveryPointExtendedInfo. +func (awsrpei AzureWorkloadSQLRecoveryPointExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) } -// BasicAzureWorkloadAutoProtectionIntent azure Recovery Services Vault specific protection intent item. -type BasicAzureWorkloadAutoProtectionIntent interface { - AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) - AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) +// BasicAzureWorkloadSQLRestoreRequest azureWorkload SQL -specific restore. Specifically for full/diff restore +type BasicAzureWorkloadSQLRestoreRequest interface { + AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) + AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) } -// AzureWorkloadAutoProtectionIntent azure Recovery Services Vault specific protection intent item. -type AzureWorkloadAutoProtectionIntent struct { - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. +// AzureWorkloadSQLRestoreRequest azureWorkload SQL -specific restore. Specifically for full/diff restore +type AzureWorkloadSQLRestoreRequest struct { + // ShouldUseAlternateTargetLocation - Default option set to true. If this is set to false, alternate data directory must be provided + ShouldUseAlternateTargetLocation *bool `json:"shouldUseAlternateTargetLocation,omitempty"` + // IsNonRecoverable - SQL specific property where user can chose to set no-recovery when restore operation is tried + IsNonRecoverable *bool `json:"isNonRecoverable,omitempty"` + // AlternateDirectoryPaths - Data directory details + AlternateDirectoryPaths *[]SQLDataDirectoryMapping `json:"alternateDirectoryPaths,omitempty"` + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId - ItemID *string `json:"itemId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' - ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } -func unmarshalBasicAzureWorkloadAutoProtectionIntent(body []byte) (BasicAzureWorkloadAutoProtectionIntent, error) { +func unmarshalBasicAzureWorkloadSQLRestoreRequest(body []byte) (BasicAzureWorkloadSQLRestoreRequest, error) { var m map[string]interface{} err := json.Unmarshal(body, &m) if err != nil { return nil, err } - switch m["protectionIntentItemType"] { - case string(ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent): - var awsapi AzureWorkloadSQLAutoProtectionIntent - err := json.Unmarshal(body, &awsapi) - return awsapi, err + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): + var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest + err := json.Unmarshal(body, &awspitrr) + return awspitrr, err default: - var awapi AzureWorkloadAutoProtectionIntent - err := json.Unmarshal(body, &awapi) - return awapi, err + var awsrr AzureWorkloadSQLRestoreRequest + err := json.Unmarshal(body, &awsrr) + return awsrr, err } } -func unmarshalBasicAzureWorkloadAutoProtectionIntentArray(body []byte) ([]BasicAzureWorkloadAutoProtectionIntent, error) { +func unmarshalBasicAzureWorkloadSQLRestoreRequestArray(body []byte) ([]BasicAzureWorkloadSQLRestoreRequest, error) { var rawMessages []*json.RawMessage err := json.Unmarshal(body, &rawMessages) if err != nil { return nil, err } - awapiArray := make([]BasicAzureWorkloadAutoProtectionIntent, len(rawMessages)) + awsrrArray := make([]BasicAzureWorkloadSQLRestoreRequest, len(rawMessages)) for index, rawMessage := range rawMessages { - awapi, err := unmarshalBasicAzureWorkloadAutoProtectionIntent(*rawMessage) + awsrr, err := unmarshalBasicAzureWorkloadSQLRestoreRequest(*rawMessage) if err != nil { return nil, err } - awapiArray[index] = awapi + awsrrArray[index] = awsrr } - return awapiArray, nil + return awsrrArray, nil } -// MarshalJSON is the custom marshaler for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) MarshalJSON() ([]byte, error) { - awapi.ProtectionIntentItemType = ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent +// MarshalJSON is the custom marshaler for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) MarshalJSON() ([]byte, error) { + awsrr.ObjectType = ObjectTypeAzureWorkloadSQLRestoreRequest objectMap := make(map[string]interface{}) - if awapi.BackupManagementType != "" { - objectMap["backupManagementType"] = awapi.BackupManagementType + if awsrr.ShouldUseAlternateTargetLocation != nil { + objectMap["shouldUseAlternateTargetLocation"] = awsrr.ShouldUseAlternateTargetLocation } - if awapi.SourceResourceID != nil { - objectMap["sourceResourceId"] = awapi.SourceResourceID + if awsrr.IsNonRecoverable != nil { + objectMap["isNonRecoverable"] = awsrr.IsNonRecoverable } - if awapi.ItemID != nil { - objectMap["itemId"] = awapi.ItemID + if awsrr.AlternateDirectoryPaths != nil { + objectMap["alternateDirectoryPaths"] = awsrr.AlternateDirectoryPaths } - if awapi.PolicyID != nil { - objectMap["policyId"] = awapi.PolicyID + if awsrr.RecoveryType != "" { + objectMap["recoveryType"] = awsrr.RecoveryType } - if awapi.ProtectionState != "" { - objectMap["protectionState"] = awapi.ProtectionState + if awsrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awsrr.SourceResourceID } - if awapi.ProtectionIntentItemType != "" { - objectMap["protectionIntentItemType"] = awapi.ProtectionIntentItemType + if awsrr.PropertyBag != nil { + objectMap["propertyBag"] = awsrr.PropertyBag } - return json.Marshal(objectMap) -} - -// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { - return nil, false -} - -// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { - return &awapi, true -} - -// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { - return nil, false -} - -// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { - return &awapi, true -} - -// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { - return &awapi, true -} - -// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { - return nil, false -} - -// AsProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { - return nil, false -} - -// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { - return &awapi, true -} - -// AzureWorkloadBackupRequest azureWorkload workload-specific backup request. -type AzureWorkloadBackupRequest struct { - // BackupType - Type of backup, viz. Full, Differential, Log or CopyOnlyFull. Possible values include: 'TypeEnumInvalid', 'TypeEnumFull', 'TypeEnumDifferential', 'TypeEnumLog', 'TypeEnumCopyOnlyFull' - BackupType TypeEnum `json:"backupType,omitempty"` - // EnableCompression - Bool for Compression setting - EnableCompression *bool `json:"enableCompression,omitempty"` - // RecoveryPointExpiryTimeInUTC - Backup copy will expire after the time specified (UTC). - RecoveryPointExpiryTimeInUTC *date.Time `json:"recoveryPointExpiryTimeInUTC,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' - ObjectType ObjectTypeBasicRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWorkloadBackupRequest. -func (awbr AzureWorkloadBackupRequest) MarshalJSON() ([]byte, error) { - awbr.ObjectType = ObjectTypeAzureWorkloadBackupRequest - objectMap := make(map[string]interface{}) - if awbr.BackupType != "" { - objectMap["backupType"] = awbr.BackupType - } - if awbr.EnableCompression != nil { - objectMap["enableCompression"] = awbr.EnableCompression + if awsrr.TargetInfo != nil { + objectMap["targetInfo"] = awsrr.TargetInfo } - if awbr.RecoveryPointExpiryTimeInUTC != nil { - objectMap["recoveryPointExpiryTimeInUTC"] = awbr.RecoveryPointExpiryTimeInUTC + if awsrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awsrr.RecoveryMode } - if awbr.ObjectType != "" { - objectMap["objectType"] = awbr.ObjectType + if awsrr.ObjectType != "" { + objectMap["objectType"] = awsrr.ObjectType } return json.Marshal(objectMap) } -// AsAzureFileShareBackupRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. -func (awbr AzureWorkloadBackupRequest) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { return nil, false } -// AsAzureWorkloadBackupRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. -func (awbr AzureWorkloadBackupRequest) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { - return &awbr, true -} - -// AsIaasVMBackupRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. -func (awbr AzureWorkloadBackupRequest) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { return nil, false } -// AsRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. -func (awbr AzureWorkloadBackupRequest) AsRequest() (*Request, bool) { +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { return nil, false } -// AsBasicRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. -func (awbr AzureWorkloadBackupRequest) AsBasicRequest() (BasicRequest, bool) { - return &awbr, true -} - -// BasicAzureWorkloadContainer container for the workloads running inside Azure Compute or Classic Compute. -type BasicAzureWorkloadContainer interface { - AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) - AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) - AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) -} - -// AzureWorkloadContainer container for the workloads running inside Azure Compute or Classic Compute. -type AzureWorkloadContainer struct { - // SourceResourceID - ARM ID of the virtual machine represented by this Azure Workload Container - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // LastUpdatedTime - Time stamp when this container was updated. - LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` - // ExtendedInfo - Additional details of a workload container. - ExtendedInfo *AzureWorkloadContainerExtendedInfo `json:"extendedInfo,omitempty"` - // WorkloadType - Workload type for which registration was sent. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` - // OperationType - Re-Do Operation. Possible values include: 'OperationTypeInvalid', 'OperationTypeRegister', 'OperationTypeReregister' - OperationType OperationType `json:"operationType,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -func unmarshalBasicAzureWorkloadContainer(body []byte) (BasicAzureWorkloadContainer, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["containerType"] { - case string(ContainerTypeSQLAGWorkLoadContainer1): - var aswcpc AzureSQLAGWorkloadContainerProtectionContainer - err := json.Unmarshal(body, &aswcpc) - return aswcpc, err - case string(ContainerTypeVMAppContainer1): - var avacpc AzureVMAppContainerProtectionContainer - err := json.Unmarshal(body, &avacpc) - return avacpc, err - default: - var awc AzureWorkloadContainer - err := json.Unmarshal(body, &awc) - return awc, err - } -} -func unmarshalBasicAzureWorkloadContainerArray(body []byte) ([]BasicAzureWorkloadContainer, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - awcArray := make([]BasicAzureWorkloadContainer, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awc, err := unmarshalBasicAzureWorkloadContainer(*rawMessage) - if err != nil { - return nil, err - } - awcArray[index] = awc - } - return awcArray, nil -} - -// MarshalJSON is the custom marshaler for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) MarshalJSON() ([]byte, error) { - awc.ContainerType = ContainerTypeAzureWorkloadContainer - objectMap := make(map[string]interface{}) - if awc.SourceResourceID != nil { - objectMap["sourceResourceId"] = awc.SourceResourceID - } - if awc.LastUpdatedTime != nil { - objectMap["lastUpdatedTime"] = awc.LastUpdatedTime - } - if awc.ExtendedInfo != nil { - objectMap["extendedInfo"] = awc.ExtendedInfo - } - if awc.WorkloadType != "" { - objectMap["workloadType"] = awc.WorkloadType - } - if awc.OperationType != "" { - objectMap["operationType"] = awc.OperationType - } - if awc.FriendlyName != nil { - objectMap["friendlyName"] = awc.FriendlyName - } - if awc.BackupManagementType != "" { - objectMap["backupManagementType"] = awc.BackupManagementType - } - if awc.RegistrationStatus != nil { - objectMap["registrationStatus"] = awc.RegistrationStatus - } - if awc.HealthStatus != nil { - objectMap["healthStatus"] = awc.HealthStatus - } - if awc.ContainerType != "" { - objectMap["containerType"] = awc.ContainerType - } - return json.Marshal(objectMap) +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awsrr, true } -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { return nil, false } -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { return nil, false } -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { return nil, false } -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return &awsrr, true } -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return &awsrr, true } -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { return nil, false } -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return &awc, true -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return &awc, true -} - -// AsDpmContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsDpmContainer() (*DpmContainer, bool) { +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { return nil, false } -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awsrr, true } -// AsGenericContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false +// BEKDetails BEK is bitlocker encryption key. +type BEKDetails struct { + // SecretURL - Secret is BEK. + SecretURL *string `json:"secretUrl,omitempty"` + // SecretVaultID - ID of the Key Vault where this Secret is stored. + SecretVaultID *string `json:"secretVaultId,omitempty"` + // SecretData - BEK data. + SecretData *string `json:"secretData,omitempty"` } -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false +// BMSRPQueryObject filters to list backup copies. +type BMSRPQueryObject struct { + // StartDate - Backup copies created after this time. + StartDate *date.Time `json:"startDate,omitempty"` + // EndDate - Backup copies created before this time. + EndDate *date.Time `json:"endDate,omitempty"` + // RestorePointQueryType - RestorePoint type. Possible values include: 'RestorePointQueryTypeInvalid', 'RestorePointQueryTypeFull', 'RestorePointQueryTypeLog', 'RestorePointQueryTypeDifferential', 'RestorePointQueryTypeFullAndDifferential', 'RestorePointQueryTypeAll' + RestorePointQueryType RestorePointQueryType `json:"restorePointQueryType,omitempty"` + // ExtendedInfo - In Get Recovery Point, it tells whether extended information about recovery point is asked. + ExtendedInfo *bool `json:"extendedInfo,omitempty"` } -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false +// DailyRetentionFormat daily retention format. +type DailyRetentionFormat struct { + // DaysOfTheMonth - List of days of the month. + DaysOfTheMonth *[]Day `json:"daysOfTheMonth,omitempty"` } -// AsMabContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false +// DailyRetentionSchedule daily retention schedule. +type DailyRetentionSchedule struct { + // RetentionTimes - Retention times of retention policy. + RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` + // RetentionDuration - Retention duration of retention Policy. + RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` } -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false +// Day day of the week. +type Day struct { + // Date - Date of the month + Date *int32 `json:"date,omitempty"` + // IsLast - Whether Date is last date of month + IsLast *bool `json:"isLast,omitempty"` } -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &awc, true +// DiskExclusionProperties ... +type DiskExclusionProperties struct { + // DiskLunList - List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. + DiskLunList *[]int32 `json:"diskLunList,omitempty"` + // IsInclusionList - Flag to indicate whether DiskLunList is to be included/ excluded from backup. + IsInclusionList *bool `json:"isInclusionList,omitempty"` } -// AzureWorkloadContainerExtendedInfo extended information of the container. -type AzureWorkloadContainerExtendedInfo struct { - // HostServerName - Host Os Name in case of Stand Alone and Cluster Name in case of distributed container. - HostServerName *string `json:"hostServerName,omitempty"` - // InquiryInfo - Inquiry Status for the container. - InquiryInfo *InquiryInfo `json:"inquiryInfo,omitempty"` - // NodesList - List of the nodes in case of distributed container. - NodesList *[]DistributedNodesInfo `json:"nodesList,omitempty"` +// DiskInformation disk information +type DiskInformation struct { + Lun *int32 `json:"lun,omitempty"` + Name *string `json:"name,omitempty"` } -// AzureWorkloadErrorInfo azure storage specific error information -type AzureWorkloadErrorInfo struct { - // ErrorCode - Error code. - ErrorCode *int32 `json:"errorCode,omitempty"` +// DpmErrorInfo DPM workload-specific error information. +type DpmErrorInfo struct { // ErrorString - Localized error string. ErrorString *string `json:"errorString,omitempty"` - // ErrorTitle - Title: Typically, the entity that the error pertains to. - ErrorTitle *string `json:"errorTitle,omitempty"` // Recommendations - List of localized recommendations for above error code. Recommendations *[]string `json:"recommendations,omitempty"` - // AdditionalDetails - Additional details for above error code. - AdditionalDetails *string `json:"additionalDetails,omitempty"` } -// AzureWorkloadJob azure storage specific job. -type AzureWorkloadJob struct { - // WorkloadType - Workload type of the job - WorkloadType *string `json:"workloadType,omitempty"` - // Duration - Time elapsed during the execution of this job. +// DpmJob DPM workload-specific job object. +type DpmJob struct { + // Duration - Time elapsed for job. Duration *string `json:"duration,omitempty"` - // ActionsInfo - Gets or sets the state/actions applicable on this job like cancel/retry. + // DpmServerName - DPM server name managing the backup item or backup job. + DpmServerName *string `json:"dpmServerName,omitempty"` + // ContainerName - Name of cluster/server protecting current backup item, if any. + ContainerName *string `json:"containerName,omitempty"` + // ContainerType - Type of container. + ContainerType *string `json:"containerType,omitempty"` + // WorkloadType - Type of backup item. + WorkloadType *string `json:"workloadType,omitempty"` + // ActionsInfo - The state/actions applicable on this job like cancel/retry. ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` - // ErrorDetails - Error details on execution of this job. - ErrorDetails *[]AzureWorkloadErrorInfo `json:"errorDetails,omitempty"` - // ExtendedInfo - Additional information about the job. - ExtendedInfo *AzureWorkloadJobExtendedInfo `json:"extendedInfo,omitempty"` + // ErrorDetails - The errors. + ErrorDetails *[]DpmErrorInfo `json:"errorDetails,omitempty"` + // ExtendedInfo - Additional information for this job. + ExtendedInfo *DpmJobExtendedInfo `json:"extendedInfo,omitempty"` // EntityFriendlyName - Friendly name of the entity on which the current job is executing. EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' @@ -7509,7633 +4965,1336 @@ type AzureWorkloadJob struct { JobType JobType `json:"jobType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureWorkloadJob. -func (awj AzureWorkloadJob) MarshalJSON() ([]byte, error) { - awj.JobType = JobTypeAzureWorkloadJob +// MarshalJSON is the custom marshaler for DpmJob. +func (dj DpmJob) MarshalJSON() ([]byte, error) { + dj.JobType = JobTypeDpmJob objectMap := make(map[string]interface{}) - if awj.WorkloadType != nil { - objectMap["workloadType"] = awj.WorkloadType + if dj.Duration != nil { + objectMap["duration"] = dj.Duration } - if awj.Duration != nil { - objectMap["duration"] = awj.Duration + if dj.DpmServerName != nil { + objectMap["dpmServerName"] = dj.DpmServerName } - if awj.ActionsInfo != nil { - objectMap["actionsInfo"] = awj.ActionsInfo + if dj.ContainerName != nil { + objectMap["containerName"] = dj.ContainerName } - if awj.ErrorDetails != nil { - objectMap["errorDetails"] = awj.ErrorDetails + if dj.ContainerType != nil { + objectMap["containerType"] = dj.ContainerType } - if awj.ExtendedInfo != nil { - objectMap["extendedInfo"] = awj.ExtendedInfo + if dj.WorkloadType != nil { + objectMap["workloadType"] = dj.WorkloadType } - if awj.EntityFriendlyName != nil { - objectMap["entityFriendlyName"] = awj.EntityFriendlyName + if dj.ActionsInfo != nil { + objectMap["actionsInfo"] = dj.ActionsInfo } - if awj.BackupManagementType != "" { - objectMap["backupManagementType"] = awj.BackupManagementType + if dj.ErrorDetails != nil { + objectMap["errorDetails"] = dj.ErrorDetails } - if awj.Operation != nil { - objectMap["operation"] = awj.Operation + if dj.ExtendedInfo != nil { + objectMap["extendedInfo"] = dj.ExtendedInfo } - if awj.Status != nil { - objectMap["status"] = awj.Status + if dj.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = dj.EntityFriendlyName } - if awj.StartTime != nil { - objectMap["startTime"] = awj.StartTime + if dj.BackupManagementType != "" { + objectMap["backupManagementType"] = dj.BackupManagementType } - if awj.EndTime != nil { - objectMap["endTime"] = awj.EndTime + if dj.Operation != nil { + objectMap["operation"] = dj.Operation } - if awj.ActivityID != nil { - objectMap["activityId"] = awj.ActivityID + if dj.Status != nil { + objectMap["status"] = dj.Status } - if awj.JobType != "" { - objectMap["jobType"] = awj.JobType + if dj.StartTime != nil { + objectMap["startTime"] = dj.StartTime + } + if dj.EndTime != nil { + objectMap["endTime"] = dj.EndTime + } + if dj.ActivityID != nil { + objectMap["activityId"] = dj.ActivityID + } + if dj.JobType != "" { + objectMap["jobType"] = dj.JobType } return json.Marshal(objectMap) } -// AsAzureIaaSVMJob is the BasicJob implementation for AzureWorkloadJob. -func (awj AzureWorkloadJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { +// AsAzureIaaSVMJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { return nil, false } -// AsAzureStorageJob is the BasicJob implementation for AzureWorkloadJob. -func (awj AzureWorkloadJob) AsAzureStorageJob() (*AzureStorageJob, bool) { +// AsAzureStorageJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsAzureStorageJob() (*AzureStorageJob, bool) { return nil, false } -// AsAzureWorkloadJob is the BasicJob implementation for AzureWorkloadJob. -func (awj AzureWorkloadJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { - return &awj, true +// AsAzureWorkloadJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { + return nil, false } -// AsDpmJob is the BasicJob implementation for AzureWorkloadJob. -func (awj AzureWorkloadJob) AsDpmJob() (*DpmJob, bool) { - return nil, false +// AsDpmJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsDpmJob() (*DpmJob, bool) { + return &dj, true } -// AsMabJob is the BasicJob implementation for AzureWorkloadJob. -func (awj AzureWorkloadJob) AsMabJob() (*MabJob, bool) { +// AsMabJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsMabJob() (*MabJob, bool) { return nil, false } -// AsJob is the BasicJob implementation for AzureWorkloadJob. -func (awj AzureWorkloadJob) AsJob() (*Job, bool) { +// AsJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsJob() (*Job, bool) { return nil, false } -// AsBasicJob is the BasicJob implementation for AzureWorkloadJob. -func (awj AzureWorkloadJob) AsBasicJob() (BasicJob, bool) { - return &awj, true +// AsBasicJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsBasicJob() (BasicJob, bool) { + return &dj, true } -// AzureWorkloadJobExtendedInfo azure VM workload-specific additional information for job. -type AzureWorkloadJobExtendedInfo struct { - // TasksList - List of tasks for this job - TasksList *[]AzureWorkloadJobTaskDetails `json:"tasksList,omitempty"` - // PropertyBag - Job properties. +// DpmJobExtendedInfo additional information on the DPM workload-specific job. +type DpmJobExtendedInfo struct { + // TasksList - List of tasks associated with this job. + TasksList *[]DpmJobTaskDetails `json:"tasksList,omitempty"` + // PropertyBag - The job properties. PropertyBag map[string]*string `json:"propertyBag"` // DynamicErrorMessage - Non localized error message on job execution. DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` } -// MarshalJSON is the custom marshaler for AzureWorkloadJobExtendedInfo. -func (awjei AzureWorkloadJobExtendedInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for DpmJobExtendedInfo. +func (djei DpmJobExtendedInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if awjei.TasksList != nil { - objectMap["tasksList"] = awjei.TasksList + if djei.TasksList != nil { + objectMap["tasksList"] = djei.TasksList } - if awjei.PropertyBag != nil { - objectMap["propertyBag"] = awjei.PropertyBag + if djei.PropertyBag != nil { + objectMap["propertyBag"] = djei.PropertyBag } - if awjei.DynamicErrorMessage != nil { - objectMap["dynamicErrorMessage"] = awjei.DynamicErrorMessage + if djei.DynamicErrorMessage != nil { + objectMap["dynamicErrorMessage"] = djei.DynamicErrorMessage } return json.Marshal(objectMap) } -// AzureWorkloadJobTaskDetails azure VM workload specific job task details. -type AzureWorkloadJobTaskDetails struct { +// DpmJobTaskDetails DPM workload-specific job task details. +type DpmJobTaskDetails struct { // TaskID - The task display name. TaskID *string `json:"taskId,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // Duration - Time elapsed for task. + Duration *string `json:"duration,omitempty"` // Status - The status. Status *string `json:"status,omitempty"` } -// BasicAzureWorkloadPointInTimeRecoveryPoint recovery point specific to PointInTime -type BasicAzureWorkloadPointInTimeRecoveryPoint interface { - AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) - AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) -} - -// AzureWorkloadPointInTimeRecoveryPoint recovery point specific to PointInTime -type AzureWorkloadPointInTimeRecoveryPoint struct { - // TimeRanges - List of log ranges - TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created - RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' - Type RestorePointType `json:"type,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +// DPMProtectedItem additional information on Backup engine specific backup item. +type DPMProtectedItem struct { + // FriendlyName - Friendly name of the managed item + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupEngineName - Backup Management server protecting this backup item + BackupEngineName *string `json:"backupEngineName,omitempty"` + // ProtectionState - Protection state of the backup engine. Possible values include: 'ProtectedItemStateInvalid', 'ProtectedItemStateIRPending', 'ProtectedItemStateProtected', 'ProtectedItemStateProtectionError', 'ProtectedItemStateProtectionStopped', 'ProtectedItemStateProtectionPaused' + ProtectionState ProtectedItemState `json:"protectionState,omitempty"` + // ExtendedInfo - Extended info of the backup item. + ExtendedInfo *DPMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } -func unmarshalBasicAzureWorkloadPointInTimeRecoveryPoint(body []byte) (BasicAzureWorkloadPointInTimeRecoveryPoint, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err +// MarshalJSON is the custom marshaler for DPMProtectedItem. +func (dpi DPMProtectedItem) MarshalJSON() ([]byte, error) { + dpi.ProtectedItemType = ProtectedItemTypeDPMProtectedItem + objectMap := make(map[string]interface{}) + if dpi.FriendlyName != nil { + objectMap["friendlyName"] = dpi.FriendlyName } - - switch m["objectType"] { - case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): - var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awshpitrp) - return awshpitrp, err - default: - var awpitrp AzureWorkloadPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awpitrp) - return awpitrp, err + if dpi.BackupEngineName != nil { + objectMap["backupEngineName"] = dpi.BackupEngineName } -} -func unmarshalBasicAzureWorkloadPointInTimeRecoveryPointArray(body []byte) ([]BasicAzureWorkloadPointInTimeRecoveryPoint, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err + if dpi.ProtectionState != "" { + objectMap["protectionState"] = dpi.ProtectionState } - - awpitrpArray := make([]BasicAzureWorkloadPointInTimeRecoveryPoint, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awpitrp, err := unmarshalBasicAzureWorkloadPointInTimeRecoveryPoint(*rawMessage) - if err != nil { - return nil, err - } - awpitrpArray[index] = awpitrp + if dpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = dpi.ExtendedInfo } - return awpitrpArray, nil -} - -// MarshalJSON is the custom marshaler for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { - awpitrp.ObjectType = ObjectTypeAzureWorkloadPointInTimeRecoveryPoint - objectMap := make(map[string]interface{}) - if awpitrp.TimeRanges != nil { - objectMap["timeRanges"] = awpitrp.TimeRanges + if dpi.BackupManagementType != "" { + objectMap["backupManagementType"] = dpi.BackupManagementType } - if awpitrp.ObjectType != "" { - objectMap["objectType"] = awpitrp.ObjectType + if dpi.WorkloadType != "" { + objectMap["workloadType"] = dpi.WorkloadType + } + if dpi.ContainerName != nil { + objectMap["containerName"] = dpi.ContainerName + } + if dpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = dpi.SourceResourceID + } + if dpi.PolicyID != nil { + objectMap["policyId"] = dpi.PolicyID + } + if dpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = dpi.LastRecoveryPoint + } + if dpi.BackupSetName != nil { + objectMap["backupSetName"] = dpi.BackupSetName + } + if dpi.CreateMode != "" { + objectMap["createMode"] = dpi.CreateMode + } + if dpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = dpi.DeferredDeleteTimeInUTC + } + if dpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = dpi.IsScheduledForDeferredDelete + } + if dpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = dpi.DeferredDeleteTimeRemaining + } + if dpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = dpi.IsDeferredDeleteScheduleUpcoming + } + if dpi.IsRehydrate != nil { + objectMap["isRehydrate"] = dpi.IsRehydrate + } + if dpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = dpi.ProtectedItemType } return json.Marshal(objectMap) } -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { return nil, false } -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return &awpitrp, true +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false } -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return &awpitrp, true +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false } -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { return nil, false } -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return &awpitrp, true +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false } -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { return nil, false } -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { return nil, false } -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { return nil, false } -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { return nil, false } -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { return nil, false } -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { return nil, false } -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { +// AsDPMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return &dpi, true +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { return nil, false } -// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { return nil, false } -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &awpitrp, true +// AsProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false } -// AzureWorkloadPointInTimeRestoreRequest azureWorkload SAP Hana -specific restore. Specifically for -// PointInTime/Log restore -type AzureWorkloadPointInTimeRestoreRequest struct { - // PointInTime - PointInTime value - PointInTime *date.Time `json:"pointInTime,omitempty"` - // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PropertyBag - Workload specific property bag. - PropertyBag map[string]*string `json:"propertyBag"` - // TargetInfo - Details of target database - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' - RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +// AsBasicProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &dpi, true } -// MarshalJSON is the custom marshaler for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { - awpitrr.ObjectType = ObjectTypeAzureWorkloadPointInTimeRestoreRequest +// DPMProtectedItemExtendedInfo additional information of DPM Protected item. +type DPMProtectedItemExtendedInfo struct { + // ProtectableObjectLoadPath - Attribute to provide information on various DBs. + ProtectableObjectLoadPath map[string]*string `json:"protectableObjectLoadPath"` + // Protected - To check if backup item is disk protected. + Protected *bool `json:"protected,omitempty"` + // IsPresentOnCloud - To check if backup item is cloud protected. + IsPresentOnCloud *bool `json:"isPresentOnCloud,omitempty"` + // LastBackupStatus - Last backup status information on backup item. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` + // LastRefreshedAt - Last refresh time on backup item. + LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` + // OldestRecoveryPoint - Oldest cloud recovery point time. + OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` + // RecoveryPointCount - cloud recovery point count. + RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` + // OnPremiseOldestRecoveryPoint - Oldest disk recovery point time. + OnPremiseOldestRecoveryPoint *date.Time `json:"onPremiseOldestRecoveryPoint,omitempty"` + // OnPremiseLatestRecoveryPoint - latest disk recovery point time. + OnPremiseLatestRecoveryPoint *date.Time `json:"onPremiseLatestRecoveryPoint,omitempty"` + // OnPremiseRecoveryPointCount - disk recovery point count. + OnPremiseRecoveryPointCount *int32 `json:"onPremiseRecoveryPointCount,omitempty"` + // IsCollocated - To check if backup item is collocated. + IsCollocated *bool `json:"isCollocated,omitempty"` + // ProtectionGroupName - Protection group name of the backup item. + ProtectionGroupName *string `json:"protectionGroupName,omitempty"` + // DiskStorageUsedInBytes - Used Disk storage in bytes. + DiskStorageUsedInBytes *string `json:"diskStorageUsedInBytes,omitempty"` + // TotalDiskStorageSizeInBytes - total Disk storage in bytes. + TotalDiskStorageSizeInBytes *string `json:"totalDiskStorageSizeInBytes,omitempty"` +} + +// MarshalJSON is the custom marshaler for DPMProtectedItemExtendedInfo. +func (dpiei DPMProtectedItemExtendedInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if awpitrr.PointInTime != nil { - objectMap["pointInTime"] = awpitrr.PointInTime + if dpiei.ProtectableObjectLoadPath != nil { + objectMap["protectableObjectLoadPath"] = dpiei.ProtectableObjectLoadPath } - if awpitrr.RecoveryType != "" { - objectMap["recoveryType"] = awpitrr.RecoveryType + if dpiei.Protected != nil { + objectMap["protected"] = dpiei.Protected } - if awpitrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = awpitrr.SourceResourceID + if dpiei.IsPresentOnCloud != nil { + objectMap["isPresentOnCloud"] = dpiei.IsPresentOnCloud } - if awpitrr.PropertyBag != nil { - objectMap["propertyBag"] = awpitrr.PropertyBag + if dpiei.LastBackupStatus != nil { + objectMap["lastBackupStatus"] = dpiei.LastBackupStatus } - if awpitrr.TargetInfo != nil { - objectMap["targetInfo"] = awpitrr.TargetInfo + if dpiei.LastRefreshedAt != nil { + objectMap["lastRefreshedAt"] = dpiei.LastRefreshedAt } - if awpitrr.RecoveryMode != "" { - objectMap["recoveryMode"] = awpitrr.RecoveryMode + if dpiei.OldestRecoveryPoint != nil { + objectMap["oldestRecoveryPoint"] = dpiei.OldestRecoveryPoint } - if awpitrr.ObjectType != "" { - objectMap["objectType"] = awpitrr.ObjectType + if dpiei.RecoveryPointCount != nil { + objectMap["recoveryPointCount"] = dpiei.RecoveryPointCount + } + if dpiei.OnPremiseOldestRecoveryPoint != nil { + objectMap["onPremiseOldestRecoveryPoint"] = dpiei.OnPremiseOldestRecoveryPoint + } + if dpiei.OnPremiseLatestRecoveryPoint != nil { + objectMap["onPremiseLatestRecoveryPoint"] = dpiei.OnPremiseLatestRecoveryPoint + } + if dpiei.OnPremiseRecoveryPointCount != nil { + objectMap["onPremiseRecoveryPointCount"] = dpiei.OnPremiseRecoveryPointCount + } + if dpiei.IsCollocated != nil { + objectMap["isCollocated"] = dpiei.IsCollocated + } + if dpiei.ProtectionGroupName != nil { + objectMap["protectionGroupName"] = dpiei.ProtectionGroupName + } + if dpiei.DiskStorageUsedInBytes != nil { + objectMap["diskStorageUsedInBytes"] = dpiei.DiskStorageUsedInBytes + } + if dpiei.TotalDiskStorageSizeInBytes != nil { + objectMap["totalDiskStorageSizeInBytes"] = dpiei.TotalDiskStorageSizeInBytes } return json.Marshal(objectMap) } -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return &awpitrr, true -} - -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return nil, false +// EncryptionDetails details needed if the VM was encrypted at the time of backup. +type EncryptionDetails struct { + // EncryptionEnabled - Identifies whether this backup copy represents an encrypted VM at the time of backup. + EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` + // KekURL - Key Url. + KekURL *string `json:"kekUrl,omitempty"` + // SecretKeyURL - Secret Url. + SecretKeyURL *string `json:"secretKeyUrl,omitempty"` + // KekVaultID - ID of Key Vault where KEK is stored. + KekVaultID *string `json:"kekVaultId,omitempty"` + // SecretKeyVaultID - ID of Key Vault where Secret is stored. + SecretKeyVaultID *string `json:"secretKeyVaultId,omitempty"` } -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return &awpitrr, true +// ErrorDetail error Detail class which encapsulates Code, Message and Recommendations. +type ErrorDetail struct { + // Code - READ-ONLY; Error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; Error Message related to the Code. + Message *string `json:"message,omitempty"` + // Recommendations - READ-ONLY; List of recommendation strings. + Recommendations *[]string `json:"recommendations,omitempty"` } -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return nil, false +// MarshalJSON is the custom marshaler for ErrorDetail. +func (ed ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) } -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false +// ExportJobsOperationResultInfo this class is used to send blob details after exporting jobs. +type ExportJobsOperationResultInfo struct { + // BlobURL - URL of the blob into which the serialized string of list of jobs is exported. + BlobURL *string `json:"blobUrl,omitempty"` + // BlobSasKey - SAS key to access the blob. It expires in 15 mins. + BlobSasKey *string `json:"blobSasKey,omitempty"` + // ExcelFileBlobURL - URL of the blob into which the ExcelFile is uploaded. + ExcelFileBlobURL *string `json:"excelFileBlobUrl,omitempty"` + // ExcelFileBlobSasKey - SAS key to access the blob. It expires in 15 mins. + ExcelFileBlobSasKey *string `json:"excelFileBlobSasKey,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeOperationResultInfoBase', 'ObjectTypeExportJobsOperationResultInfo', 'ObjectTypeOperationResultInfo' + ObjectType ObjectType `json:"objectType,omitempty"` } -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false +// MarshalJSON is the custom marshaler for ExportJobsOperationResultInfo. +func (ejori ExportJobsOperationResultInfo) MarshalJSON() ([]byte, error) { + ejori.ObjectType = ObjectTypeExportJobsOperationResultInfo + objectMap := make(map[string]interface{}) + if ejori.BlobURL != nil { + objectMap["blobUrl"] = ejori.BlobURL + } + if ejori.BlobSasKey != nil { + objectMap["blobSasKey"] = ejori.BlobSasKey + } + if ejori.ExcelFileBlobURL != nil { + objectMap["excelFileBlobUrl"] = ejori.ExcelFileBlobURL + } + if ejori.ExcelFileBlobSasKey != nil { + objectMap["excelFileBlobSasKey"] = ejori.ExcelFileBlobSasKey + } + if ejori.ObjectType != "" { + objectMap["objectType"] = ejori.ObjectType + } + return json.Marshal(objectMap) } -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return nil, false +// AsExportJobsOperationResultInfo is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. +func (ejori ExportJobsOperationResultInfo) AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) { + return &ejori, true } -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { +// AsOperationResultInfo is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. +func (ejori ExportJobsOperationResultInfo) AsOperationResultInfo() (*OperationResultInfo, bool) { return nil, false } -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { +// AsOperationResultInfoBase is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. +func (ejori ExportJobsOperationResultInfo) AsOperationResultInfoBase() (*OperationResultInfoBase, bool) { return nil, false } -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { - return nil, false +// AsBasicOperationResultInfoBase is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. +func (ejori ExportJobsOperationResultInfo) AsBasicOperationResultInfoBase() (BasicOperationResultInfoBase, bool) { + return &ejori, true } -// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return nil, false +// ExtendedProperties extended Properties for Azure IaasVM Backup. +type ExtendedProperties struct { + // DiskExclusionProperties - Extended Properties for Disk Exclusion. + DiskExclusionProperties *DiskExclusionProperties `json:"diskExclusionProperties,omitempty"` } -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &awpitrr, true -} - -// BasicAzureWorkloadRecoveryPoint workload specific recovery point, specifically encapsulates full/diff recovery point -type BasicAzureWorkloadRecoveryPoint interface { - AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) - AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) - AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) - AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) - AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) - AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) - AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) - AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) -} - -// AzureWorkloadRecoveryPoint workload specific recovery point, specifically encapsulates full/diff recovery -// point -type AzureWorkloadRecoveryPoint struct { - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created - RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' - Type RestorePointType `json:"type,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +// GenericProtectedItem base class for backup items. +type GenericProtectedItem struct { + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // PolicyState - Indicates consistency of policy object and policy applied to this backup item. + PolicyState *string `json:"policyState,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // ProtectedItemID - Data Plane Service ID of the protected item. + ProtectedItemID *int64 `json:"protectedItemId,omitempty"` + // SourceAssociations - Loosely coupled (type, value) associations (example - parent of a protected item) + SourceAssociations map[string]*string `json:"sourceAssociations"` + // FabricName - Name of this backup item's fabric. + FabricName *string `json:"fabricName,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } -func unmarshalBasicAzureWorkloadRecoveryPoint(body []byte) (BasicAzureWorkloadRecoveryPoint, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err +// MarshalJSON is the custom marshaler for GenericProtectedItem. +func (gpi GenericProtectedItem) MarshalJSON() ([]byte, error) { + gpi.ProtectedItemType = ProtectedItemTypeGenericProtectedItem + objectMap := make(map[string]interface{}) + if gpi.FriendlyName != nil { + objectMap["friendlyName"] = gpi.FriendlyName } - - switch m["objectType"] { - case string(ObjectTypeAzureWorkloadPointInTimeRecoveryPoint): - var awpitrp AzureWorkloadPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awpitrp) - return awpitrp, err - case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): - var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awshpitrp) - return awshpitrp, err - case string(ObjectTypeAzureWorkloadSAPHanaRecoveryPoint): - var awshrp AzureWorkloadSAPHanaRecoveryPoint - err := json.Unmarshal(body, &awshrp) - return awshrp, err - case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): - var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awspitrp) - return awspitrp, err - case string(ObjectTypeAzureWorkloadSQLRecoveryPoint): - var awsrp AzureWorkloadSQLRecoveryPoint - err := json.Unmarshal(body, &awsrp) - return awsrp, err - default: - var awrp AzureWorkloadRecoveryPoint - err := json.Unmarshal(body, &awrp) - return awrp, err + if gpi.PolicyState != nil { + objectMap["policyState"] = gpi.PolicyState } -} -func unmarshalBasicAzureWorkloadRecoveryPointArray(body []byte) ([]BasicAzureWorkloadRecoveryPoint, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err + if gpi.ProtectionState != "" { + objectMap["protectionState"] = gpi.ProtectionState } - - awrpArray := make([]BasicAzureWorkloadRecoveryPoint, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awrp, err := unmarshalBasicAzureWorkloadRecoveryPoint(*rawMessage) - if err != nil { - return nil, err - } - awrpArray[index] = awrp + if gpi.ProtectedItemID != nil { + objectMap["protectedItemId"] = gpi.ProtectedItemID } - return awrpArray, nil -} - -// MarshalJSON is the custom marshaler for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) MarshalJSON() ([]byte, error) { - awrp.ObjectType = ObjectTypeAzureWorkloadRecoveryPoint - objectMap := make(map[string]interface{}) - if awrp.ObjectType != "" { - objectMap["objectType"] = awrp.ObjectType + if gpi.SourceAssociations != nil { + objectMap["sourceAssociations"] = gpi.SourceAssociations + } + if gpi.FabricName != nil { + objectMap["fabricName"] = gpi.FabricName + } + if gpi.BackupManagementType != "" { + objectMap["backupManagementType"] = gpi.BackupManagementType + } + if gpi.WorkloadType != "" { + objectMap["workloadType"] = gpi.WorkloadType + } + if gpi.ContainerName != nil { + objectMap["containerName"] = gpi.ContainerName + } + if gpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = gpi.SourceResourceID + } + if gpi.PolicyID != nil { + objectMap["policyId"] = gpi.PolicyID + } + if gpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = gpi.LastRecoveryPoint + } + if gpi.BackupSetName != nil { + objectMap["backupSetName"] = gpi.BackupSetName + } + if gpi.CreateMode != "" { + objectMap["createMode"] = gpi.CreateMode + } + if gpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = gpi.DeferredDeleteTimeInUTC + } + if gpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = gpi.IsScheduledForDeferredDelete + } + if gpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = gpi.DeferredDeleteTimeRemaining + } + if gpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = gpi.IsDeferredDeleteScheduleUpcoming + } + if gpi.IsRehydrate != nil { + objectMap["isRehydrate"] = gpi.IsRehydrate + } + if gpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = gpi.ProtectedItemType } return json.Marshal(objectMap) } -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { return nil, false } -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { return nil, false } -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { return nil, false } -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return &awrp, true -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return &awrp, true +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false } -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { return nil, false } -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { return nil, false } -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { return nil, false } -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { return nil, false } -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { return nil, false } -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { return nil, false } -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { return nil, false } -// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { +// AsDPMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { return nil, false } -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &awrp, true +// AsGenericProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return &gpi, true } -// BasicAzureWorkloadRestoreRequest azureWorkload-specific restore. -type BasicAzureWorkloadRestoreRequest interface { - AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) - AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) - AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) - AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) - AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) - AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) - AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) - AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false } -// AzureWorkloadRestoreRequest azureWorkload-specific restore. -type AzureWorkloadRestoreRequest struct { - // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PropertyBag - Workload specific property bag. - PropertyBag map[string]*string `json:"propertyBag"` - // TargetInfo - Details of target database - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' - RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +// AsProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false } -func unmarshalBasicAzureWorkloadRestoreRequest(body []byte) (BasicAzureWorkloadRestoreRequest, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeAzureWorkloadPointInTimeRestoreRequest): - var awpitrr AzureWorkloadPointInTimeRestoreRequest - err := json.Unmarshal(body, &awpitrr) - return awpitrr, err - case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): - var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest - err := json.Unmarshal(body, &awshpitrr) - return awshpitrr, err - case string(ObjectTypeAzureWorkloadSAPHanaRestoreRequest): - var awshrr AzureWorkloadSAPHanaRestoreRequest - err := json.Unmarshal(body, &awshrr) - return awshrr, err - case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): - var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest - err := json.Unmarshal(body, &awspitrr) - return awspitrr, err - case string(ObjectTypeAzureWorkloadSQLRestoreRequest): - var awsrr AzureWorkloadSQLRestoreRequest - err := json.Unmarshal(body, &awsrr) - return awsrr, err - default: - var awrr AzureWorkloadRestoreRequest - err := json.Unmarshal(body, &awrr) - return awrr, err - } +// AsBasicProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &gpi, true } -func unmarshalBasicAzureWorkloadRestoreRequestArray(body []byte) ([]BasicAzureWorkloadRestoreRequest, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - awrrArray := make([]BasicAzureWorkloadRestoreRequest, len(rawMessages)) - for index, rawMessage := range rawMessages { - awrr, err := unmarshalBasicAzureWorkloadRestoreRequest(*rawMessage) - if err != nil { - return nil, err - } - awrrArray[index] = awrr - } - return awrrArray, nil +// GenericProtectionPolicy azure VM (Mercury) workload-specific backup policy. +type GenericProtectionPolicy struct { + // SubProtectionPolicy - List of sub-protection policies which includes schedule and retention + SubProtectionPolicy *[]SubProtectionPolicy `json:"subProtectionPolicy,omitempty"` + // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + TimeZone *string `json:"timeZone,omitempty"` + // FabricName - Name of this policy's fabric. + FabricName *string `json:"fabricName,omitempty"` + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) MarshalJSON() ([]byte, error) { - awrr.ObjectType = ObjectTypeAzureWorkloadRestoreRequest +// MarshalJSON is the custom marshaler for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) MarshalJSON() ([]byte, error) { + gpp.BackupManagementType = BackupManagementTypeGenericProtectionPolicy objectMap := make(map[string]interface{}) - if awrr.RecoveryType != "" { - objectMap["recoveryType"] = awrr.RecoveryType - } - if awrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = awrr.SourceResourceID + if gpp.SubProtectionPolicy != nil { + objectMap["subProtectionPolicy"] = gpp.SubProtectionPolicy } - if awrr.PropertyBag != nil { - objectMap["propertyBag"] = awrr.PropertyBag + if gpp.TimeZone != nil { + objectMap["timeZone"] = gpp.TimeZone } - if awrr.TargetInfo != nil { - objectMap["targetInfo"] = awrr.TargetInfo + if gpp.FabricName != nil { + objectMap["fabricName"] = gpp.FabricName } - if awrr.RecoveryMode != "" { - objectMap["recoveryMode"] = awrr.RecoveryMode + if gpp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = gpp.ProtectedItemsCount } - if awrr.ObjectType != "" { - objectMap["objectType"] = awrr.ObjectType + if gpp.BackupManagementType != "" { + objectMap["backupManagementType"] = gpp.BackupManagementType } return json.Marshal(objectMap) } -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return &awrr, true -} - -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return &awrr, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { return nil, false } -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { return nil, false } -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { return nil, false } -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { return nil, false } -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { - return nil, false +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { + return &gpp, true } -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { return nil, false } -// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { +// AsProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { return nil, false } -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &awrr, true +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &gpp, true } -// AzureWorkloadSAPHanaPointInTimeRecoveryPoint recovery point specific to PointInTime in SAPHana -type AzureWorkloadSAPHanaPointInTimeRecoveryPoint struct { - // TimeRanges - List of log ranges - TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created - RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' - Type RestorePointType `json:"type,omitempty"` +// GenericRecoveryPoint generic backup copy. +type GenericRecoveryPoint struct { + // FriendlyName - Friendly name of the backup copy. + FriendlyName *string `json:"friendlyName,omitempty"` + // RecoveryPointType - Type of the backup copy. + RecoveryPointType *string `json:"recoveryPointType,omitempty"` + // RecoveryPointTime - Time at which this backup copy was created. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // RecoveryPointAdditionalInfo - Additional information associated with this backup copy. + RecoveryPointAdditionalInfo *string `json:"recoveryPointAdditionalInfo,omitempty"` // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { - awshpitrp.ObjectType = ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint +// MarshalJSON is the custom marshaler for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) MarshalJSON() ([]byte, error) { + grp.ObjectType = ObjectTypeGenericRecoveryPoint objectMap := make(map[string]interface{}) - if awshpitrp.TimeRanges != nil { - objectMap["timeRanges"] = awshpitrp.TimeRanges + if grp.FriendlyName != nil { + objectMap["friendlyName"] = grp.FriendlyName } - if awshpitrp.ObjectType != "" { - objectMap["objectType"] = awshpitrp.ObjectType + if grp.RecoveryPointType != nil { + objectMap["recoveryPointType"] = grp.RecoveryPointType + } + if grp.RecoveryPointTime != nil { + objectMap["recoveryPointTime"] = grp.RecoveryPointTime + } + if grp.RecoveryPointAdditionalInfo != nil { + objectMap["recoveryPointAdditionalInfo"] = grp.RecoveryPointAdditionalInfo + } + if grp.ObjectType != "" { + objectMap["objectType"] = grp.ObjectType } return json.Marshal(objectMap) } -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { return nil, false } -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { return nil, false } -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return &awshpitrp, true -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { return nil, false } -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return &awshpitrp, true +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false } -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return &awshpitrp, true +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return nil, false } -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { return nil, false } -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { return nil, false } -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { return nil, false } -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { return nil, false } -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return &grp, true +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { return nil, false } -// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { +// AsRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { return nil, false } -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &awshpitrp, true +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &grp, true } -// AzureWorkloadSAPHanaPointInTimeRestoreRequest azureWorkload SAP Hana -specific restore. Specifically for -// PointInTime/Log restore -type AzureWorkloadSAPHanaPointInTimeRestoreRequest struct { - // PointInTime - PointInTime value - PointInTime *date.Time `json:"pointInTime,omitempty"` - // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PropertyBag - Workload specific property bag. - PropertyBag map[string]*string `json:"propertyBag"` - // TargetInfo - Details of target database - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' - RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +// GetProtectedItemQueryObject filters to list backup items. +type GetProtectedItemQueryObject struct { + // Expand - Specifies if the additional information should be provided for this item. + Expand *string `json:"expand,omitempty"` } -// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { - awshpitrr.ObjectType = ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest +// IaasVMRecoveryPoint iaaS VM workload specific backup copy. +type IaasVMRecoveryPoint struct { + // RecoveryPointType - READ-ONLY; Type of the backup copy. + RecoveryPointType *string `json:"recoveryPointType,omitempty"` + // RecoveryPointTime - READ-ONLY; Time at which this backup copy was created. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // RecoveryPointAdditionalInfo - READ-ONLY; Additional information associated with this backup copy. + RecoveryPointAdditionalInfo *string `json:"recoveryPointAdditionalInfo,omitempty"` + // SourceVMStorageType - READ-ONLY; Storage type of the VM whose backup copy is created. + SourceVMStorageType *string `json:"sourceVMStorageType,omitempty"` + // IsSourceVMEncrypted - READ-ONLY; Identifies whether the VM was encrypted when the backup copy is created. + IsSourceVMEncrypted *bool `json:"isSourceVMEncrypted,omitempty"` + // KeyAndSecret - Required details for recovering an encrypted VM. Applicable only when IsSourceVMEncrypted is true. + KeyAndSecret *KeyAndSecretDetails `json:"keyAndSecret,omitempty"` + // IsInstantIlrSessionActive - Is the session to recover items from this backup copy still active. + IsInstantIlrSessionActive *bool `json:"isInstantIlrSessionActive,omitempty"` + // RecoveryPointTierDetails - Recovery point tier information. + RecoveryPointTierDetails *[]RecoveryPointTierInformation `json:"recoveryPointTierDetails,omitempty"` + // IsManagedVirtualMachine - Whether VM is with Managed Disks + IsManagedVirtualMachine *bool `json:"isManagedVirtualMachine,omitempty"` + // VirtualMachineSize - Virtual Machine Size + VirtualMachineSize *string `json:"virtualMachineSize,omitempty"` + // OriginalStorageAccountOption - Original Storage Account Option + OriginalStorageAccountOption *bool `json:"originalStorageAccountOption,omitempty"` + // OsType - OS type + OsType *string `json:"osType,omitempty"` + // RecoveryPointDiskConfiguration - Disk configuration + RecoveryPointDiskConfiguration *RecoveryPointDiskConfiguration `json:"recoveryPointDiskConfiguration,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) MarshalJSON() ([]byte, error) { + ivrp.ObjectType = ObjectTypeIaasVMRecoveryPoint objectMap := make(map[string]interface{}) - if awshpitrr.PointInTime != nil { - objectMap["pointInTime"] = awshpitrr.PointInTime + if ivrp.KeyAndSecret != nil { + objectMap["keyAndSecret"] = ivrp.KeyAndSecret } - if awshpitrr.RecoveryType != "" { - objectMap["recoveryType"] = awshpitrr.RecoveryType + if ivrp.IsInstantIlrSessionActive != nil { + objectMap["isInstantIlrSessionActive"] = ivrp.IsInstantIlrSessionActive } - if awshpitrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = awshpitrr.SourceResourceID + if ivrp.RecoveryPointTierDetails != nil { + objectMap["recoveryPointTierDetails"] = ivrp.RecoveryPointTierDetails } - if awshpitrr.PropertyBag != nil { - objectMap["propertyBag"] = awshpitrr.PropertyBag + if ivrp.IsManagedVirtualMachine != nil { + objectMap["isManagedVirtualMachine"] = ivrp.IsManagedVirtualMachine } - if awshpitrr.TargetInfo != nil { - objectMap["targetInfo"] = awshpitrr.TargetInfo + if ivrp.VirtualMachineSize != nil { + objectMap["virtualMachineSize"] = ivrp.VirtualMachineSize } - if awshpitrr.RecoveryMode != "" { - objectMap["recoveryMode"] = awshpitrr.RecoveryMode + if ivrp.OriginalStorageAccountOption != nil { + objectMap["originalStorageAccountOption"] = ivrp.OriginalStorageAccountOption } - if awshpitrr.ObjectType != "" { - objectMap["objectType"] = awshpitrr.ObjectType + if ivrp.OsType != nil { + objectMap["osType"] = ivrp.OsType + } + if ivrp.RecoveryPointDiskConfiguration != nil { + objectMap["recoveryPointDiskConfiguration"] = ivrp.RecoveryPointDiskConfiguration + } + if ivrp.ObjectType != "" { + objectMap["objectType"] = ivrp.ObjectType } return json.Marshal(objectMap) } -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return &awshpitrr, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return &awshpitrr, true -} - -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return &awshpitrr, true -} - -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { return nil, false } -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { return nil, false } -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { return nil, false } -// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { return nil, false } -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &awshpitrr, true -} - -// AzureWorkloadSAPHanaRecoveryPoint sAPHana specific recoverypoint, specifically encapsulates full/diff -// recoverypoints -type AzureWorkloadSAPHanaRecoveryPoint struct { - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created - RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' - Type RestorePointType `json:"type,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) MarshalJSON() ([]byte, error) { - awshrp.ObjectType = ObjectTypeAzureWorkloadSAPHanaRecoveryPoint - objectMap := make(map[string]interface{}) - if awshrp.ObjectType != "" { - objectMap["objectType"] = awshrp.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { return nil, false } -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { return nil, false } -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { return nil, false } -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { return nil, false } -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return &awshrp, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { return nil, false } -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return &awshrp, true -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { return nil, false } -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { return nil, false } -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return nil, false +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return &ivrp, true } -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { +// AsRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { return nil, false } -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return nil, false +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &ivrp, true } -// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return nil, false -} - -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &awshrp, true -} - -// BasicAzureWorkloadSAPHanaRestoreRequest azureWorkload SAP Hana-specific restore. -type BasicAzureWorkloadSAPHanaRestoreRequest interface { - AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) - AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) -} - -// AzureWorkloadSAPHanaRestoreRequest azureWorkload SAP Hana-specific restore. -type AzureWorkloadSAPHanaRestoreRequest struct { +// IaasVMRestoreRequest iaaS VM workload-specific restore. +type IaasVMRestoreRequest struct { + // RecoveryPointID - ID of the backup copy to be recovered. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + // SourceResourceID - Fully qualified ARM ID of the VM which is being recovered. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PropertyBag - Workload specific property bag. - PropertyBag map[string]*string `json:"propertyBag"` - // TargetInfo - Details of target database - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' - RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // TargetVirtualMachineID - This is the complete ARM Id of the VM that will be created. + // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` + // TargetResourceGroupID - This is the ARM Id of the resource group that you want to create for this Virtual machine and other artifacts. + // For e.g. /subscriptions/{subId}/resourcegroups/{rg} + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // StorageAccountID - Fully qualified ARM ID of the storage account to which the VM has to be restored. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // VirtualNetworkID - This is the virtual network Id of the vnet that will be attached to the virtual machine. + // User will be validated for join action permissions in the linked access. + VirtualNetworkID *string `json:"virtualNetworkId,omitempty"` + // SubnetID - Subnet ID, is the subnet ID associated with the to be restored VM. For Classic VMs it would be + // {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager VMs it would be ARM resource ID used to represent + // the subnet. + SubnetID *string `json:"subnetId,omitempty"` + // TargetDomainNameID - Fully qualified ARM ID of the domain name to be associated to the VM being restored. This applies only to Classic + // Virtual Machines. + TargetDomainNameID *string `json:"targetDomainNameId,omitempty"` + // Region - Region in which the virtual machine is restored. + Region *string `json:"region,omitempty"` + // AffinityGroup - Affinity group associated to VM to be restored. Used only for Classic Compute Virtual Machines. + AffinityGroup *string `json:"affinityGroup,omitempty"` + // CreateNewCloudService - Should a new cloud service be created while restoring the VM. If this is false, VM will be restored to the same + // cloud service as it was at the time of backup. + CreateNewCloudService *bool `json:"createNewCloudService,omitempty"` + // OriginalStorageAccountOption - Original Storage Account Option + OriginalStorageAccountOption *bool `json:"originalStorageAccountOption,omitempty"` + // EncryptionDetails - Details needed if the VM was encrypted at the time of backup. + EncryptionDetails *EncryptionDetails `json:"encryptionDetails,omitempty"` + // RestoreDiskLunList - List of Disk LUNs for partial restore + RestoreDiskLunList *[]int32 `json:"restoreDiskLunList,omitempty"` // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } -func unmarshalBasicAzureWorkloadSAPHanaRestoreRequest(body []byte) (BasicAzureWorkloadSAPHanaRestoreRequest, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err +// MarshalJSON is the custom marshaler for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) MarshalJSON() ([]byte, error) { + ivrr.ObjectType = ObjectTypeIaasVMRestoreRequest + objectMap := make(map[string]interface{}) + if ivrr.RecoveryPointID != nil { + objectMap["recoveryPointId"] = ivrr.RecoveryPointID } - - switch m["objectType"] { - case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): - var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest - err := json.Unmarshal(body, &awshpitrr) - return awshpitrr, err - default: - var awshrr AzureWorkloadSAPHanaRestoreRequest - err := json.Unmarshal(body, &awshrr) - return awshrr, err + if ivrr.RecoveryType != "" { + objectMap["recoveryType"] = ivrr.RecoveryType } -} -func unmarshalBasicAzureWorkloadSAPHanaRestoreRequestArray(body []byte) ([]BasicAzureWorkloadSAPHanaRestoreRequest, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err + if ivrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = ivrr.SourceResourceID } - - awshrrArray := make([]BasicAzureWorkloadSAPHanaRestoreRequest, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awshrr, err := unmarshalBasicAzureWorkloadSAPHanaRestoreRequest(*rawMessage) - if err != nil { - return nil, err - } - awshrrArray[index] = awshrr + if ivrr.TargetVirtualMachineID != nil { + objectMap["targetVirtualMachineId"] = ivrr.TargetVirtualMachineID } - return awshrrArray, nil -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) MarshalJSON() ([]byte, error) { - awshrr.ObjectType = ObjectTypeAzureWorkloadSAPHanaRestoreRequest - objectMap := make(map[string]interface{}) - if awshrr.RecoveryType != "" { - objectMap["recoveryType"] = awshrr.RecoveryType + if ivrr.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = ivrr.TargetResourceGroupID } - if awshrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = awshrr.SourceResourceID + if ivrr.StorageAccountID != nil { + objectMap["storageAccountId"] = ivrr.StorageAccountID } - if awshrr.PropertyBag != nil { - objectMap["propertyBag"] = awshrr.PropertyBag + if ivrr.VirtualNetworkID != nil { + objectMap["virtualNetworkId"] = ivrr.VirtualNetworkID } - if awshrr.TargetInfo != nil { - objectMap["targetInfo"] = awshrr.TargetInfo + if ivrr.SubnetID != nil { + objectMap["subnetId"] = ivrr.SubnetID } - if awshrr.RecoveryMode != "" { - objectMap["recoveryMode"] = awshrr.RecoveryMode + if ivrr.TargetDomainNameID != nil { + objectMap["targetDomainNameId"] = ivrr.TargetDomainNameID } - if awshrr.ObjectType != "" { - objectMap["objectType"] = awshrr.ObjectType + if ivrr.Region != nil { + objectMap["region"] = ivrr.Region + } + if ivrr.AffinityGroup != nil { + objectMap["affinityGroup"] = ivrr.AffinityGroup + } + if ivrr.CreateNewCloudService != nil { + objectMap["createNewCloudService"] = ivrr.CreateNewCloudService + } + if ivrr.OriginalStorageAccountOption != nil { + objectMap["originalStorageAccountOption"] = ivrr.OriginalStorageAccountOption + } + if ivrr.EncryptionDetails != nil { + objectMap["encryptionDetails"] = ivrr.EncryptionDetails + } + if ivrr.RestoreDiskLunList != nil { + objectMap["restoreDiskLunList"] = ivrr.RestoreDiskLunList + } + if ivrr.ObjectType != "" { + objectMap["objectType"] = ivrr.ObjectType } return json.Marshal(objectMap) } -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { return nil, false } -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { return nil, false } -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { return nil, false } -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return &awshrr, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { return nil, false } -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return &awshrr, true -} - -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return &awshrr, true -} - -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { return nil, false } -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { return nil, false } -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { return nil, false } -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { return nil, false } -// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { return nil, false } -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &awshrr, true -} - -// AzureWorkloadSQLAutoProtectionIntent azure Workload SQL Auto Protection intent item. -type AzureWorkloadSQLAutoProtectionIntent struct { - // WorkloadItemType - Workload item type of the item for which intent is to be set. Possible values include: 'WorkloadItemTypeInvalid', 'WorkloadItemTypeSQLInstance', 'WorkloadItemTypeSQLDataBase', 'WorkloadItemTypeSAPHanaSystem', 'WorkloadItemTypeSAPHanaDatabase', 'WorkloadItemTypeSAPAseSystem', 'WorkloadItemTypeSAPAseDatabase' - WorkloadItemType WorkloadItemType `json:"workloadItemType,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId - ItemID *string `json:"itemId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' - ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) MarshalJSON() ([]byte, error) { - awsapi.ProtectionIntentItemType = ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent - objectMap := make(map[string]interface{}) - if awsapi.WorkloadItemType != "" { - objectMap["workloadItemType"] = awsapi.WorkloadItemType - } - if awsapi.BackupManagementType != "" { - objectMap["backupManagementType"] = awsapi.BackupManagementType - } - if awsapi.SourceResourceID != nil { - objectMap["sourceResourceId"] = awsapi.SourceResourceID - } - if awsapi.ItemID != nil { - objectMap["itemId"] = awsapi.ItemID - } - if awsapi.PolicyID != nil { - objectMap["policyId"] = awsapi.PolicyID - } - if awsapi.ProtectionState != "" { - objectMap["protectionState"] = awsapi.ProtectionState - } - if awsapi.ProtectionIntentItemType != "" { - objectMap["protectionIntentItemType"] = awsapi.ProtectionIntentItemType - } - return json.Marshal(objectMap) -} - -// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { return nil, false } -// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { - return &awsapi, true -} - -// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { - return nil, false +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return &ivrr, true } -// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { +// AsRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { return nil, false } -// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { - return &awsapi, true -} - -// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { - return &awsapi, true -} - -// AsProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { - return nil, false +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &ivrr, true } -// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { - return &awsapi, true +// BasicJob defines workload agnostic properties for a job. +type BasicJob interface { + AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) + AsAzureStorageJob() (*AzureStorageJob, bool) + AsAzureWorkloadJob() (*AzureWorkloadJob, bool) + AsDpmJob() (*DpmJob, bool) + AsMabJob() (*MabJob, bool) + AsJob() (*Job, bool) } -// AzureWorkloadSQLPointInTimeRecoveryPoint recovery point specific to PointInTime -type AzureWorkloadSQLPointInTimeRecoveryPoint struct { - // TimeRanges - List of log ranges - TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` - // ExtendedInfo - Extended Info that provides data directory details. Will be populated in two cases: - // When a specific recovery point is accessed using GetRecoveryPoint - // Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter - ExtendedInfo *AzureWorkloadSQLRecoveryPointExtendedInfo `json:"extendedInfo,omitempty"` - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created - RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' - Type RestorePointType `json:"type,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +// Job defines workload agnostic properties for a job. +type Job struct { + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' + JobType JobType `json:"jobType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { - awspitrp.ObjectType = ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint - objectMap := make(map[string]interface{}) - if awspitrp.TimeRanges != nil { - objectMap["timeRanges"] = awspitrp.TimeRanges - } - if awspitrp.ExtendedInfo != nil { - objectMap["extendedInfo"] = awspitrp.ExtendedInfo - } - if awspitrp.ObjectType != "" { - objectMap["objectType"] = awspitrp.ObjectType +func unmarshalBasicJob(body []byte) (BasicJob, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return nil, false -} -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return &awspitrp, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return &awspitrp, true -} - -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return &awspitrp, true -} - -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { - return nil, false -} - -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return nil, false -} - -// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return nil, false + switch m["jobType"] { + case string(JobTypeAzureIaaSVMJob): + var aisj AzureIaaSVMJob + err := json.Unmarshal(body, &aisj) + return aisj, err + case string(JobTypeAzureStorageJob): + var asj AzureStorageJob + err := json.Unmarshal(body, &asj) + return asj, err + case string(JobTypeAzureWorkloadJob): + var awj AzureWorkloadJob + err := json.Unmarshal(body, &awj) + return awj, err + case string(JobTypeDpmJob): + var dj DpmJob + err := json.Unmarshal(body, &dj) + return dj, err + case string(JobTypeMabJob): + var mj MabJob + err := json.Unmarshal(body, &mj) + return mj, err + default: + var j Job + err := json.Unmarshal(body, &j) + return j, err + } } +func unmarshalBasicJobArray(body []byte) ([]BasicJob, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &awspitrp, true -} + jArray := make([]BasicJob, len(rawMessages)) -// AzureWorkloadSQLPointInTimeRestoreRequest azureWorkload SQL -specific restore. Specifically for -// PointInTime/Log restore -type AzureWorkloadSQLPointInTimeRestoreRequest struct { - // PointInTime - PointInTime value - PointInTime *date.Time `json:"pointInTime,omitempty"` - // ShouldUseAlternateTargetLocation - Default option set to true. If this is set to false, alternate data directory must be provided - ShouldUseAlternateTargetLocation *bool `json:"shouldUseAlternateTargetLocation,omitempty"` - // IsNonRecoverable - SQL specific property where user can chose to set no-recovery when restore operation is tried - IsNonRecoverable *bool `json:"isNonRecoverable,omitempty"` - // AlternateDirectoryPaths - Data directory details - AlternateDirectoryPaths *[]SQLDataDirectoryMapping `json:"alternateDirectoryPaths,omitempty"` - // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PropertyBag - Workload specific property bag. - PropertyBag map[string]*string `json:"propertyBag"` - // TargetInfo - Details of target database - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' - RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` + for index, rawMessage := range rawMessages { + j, err := unmarshalBasicJob(*rawMessage) + if err != nil { + return nil, err + } + jArray[index] = j + } + return jArray, nil } -// MarshalJSON is the custom marshaler for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { - awspitrr.ObjectType = ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest +// MarshalJSON is the custom marshaler for Job. +func (j Job) MarshalJSON() ([]byte, error) { + j.JobType = JobTypeJob objectMap := make(map[string]interface{}) - if awspitrr.PointInTime != nil { - objectMap["pointInTime"] = awspitrr.PointInTime - } - if awspitrr.ShouldUseAlternateTargetLocation != nil { - objectMap["shouldUseAlternateTargetLocation"] = awspitrr.ShouldUseAlternateTargetLocation - } - if awspitrr.IsNonRecoverable != nil { - objectMap["isNonRecoverable"] = awspitrr.IsNonRecoverable + if j.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = j.EntityFriendlyName } - if awspitrr.AlternateDirectoryPaths != nil { - objectMap["alternateDirectoryPaths"] = awspitrr.AlternateDirectoryPaths + if j.BackupManagementType != "" { + objectMap["backupManagementType"] = j.BackupManagementType } - if awspitrr.RecoveryType != "" { - objectMap["recoveryType"] = awspitrr.RecoveryType + if j.Operation != nil { + objectMap["operation"] = j.Operation } - if awspitrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = awspitrr.SourceResourceID + if j.Status != nil { + objectMap["status"] = j.Status } - if awspitrr.PropertyBag != nil { - objectMap["propertyBag"] = awspitrr.PropertyBag + if j.StartTime != nil { + objectMap["startTime"] = j.StartTime } - if awspitrr.TargetInfo != nil { - objectMap["targetInfo"] = awspitrr.TargetInfo + if j.EndTime != nil { + objectMap["endTime"] = j.EndTime } - if awspitrr.RecoveryMode != "" { - objectMap["recoveryMode"] = awspitrr.RecoveryMode + if j.ActivityID != nil { + objectMap["activityId"] = j.ActivityID } - if awspitrr.ObjectType != "" { - objectMap["objectType"] = awspitrr.ObjectType + if j.JobType != "" { + objectMap["jobType"] = j.JobType } return json.Marshal(objectMap) } -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { +// AsAzureIaaSVMJob is the BasicJob implementation for Job. +func (j Job) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { return nil, false } -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { +// AsAzureStorageJob is the BasicJob implementation for Job. +func (j Job) AsAzureStorageJob() (*AzureStorageJob, bool) { return nil, false } -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { +// AsAzureWorkloadJob is the BasicJob implementation for Job. +func (j Job) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { return nil, false } -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return &awspitrr, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { +// AsDpmJob is the BasicJob implementation for Job. +func (j Job) AsDpmJob() (*DpmJob, bool) { return nil, false } -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { +// AsMabJob is the BasicJob implementation for Job. +func (j Job) AsMabJob() (*MabJob, bool) { return nil, false } -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false +// AsJob is the BasicJob implementation for Job. +func (j Job) AsJob() (*Job, bool) { + return &j, true } -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return &awspitrr, true +// AsBasicJob is the BasicJob implementation for Job. +func (j Job) AsBasicJob() (BasicJob, bool) { + return &j, true } -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { - return &awspitrr, true -} - -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { - return nil, false -} - -// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return nil, false -} - -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &awspitrr, true -} - -// BasicAzureWorkloadSQLRecoveryPoint SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint -// along with extended info -type BasicAzureWorkloadSQLRecoveryPoint interface { - AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) - AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) -} - -// AzureWorkloadSQLRecoveryPoint SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint -// along with extended info -type AzureWorkloadSQLRecoveryPoint struct { - // ExtendedInfo - Extended Info that provides data directory details. Will be populated in two cases: - // When a specific recovery point is accessed using GetRecoveryPoint - // Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter - ExtendedInfo *AzureWorkloadSQLRecoveryPointExtendedInfo `json:"extendedInfo,omitempty"` - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created - RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' - Type RestorePointType `json:"type,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` -} - -func unmarshalBasicAzureWorkloadSQLRecoveryPoint(body []byte) (BasicAzureWorkloadSQLRecoveryPoint, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): - var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awspitrp) - return awspitrp, err - default: - var awsrp AzureWorkloadSQLRecoveryPoint - err := json.Unmarshal(body, &awsrp) - return awsrp, err - } -} -func unmarshalBasicAzureWorkloadSQLRecoveryPointArray(body []byte) ([]BasicAzureWorkloadSQLRecoveryPoint, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - awsrpArray := make([]BasicAzureWorkloadSQLRecoveryPoint, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awsrp, err := unmarshalBasicAzureWorkloadSQLRecoveryPoint(*rawMessage) - if err != nil { - return nil, err - } - awsrpArray[index] = awsrp - } - return awsrpArray, nil -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) MarshalJSON() ([]byte, error) { - awsrp.ObjectType = ObjectTypeAzureWorkloadSQLRecoveryPoint - objectMap := make(map[string]interface{}) - if awsrp.ExtendedInfo != nil { - objectMap["extendedInfo"] = awsrp.ExtendedInfo - } - if awsrp.ObjectType != "" { - objectMap["objectType"] = awsrp.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return &awsrp, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return &awsrp, true -} - -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return &awsrp, true -} - -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { - return nil, false -} - -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return nil, false -} - -// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return nil, false -} - -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &awsrp, true -} - -// AzureWorkloadSQLRecoveryPointExtendedInfo extended info class details -type AzureWorkloadSQLRecoveryPointExtendedInfo struct { - // DataDirectoryTimeInUTC - READ-ONLY; UTC time at which data directory info was captured - DataDirectoryTimeInUTC *date.Time `json:"dataDirectoryTimeInUTC,omitempty"` - // DataDirectoryPaths - READ-ONLY; List of data directory paths during restore operation. - DataDirectoryPaths *[]SQLDataDirectory `json:"dataDirectoryPaths,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSQLRecoveryPointExtendedInfo. -func (awsrpei AzureWorkloadSQLRecoveryPointExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// BasicAzureWorkloadSQLRestoreRequest azureWorkload SQL -specific restore. Specifically for full/diff restore -type BasicAzureWorkloadSQLRestoreRequest interface { - AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) - AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) -} - -// AzureWorkloadSQLRestoreRequest azureWorkload SQL -specific restore. Specifically for full/diff restore -type AzureWorkloadSQLRestoreRequest struct { - // ShouldUseAlternateTargetLocation - Default option set to true. If this is set to false, alternate data directory must be provided - ShouldUseAlternateTargetLocation *bool `json:"shouldUseAlternateTargetLocation,omitempty"` - // IsNonRecoverable - SQL specific property where user can chose to set no-recovery when restore operation is tried - IsNonRecoverable *bool `json:"isNonRecoverable,omitempty"` - // AlternateDirectoryPaths - Data directory details - AlternateDirectoryPaths *[]SQLDataDirectoryMapping `json:"alternateDirectoryPaths,omitempty"` - // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PropertyBag - Workload specific property bag. - PropertyBag map[string]*string `json:"propertyBag"` - // TargetInfo - Details of target database - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' - RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` -} - -func unmarshalBasicAzureWorkloadSQLRestoreRequest(body []byte) (BasicAzureWorkloadSQLRestoreRequest, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): - var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest - err := json.Unmarshal(body, &awspitrr) - return awspitrr, err - default: - var awsrr AzureWorkloadSQLRestoreRequest - err := json.Unmarshal(body, &awsrr) - return awsrr, err - } -} -func unmarshalBasicAzureWorkloadSQLRestoreRequestArray(body []byte) ([]BasicAzureWorkloadSQLRestoreRequest, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - awsrrArray := make([]BasicAzureWorkloadSQLRestoreRequest, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awsrr, err := unmarshalBasicAzureWorkloadSQLRestoreRequest(*rawMessage) - if err != nil { - return nil, err - } - awsrrArray[index] = awsrr - } - return awsrrArray, nil -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) MarshalJSON() ([]byte, error) { - awsrr.ObjectType = ObjectTypeAzureWorkloadSQLRestoreRequest - objectMap := make(map[string]interface{}) - if awsrr.ShouldUseAlternateTargetLocation != nil { - objectMap["shouldUseAlternateTargetLocation"] = awsrr.ShouldUseAlternateTargetLocation - } - if awsrr.IsNonRecoverable != nil { - objectMap["isNonRecoverable"] = awsrr.IsNonRecoverable - } - if awsrr.AlternateDirectoryPaths != nil { - objectMap["alternateDirectoryPaths"] = awsrr.AlternateDirectoryPaths - } - if awsrr.RecoveryType != "" { - objectMap["recoveryType"] = awsrr.RecoveryType - } - if awsrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = awsrr.SourceResourceID - } - if awsrr.PropertyBag != nil { - objectMap["propertyBag"] = awsrr.PropertyBag - } - if awsrr.TargetInfo != nil { - objectMap["targetInfo"] = awsrr.TargetInfo - } - if awsrr.RecoveryMode != "" { - objectMap["recoveryMode"] = awsrr.RecoveryMode - } - if awsrr.ObjectType != "" { - objectMap["objectType"] = awsrr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return &awsrr, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { - return &awsrr, true -} - -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { - return &awsrr, true -} - -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { - return nil, false -} - -// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return nil, false -} - -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &awsrr, true -} - -// BEKDetails BEK is bitlocker encryption key. -type BEKDetails struct { - // SecretURL - Secret is BEK. - SecretURL *string `json:"secretUrl,omitempty"` - // SecretVaultID - ID of the Key Vault where this Secret is stored. - SecretVaultID *string `json:"secretVaultId,omitempty"` - // SecretData - BEK data. - SecretData *string `json:"secretData,omitempty"` -} - -// BMSBackupEngineQueryObject query parameters to fetch list of backup engines. -type BMSBackupEngineQueryObject struct { - // Expand - attribute to add extended info - Expand *string `json:"expand,omitempty"` -} - -// BMSBackupEnginesQueryObject query parameters to fetch list of backup engines. -type BMSBackupEnginesQueryObject struct { - // BackupManagementType - Backup management type for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // FriendlyName - Friendly name of the backup engine. - FriendlyName *string `json:"friendlyName,omitempty"` - // Expand - Attribute to add extended info. - Expand *string `json:"expand,omitempty"` -} - -// BMSBackupSummariesQueryObject query parameters to fetch backup summaries. -type BMSBackupSummariesQueryObject struct { - // Type - Backup management type for this container. Possible values include: 'TypeInvalid', 'TypeBackupProtectedItemCountSummary', 'TypeBackupProtectionContainerCountSummary' - Type Type `json:"type,omitempty"` -} - -// BMSContainerQueryObject the query filters that can be used with the list containers API. -type BMSContainerQueryObject struct { - // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // ContainerType - Type of container for filter. Possible values include: 'ContainerTypeInvalid', 'ContainerTypeUnknown', 'ContainerTypeIaasVMContainer', 'ContainerTypeIaasVMServiceContainer', 'ContainerTypeDPMContainer', 'ContainerTypeAzureBackupServerContainer', 'ContainerTypeMABContainer', 'ContainerTypeCluster', 'ContainerTypeAzureSQLContainer', 'ContainerTypeWindows', 'ContainerTypeVCenter', 'ContainerTypeVMAppContainer', 'ContainerTypeSQLAGWorkLoadContainer', 'ContainerTypeStorageContainer', 'ContainerTypeGenericContainer' - ContainerType ContainerType `json:"containerType,omitempty"` - // BackupEngineName - Backup engine name - BackupEngineName *string `json:"backupEngineName,omitempty"` - // FabricName - Fabric name for filter - FabricName *string `json:"fabricName,omitempty"` - // Status - Status of registration of this container with the Recovery Services Vault. - Status *string `json:"status,omitempty"` - // FriendlyName - Friendly name of this container. - FriendlyName *string `json:"friendlyName,omitempty"` -} - -// BMSContainersInquiryQueryObject the query filters that can be used with the inquire container API. -type BMSContainersInquiryQueryObject struct { - // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Workload type for this container. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` -} - -// BMSPOQueryObject filters to list items that can be backed up. -type BMSPOQueryObject struct { - // BackupManagementType - Backup management type. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Workload type. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` - // ContainerName - Full name of the container whose Protectable Objects should be returned. - ContainerName *string `json:"containerName,omitempty"` - // Status - Backup status query parameter. - Status *string `json:"status,omitempty"` - // FriendlyName - Friendly name. - FriendlyName *string `json:"friendlyName,omitempty"` -} - -// BMSRefreshContainersQueryObject the query filters that can be used with the refresh container API. -type BMSRefreshContainersQueryObject struct { - // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` -} - -// BMSRPQueryObject filters to list backup copies. -type BMSRPQueryObject struct { - // StartDate - Backup copies created after this time. - StartDate *date.Time `json:"startDate,omitempty"` - // EndDate - Backup copies created before this time. - EndDate *date.Time `json:"endDate,omitempty"` - // RestorePointQueryType - RestorePoint type. Possible values include: 'RestorePointQueryTypeInvalid', 'RestorePointQueryTypeFull', 'RestorePointQueryTypeLog', 'RestorePointQueryTypeDifferential', 'RestorePointQueryTypeFullAndDifferential', 'RestorePointQueryTypeAll' - RestorePointQueryType RestorePointQueryType `json:"restorePointQueryType,omitempty"` - // ExtendedInfo - In Get Recovery Point, it tells whether extended information about recovery point is asked. - ExtendedInfo *bool `json:"extendedInfo,omitempty"` -} - -// BMSWorkloadItemQueryObject filters to list items that can be backed up. -type BMSWorkloadItemQueryObject struct { - // BackupManagementType - Backup management type. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadItemType - Workload Item type. Possible values include: 'WorkloadItemTypeInvalid', 'WorkloadItemTypeSQLInstance', 'WorkloadItemTypeSQLDataBase', 'WorkloadItemTypeSAPHanaSystem', 'WorkloadItemTypeSAPHanaDatabase', 'WorkloadItemTypeSAPAseSystem', 'WorkloadItemTypeSAPAseDatabase' - WorkloadItemType WorkloadItemType `json:"workloadItemType,omitempty"` - // WorkloadType - Workload type. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` - // ProtectionStatus - Backup status query parameter. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionStatus ProtectionStatus `json:"protectionStatus,omitempty"` -} - -// ClientDiscoveryDisplay localized display information of an operation. -type ClientDiscoveryDisplay struct { - // Provider - Name of the provider for display purposes - Provider *string `json:"provider,omitempty"` - // Resource - ResourceType for which this Operation can be performed. - Resource *string `json:"resource,omitempty"` - // Operation - Operations Name itself. - Operation *string `json:"operation,omitempty"` - // Description - Description of the operation having details of what operation is about. - Description *string `json:"description,omitempty"` -} - -// ClientDiscoveryForLogSpecification class to represent shoebox log specification in json client -// discovery. -type ClientDiscoveryForLogSpecification struct { - // Name - Name for shoebox log specification. - Name *string `json:"name,omitempty"` - // DisplayName - Localized display name - DisplayName *string `json:"displayName,omitempty"` - // BlobDuration - blob duration of shoebox log specification - BlobDuration *string `json:"blobDuration,omitempty"` -} - -// ClientDiscoveryForProperties class to represent shoebox properties in json client discovery. -type ClientDiscoveryForProperties struct { - // ServiceSpecification - Operation properties. - ServiceSpecification *ClientDiscoveryForServiceSpecification `json:"serviceSpecification,omitempty"` -} - -// ClientDiscoveryForServiceSpecification class to represent shoebox service specification in json client -// discovery. -type ClientDiscoveryForServiceSpecification struct { - // LogSpecifications - List of log specifications of this operation. - LogSpecifications *[]ClientDiscoveryForLogSpecification `json:"logSpecifications,omitempty"` -} - -// ClientDiscoveryResponse operations List response which contains list of available APIs. -type ClientDiscoveryResponse struct { - autorest.Response `json:"-"` - // Value - List of available operations. - Value *[]ClientDiscoveryValueForSingleAPI `json:"value,omitempty"` - // NextLink - Link to the next chunk of Response. - NextLink *string `json:"nextLink,omitempty"` -} - -// ClientDiscoveryResponseIterator provides access to a complete listing of -// ClientDiscoveryValueForSingleAPI values. -type ClientDiscoveryResponseIterator struct { - i int - page ClientDiscoveryResponsePage -} - -// NextWithContext 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 *ClientDiscoveryResponseIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ClientDiscoveryResponseIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ClientDiscoveryResponseIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ClientDiscoveryResponseIterator) 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 ClientDiscoveryResponseIterator) Response() ClientDiscoveryResponse { - 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 ClientDiscoveryResponseIterator) Value() ClientDiscoveryValueForSingleAPI { - if !iter.page.NotDone() { - return ClientDiscoveryValueForSingleAPI{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ClientDiscoveryResponseIterator type. -func NewClientDiscoveryResponseIterator(page ClientDiscoveryResponsePage) ClientDiscoveryResponseIterator { - return ClientDiscoveryResponseIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (cdr ClientDiscoveryResponse) IsEmpty() bool { - return cdr.Value == nil || len(*cdr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (cdr ClientDiscoveryResponse) hasNextLink() bool { - return cdr.NextLink != nil && len(*cdr.NextLink) != 0 -} - -// clientDiscoveryResponsePreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cdr ClientDiscoveryResponse) clientDiscoveryResponsePreparer(ctx context.Context) (*http.Request, error) { - if !cdr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cdr.NextLink))) -} - -// ClientDiscoveryResponsePage contains a page of ClientDiscoveryValueForSingleAPI values. -type ClientDiscoveryResponsePage struct { - fn func(context.Context, ClientDiscoveryResponse) (ClientDiscoveryResponse, error) - cdr ClientDiscoveryResponse -} - -// NextWithContext 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 *ClientDiscoveryResponsePage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ClientDiscoveryResponsePage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.cdr) - if err != nil { - return err - } - page.cdr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *ClientDiscoveryResponsePage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ClientDiscoveryResponsePage) NotDone() bool { - return !page.cdr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ClientDiscoveryResponsePage) Response() ClientDiscoveryResponse { - return page.cdr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ClientDiscoveryResponsePage) Values() []ClientDiscoveryValueForSingleAPI { - if page.cdr.IsEmpty() { - return nil - } - return *page.cdr.Value -} - -// Creates a new instance of the ClientDiscoveryResponsePage type. -func NewClientDiscoveryResponsePage(cur ClientDiscoveryResponse, getNextPage func(context.Context, ClientDiscoveryResponse) (ClientDiscoveryResponse, error)) ClientDiscoveryResponsePage { - return ClientDiscoveryResponsePage{ - fn: getNextPage, - cdr: cur, - } -} - -// ClientDiscoveryValueForSingleAPI available operation details. -type ClientDiscoveryValueForSingleAPI struct { - // Name - Name of the Operation. - Name *string `json:"name,omitempty"` - // Display - Contains the localized display information for this particular operation - Display *ClientDiscoveryDisplay `json:"display,omitempty"` - // Origin - The intended executor of the operation;governs the display of the operation in the RBAC UX and the audit logs UX - Origin *string `json:"origin,omitempty"` - // Properties - ShoeBox properties for the given operation. - Properties *ClientDiscoveryForProperties `json:"properties,omitempty"` -} - -// ClientScriptForConnect client script details for file / folder restore. -type ClientScriptForConnect struct { - // ScriptContent - File content of the client script for file / folder restore. - ScriptContent *string `json:"scriptContent,omitempty"` - // ScriptExtension - File extension of the client script for file / folder restore - .ps1 , .sh , etc. - ScriptExtension *string `json:"scriptExtension,omitempty"` - // OsType - OS type - Windows, Linux etc. for which this file / folder restore client script works. - OsType *string `json:"osType,omitempty"` - // URL - URL of Executable from where to source the content. If this is not null then ScriptContent should not be used - URL *string `json:"url,omitempty"` - // ScriptNameSuffix - Mandatory suffix that should be added to the name of script that is given for download to user. - // If its null or empty then , ignore it. - ScriptNameSuffix *string `json:"scriptNameSuffix,omitempty"` -} - -// ContainerIdentityInfo container identity information -type ContainerIdentityInfo struct { - // UniqueName - Unique name of the container - UniqueName *string `json:"uniqueName,omitempty"` - // AadTenantID - Protection container identity - AAD Tenant - AadTenantID *string `json:"aadTenantId,omitempty"` - // ServicePrincipalClientID - Protection container identity - AAD Service Principal - ServicePrincipalClientID *string `json:"servicePrincipalClientId,omitempty"` - // Audience - Protection container identity - Audience - Audience *string `json:"audience,omitempty"` -} - -// DailyRetentionFormat daily retention format. -type DailyRetentionFormat struct { - // DaysOfTheMonth - List of days of the month. - DaysOfTheMonth *[]Day `json:"daysOfTheMonth,omitempty"` -} - -// DailyRetentionSchedule daily retention schedule. -type DailyRetentionSchedule struct { - // RetentionTimes - Retention times of retention policy. - RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` - // RetentionDuration - Retention duration of retention Policy. - RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` -} - -// Day day of the week. -type Day struct { - // Date - Date of the month - Date *int32 `json:"date,omitempty"` - // IsLast - Whether Date is last date of month - IsLast *bool `json:"isLast,omitempty"` -} - -// DiskExclusionProperties ... -type DiskExclusionProperties struct { - // DiskLunList - List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. - DiskLunList *[]int32 `json:"diskLunList,omitempty"` - // IsInclusionList - Flag to indicate whether DiskLunList is to be included/ excluded from backup. - IsInclusionList *bool `json:"isInclusionList,omitempty"` -} - -// DiskInformation disk information -type DiskInformation struct { - Lun *int32 `json:"lun,omitempty"` - Name *string `json:"name,omitempty"` -} - -// DistributedNodesInfo this is used to represent the various nodes of the distributed container. -type DistributedNodesInfo struct { - // NodeName - Name of the node under a distributed container. - NodeName *string `json:"nodeName,omitempty"` - // Status - Status of this Node. - // Failed | Succeeded - Status *string `json:"status,omitempty"` - // ErrorDetail - Error Details if the Status is non-success. - ErrorDetail *ErrorDetail `json:"errorDetail,omitempty"` -} - -// DpmBackupEngine data Protection Manager (DPM) specific backup engine. -type DpmBackupEngine struct { - // FriendlyName - Friendly name of the backup engine. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Registration status of the backup engine with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // BackupEngineState - Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} - BackupEngineState *string `json:"backupEngineState,omitempty"` - // HealthStatus - Backup status of the backup engine. - HealthStatus *string `json:"healthStatus,omitempty"` - // CanReRegister - Flag indicating if the backup engine be registered, once already registered. - CanReRegister *bool `json:"canReRegister,omitempty"` - // BackupEngineID - ID of the backup engine. - BackupEngineID *string `json:"backupEngineId,omitempty"` - // DpmVersion - Backup engine version - DpmVersion *string `json:"dpmVersion,omitempty"` - // AzureBackupAgentVersion - Backup agent version - AzureBackupAgentVersion *string `json:"azureBackupAgentVersion,omitempty"` - // IsAzureBackupAgentUpgradeAvailable - To check if backup agent upgrade available - IsAzureBackupAgentUpgradeAvailable *bool `json:"isAzureBackupAgentUpgradeAvailable,omitempty"` - // IsDpmUpgradeAvailable - To check if backup engine upgrade available - IsDpmUpgradeAvailable *bool `json:"isDpmUpgradeAvailable,omitempty"` - // ExtendedInfo - Extended info of the backupengine - ExtendedInfo *EngineExtendedInfo `json:"extendedInfo,omitempty"` - // BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine' - BackupEngineType EngineType `json:"backupEngineType,omitempty"` -} - -// MarshalJSON is the custom marshaler for DpmBackupEngine. -func (dbe DpmBackupEngine) MarshalJSON() ([]byte, error) { - dbe.BackupEngineType = BackupEngineTypeDpmBackupEngine - objectMap := make(map[string]interface{}) - if dbe.FriendlyName != nil { - objectMap["friendlyName"] = dbe.FriendlyName - } - if dbe.BackupManagementType != "" { - objectMap["backupManagementType"] = dbe.BackupManagementType - } - if dbe.RegistrationStatus != nil { - objectMap["registrationStatus"] = dbe.RegistrationStatus - } - if dbe.BackupEngineState != nil { - objectMap["backupEngineState"] = dbe.BackupEngineState - } - if dbe.HealthStatus != nil { - objectMap["healthStatus"] = dbe.HealthStatus - } - if dbe.CanReRegister != nil { - objectMap["canReRegister"] = dbe.CanReRegister - } - if dbe.BackupEngineID != nil { - objectMap["backupEngineId"] = dbe.BackupEngineID - } - if dbe.DpmVersion != nil { - objectMap["dpmVersion"] = dbe.DpmVersion - } - if dbe.AzureBackupAgentVersion != nil { - objectMap["azureBackupAgentVersion"] = dbe.AzureBackupAgentVersion - } - if dbe.IsAzureBackupAgentUpgradeAvailable != nil { - objectMap["isAzureBackupAgentUpgradeAvailable"] = dbe.IsAzureBackupAgentUpgradeAvailable - } - if dbe.IsDpmUpgradeAvailable != nil { - objectMap["isDpmUpgradeAvailable"] = dbe.IsDpmUpgradeAvailable - } - if dbe.ExtendedInfo != nil { - objectMap["extendedInfo"] = dbe.ExtendedInfo - } - if dbe.BackupEngineType != "" { - objectMap["backupEngineType"] = dbe.BackupEngineType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerEngine is the BasicEngineBase implementation for DpmBackupEngine. -func (dbe DpmBackupEngine) AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) { - return nil, false -} - -// AsDpmBackupEngine is the BasicEngineBase implementation for DpmBackupEngine. -func (dbe DpmBackupEngine) AsDpmBackupEngine() (*DpmBackupEngine, bool) { - return &dbe, true -} - -// AsEngineBase is the BasicEngineBase implementation for DpmBackupEngine. -func (dbe DpmBackupEngine) AsEngineBase() (*EngineBase, bool) { - return nil, false -} - -// AsBasicEngineBase is the BasicEngineBase implementation for DpmBackupEngine. -func (dbe DpmBackupEngine) AsBasicEngineBase() (BasicEngineBase, bool) { - return &dbe, true -} - -// BasicDpmContainer DPM workload-specific protection container. -type BasicDpmContainer interface { - AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) - AsDpmContainer() (*DpmContainer, bool) -} - -// DpmContainer DPM workload-specific protection container. -type DpmContainer struct { - // CanReRegister - Specifies whether the container is re-registrable. - CanReRegister *bool `json:"canReRegister,omitempty"` - // ContainerID - ID of container. - ContainerID *string `json:"containerId,omitempty"` - // ProtectedItemCount - Number of protected items in the BackupEngine - ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` - // DpmAgentVersion - Backup engine Agent version - DpmAgentVersion *string `json:"dpmAgentVersion,omitempty"` - // DpmServers - List of BackupEngines protecting the container - DpmServers *[]string `json:"dpmServers,omitempty"` - // UpgradeAvailable - To check if upgrade available - UpgradeAvailable *bool `json:"upgradeAvailable,omitempty"` - // ProtectionStatus - Protection status of the container. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ExtendedInfo - Extended Info of the container. - ExtendedInfo *DPMContainerExtendedInfo `json:"extendedInfo,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -func unmarshalBasicDpmContainer(body []byte) (BasicDpmContainer, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["containerType"] { - case string(ContainerTypeAzureBackupServerContainer1): - var absc AzureBackupServerContainer - err := json.Unmarshal(body, &absc) - return absc, err - default: - var dc DpmContainer - err := json.Unmarshal(body, &dc) - return dc, err - } -} -func unmarshalBasicDpmContainerArray(body []byte) ([]BasicDpmContainer, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - dcArray := make([]BasicDpmContainer, len(rawMessages)) - - for index, rawMessage := range rawMessages { - dc, err := unmarshalBasicDpmContainer(*rawMessage) - if err != nil { - return nil, err - } - dcArray[index] = dc - } - return dcArray, nil -} - -// MarshalJSON is the custom marshaler for DpmContainer. -func (dc DpmContainer) MarshalJSON() ([]byte, error) { - dc.ContainerType = ContainerTypeDPMContainer1 - objectMap := make(map[string]interface{}) - if dc.CanReRegister != nil { - objectMap["canReRegister"] = dc.CanReRegister - } - if dc.ContainerID != nil { - objectMap["containerId"] = dc.ContainerID - } - if dc.ProtectedItemCount != nil { - objectMap["protectedItemCount"] = dc.ProtectedItemCount - } - if dc.DpmAgentVersion != nil { - objectMap["dpmAgentVersion"] = dc.DpmAgentVersion - } - if dc.DpmServers != nil { - objectMap["dpmServers"] = dc.DpmServers - } - if dc.UpgradeAvailable != nil { - objectMap["upgradeAvailable"] = dc.UpgradeAvailable - } - if dc.ProtectionStatus != nil { - objectMap["protectionStatus"] = dc.ProtectionStatus - } - if dc.ExtendedInfo != nil { - objectMap["extendedInfo"] = dc.ExtendedInfo - } - if dc.FriendlyName != nil { - objectMap["friendlyName"] = dc.FriendlyName - } - if dc.BackupManagementType != "" { - objectMap["backupManagementType"] = dc.BackupManagementType - } - if dc.RegistrationStatus != nil { - objectMap["registrationStatus"] = dc.RegistrationStatus - } - if dc.HealthStatus != nil { - objectMap["healthStatus"] = dc.HealthStatus - } - if dc.ContainerType != "" { - objectMap["containerType"] = dc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsDpmContainer() (*DpmContainer, bool) { - return &dc, true -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return &dc, true -} - -// AsGenericContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false -} - -// AsMabContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &dc, true -} - -// DPMContainerExtendedInfo additional information of the DPMContainer. -type DPMContainerExtendedInfo struct { - // LastRefreshedAt - Last refresh time of the DPMContainer. - LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` -} - -// DpmErrorInfo DPM workload-specific error information. -type DpmErrorInfo struct { - // ErrorString - Localized error string. - ErrorString *string `json:"errorString,omitempty"` - // Recommendations - List of localized recommendations for above error code. - Recommendations *[]string `json:"recommendations,omitempty"` -} - -// DpmJob DPM workload-specific job object. -type DpmJob struct { - // Duration - Time elapsed for job. - Duration *string `json:"duration,omitempty"` - // DpmServerName - DPM server name managing the backup item or backup job. - DpmServerName *string `json:"dpmServerName,omitempty"` - // ContainerName - Name of cluster/server protecting current backup item, if any. - ContainerName *string `json:"containerName,omitempty"` - // ContainerType - Type of container. - ContainerType *string `json:"containerType,omitempty"` - // WorkloadType - Type of backup item. - WorkloadType *string `json:"workloadType,omitempty"` - // ActionsInfo - The state/actions applicable on this job like cancel/retry. - ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` - // ErrorDetails - The errors. - ErrorDetails *[]DpmErrorInfo `json:"errorDetails,omitempty"` - // ExtendedInfo - Additional information for this job. - ExtendedInfo *DpmJobExtendedInfo `json:"extendedInfo,omitempty"` - // EntityFriendlyName - Friendly name of the entity on which the current job is executing. - EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` - // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // Operation - The operation name. - Operation *string `json:"operation,omitempty"` - // Status - Job status. - Status *string `json:"status,omitempty"` - // StartTime - The start time. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time. - EndTime *date.Time `json:"endTime,omitempty"` - // ActivityID - ActivityId of job. - ActivityID *string `json:"activityId,omitempty"` - // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' - JobType JobType `json:"jobType,omitempty"` -} - -// MarshalJSON is the custom marshaler for DpmJob. -func (dj DpmJob) MarshalJSON() ([]byte, error) { - dj.JobType = JobTypeDpmJob - objectMap := make(map[string]interface{}) - if dj.Duration != nil { - objectMap["duration"] = dj.Duration - } - if dj.DpmServerName != nil { - objectMap["dpmServerName"] = dj.DpmServerName - } - if dj.ContainerName != nil { - objectMap["containerName"] = dj.ContainerName - } - if dj.ContainerType != nil { - objectMap["containerType"] = dj.ContainerType - } - if dj.WorkloadType != nil { - objectMap["workloadType"] = dj.WorkloadType - } - if dj.ActionsInfo != nil { - objectMap["actionsInfo"] = dj.ActionsInfo - } - if dj.ErrorDetails != nil { - objectMap["errorDetails"] = dj.ErrorDetails - } - if dj.ExtendedInfo != nil { - objectMap["extendedInfo"] = dj.ExtendedInfo - } - if dj.EntityFriendlyName != nil { - objectMap["entityFriendlyName"] = dj.EntityFriendlyName - } - if dj.BackupManagementType != "" { - objectMap["backupManagementType"] = dj.BackupManagementType - } - if dj.Operation != nil { - objectMap["operation"] = dj.Operation - } - if dj.Status != nil { - objectMap["status"] = dj.Status - } - if dj.StartTime != nil { - objectMap["startTime"] = dj.StartTime - } - if dj.EndTime != nil { - objectMap["endTime"] = dj.EndTime - } - if dj.ActivityID != nil { - objectMap["activityId"] = dj.ActivityID - } - if dj.JobType != "" { - objectMap["jobType"] = dj.JobType - } - return json.Marshal(objectMap) -} - -// AsAzureIaaSVMJob is the BasicJob implementation for DpmJob. -func (dj DpmJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { - return nil, false -} - -// AsAzureStorageJob is the BasicJob implementation for DpmJob. -func (dj DpmJob) AsAzureStorageJob() (*AzureStorageJob, bool) { - return nil, false -} - -// AsAzureWorkloadJob is the BasicJob implementation for DpmJob. -func (dj DpmJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { - return nil, false -} - -// AsDpmJob is the BasicJob implementation for DpmJob. -func (dj DpmJob) AsDpmJob() (*DpmJob, bool) { - return &dj, true -} - -// AsMabJob is the BasicJob implementation for DpmJob. -func (dj DpmJob) AsMabJob() (*MabJob, bool) { - return nil, false -} - -// AsJob is the BasicJob implementation for DpmJob. -func (dj DpmJob) AsJob() (*Job, bool) { - return nil, false -} - -// AsBasicJob is the BasicJob implementation for DpmJob. -func (dj DpmJob) AsBasicJob() (BasicJob, bool) { - return &dj, true -} - -// DpmJobExtendedInfo additional information on the DPM workload-specific job. -type DpmJobExtendedInfo struct { - // TasksList - List of tasks associated with this job. - TasksList *[]DpmJobTaskDetails `json:"tasksList,omitempty"` - // PropertyBag - The job properties. - PropertyBag map[string]*string `json:"propertyBag"` - // DynamicErrorMessage - Non localized error message on job execution. - DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` -} - -// MarshalJSON is the custom marshaler for DpmJobExtendedInfo. -func (djei DpmJobExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if djei.TasksList != nil { - objectMap["tasksList"] = djei.TasksList - } - if djei.PropertyBag != nil { - objectMap["propertyBag"] = djei.PropertyBag - } - if djei.DynamicErrorMessage != nil { - objectMap["dynamicErrorMessage"] = djei.DynamicErrorMessage - } - return json.Marshal(objectMap) -} - -// DpmJobTaskDetails DPM workload-specific job task details. -type DpmJobTaskDetails struct { - // TaskID - The task display name. - TaskID *string `json:"taskId,omitempty"` - // StartTime - The start time. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time. - EndTime *date.Time `json:"endTime,omitempty"` - // Duration - Time elapsed for task. - Duration *string `json:"duration,omitempty"` - // Status - The status. - Status *string `json:"status,omitempty"` -} - -// DPMProtectedItem additional information on Backup engine specific backup item. -type DPMProtectedItem struct { - // FriendlyName - Friendly name of the managed item - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupEngineName - Backup Management server protecting this backup item - BackupEngineName *string `json:"backupEngineName,omitempty"` - // ProtectionState - Protection state of the backup engine. Possible values include: 'ProtectedItemStateInvalid', 'ProtectedItemStateIRPending', 'ProtectedItemStateProtected', 'ProtectedItemStateProtectionError', 'ProtectedItemStateProtectionStopped', 'ProtectedItemStateProtectionPaused' - ProtectionState ProtectedItemState `json:"protectionState,omitempty"` - // ExtendedInfo - Extended info of the backup item. - ExtendedInfo *DPMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for DPMProtectedItem. -func (dpi DPMProtectedItem) MarshalJSON() ([]byte, error) { - dpi.ProtectedItemType = ProtectedItemTypeDPMProtectedItem - objectMap := make(map[string]interface{}) - if dpi.FriendlyName != nil { - objectMap["friendlyName"] = dpi.FriendlyName - } - if dpi.BackupEngineName != nil { - objectMap["backupEngineName"] = dpi.BackupEngineName - } - if dpi.ProtectionState != "" { - objectMap["protectionState"] = dpi.ProtectionState - } - if dpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = dpi.ExtendedInfo - } - if dpi.BackupManagementType != "" { - objectMap["backupManagementType"] = dpi.BackupManagementType - } - if dpi.WorkloadType != "" { - objectMap["workloadType"] = dpi.WorkloadType - } - if dpi.ContainerName != nil { - objectMap["containerName"] = dpi.ContainerName - } - if dpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = dpi.SourceResourceID - } - if dpi.PolicyID != nil { - objectMap["policyId"] = dpi.PolicyID - } - if dpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = dpi.LastRecoveryPoint - } - if dpi.BackupSetName != nil { - objectMap["backupSetName"] = dpi.BackupSetName - } - if dpi.CreateMode != "" { - objectMap["createMode"] = dpi.CreateMode - } - if dpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = dpi.DeferredDeleteTimeInUTC - } - if dpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = dpi.IsScheduledForDeferredDelete - } - if dpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = dpi.DeferredDeleteTimeRemaining - } - if dpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = dpi.IsDeferredDeleteScheduleUpcoming - } - if dpi.IsRehydrate != nil { - objectMap["isRehydrate"] = dpi.IsRehydrate - } - if dpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = dpi.ProtectedItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return nil, false -} - -// AsDPMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return &dpi, true -} - -// AsGenericProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return nil, false -} - -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return nil, false -} - -// AsProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return nil, false -} - -// AsBasicProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &dpi, true -} - -// DPMProtectedItemExtendedInfo additional information of DPM Protected item. -type DPMProtectedItemExtendedInfo struct { - // ProtectableObjectLoadPath - Attribute to provide information on various DBs. - ProtectableObjectLoadPath map[string]*string `json:"protectableObjectLoadPath"` - // Protected - To check if backup item is disk protected. - Protected *bool `json:"protected,omitempty"` - // IsPresentOnCloud - To check if backup item is cloud protected. - IsPresentOnCloud *bool `json:"isPresentOnCloud,omitempty"` - // LastBackupStatus - Last backup status information on backup item. - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - // LastRefreshedAt - Last refresh time on backup item. - LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` - // OldestRecoveryPoint - Oldest cloud recovery point time. - OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` - // RecoveryPointCount - cloud recovery point count. - RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` - // OnPremiseOldestRecoveryPoint - Oldest disk recovery point time. - OnPremiseOldestRecoveryPoint *date.Time `json:"onPremiseOldestRecoveryPoint,omitempty"` - // OnPremiseLatestRecoveryPoint - latest disk recovery point time. - OnPremiseLatestRecoveryPoint *date.Time `json:"onPremiseLatestRecoveryPoint,omitempty"` - // OnPremiseRecoveryPointCount - disk recovery point count. - OnPremiseRecoveryPointCount *int32 `json:"onPremiseRecoveryPointCount,omitempty"` - // IsCollocated - To check if backup item is collocated. - IsCollocated *bool `json:"isCollocated,omitempty"` - // ProtectionGroupName - Protection group name of the backup item. - ProtectionGroupName *string `json:"protectionGroupName,omitempty"` - // DiskStorageUsedInBytes - Used Disk storage in bytes. - DiskStorageUsedInBytes *string `json:"diskStorageUsedInBytes,omitempty"` - // TotalDiskStorageSizeInBytes - total Disk storage in bytes. - TotalDiskStorageSizeInBytes *string `json:"totalDiskStorageSizeInBytes,omitempty"` -} - -// MarshalJSON is the custom marshaler for DPMProtectedItemExtendedInfo. -func (dpiei DPMProtectedItemExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dpiei.ProtectableObjectLoadPath != nil { - objectMap["protectableObjectLoadPath"] = dpiei.ProtectableObjectLoadPath - } - if dpiei.Protected != nil { - objectMap["protected"] = dpiei.Protected - } - if dpiei.IsPresentOnCloud != nil { - objectMap["isPresentOnCloud"] = dpiei.IsPresentOnCloud - } - if dpiei.LastBackupStatus != nil { - objectMap["lastBackupStatus"] = dpiei.LastBackupStatus - } - if dpiei.LastRefreshedAt != nil { - objectMap["lastRefreshedAt"] = dpiei.LastRefreshedAt - } - if dpiei.OldestRecoveryPoint != nil { - objectMap["oldestRecoveryPoint"] = dpiei.OldestRecoveryPoint - } - if dpiei.RecoveryPointCount != nil { - objectMap["recoveryPointCount"] = dpiei.RecoveryPointCount - } - if dpiei.OnPremiseOldestRecoveryPoint != nil { - objectMap["onPremiseOldestRecoveryPoint"] = dpiei.OnPremiseOldestRecoveryPoint - } - if dpiei.OnPremiseLatestRecoveryPoint != nil { - objectMap["onPremiseLatestRecoveryPoint"] = dpiei.OnPremiseLatestRecoveryPoint - } - if dpiei.OnPremiseRecoveryPointCount != nil { - objectMap["onPremiseRecoveryPointCount"] = dpiei.OnPremiseRecoveryPointCount - } - if dpiei.IsCollocated != nil { - objectMap["isCollocated"] = dpiei.IsCollocated - } - if dpiei.ProtectionGroupName != nil { - objectMap["protectionGroupName"] = dpiei.ProtectionGroupName - } - if dpiei.DiskStorageUsedInBytes != nil { - objectMap["diskStorageUsedInBytes"] = dpiei.DiskStorageUsedInBytes - } - if dpiei.TotalDiskStorageSizeInBytes != nil { - objectMap["totalDiskStorageSizeInBytes"] = dpiei.TotalDiskStorageSizeInBytes - } - return json.Marshal(objectMap) -} - -// EncryptionDetails details needed if the VM was encrypted at the time of backup. -type EncryptionDetails struct { - // EncryptionEnabled - Identifies whether this backup copy represents an encrypted VM at the time of backup. - EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` - // KekURL - Key Url. - KekURL *string `json:"kekUrl,omitempty"` - // SecretKeyURL - Secret Url. - SecretKeyURL *string `json:"secretKeyUrl,omitempty"` - // KekVaultID - ID of Key Vault where KEK is stored. - KekVaultID *string `json:"kekVaultId,omitempty"` - // SecretKeyVaultID - ID of Key Vault where Secret is stored. - SecretKeyVaultID *string `json:"secretKeyVaultId,omitempty"` -} - -// BasicEngineBase the base backup engine class. All workload specific backup engines derive from this class. -type BasicEngineBase interface { - AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) - AsDpmBackupEngine() (*DpmBackupEngine, bool) - AsEngineBase() (*EngineBase, bool) -} - -// EngineBase the base backup engine class. All workload specific backup engines derive from this class. -type EngineBase struct { - // FriendlyName - Friendly name of the backup engine. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Registration status of the backup engine with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // BackupEngineState - Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} - BackupEngineState *string `json:"backupEngineState,omitempty"` - // HealthStatus - Backup status of the backup engine. - HealthStatus *string `json:"healthStatus,omitempty"` - // CanReRegister - Flag indicating if the backup engine be registered, once already registered. - CanReRegister *bool `json:"canReRegister,omitempty"` - // BackupEngineID - ID of the backup engine. - BackupEngineID *string `json:"backupEngineId,omitempty"` - // DpmVersion - Backup engine version - DpmVersion *string `json:"dpmVersion,omitempty"` - // AzureBackupAgentVersion - Backup agent version - AzureBackupAgentVersion *string `json:"azureBackupAgentVersion,omitempty"` - // IsAzureBackupAgentUpgradeAvailable - To check if backup agent upgrade available - IsAzureBackupAgentUpgradeAvailable *bool `json:"isAzureBackupAgentUpgradeAvailable,omitempty"` - // IsDpmUpgradeAvailable - To check if backup engine upgrade available - IsDpmUpgradeAvailable *bool `json:"isDpmUpgradeAvailable,omitempty"` - // ExtendedInfo - Extended info of the backupengine - ExtendedInfo *EngineExtendedInfo `json:"extendedInfo,omitempty"` - // BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine' - BackupEngineType EngineType `json:"backupEngineType,omitempty"` -} - -func unmarshalBasicEngineBase(body []byte) (BasicEngineBase, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["backupEngineType"] { - case string(BackupEngineTypeAzureBackupServerEngine): - var abse AzureBackupServerEngine - err := json.Unmarshal(body, &abse) - return abse, err - case string(BackupEngineTypeDpmBackupEngine): - var dbe DpmBackupEngine - err := json.Unmarshal(body, &dbe) - return dbe, err - default: - var eb EngineBase - err := json.Unmarshal(body, &eb) - return eb, err - } -} -func unmarshalBasicEngineBaseArray(body []byte) ([]BasicEngineBase, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - ebArray := make([]BasicEngineBase, len(rawMessages)) - - for index, rawMessage := range rawMessages { - eb, err := unmarshalBasicEngineBase(*rawMessage) - if err != nil { - return nil, err - } - ebArray[index] = eb - } - return ebArray, nil -} - -// MarshalJSON is the custom marshaler for EngineBase. -func (eb EngineBase) MarshalJSON() ([]byte, error) { - eb.BackupEngineType = BackupEngineTypeBackupEngineBase - objectMap := make(map[string]interface{}) - if eb.FriendlyName != nil { - objectMap["friendlyName"] = eb.FriendlyName - } - if eb.BackupManagementType != "" { - objectMap["backupManagementType"] = eb.BackupManagementType - } - if eb.RegistrationStatus != nil { - objectMap["registrationStatus"] = eb.RegistrationStatus - } - if eb.BackupEngineState != nil { - objectMap["backupEngineState"] = eb.BackupEngineState - } - if eb.HealthStatus != nil { - objectMap["healthStatus"] = eb.HealthStatus - } - if eb.CanReRegister != nil { - objectMap["canReRegister"] = eb.CanReRegister - } - if eb.BackupEngineID != nil { - objectMap["backupEngineId"] = eb.BackupEngineID - } - if eb.DpmVersion != nil { - objectMap["dpmVersion"] = eb.DpmVersion - } - if eb.AzureBackupAgentVersion != nil { - objectMap["azureBackupAgentVersion"] = eb.AzureBackupAgentVersion - } - if eb.IsAzureBackupAgentUpgradeAvailable != nil { - objectMap["isAzureBackupAgentUpgradeAvailable"] = eb.IsAzureBackupAgentUpgradeAvailable - } - if eb.IsDpmUpgradeAvailable != nil { - objectMap["isDpmUpgradeAvailable"] = eb.IsDpmUpgradeAvailable - } - if eb.ExtendedInfo != nil { - objectMap["extendedInfo"] = eb.ExtendedInfo - } - if eb.BackupEngineType != "" { - objectMap["backupEngineType"] = eb.BackupEngineType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerEngine is the BasicEngineBase implementation for EngineBase. -func (eb EngineBase) AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) { - return nil, false -} - -// AsDpmBackupEngine is the BasicEngineBase implementation for EngineBase. -func (eb EngineBase) AsDpmBackupEngine() (*DpmBackupEngine, bool) { - return nil, false -} - -// AsEngineBase is the BasicEngineBase implementation for EngineBase. -func (eb EngineBase) AsEngineBase() (*EngineBase, bool) { - return &eb, true -} - -// AsBasicEngineBase is the BasicEngineBase implementation for EngineBase. -func (eb EngineBase) AsBasicEngineBase() (BasicEngineBase, bool) { - return &eb, true -} - -// EngineBaseResource the base backup engine class. All workload specific backup engines derive from this -// class. -type EngineBaseResource struct { - autorest.Response `json:"-"` - // Properties - BackupEngineBaseResource properties - Properties BasicEngineBase `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for EngineBaseResource. -func (ebr EngineBaseResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = ebr.Properties - if ebr.Location != nil { - objectMap["location"] = ebr.Location - } - if ebr.Tags != nil { - objectMap["tags"] = ebr.Tags - } - if ebr.ETag != nil { - objectMap["eTag"] = ebr.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for EngineBaseResource struct. -func (ebr *EngineBaseResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicEngineBase(*v) - if err != nil { - return err - } - ebr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ebr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ebr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ebr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ebr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ebr.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - ebr.ETag = &eTag - } - } - } - - return nil -} - -// EngineBaseResourceList list of BackupEngineBase resources -type EngineBaseResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]EngineBaseResource `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"` -} - -// EngineBaseResourceListIterator provides access to a complete listing of EngineBaseResource values. -type EngineBaseResourceListIterator struct { - i int - page EngineBaseResourceListPage -} - -// NextWithContext 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 *EngineBaseResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EngineBaseResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *EngineBaseResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter EngineBaseResourceListIterator) 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 EngineBaseResourceListIterator) Response() EngineBaseResourceList { - 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 EngineBaseResourceListIterator) Value() EngineBaseResource { - if !iter.page.NotDone() { - return EngineBaseResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the EngineBaseResourceListIterator type. -func NewEngineBaseResourceListIterator(page EngineBaseResourceListPage) EngineBaseResourceListIterator { - return EngineBaseResourceListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ebrl EngineBaseResourceList) IsEmpty() bool { - return ebrl.Value == nil || len(*ebrl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ebrl EngineBaseResourceList) hasNextLink() bool { - return ebrl.NextLink != nil && len(*ebrl.NextLink) != 0 -} - -// engineBaseResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ebrl EngineBaseResourceList) engineBaseResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !ebrl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ebrl.NextLink))) -} - -// EngineBaseResourceListPage contains a page of EngineBaseResource values. -type EngineBaseResourceListPage struct { - fn func(context.Context, EngineBaseResourceList) (EngineBaseResourceList, error) - ebrl EngineBaseResourceList -} - -// NextWithContext 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 *EngineBaseResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EngineBaseResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ebrl) - if err != nil { - return err - } - page.ebrl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *EngineBaseResourceListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page EngineBaseResourceListPage) NotDone() bool { - return !page.ebrl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page EngineBaseResourceListPage) Response() EngineBaseResourceList { - return page.ebrl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page EngineBaseResourceListPage) Values() []EngineBaseResource { - if page.ebrl.IsEmpty() { - return nil - } - return *page.ebrl.Value -} - -// Creates a new instance of the EngineBaseResourceListPage type. -func NewEngineBaseResourceListPage(cur EngineBaseResourceList, getNextPage func(context.Context, EngineBaseResourceList) (EngineBaseResourceList, error)) EngineBaseResourceListPage { - return EngineBaseResourceListPage{ - fn: getNextPage, - ebrl: cur, - } -} - -// EngineExtendedInfo additional information on backup engine. -type EngineExtendedInfo struct { - // DatabaseName - Database name of backup engine. - DatabaseName *string `json:"databaseName,omitempty"` - // ProtectedItemsCount - Number of protected items in the backup engine. - ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // ProtectedServersCount - Number of protected servers in the backup engine. - ProtectedServersCount *int32 `json:"protectedServersCount,omitempty"` - // DiskCount - Number of disks in the backup engine. - DiskCount *int32 `json:"diskCount,omitempty"` - // UsedDiskSpace - Disk space used in the backup engine. - UsedDiskSpace *float64 `json:"usedDiskSpace,omitempty"` - // AvailableDiskSpace - Disk space currently available in the backup engine. - AvailableDiskSpace *float64 `json:"availableDiskSpace,omitempty"` - // RefreshedAt - Last refresh time in the backup engine. - RefreshedAt *date.Time `json:"refreshedAt,omitempty"` - // AzureProtectedInstances - Protected instances in the backup engine. - AzureProtectedInstances *int32 `json:"azureProtectedInstances,omitempty"` -} - -// ErrorDetail error Detail class which encapsulates Code, Message and Recommendations. -type ErrorDetail struct { - // Code - READ-ONLY; Error code. - Code *string `json:"code,omitempty"` - // Message - READ-ONLY; Error Message related to the Code. - Message *string `json:"message,omitempty"` - // Recommendations - READ-ONLY; List of recommendation strings. - Recommendations *[]string `json:"recommendations,omitempty"` -} - -// MarshalJSON is the custom marshaler for ErrorDetail. -func (ed ErrorDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ExportJobsOperationResultInfo this class is used to send blob details after exporting jobs. -type ExportJobsOperationResultInfo struct { - // BlobURL - URL of the blob into which the serialized string of list of jobs is exported. - BlobURL *string `json:"blobUrl,omitempty"` - // BlobSasKey - SAS key to access the blob. It expires in 15 mins. - BlobSasKey *string `json:"blobSasKey,omitempty"` - // ExcelFileBlobURL - URL of the blob into which the ExcelFile is uploaded. - ExcelFileBlobURL *string `json:"excelFileBlobUrl,omitempty"` - // ExcelFileBlobSasKey - SAS key to access the blob. It expires in 15 mins. - ExcelFileBlobSasKey *string `json:"excelFileBlobSasKey,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeOperationResultInfoBase', 'ObjectTypeExportJobsOperationResultInfo', 'ObjectTypeOperationResultInfo' - ObjectType ObjectType `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExportJobsOperationResultInfo. -func (ejori ExportJobsOperationResultInfo) MarshalJSON() ([]byte, error) { - ejori.ObjectType = ObjectTypeExportJobsOperationResultInfo - objectMap := make(map[string]interface{}) - if ejori.BlobURL != nil { - objectMap["blobUrl"] = ejori.BlobURL - } - if ejori.BlobSasKey != nil { - objectMap["blobSasKey"] = ejori.BlobSasKey - } - if ejori.ExcelFileBlobURL != nil { - objectMap["excelFileBlobUrl"] = ejori.ExcelFileBlobURL - } - if ejori.ExcelFileBlobSasKey != nil { - objectMap["excelFileBlobSasKey"] = ejori.ExcelFileBlobSasKey - } - if ejori.ObjectType != "" { - objectMap["objectType"] = ejori.ObjectType - } - return json.Marshal(objectMap) -} - -// AsExportJobsOperationResultInfo is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. -func (ejori ExportJobsOperationResultInfo) AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) { - return &ejori, true -} - -// AsOperationResultInfo is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. -func (ejori ExportJobsOperationResultInfo) AsOperationResultInfo() (*OperationResultInfo, bool) { - return nil, false -} - -// AsOperationResultInfoBase is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. -func (ejori ExportJobsOperationResultInfo) AsOperationResultInfoBase() (*OperationResultInfoBase, bool) { - return nil, false -} - -// AsBasicOperationResultInfoBase is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. -func (ejori ExportJobsOperationResultInfo) AsBasicOperationResultInfoBase() (BasicOperationResultInfoBase, bool) { - return &ejori, true -} - -// ExtendedProperties extended Properties for Azure IaasVM Backup. -type ExtendedProperties struct { - // DiskExclusionProperties - Extended Properties for Disk Exclusion. - DiskExclusionProperties *DiskExclusionProperties `json:"diskExclusionProperties,omitempty"` -} - -// BasicFeatureSupportRequest base class for feature request -type BasicFeatureSupportRequest interface { - AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) - AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) - AsFeatureSupportRequest() (*FeatureSupportRequest, bool) -} - -// FeatureSupportRequest base class for feature request -type FeatureSupportRequest struct { - // FeatureType - Possible values include: 'FeatureTypeFeatureSupportRequest', 'FeatureTypeAzureBackupGoals', 'FeatureTypeAzureVMResourceBackup' - FeatureType FeatureType `json:"featureType,omitempty"` -} - -func unmarshalBasicFeatureSupportRequest(body []byte) (BasicFeatureSupportRequest, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["featureType"] { - case string(FeatureTypeAzureBackupGoals): - var abgfsr AzureBackupGoalFeatureSupportRequest - err := json.Unmarshal(body, &abgfsr) - return abgfsr, err - case string(FeatureTypeAzureVMResourceBackup): - var avrfsr AzureVMResourceFeatureSupportRequest - err := json.Unmarshal(body, &avrfsr) - return avrfsr, err - default: - var fsr FeatureSupportRequest - err := json.Unmarshal(body, &fsr) - return fsr, err - } -} -func unmarshalBasicFeatureSupportRequestArray(body []byte) ([]BasicFeatureSupportRequest, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - fsrArray := make([]BasicFeatureSupportRequest, len(rawMessages)) - - for index, rawMessage := range rawMessages { - fsr, err := unmarshalBasicFeatureSupportRequest(*rawMessage) - if err != nil { - return nil, err - } - fsrArray[index] = fsr - } - return fsrArray, nil -} - -// MarshalJSON is the custom marshaler for FeatureSupportRequest. -func (fsr FeatureSupportRequest) MarshalJSON() ([]byte, error) { - fsr.FeatureType = FeatureTypeFeatureSupportRequest - objectMap := make(map[string]interface{}) - if fsr.FeatureType != "" { - objectMap["featureType"] = fsr.FeatureType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupGoalFeatureSupportRequest is the BasicFeatureSupportRequest implementation for FeatureSupportRequest. -func (fsr FeatureSupportRequest) AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) { - return nil, false -} - -// AsAzureVMResourceFeatureSupportRequest is the BasicFeatureSupportRequest implementation for FeatureSupportRequest. -func (fsr FeatureSupportRequest) AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) { - return nil, false -} - -// AsFeatureSupportRequest is the BasicFeatureSupportRequest implementation for FeatureSupportRequest. -func (fsr FeatureSupportRequest) AsFeatureSupportRequest() (*FeatureSupportRequest, bool) { - return &fsr, true -} - -// AsBasicFeatureSupportRequest is the BasicFeatureSupportRequest implementation for FeatureSupportRequest. -func (fsr FeatureSupportRequest) AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) { - return &fsr, true -} - -// GenericContainer base class for generic container of backup items -type GenericContainer struct { - // FabricName - Name of the container's fabric - FabricName *string `json:"fabricName,omitempty"` - // ExtendedInformation - Extended information (not returned in List container API calls) - ExtendedInformation *GenericContainerExtendedInfo `json:"extendedInformation,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for GenericContainer. -func (gc GenericContainer) MarshalJSON() ([]byte, error) { - gc.ContainerType = ContainerTypeGenericContainer1 - objectMap := make(map[string]interface{}) - if gc.FabricName != nil { - objectMap["fabricName"] = gc.FabricName - } - if gc.ExtendedInformation != nil { - objectMap["extendedInformation"] = gc.ExtendedInformation - } - if gc.FriendlyName != nil { - objectMap["friendlyName"] = gc.FriendlyName - } - if gc.BackupManagementType != "" { - objectMap["backupManagementType"] = gc.BackupManagementType - } - if gc.RegistrationStatus != nil { - objectMap["registrationStatus"] = gc.RegistrationStatus - } - if gc.HealthStatus != nil { - objectMap["healthStatus"] = gc.HealthStatus - } - if gc.ContainerType != "" { - objectMap["containerType"] = gc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsGenericContainer() (*GenericContainer, bool) { - return &gc, true -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false -} - -// AsMabContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &gc, true -} - -// GenericContainerExtendedInfo container extended information -type GenericContainerExtendedInfo struct { - // RawCertData - Public key of container cert - RawCertData *string `json:"rawCertData,omitempty"` - // ContainerIdentityInfo - Container identity information - ContainerIdentityInfo *ContainerIdentityInfo `json:"containerIdentityInfo,omitempty"` - // ServiceEndpoints - Azure Backup Service Endpoints for the container - ServiceEndpoints map[string]*string `json:"serviceEndpoints"` -} - -// MarshalJSON is the custom marshaler for GenericContainerExtendedInfo. -func (gcei GenericContainerExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gcei.RawCertData != nil { - objectMap["rawCertData"] = gcei.RawCertData - } - if gcei.ContainerIdentityInfo != nil { - objectMap["containerIdentityInfo"] = gcei.ContainerIdentityInfo - } - if gcei.ServiceEndpoints != nil { - objectMap["serviceEndpoints"] = gcei.ServiceEndpoints - } - return json.Marshal(objectMap) -} - -// GenericProtectedItem base class for backup items. -type GenericProtectedItem struct { - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // PolicyState - Indicates consistency of policy object and policy applied to this backup item. - PolicyState *string `json:"policyState,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // ProtectedItemID - Data Plane Service ID of the protected item. - ProtectedItemID *int64 `json:"protectedItemId,omitempty"` - // SourceAssociations - Loosely coupled (type, value) associations (example - parent of a protected item) - SourceAssociations map[string]*string `json:"sourceAssociations"` - // FabricName - Name of this backup item's fabric. - FabricName *string `json:"fabricName,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for GenericProtectedItem. -func (gpi GenericProtectedItem) MarshalJSON() ([]byte, error) { - gpi.ProtectedItemType = ProtectedItemTypeGenericProtectedItem - objectMap := make(map[string]interface{}) - if gpi.FriendlyName != nil { - objectMap["friendlyName"] = gpi.FriendlyName - } - if gpi.PolicyState != nil { - objectMap["policyState"] = gpi.PolicyState - } - if gpi.ProtectionState != "" { - objectMap["protectionState"] = gpi.ProtectionState - } - if gpi.ProtectedItemID != nil { - objectMap["protectedItemId"] = gpi.ProtectedItemID - } - if gpi.SourceAssociations != nil { - objectMap["sourceAssociations"] = gpi.SourceAssociations - } - if gpi.FabricName != nil { - objectMap["fabricName"] = gpi.FabricName - } - if gpi.BackupManagementType != "" { - objectMap["backupManagementType"] = gpi.BackupManagementType - } - if gpi.WorkloadType != "" { - objectMap["workloadType"] = gpi.WorkloadType - } - if gpi.ContainerName != nil { - objectMap["containerName"] = gpi.ContainerName - } - if gpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = gpi.SourceResourceID - } - if gpi.PolicyID != nil { - objectMap["policyId"] = gpi.PolicyID - } - if gpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = gpi.LastRecoveryPoint - } - if gpi.BackupSetName != nil { - objectMap["backupSetName"] = gpi.BackupSetName - } - if gpi.CreateMode != "" { - objectMap["createMode"] = gpi.CreateMode - } - if gpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = gpi.DeferredDeleteTimeInUTC - } - if gpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = gpi.IsScheduledForDeferredDelete - } - if gpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = gpi.DeferredDeleteTimeRemaining - } - if gpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = gpi.IsDeferredDeleteScheduleUpcoming - } - if gpi.IsRehydrate != nil { - objectMap["isRehydrate"] = gpi.IsRehydrate - } - if gpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = gpi.ProtectedItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return nil, false -} - -// AsDPMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return nil, false -} - -// AsGenericProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return &gpi, true -} - -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return nil, false -} - -// AsProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return nil, false -} - -// AsBasicProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &gpi, true -} - -// GenericProtectionPolicy azure VM (Mercury) workload-specific backup policy. -type GenericProtectionPolicy struct { - // SubProtectionPolicy - List of sub-protection policies which includes schedule and retention - SubProtectionPolicy *[]SubProtectionPolicy `json:"subProtectionPolicy,omitempty"` - // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". - TimeZone *string `json:"timeZone,omitempty"` - // FabricName - Name of this policy's fabric. - FabricName *string `json:"fabricName,omitempty"` - // ProtectedItemsCount - Number of items associated with this policy. - ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' - BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` -} - -// MarshalJSON is the custom marshaler for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) MarshalJSON() ([]byte, error) { - gpp.BackupManagementType = BackupManagementTypeGenericProtectionPolicy - objectMap := make(map[string]interface{}) - if gpp.SubProtectionPolicy != nil { - objectMap["subProtectionPolicy"] = gpp.SubProtectionPolicy - } - if gpp.TimeZone != nil { - objectMap["timeZone"] = gpp.TimeZone - } - if gpp.FabricName != nil { - objectMap["fabricName"] = gpp.FabricName - } - if gpp.ProtectedItemsCount != nil { - objectMap["protectedItemsCount"] = gpp.ProtectedItemsCount - } - if gpp.BackupManagementType != "" { - objectMap["backupManagementType"] = gpp.BackupManagementType - } - return json.Marshal(objectMap) -} - -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { - return nil, false -} - -// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { - return nil, false -} - -// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { - return nil, false -} - -// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { - return &gpp, true -} - -// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { - return nil, false -} - -// AsProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { - return nil, false -} - -// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { - return &gpp, true -} - -// GenericRecoveryPoint generic backup copy. -type GenericRecoveryPoint struct { - // FriendlyName - Friendly name of the backup copy. - FriendlyName *string `json:"friendlyName,omitempty"` - // RecoveryPointType - Type of the backup copy. - RecoveryPointType *string `json:"recoveryPointType,omitempty"` - // RecoveryPointTime - Time at which this backup copy was created. - RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` - // RecoveryPointAdditionalInfo - Additional information associated with this backup copy. - RecoveryPointAdditionalInfo *string `json:"recoveryPointAdditionalInfo,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) MarshalJSON() ([]byte, error) { - grp.ObjectType = ObjectTypeGenericRecoveryPoint - objectMap := make(map[string]interface{}) - if grp.FriendlyName != nil { - objectMap["friendlyName"] = grp.FriendlyName - } - if grp.RecoveryPointType != nil { - objectMap["recoveryPointType"] = grp.RecoveryPointType - } - if grp.RecoveryPointTime != nil { - objectMap["recoveryPointTime"] = grp.RecoveryPointTime - } - if grp.RecoveryPointAdditionalInfo != nil { - objectMap["recoveryPointAdditionalInfo"] = grp.RecoveryPointAdditionalInfo - } - if grp.ObjectType != "" { - objectMap["objectType"] = grp.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { - return &grp, true -} - -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return nil, false -} - -// AsRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return nil, false -} - -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &grp, true -} - -// GetProtectedItemQueryObject filters to list backup items. -type GetProtectedItemQueryObject struct { - // Expand - Specifies if the additional information should be provided for this item. - Expand *string `json:"expand,omitempty"` -} - -// IaasVMBackupRequest iaaS VM workload-specific backup request. -type IaasVMBackupRequest struct { - // RecoveryPointExpiryTimeInUTC - Backup copy will expire after the time specified (UTC). - RecoveryPointExpiryTimeInUTC *date.Time `json:"recoveryPointExpiryTimeInUTC,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' - ObjectType ObjectTypeBasicRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for IaasVMBackupRequest. -func (ivbr IaasVMBackupRequest) MarshalJSON() ([]byte, error) { - ivbr.ObjectType = ObjectTypeIaasVMBackupRequest - objectMap := make(map[string]interface{}) - if ivbr.RecoveryPointExpiryTimeInUTC != nil { - objectMap["recoveryPointExpiryTimeInUTC"] = ivbr.RecoveryPointExpiryTimeInUTC - } - if ivbr.ObjectType != "" { - objectMap["objectType"] = ivbr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareBackupRequest is the BasicRequest implementation for IaasVMBackupRequest. -func (ivbr IaasVMBackupRequest) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { - return nil, false -} - -// AsAzureWorkloadBackupRequest is the BasicRequest implementation for IaasVMBackupRequest. -func (ivbr IaasVMBackupRequest) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { - return nil, false -} - -// AsIaasVMBackupRequest is the BasicRequest implementation for IaasVMBackupRequest. -func (ivbr IaasVMBackupRequest) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { - return &ivbr, true -} - -// AsRequest is the BasicRequest implementation for IaasVMBackupRequest. -func (ivbr IaasVMBackupRequest) AsRequest() (*Request, bool) { - return nil, false -} - -// AsBasicRequest is the BasicRequest implementation for IaasVMBackupRequest. -func (ivbr IaasVMBackupRequest) AsBasicRequest() (BasicRequest, bool) { - return &ivbr, true -} - -// BasicIaaSVMContainer iaaS VM workload-specific container. -type BasicIaaSVMContainer interface { - AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) - AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) - AsIaaSVMContainer() (*IaaSVMContainer, bool) -} - -// IaaSVMContainer iaaS VM workload-specific container. -type IaaSVMContainer struct { - // VirtualMachineID - Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // VirtualMachineVersion - Specifies whether the container represents a Classic or an Azure Resource Manager VM. - VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` - // ResourceGroup - Resource group name of Recovery Services Vault. - ResourceGroup *string `json:"resourceGroup,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -func unmarshalBasicIaaSVMContainer(body []byte) (BasicIaaSVMContainer, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["containerType"] { - case string(ContainerTypeMicrosoftClassicComputevirtualMachines): - var aisccvc AzureIaaSClassicComputeVMContainer - err := json.Unmarshal(body, &aisccvc) - return aisccvc, err - case string(ContainerTypeMicrosoftComputevirtualMachines): - var aiscvc AzureIaaSComputeVMContainer - err := json.Unmarshal(body, &aiscvc) - return aiscvc, err - default: - var isc IaaSVMContainer - err := json.Unmarshal(body, &isc) - return isc, err - } -} -func unmarshalBasicIaaSVMContainerArray(body []byte) ([]BasicIaaSVMContainer, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - iscArray := make([]BasicIaaSVMContainer, len(rawMessages)) - - for index, rawMessage := range rawMessages { - isc, err := unmarshalBasicIaaSVMContainer(*rawMessage) - if err != nil { - return nil, err - } - iscArray[index] = isc - } - return iscArray, nil -} - -// MarshalJSON is the custom marshaler for IaaSVMContainer. -func (isc IaaSVMContainer) MarshalJSON() ([]byte, error) { - isc.ContainerType = ContainerTypeIaaSVMContainer - objectMap := make(map[string]interface{}) - if isc.VirtualMachineID != nil { - objectMap["virtualMachineId"] = isc.VirtualMachineID - } - if isc.VirtualMachineVersion != nil { - objectMap["virtualMachineVersion"] = isc.VirtualMachineVersion - } - if isc.ResourceGroup != nil { - objectMap["resourceGroup"] = isc.ResourceGroup - } - if isc.FriendlyName != nil { - objectMap["friendlyName"] = isc.FriendlyName - } - if isc.BackupManagementType != "" { - objectMap["backupManagementType"] = isc.BackupManagementType - } - if isc.RegistrationStatus != nil { - objectMap["registrationStatus"] = isc.RegistrationStatus - } - if isc.HealthStatus != nil { - objectMap["healthStatus"] = isc.HealthStatus - } - if isc.ContainerType != "" { - objectMap["containerType"] = isc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return &isc, true -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return &isc, true -} - -// AsMabContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &isc, true -} - -// IaasVMILRRegistrationRequest restore files/folders from a backup copy of IaaS VM. -type IaasVMILRRegistrationRequest struct { - // RecoveryPointID - ID of the IaaS VM backup copy from where the files/folders have to be restored. - RecoveryPointID *string `json:"recoveryPointId,omitempty"` - // VirtualMachineID - Fully qualified ARM ID of the virtual machine whose the files / folders have to be restored. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // InitiatorName - iSCSI initiator name. - InitiatorName *string `json:"initiatorName,omitempty"` - // RenewExistingRegistration - Whether to renew existing registration with the iSCSI server. - RenewExistingRegistration *bool `json:"renewExistingRegistration,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeAzureFileShareProvisionILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest' - ObjectType ObjectTypeBasicILRRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for IaasVMILRRegistrationRequest. -func (ivrr IaasVMILRRegistrationRequest) MarshalJSON() ([]byte, error) { - ivrr.ObjectType = ObjectTypeIaasVMILRRegistrationRequest - objectMap := make(map[string]interface{}) - if ivrr.RecoveryPointID != nil { - objectMap["recoveryPointId"] = ivrr.RecoveryPointID - } - if ivrr.VirtualMachineID != nil { - objectMap["virtualMachineId"] = ivrr.VirtualMachineID - } - if ivrr.InitiatorName != nil { - objectMap["initiatorName"] = ivrr.InitiatorName - } - if ivrr.RenewExistingRegistration != nil { - objectMap["renewExistingRegistration"] = ivrr.RenewExistingRegistration - } - if ivrr.ObjectType != "" { - objectMap["objectType"] = ivrr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProvisionILRRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. -func (ivrr IaasVMILRRegistrationRequest) AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) { - return nil, false -} - -// AsIaasVMILRRegistrationRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. -func (ivrr IaasVMILRRegistrationRequest) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) { - return &ivrr, true -} - -// AsILRRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. -func (ivrr IaasVMILRRegistrationRequest) AsILRRequest() (*ILRRequest, bool) { - return nil, false -} - -// AsBasicILRRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. -func (ivrr IaasVMILRRegistrationRequest) AsBasicILRRequest() (BasicILRRequest, bool) { - return &ivrr, true -} - -// BasicIaaSVMProtectableItem iaaS VM workload-specific backup item. -type BasicIaaSVMProtectableItem interface { - AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) - AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) - AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) -} - -// IaaSVMProtectableItem iaaS VM workload-specific backup item. -type IaaSVMProtectableItem struct { - // VirtualMachineID - Fully qualified ARM ID of the virtual machine. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -func unmarshalBasicIaaSVMProtectableItem(body []byte) (BasicIaaSVMProtectableItem, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["protectableItemType"] { - case string(ProtectableItemTypeMicrosoftClassicComputevirtualMachines): - var aisccvpi AzureIaaSClassicComputeVMProtectableItem - err := json.Unmarshal(body, &aisccvpi) - return aisccvpi, err - case string(ProtectableItemTypeMicrosoftComputevirtualMachines): - var aiscvpi AzureIaaSComputeVMProtectableItem - err := json.Unmarshal(body, &aiscvpi) - return aiscvpi, err - default: - var ispi IaaSVMProtectableItem - err := json.Unmarshal(body, &ispi) - return ispi, err - } -} -func unmarshalBasicIaaSVMProtectableItemArray(body []byte) ([]BasicIaaSVMProtectableItem, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - ispiArray := make([]BasicIaaSVMProtectableItem, len(rawMessages)) - - for index, rawMessage := range rawMessages { - ispi, err := unmarshalBasicIaaSVMProtectableItem(*rawMessage) - if err != nil { - return nil, err - } - ispiArray[index] = ispi - } - return ispiArray, nil -} - -// MarshalJSON is the custom marshaler for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) MarshalJSON() ([]byte, error) { - ispi.ProtectableItemType = ProtectableItemTypeIaaSVMProtectableItem - objectMap := make(map[string]interface{}) - if ispi.VirtualMachineID != nil { - objectMap["virtualMachineId"] = ispi.VirtualMachineID - } - if ispi.BackupManagementType != nil { - objectMap["backupManagementType"] = ispi.BackupManagementType - } - if ispi.WorkloadType != nil { - objectMap["workloadType"] = ispi.WorkloadType - } - if ispi.FriendlyName != nil { - objectMap["friendlyName"] = ispi.FriendlyName - } - if ispi.ProtectionState != "" { - objectMap["protectionState"] = ispi.ProtectionState - } - if ispi.ProtectableItemType != "" { - objectMap["protectableItemType"] = ispi.ProtectableItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false -} - -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return &ispi, true -} - -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return &ispi, true -} - -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &ispi, true -} - -// IaasVMRecoveryPoint iaaS VM workload specific backup copy. -type IaasVMRecoveryPoint struct { - // RecoveryPointType - READ-ONLY; Type of the backup copy. - RecoveryPointType *string `json:"recoveryPointType,omitempty"` - // RecoveryPointTime - READ-ONLY; Time at which this backup copy was created. - RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` - // RecoveryPointAdditionalInfo - READ-ONLY; Additional information associated with this backup copy. - RecoveryPointAdditionalInfo *string `json:"recoveryPointAdditionalInfo,omitempty"` - // SourceVMStorageType - READ-ONLY; Storage type of the VM whose backup copy is created. - SourceVMStorageType *string `json:"sourceVMStorageType,omitempty"` - // IsSourceVMEncrypted - READ-ONLY; Identifies whether the VM was encrypted when the backup copy is created. - IsSourceVMEncrypted *bool `json:"isSourceVMEncrypted,omitempty"` - // KeyAndSecret - Required details for recovering an encrypted VM. Applicable only when IsSourceVMEncrypted is true. - KeyAndSecret *KeyAndSecretDetails `json:"keyAndSecret,omitempty"` - // IsInstantIlrSessionActive - Is the session to recover items from this backup copy still active. - IsInstantIlrSessionActive *bool `json:"isInstantIlrSessionActive,omitempty"` - // RecoveryPointTierDetails - Recovery point tier information. - RecoveryPointTierDetails *[]RecoveryPointTierInformation `json:"recoveryPointTierDetails,omitempty"` - // IsManagedVirtualMachine - Whether VM is with Managed Disks - IsManagedVirtualMachine *bool `json:"isManagedVirtualMachine,omitempty"` - // VirtualMachineSize - Virtual Machine Size - VirtualMachineSize *string `json:"virtualMachineSize,omitempty"` - // OriginalStorageAccountOption - Original Storage Account Option - OriginalStorageAccountOption *bool `json:"originalStorageAccountOption,omitempty"` - // OsType - OS type - OsType *string `json:"osType,omitempty"` - // RecoveryPointDiskConfiguration - Disk configuration - RecoveryPointDiskConfiguration *RecoveryPointDiskConfiguration `json:"recoveryPointDiskConfiguration,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) MarshalJSON() ([]byte, error) { - ivrp.ObjectType = ObjectTypeIaasVMRecoveryPoint - objectMap := make(map[string]interface{}) - if ivrp.KeyAndSecret != nil { - objectMap["keyAndSecret"] = ivrp.KeyAndSecret - } - if ivrp.IsInstantIlrSessionActive != nil { - objectMap["isInstantIlrSessionActive"] = ivrp.IsInstantIlrSessionActive - } - if ivrp.RecoveryPointTierDetails != nil { - objectMap["recoveryPointTierDetails"] = ivrp.RecoveryPointTierDetails - } - if ivrp.IsManagedVirtualMachine != nil { - objectMap["isManagedVirtualMachine"] = ivrp.IsManagedVirtualMachine - } - if ivrp.VirtualMachineSize != nil { - objectMap["virtualMachineSize"] = ivrp.VirtualMachineSize - } - if ivrp.OriginalStorageAccountOption != nil { - objectMap["originalStorageAccountOption"] = ivrp.OriginalStorageAccountOption - } - if ivrp.OsType != nil { - objectMap["osType"] = ivrp.OsType - } - if ivrp.RecoveryPointDiskConfiguration != nil { - objectMap["recoveryPointDiskConfiguration"] = ivrp.RecoveryPointDiskConfiguration - } - if ivrp.ObjectType != "" { - objectMap["objectType"] = ivrp.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { - return nil, false -} - -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return &ivrp, true -} - -// AsRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return nil, false -} - -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &ivrp, true -} - -// IaasVMRestoreRequest iaaS VM workload-specific restore. -type IaasVMRestoreRequest struct { - // RecoveryPointID - ID of the backup copy to be recovered. - RecoveryPointID *string `json:"recoveryPointId,omitempty"` - // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM which is being recovered. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // TargetVirtualMachineID - This is the complete ARM Id of the VM that will be created. - // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} - TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` - // TargetResourceGroupID - This is the ARM Id of the resource group that you want to create for this Virtual machine and other artifacts. - // For e.g. /subscriptions/{subId}/resourcegroups/{rg} - TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` - // StorageAccountID - Fully qualified ARM ID of the storage account to which the VM has to be restored. - StorageAccountID *string `json:"storageAccountId,omitempty"` - // VirtualNetworkID - This is the virtual network Id of the vnet that will be attached to the virtual machine. - // User will be validated for join action permissions in the linked access. - VirtualNetworkID *string `json:"virtualNetworkId,omitempty"` - // SubnetID - Subnet ID, is the subnet ID associated with the to be restored VM. For Classic VMs it would be - // {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager VMs it would be ARM resource ID used to represent - // the subnet. - SubnetID *string `json:"subnetId,omitempty"` - // TargetDomainNameID - Fully qualified ARM ID of the domain name to be associated to the VM being restored. This applies only to Classic - // Virtual Machines. - TargetDomainNameID *string `json:"targetDomainNameId,omitempty"` - // Region - Region in which the virtual machine is restored. - Region *string `json:"region,omitempty"` - // AffinityGroup - Affinity group associated to VM to be restored. Used only for Classic Compute Virtual Machines. - AffinityGroup *string `json:"affinityGroup,omitempty"` - // CreateNewCloudService - Should a new cloud service be created while restoring the VM. If this is false, VM will be restored to the same - // cloud service as it was at the time of backup. - CreateNewCloudService *bool `json:"createNewCloudService,omitempty"` - // OriginalStorageAccountOption - Original Storage Account Option - OriginalStorageAccountOption *bool `json:"originalStorageAccountOption,omitempty"` - // EncryptionDetails - Details needed if the VM was encrypted at the time of backup. - EncryptionDetails *EncryptionDetails `json:"encryptionDetails,omitempty"` - // RestoreDiskLunList - List of Disk LUNs for partial restore - RestoreDiskLunList *[]int32 `json:"restoreDiskLunList,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) MarshalJSON() ([]byte, error) { - ivrr.ObjectType = ObjectTypeIaasVMRestoreRequest - objectMap := make(map[string]interface{}) - if ivrr.RecoveryPointID != nil { - objectMap["recoveryPointId"] = ivrr.RecoveryPointID - } - if ivrr.RecoveryType != "" { - objectMap["recoveryType"] = ivrr.RecoveryType - } - if ivrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = ivrr.SourceResourceID - } - if ivrr.TargetVirtualMachineID != nil { - objectMap["targetVirtualMachineId"] = ivrr.TargetVirtualMachineID - } - if ivrr.TargetResourceGroupID != nil { - objectMap["targetResourceGroupId"] = ivrr.TargetResourceGroupID - } - if ivrr.StorageAccountID != nil { - objectMap["storageAccountId"] = ivrr.StorageAccountID - } - if ivrr.VirtualNetworkID != nil { - objectMap["virtualNetworkId"] = ivrr.VirtualNetworkID - } - if ivrr.SubnetID != nil { - objectMap["subnetId"] = ivrr.SubnetID - } - if ivrr.TargetDomainNameID != nil { - objectMap["targetDomainNameId"] = ivrr.TargetDomainNameID - } - if ivrr.Region != nil { - objectMap["region"] = ivrr.Region - } - if ivrr.AffinityGroup != nil { - objectMap["affinityGroup"] = ivrr.AffinityGroup - } - if ivrr.CreateNewCloudService != nil { - objectMap["createNewCloudService"] = ivrr.CreateNewCloudService - } - if ivrr.OriginalStorageAccountOption != nil { - objectMap["originalStorageAccountOption"] = ivrr.OriginalStorageAccountOption - } - if ivrr.EncryptionDetails != nil { - objectMap["encryptionDetails"] = ivrr.EncryptionDetails - } - if ivrr.RestoreDiskLunList != nil { - objectMap["restoreDiskLunList"] = ivrr.RestoreDiskLunList - } - if ivrr.ObjectType != "" { - objectMap["objectType"] = ivrr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { - return &ivrr, true -} - -// AsRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return nil, false -} - -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &ivrr, true -} - -// BasicILRRequest parameters to Provision ILR API. -type BasicILRRequest interface { - AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) - AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) - AsILRRequest() (*ILRRequest, bool) -} - -// ILRRequest parameters to Provision ILR API. -type ILRRequest struct { - // ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeAzureFileShareProvisionILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest' - ObjectType ObjectTypeBasicILRRequest `json:"objectType,omitempty"` -} - -func unmarshalBasicILRRequest(body []byte) (BasicILRRequest, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeAzureFileShareProvisionILRRequest): - var afspir AzureFileShareProvisionILRRequest - err := json.Unmarshal(body, &afspir) - return afspir, err - case string(ObjectTypeIaasVMILRRegistrationRequest): - var ivrr IaasVMILRRegistrationRequest - err := json.Unmarshal(body, &ivrr) - return ivrr, err - default: - var ir ILRRequest - err := json.Unmarshal(body, &ir) - return ir, err - } -} -func unmarshalBasicILRRequestArray(body []byte) ([]BasicILRRequest, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - irArray := make([]BasicILRRequest, len(rawMessages)) - - for index, rawMessage := range rawMessages { - ir, err := unmarshalBasicILRRequest(*rawMessage) - if err != nil { - return nil, err - } - irArray[index] = ir - } - return irArray, nil -} - -// MarshalJSON is the custom marshaler for ILRRequest. -func (ir ILRRequest) MarshalJSON() ([]byte, error) { - ir.ObjectType = ObjectTypeILRRequest - objectMap := make(map[string]interface{}) - if ir.ObjectType != "" { - objectMap["objectType"] = ir.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProvisionILRRequest is the BasicILRRequest implementation for ILRRequest. -func (ir ILRRequest) AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) { - return nil, false -} - -// AsIaasVMILRRegistrationRequest is the BasicILRRequest implementation for ILRRequest. -func (ir ILRRequest) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) { - return nil, false -} - -// AsILRRequest is the BasicILRRequest implementation for ILRRequest. -func (ir ILRRequest) AsILRRequest() (*ILRRequest, bool) { - return &ir, true -} - -// AsBasicILRRequest is the BasicILRRequest implementation for ILRRequest. -func (ir ILRRequest) AsBasicILRRequest() (BasicILRRequest, bool) { - return &ir, true -} - -// ILRRequestResource parameters to Provision ILR API. -type ILRRequestResource struct { - // Properties - ILRRequestResource properties - Properties BasicILRRequest `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ILRRequestResource. -func (irr ILRRequestResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = irr.Properties - if irr.Location != nil { - objectMap["location"] = irr.Location - } - if irr.Tags != nil { - objectMap["tags"] = irr.Tags - } - if irr.ETag != nil { - objectMap["eTag"] = irr.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ILRRequestResource struct. -func (irr *ILRRequestResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicILRRequest(*v) - if err != nil { - return err - } - irr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - irr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - irr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - irr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - irr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - irr.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - irr.ETag = &eTag - } - } - } - - return nil -} - -// InquiryInfo details about inquired protectable items under a given container. -type InquiryInfo struct { - // Status - Inquiry Status for this container such as - // InProgress | Failed | Succeeded - Status *string `json:"status,omitempty"` - // ErrorDetail - Error Details if the Status is non-success. - ErrorDetail *ErrorDetail `json:"errorDetail,omitempty"` - // InquiryDetails - Inquiry Details which will have workload specific details. - // For e.g. - For SQL and oracle this will contain different details. - InquiryDetails *[]WorkloadInquiryDetails `json:"inquiryDetails,omitempty"` -} - -// InquiryValidation validation for inquired protectable items under a given container. -type InquiryValidation struct { - // Status - Status for the Inquiry Validation. - Status *string `json:"status,omitempty"` - // ErrorDetail - Error Detail in case the status is non-success. - ErrorDetail *ErrorDetail `json:"errorDetail,omitempty"` - // AdditionalDetail - READ-ONLY; Error Additional Detail in case the status is non-success. - AdditionalDetail *string `json:"additionalDetail,omitempty"` -} - -// MarshalJSON is the custom marshaler for InquiryValidation. -func (iv InquiryValidation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if iv.Status != nil { - objectMap["status"] = iv.Status - } - if iv.ErrorDetail != nil { - objectMap["errorDetail"] = iv.ErrorDetail - } - return json.Marshal(objectMap) -} - -// InstantItemRecoveryTarget target details for file / folder restore. -type InstantItemRecoveryTarget struct { - // ClientScripts - List of client scripts. - ClientScripts *[]ClientScriptForConnect `json:"clientScripts,omitempty"` -} - -// InstantRPAdditionalDetails ... -type InstantRPAdditionalDetails struct { - AzureBackupRGNamePrefix *string `json:"azureBackupRGNamePrefix,omitempty"` - AzureBackupRGNameSuffix *string `json:"azureBackupRGNameSuffix,omitempty"` -} - -// BasicJob defines workload agnostic properties for a job. -type BasicJob interface { - AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) - AsAzureStorageJob() (*AzureStorageJob, bool) - AsAzureWorkloadJob() (*AzureWorkloadJob, bool) - AsDpmJob() (*DpmJob, bool) - AsMabJob() (*MabJob, bool) - AsJob() (*Job, bool) -} - -// Job defines workload agnostic properties for a job. -type Job struct { - // EntityFriendlyName - Friendly name of the entity on which the current job is executing. - EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` - // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // Operation - The operation name. - Operation *string `json:"operation,omitempty"` - // Status - Job status. - Status *string `json:"status,omitempty"` - // StartTime - The start time. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time. - EndTime *date.Time `json:"endTime,omitempty"` - // ActivityID - ActivityId of job. - ActivityID *string `json:"activityId,omitempty"` - // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' - JobType JobType `json:"jobType,omitempty"` -} - -func unmarshalBasicJob(body []byte) (BasicJob, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["jobType"] { - case string(JobTypeAzureIaaSVMJob): - var aisj AzureIaaSVMJob - err := json.Unmarshal(body, &aisj) - return aisj, err - case string(JobTypeAzureStorageJob): - var asj AzureStorageJob - err := json.Unmarshal(body, &asj) - return asj, err - case string(JobTypeAzureWorkloadJob): - var awj AzureWorkloadJob - err := json.Unmarshal(body, &awj) - return awj, err - case string(JobTypeDpmJob): - var dj DpmJob - err := json.Unmarshal(body, &dj) - return dj, err - case string(JobTypeMabJob): - var mj MabJob - err := json.Unmarshal(body, &mj) - return mj, err - default: - var j Job - err := json.Unmarshal(body, &j) - return j, err - } -} -func unmarshalBasicJobArray(body []byte) ([]BasicJob, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - jArray := make([]BasicJob, len(rawMessages)) - - for index, rawMessage := range rawMessages { - j, err := unmarshalBasicJob(*rawMessage) - if err != nil { - return nil, err - } - jArray[index] = j - } - return jArray, nil -} - -// MarshalJSON is the custom marshaler for Job. -func (j Job) MarshalJSON() ([]byte, error) { - j.JobType = JobTypeJob - objectMap := make(map[string]interface{}) - if j.EntityFriendlyName != nil { - objectMap["entityFriendlyName"] = j.EntityFriendlyName - } - if j.BackupManagementType != "" { - objectMap["backupManagementType"] = j.BackupManagementType - } - if j.Operation != nil { - objectMap["operation"] = j.Operation - } - if j.Status != nil { - objectMap["status"] = j.Status - } - if j.StartTime != nil { - objectMap["startTime"] = j.StartTime - } - if j.EndTime != nil { - objectMap["endTime"] = j.EndTime - } - if j.ActivityID != nil { - objectMap["activityId"] = j.ActivityID - } - if j.JobType != "" { - objectMap["jobType"] = j.JobType - } - return json.Marshal(objectMap) -} - -// AsAzureIaaSVMJob is the BasicJob implementation for Job. -func (j Job) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { - return nil, false -} - -// AsAzureStorageJob is the BasicJob implementation for Job. -func (j Job) AsAzureStorageJob() (*AzureStorageJob, bool) { - return nil, false -} - -// AsAzureWorkloadJob is the BasicJob implementation for Job. -func (j Job) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { - return nil, false -} - -// AsDpmJob is the BasicJob implementation for Job. -func (j Job) AsDpmJob() (*DpmJob, bool) { - return nil, false -} - -// AsMabJob is the BasicJob implementation for Job. -func (j Job) AsMabJob() (*MabJob, bool) { - return nil, false -} - -// AsJob is the BasicJob implementation for Job. -func (j Job) AsJob() (*Job, bool) { - return &j, true -} - -// AsBasicJob is the BasicJob implementation for Job. -func (j Job) AsBasicJob() (BasicJob, bool) { - return &j, true -} - -// JobQueryObject filters to list the jobs. -type JobQueryObject struct { - // Status - Status of the job. Possible values include: 'JobStatusInvalid', 'JobStatusInProgress', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusCompletedWithWarnings', 'JobStatusCancelled', 'JobStatusCancelling' - Status JobStatus `json:"status,omitempty"` - // BackupManagementType - Type of backup management for the job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // Operation - Type of operation. Possible values include: 'JobOperationTypeInvalid', 'JobOperationTypeRegister', 'JobOperationTypeUnRegister', 'JobOperationTypeConfigureBackup', 'JobOperationTypeBackup', 'JobOperationTypeRestore', 'JobOperationTypeDisableBackup', 'JobOperationTypeDeleteBackupData', 'JobOperationTypeCrossRegionRestore', 'JobOperationTypeUndelete' - Operation JobOperationType `json:"operation,omitempty"` - // JobID - JobID represents the job uniquely. - JobID *string `json:"jobId,omitempty"` - // StartTime - Job has started at this time. Value is in UTC. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - Job has ended at this time. Value is in UTC. - EndTime *date.Time `json:"endTime,omitempty"` -} - -// JobResource defines workload agnostic properties for a job. -type JobResource struct { - autorest.Response `json:"-"` - // Properties - JobResource properties - Properties BasicJob `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for JobResource. -func (jr JobResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = jr.Properties - if jr.Location != nil { - objectMap["location"] = jr.Location - } - if jr.Tags != nil { - objectMap["tags"] = jr.Tags - } - if jr.ETag != nil { - objectMap["eTag"] = jr.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for JobResource struct. -func (jr *JobResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicJob(*v) - if err != nil { - return err - } - jr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - jr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - jr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - jr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - jr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - jr.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - jr.ETag = &eTag - } - } - } - - return nil -} - -// JobResourceList list of Job resources -type JobResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]JobResource `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"` -} - -// JobResourceListIterator provides access to a complete listing of JobResource values. -type JobResourceListIterator struct { - i int - page JobResourceListPage -} - -// NextWithContext 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 *JobResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *JobResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter JobResourceListIterator) 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 JobResourceListIterator) Response() JobResourceList { - 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 JobResourceListIterator) Value() JobResource { - if !iter.page.NotDone() { - return JobResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the JobResourceListIterator type. -func NewJobResourceListIterator(page JobResourceListPage) JobResourceListIterator { - return JobResourceListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (jrl JobResourceList) IsEmpty() bool { - return jrl.Value == nil || len(*jrl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (jrl JobResourceList) hasNextLink() bool { - return jrl.NextLink != nil && len(*jrl.NextLink) != 0 -} - -// jobResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (jrl JobResourceList) jobResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !jrl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(jrl.NextLink))) -} - -// JobResourceListPage contains a page of JobResource values. -type JobResourceListPage struct { - fn func(context.Context, JobResourceList) (JobResourceList, error) - jrl JobResourceList -} - -// NextWithContext 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 *JobResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.jrl) - if err != nil { - return err - } - page.jrl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *JobResourceListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page JobResourceListPage) NotDone() bool { - return !page.jrl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page JobResourceListPage) Response() JobResourceList { - return page.jrl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page JobResourceListPage) Values() []JobResource { - if page.jrl.IsEmpty() { - return nil - } - return *page.jrl.Value -} - -// Creates a new instance of the JobResourceListPage type. -func NewJobResourceListPage(cur JobResourceList, getNextPage func(context.Context, JobResourceList) (JobResourceList, error)) JobResourceListPage { - return JobResourceListPage{ - fn: getNextPage, - jrl: cur, - } -} - -// KEKDetails KEK is encryption key for BEK. -type KEKDetails struct { - // KeyURL - Key is KEK. - KeyURL *string `json:"keyUrl,omitempty"` - // KeyVaultID - Key Vault ID where this Key is stored. - KeyVaultID *string `json:"keyVaultId,omitempty"` - // KeyBackupData - KEK data. - KeyBackupData *string `json:"keyBackupData,omitempty"` -} - -// KeyAndSecretDetails BEK is bitlocker key. -// KEK is encryption key for BEK -// If the VM was encrypted then we will store following details : -// 1. Secret(BEK) - Url + Backup Data + vaultId. -// 2. Key(KEK) - Url + Backup Data + vaultId. -// 3. EncryptionMechanism -// BEK and KEK can potentially have different vault ids. -type KeyAndSecretDetails struct { - // KekDetails - KEK is encryption key for BEK. - KekDetails *KEKDetails `json:"kekDetails,omitempty"` - // BekDetails - BEK is bitlocker encryption key. - BekDetails *BEKDetails `json:"bekDetails,omitempty"` - // EncryptionMechanism - Encryption mechanism: None/ SinglePass/ DoublePass - EncryptionMechanism *string `json:"encryptionMechanism,omitempty"` -} - -// LogSchedulePolicy log policy schedule. -type LogSchedulePolicy struct { - // ScheduleFrequencyInMins - Frequency of the log schedule operation of this policy in minutes. - ScheduleFrequencyInMins *int32 `json:"scheduleFrequencyInMins,omitempty"` - // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' - SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` -} - -// MarshalJSON is the custom marshaler for LogSchedulePolicy. -func (lsp LogSchedulePolicy) MarshalJSON() ([]byte, error) { - lsp.SchedulePolicyType = SchedulePolicyTypeLogSchedulePolicy - objectMap := make(map[string]interface{}) - if lsp.ScheduleFrequencyInMins != nil { - objectMap["scheduleFrequencyInMins"] = lsp.ScheduleFrequencyInMins - } - if lsp.SchedulePolicyType != "" { - objectMap["schedulePolicyType"] = lsp.SchedulePolicyType - } - return json.Marshal(objectMap) -} - -// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. -func (lsp LogSchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { - return &lsp, true -} - -// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. -func (lsp LogSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { - return nil, false -} - -// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. -func (lsp LogSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { - return nil, false -} - -// AsSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. -func (lsp LogSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { - return nil, false -} - -// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. -func (lsp LogSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { - return &lsp, true -} - -// LongTermRetentionPolicy long term retention policy. -type LongTermRetentionPolicy struct { - // DailySchedule - Daily retention schedule of the protection policy. - DailySchedule *DailyRetentionSchedule `json:"dailySchedule,omitempty"` - // WeeklySchedule - Weekly retention schedule of the protection policy. - WeeklySchedule *WeeklyRetentionSchedule `json:"weeklySchedule,omitempty"` - // MonthlySchedule - Monthly retention schedule of the protection policy. - MonthlySchedule *MonthlyRetentionSchedule `json:"monthlySchedule,omitempty"` - // YearlySchedule - Yearly retention schedule of the protection policy. - YearlySchedule *YearlyRetentionSchedule `json:"yearlySchedule,omitempty"` - // RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy' - RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"` -} - -// MarshalJSON is the custom marshaler for LongTermRetentionPolicy. -func (ltrp LongTermRetentionPolicy) MarshalJSON() ([]byte, error) { - ltrp.RetentionPolicyType = RetentionPolicyTypeLongTermRetentionPolicy - objectMap := make(map[string]interface{}) - if ltrp.DailySchedule != nil { - objectMap["dailySchedule"] = ltrp.DailySchedule - } - if ltrp.WeeklySchedule != nil { - objectMap["weeklySchedule"] = ltrp.WeeklySchedule - } - if ltrp.MonthlySchedule != nil { - objectMap["monthlySchedule"] = ltrp.MonthlySchedule - } - if ltrp.YearlySchedule != nil { - objectMap["yearlySchedule"] = ltrp.YearlySchedule - } - if ltrp.RetentionPolicyType != "" { - objectMap["retentionPolicyType"] = ltrp.RetentionPolicyType - } - return json.Marshal(objectMap) -} - -// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. -func (ltrp LongTermRetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) { - return <rp, true -} - -// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. -func (ltrp LongTermRetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) { - return nil, false -} - -// AsRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. -func (ltrp LongTermRetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) { - return nil, false -} - -// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. -func (ltrp LongTermRetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) { - return <rp, true -} - -// LongTermSchedulePolicy long term policy schedule. -type LongTermSchedulePolicy struct { - // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' - SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` -} - -// MarshalJSON is the custom marshaler for LongTermSchedulePolicy. -func (ltsp LongTermSchedulePolicy) MarshalJSON() ([]byte, error) { - ltsp.SchedulePolicyType = SchedulePolicyTypeLongTermSchedulePolicy - objectMap := make(map[string]interface{}) - if ltsp.SchedulePolicyType != "" { - objectMap["schedulePolicyType"] = ltsp.SchedulePolicyType - } - return json.Marshal(objectMap) -} - -// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. -func (ltsp LongTermSchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { - return nil, false -} - -// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. -func (ltsp LongTermSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { - return <sp, true -} - -// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. -func (ltsp LongTermSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { - return nil, false -} - -// AsSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. -func (ltsp LongTermSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { - return nil, false -} - -// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. -func (ltsp LongTermSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { - return <sp, true -} - -// MabContainer container with items backed up using MAB backup engine. -type MabContainer struct { - // CanReRegister - Can the container be registered one more time. - CanReRegister *bool `json:"canReRegister,omitempty"` - // ContainerID - ContainerID represents the container. - ContainerID *int64 `json:"containerId,omitempty"` - // ProtectedItemCount - Number of items backed up in this container. - ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` - // AgentVersion - Agent version of this container. - AgentVersion *string `json:"agentVersion,omitempty"` - // ExtendedInfo - Additional information for this container - ExtendedInfo *MabContainerExtendedInfo `json:"extendedInfo,omitempty"` - // MabContainerHealthDetails - Health details on this mab container. - MabContainerHealthDetails *[]MABContainerHealthDetails `json:"mabContainerHealthDetails,omitempty"` - // ContainerHealthState - Health state of mab container. - ContainerHealthState *string `json:"containerHealthState,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for MabContainer. -func (mc MabContainer) MarshalJSON() ([]byte, error) { - mc.ContainerType = ContainerTypeWindows1 - objectMap := make(map[string]interface{}) - if mc.CanReRegister != nil { - objectMap["canReRegister"] = mc.CanReRegister - } - if mc.ContainerID != nil { - objectMap["containerId"] = mc.ContainerID - } - if mc.ProtectedItemCount != nil { - objectMap["protectedItemCount"] = mc.ProtectedItemCount - } - if mc.AgentVersion != nil { - objectMap["agentVersion"] = mc.AgentVersion - } - if mc.ExtendedInfo != nil { - objectMap["extendedInfo"] = mc.ExtendedInfo - } - if mc.MabContainerHealthDetails != nil { - objectMap["mabContainerHealthDetails"] = mc.MabContainerHealthDetails - } - if mc.ContainerHealthState != nil { - objectMap["containerHealthState"] = mc.ContainerHealthState - } - if mc.FriendlyName != nil { - objectMap["friendlyName"] = mc.FriendlyName - } - if mc.BackupManagementType != "" { - objectMap["backupManagementType"] = mc.BackupManagementType - } - if mc.RegistrationStatus != nil { - objectMap["registrationStatus"] = mc.RegistrationStatus - } - if mc.HealthStatus != nil { - objectMap["healthStatus"] = mc.HealthStatus - } - if mc.ContainerType != "" { - objectMap["containerType"] = mc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false -} - -// AsMabContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsMabContainer() (*MabContainer, bool) { - return &mc, true -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &mc, true -} - -// MabContainerExtendedInfo additional information of the container. -type MabContainerExtendedInfo struct { - // LastRefreshedAt - Time stamp when this container was refreshed. - LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` - // BackupItemType - Type of backup items associated with this container. Possible values include: 'ItemTypeInvalid', 'ItemTypeVM', 'ItemTypeFileFolder', 'ItemTypeAzureSQLDb', 'ItemTypeSQLDB', 'ItemTypeExchange', 'ItemTypeSharepoint', 'ItemTypeVMwareVM', 'ItemTypeSystemState', 'ItemTypeClient', 'ItemTypeGenericDataSource', 'ItemTypeSQLDataBase', 'ItemTypeAzureFileShare', 'ItemTypeSAPHanaDatabase', 'ItemTypeSAPAseDatabase' - BackupItemType ItemType `json:"backupItemType,omitempty"` - // BackupItems - List of backup items associated with this container. - BackupItems *[]string `json:"backupItems,omitempty"` - // PolicyName - Backup policy associated with this container. - PolicyName *string `json:"policyName,omitempty"` - // LastBackupStatus - Latest backup status of this container. - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` -} - -// MABContainerHealthDetails MAB workload-specific Health Details. -type MABContainerHealthDetails struct { - // Code - Health Code - Code *int32 `json:"code,omitempty"` - // Title - Health Title - Title *string `json:"title,omitempty"` - // Message - Health Message - Message *string `json:"message,omitempty"` - // Recommendations - Health Recommended Actions - Recommendations *[]string `json:"recommendations,omitempty"` -} - -// MabErrorInfo MAB workload-specific error information. -type MabErrorInfo struct { - // ErrorString - READ-ONLY; Localized error string. - ErrorString *string `json:"errorString,omitempty"` - // Recommendations - READ-ONLY; List of localized recommendations. - Recommendations *[]string `json:"recommendations,omitempty"` -} - -// MarshalJSON is the custom marshaler for MabErrorInfo. -func (mei MabErrorInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// MabFileFolderProtectedItem MAB workload-specific backup item. -type MabFileFolderProtectedItem struct { - // FriendlyName - Friendly name of this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ComputerName - Name of the computer associated with this backup item. - ComputerName *string `json:"computerName,omitempty"` - // LastBackupStatus - Status of last backup operation. - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // ProtectionState - Protected, ProtectionStopped, IRPending or ProtectionError - ProtectionState *string `json:"protectionState,omitempty"` - // DeferredDeleteSyncTimeInUTC - Sync time for deferred deletion in UTC - DeferredDeleteSyncTimeInUTC *int64 `json:"deferredDeleteSyncTimeInUTC,omitempty"` - // ExtendedInfo - Additional information with this backup item. - ExtendedInfo *MabFileFolderProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) MarshalJSON() ([]byte, error) { - mffpi.ProtectedItemType = ProtectedItemTypeMabFileFolderProtectedItem - objectMap := make(map[string]interface{}) - if mffpi.FriendlyName != nil { - objectMap["friendlyName"] = mffpi.FriendlyName - } - if mffpi.ComputerName != nil { - objectMap["computerName"] = mffpi.ComputerName - } - if mffpi.LastBackupStatus != nil { - objectMap["lastBackupStatus"] = mffpi.LastBackupStatus - } - if mffpi.LastBackupTime != nil { - objectMap["lastBackupTime"] = mffpi.LastBackupTime - } - if mffpi.ProtectionState != nil { - objectMap["protectionState"] = mffpi.ProtectionState - } - if mffpi.DeferredDeleteSyncTimeInUTC != nil { - objectMap["deferredDeleteSyncTimeInUTC"] = mffpi.DeferredDeleteSyncTimeInUTC - } - if mffpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = mffpi.ExtendedInfo - } - if mffpi.BackupManagementType != "" { - objectMap["backupManagementType"] = mffpi.BackupManagementType - } - if mffpi.WorkloadType != "" { - objectMap["workloadType"] = mffpi.WorkloadType - } - if mffpi.ContainerName != nil { - objectMap["containerName"] = mffpi.ContainerName - } - if mffpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = mffpi.SourceResourceID - } - if mffpi.PolicyID != nil { - objectMap["policyId"] = mffpi.PolicyID - } - if mffpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = mffpi.LastRecoveryPoint - } - if mffpi.BackupSetName != nil { - objectMap["backupSetName"] = mffpi.BackupSetName - } - if mffpi.CreateMode != "" { - objectMap["createMode"] = mffpi.CreateMode - } - if mffpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = mffpi.DeferredDeleteTimeInUTC - } - if mffpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = mffpi.IsScheduledForDeferredDelete - } - if mffpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = mffpi.DeferredDeleteTimeRemaining - } - if mffpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = mffpi.IsDeferredDeleteScheduleUpcoming - } - if mffpi.IsRehydrate != nil { - objectMap["isRehydrate"] = mffpi.IsRehydrate - } - if mffpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = mffpi.ProtectedItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return nil, false -} - -// AsDPMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return nil, false -} - -// AsGenericProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return nil, false -} - -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return &mffpi, true -} - -// AsProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return nil, false -} - -// AsBasicProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &mffpi, true -} - -// MabFileFolderProtectedItemExtendedInfo additional information on the backed up item. -type MabFileFolderProtectedItemExtendedInfo struct { - // LastRefreshedAt - Last time when the agent data synced to service. - LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` - // OldestRecoveryPoint - The oldest backup copy available. - OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` - // RecoveryPointCount - Number of backup copies associated with the backup item. - RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` -} - -// MabJob MAB workload-specific job. -type MabJob struct { - // Duration - Time taken by job to run. - Duration *string `json:"duration,omitempty"` - // ActionsInfo - The state/actions applicable on jobs like cancel/retry. - ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` - // MabServerName - Name of server protecting the DS. - MabServerName *string `json:"mabServerName,omitempty"` - // MabServerType - Server type of MAB container. Possible values include: 'MabServerTypeInvalid', 'MabServerTypeUnknown', 'MabServerTypeIaasVMContainer', 'MabServerTypeIaasVMServiceContainer', 'MabServerTypeDPMContainer', 'MabServerTypeAzureBackupServerContainer', 'MabServerTypeMABContainer', 'MabServerTypeCluster', 'MabServerTypeAzureSQLContainer', 'MabServerTypeWindows', 'MabServerTypeVCenter', 'MabServerTypeVMAppContainer', 'MabServerTypeSQLAGWorkLoadContainer', 'MabServerTypeStorageContainer', 'MabServerTypeGenericContainer' - MabServerType MabServerType `json:"mabServerType,omitempty"` - // WorkloadType - Workload type of backup item. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` - // ErrorDetails - The errors. - ErrorDetails *[]MabErrorInfo `json:"errorDetails,omitempty"` - // ExtendedInfo - Additional information on the job. - ExtendedInfo *MabJobExtendedInfo `json:"extendedInfo,omitempty"` - // EntityFriendlyName - Friendly name of the entity on which the current job is executing. - EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` - // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // Operation - The operation name. - Operation *string `json:"operation,omitempty"` - // Status - Job status. - Status *string `json:"status,omitempty"` - // StartTime - The start time. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time. - EndTime *date.Time `json:"endTime,omitempty"` - // ActivityID - ActivityId of job. - ActivityID *string `json:"activityId,omitempty"` - // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' - JobType JobType `json:"jobType,omitempty"` -} - -// MarshalJSON is the custom marshaler for MabJob. -func (mj MabJob) MarshalJSON() ([]byte, error) { - mj.JobType = JobTypeMabJob - objectMap := make(map[string]interface{}) - if mj.Duration != nil { - objectMap["duration"] = mj.Duration - } - if mj.ActionsInfo != nil { - objectMap["actionsInfo"] = mj.ActionsInfo - } - if mj.MabServerName != nil { - objectMap["mabServerName"] = mj.MabServerName - } - if mj.MabServerType != "" { - objectMap["mabServerType"] = mj.MabServerType - } - if mj.WorkloadType != "" { - objectMap["workloadType"] = mj.WorkloadType - } - if mj.ErrorDetails != nil { - objectMap["errorDetails"] = mj.ErrorDetails - } - if mj.ExtendedInfo != nil { - objectMap["extendedInfo"] = mj.ExtendedInfo - } - if mj.EntityFriendlyName != nil { - objectMap["entityFriendlyName"] = mj.EntityFriendlyName - } - if mj.BackupManagementType != "" { - objectMap["backupManagementType"] = mj.BackupManagementType - } - if mj.Operation != nil { - objectMap["operation"] = mj.Operation - } - if mj.Status != nil { - objectMap["status"] = mj.Status - } - if mj.StartTime != nil { - objectMap["startTime"] = mj.StartTime - } - if mj.EndTime != nil { - objectMap["endTime"] = mj.EndTime - } - if mj.ActivityID != nil { - objectMap["activityId"] = mj.ActivityID - } - if mj.JobType != "" { - objectMap["jobType"] = mj.JobType - } - return json.Marshal(objectMap) -} - -// AsAzureIaaSVMJob is the BasicJob implementation for MabJob. -func (mj MabJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { - return nil, false -} - -// AsAzureStorageJob is the BasicJob implementation for MabJob. -func (mj MabJob) AsAzureStorageJob() (*AzureStorageJob, bool) { - return nil, false -} - -// AsAzureWorkloadJob is the BasicJob implementation for MabJob. -func (mj MabJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { - return nil, false -} - -// AsDpmJob is the BasicJob implementation for MabJob. -func (mj MabJob) AsDpmJob() (*DpmJob, bool) { - return nil, false -} - -// AsMabJob is the BasicJob implementation for MabJob. -func (mj MabJob) AsMabJob() (*MabJob, bool) { - return &mj, true -} - -// AsJob is the BasicJob implementation for MabJob. -func (mj MabJob) AsJob() (*Job, bool) { - return nil, false -} - -// AsBasicJob is the BasicJob implementation for MabJob. -func (mj MabJob) AsBasicJob() (BasicJob, bool) { - return &mj, true -} - -// MabJobExtendedInfo additional information for the MAB workload-specific job. -type MabJobExtendedInfo struct { - // TasksList - List of tasks for this job. - TasksList *[]MabJobTaskDetails `json:"tasksList,omitempty"` - // PropertyBag - The job properties. - PropertyBag map[string]*string `json:"propertyBag"` - // DynamicErrorMessage - Non localized error message specific to this job. - DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` -} - -// MarshalJSON is the custom marshaler for MabJobExtendedInfo. -func (mjei MabJobExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mjei.TasksList != nil { - objectMap["tasksList"] = mjei.TasksList - } - if mjei.PropertyBag != nil { - objectMap["propertyBag"] = mjei.PropertyBag - } - if mjei.DynamicErrorMessage != nil { - objectMap["dynamicErrorMessage"] = mjei.DynamicErrorMessage - } - return json.Marshal(objectMap) -} - -// MabJobTaskDetails MAB workload-specific job task details. -type MabJobTaskDetails struct { - // TaskID - The task display name. - TaskID *string `json:"taskId,omitempty"` - // StartTime - The start time. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time. - EndTime *date.Time `json:"endTime,omitempty"` - // Duration - Time elapsed for task. - Duration *string `json:"duration,omitempty"` - // Status - The status. - Status *string `json:"status,omitempty"` -} - -// MabProtectionPolicy mab container-specific backup policy. -type MabProtectionPolicy struct { - // SchedulePolicy - Backup schedule of backup policy. - SchedulePolicy BasicSchedulePolicy `json:"schedulePolicy,omitempty"` - // RetentionPolicy - Retention policy details. - RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` - // ProtectedItemsCount - Number of items associated with this policy. - ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' - BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` -} - -// MarshalJSON is the custom marshaler for MabProtectionPolicy. -func (mpp MabProtectionPolicy) MarshalJSON() ([]byte, error) { - mpp.BackupManagementType = BackupManagementTypeMAB - objectMap := make(map[string]interface{}) - objectMap["schedulePolicy"] = mpp.SchedulePolicy - objectMap["retentionPolicy"] = mpp.RetentionPolicy - if mpp.ProtectedItemsCount != nil { - objectMap["protectedItemsCount"] = mpp.ProtectedItemsCount - } - if mpp.BackupManagementType != "" { - objectMap["backupManagementType"] = mpp.BackupManagementType - } - return json.Marshal(objectMap) -} - -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { - return nil, false -} - -// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { - return nil, false -} - -// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { - return nil, false -} - -// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { - return nil, false -} - -// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { - return &mpp, true -} - -// AsProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { - return nil, false -} - -// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { - return &mpp, true -} - -// UnmarshalJSON is the custom unmarshaler for MabProtectionPolicy struct. -func (mpp *MabProtectionPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "schedulePolicy": - if v != nil { - schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) - if err != nil { - return err - } - mpp.SchedulePolicy = schedulePolicy - } - case "retentionPolicy": - if v != nil { - retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) - if err != nil { - return err - } - mpp.RetentionPolicy = retentionPolicy - } - case "protectedItemsCount": - if v != nil { - var protectedItemsCount int32 - err = json.Unmarshal(*v, &protectedItemsCount) - if err != nil { - return err - } - mpp.ProtectedItemsCount = &protectedItemsCount - } - case "backupManagementType": - if v != nil { - var backupManagementType ManagementTypeBasicProtectionPolicy - err = json.Unmarshal(*v, &backupManagementType) - if err != nil { - return err - } - mpp.BackupManagementType = backupManagementType - } - } - } - - return nil -} - -// ManagementUsage backup management usages of a vault. -type ManagementUsage struct { - // Unit - Unit of the usage. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond' - Unit UsagesUnit `json:"unit,omitempty"` - // QuotaPeriod - Quota period of usage. - QuotaPeriod *string `json:"quotaPeriod,omitempty"` - // NextResetTime - Next reset time of usage. - NextResetTime *date.Time `json:"nextResetTime,omitempty"` - // CurrentValue - Current value of usage. - CurrentValue *int64 `json:"currentValue,omitempty"` - // Limit - Limit of usage. - Limit *int64 `json:"limit,omitempty"` - // Name - Name of usage. - Name *NameInfo `json:"name,omitempty"` -} - -// ManagementUsageList backup management usage for vault. -type ManagementUsageList struct { - autorest.Response `json:"-"` - // Value - The list of backup management usages for the given vault. - Value *[]ManagementUsage `json:"value,omitempty"` -} - -// MonthlyRetentionSchedule monthly retention schedule. -type MonthlyRetentionSchedule struct { - // RetentionScheduleFormatType - Retention schedule format type for monthly retention policy. Possible values include: 'RetentionScheduleFormatInvalid', 'RetentionScheduleFormatDaily', 'RetentionScheduleFormatWeekly' - RetentionScheduleFormatType RetentionScheduleFormat `json:"retentionScheduleFormatType,omitempty"` - // RetentionScheduleDaily - Daily retention format for monthly retention policy. - RetentionScheduleDaily *DailyRetentionFormat `json:"retentionScheduleDaily,omitempty"` - // RetentionScheduleWeekly - Weekly retention format for monthly retention policy. - RetentionScheduleWeekly *WeeklyRetentionFormat `json:"retentionScheduleWeekly,omitempty"` - // RetentionTimes - Retention times of retention policy. - RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` - // RetentionDuration - Retention duration of retention Policy. - RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` -} - -// NameInfo the name of usage. -type NameInfo struct { - // Value - Value of usage. - Value *string `json:"value,omitempty"` - // LocalizedValue - Localized value of usage. - LocalizedValue *string `json:"localizedValue,omitempty"` -} - -// OperationResultInfo operation result info. -type OperationResultInfo struct { - // JobList - List of jobs created by this operation. - JobList *[]string `json:"jobList,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeOperationResultInfoBase', 'ObjectTypeExportJobsOperationResultInfo', 'ObjectTypeOperationResultInfo' - ObjectType ObjectType `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationResultInfo. -func (ori OperationResultInfo) MarshalJSON() ([]byte, error) { - ori.ObjectType = ObjectTypeOperationResultInfo - objectMap := make(map[string]interface{}) - if ori.JobList != nil { - objectMap["jobList"] = ori.JobList - } - if ori.ObjectType != "" { - objectMap["objectType"] = ori.ObjectType - } - return json.Marshal(objectMap) -} - -// AsExportJobsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfo. -func (ori OperationResultInfo) AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) { - return nil, false -} - -// AsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfo. -func (ori OperationResultInfo) AsOperationResultInfo() (*OperationResultInfo, bool) { - return &ori, true -} - -// AsOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfo. -func (ori OperationResultInfo) AsOperationResultInfoBase() (*OperationResultInfoBase, bool) { - return nil, false -} - -// AsBasicOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfo. -func (ori OperationResultInfo) AsBasicOperationResultInfoBase() (BasicOperationResultInfoBase, bool) { - return &ori, true -} - -// BasicOperationResultInfoBase base class for operation result info. -type BasicOperationResultInfoBase interface { - AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) - AsOperationResultInfo() (*OperationResultInfo, bool) - AsOperationResultInfoBase() (*OperationResultInfoBase, bool) -} - -// OperationResultInfoBase base class for operation result info. -type OperationResultInfoBase struct { - // ObjectType - Possible values include: 'ObjectTypeOperationResultInfoBase', 'ObjectTypeExportJobsOperationResultInfo', 'ObjectTypeOperationResultInfo' - ObjectType ObjectType `json:"objectType,omitempty"` -} - -func unmarshalBasicOperationResultInfoBase(body []byte) (BasicOperationResultInfoBase, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeExportJobsOperationResultInfo): - var ejori ExportJobsOperationResultInfo - err := json.Unmarshal(body, &ejori) - return ejori, err - case string(ObjectTypeOperationResultInfo): - var ori OperationResultInfo - err := json.Unmarshal(body, &ori) - return ori, err - default: - var orib OperationResultInfoBase - err := json.Unmarshal(body, &orib) - return orib, err - } -} -func unmarshalBasicOperationResultInfoBaseArray(body []byte) ([]BasicOperationResultInfoBase, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - oribArray := make([]BasicOperationResultInfoBase, len(rawMessages)) - - for index, rawMessage := range rawMessages { - orib, err := unmarshalBasicOperationResultInfoBase(*rawMessage) - if err != nil { - return nil, err - } - oribArray[index] = orib - } - return oribArray, nil -} - -// MarshalJSON is the custom marshaler for OperationResultInfoBase. -func (orib OperationResultInfoBase) MarshalJSON() ([]byte, error) { - orib.ObjectType = ObjectTypeOperationResultInfoBase - objectMap := make(map[string]interface{}) - if orib.ObjectType != "" { - objectMap["objectType"] = orib.ObjectType - } - return json.Marshal(objectMap) -} - -// AsExportJobsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. -func (orib OperationResultInfoBase) AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) { - return nil, false -} - -// AsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. -func (orib OperationResultInfoBase) AsOperationResultInfo() (*OperationResultInfo, bool) { - return nil, false -} - -// AsOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. -func (orib OperationResultInfoBase) AsOperationResultInfoBase() (*OperationResultInfoBase, bool) { - return &orib, true -} - -// AsBasicOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. -func (orib OperationResultInfoBase) AsBasicOperationResultInfoBase() (BasicOperationResultInfoBase, bool) { - return &orib, true -} - -// OperationResultInfoBaseResource base class for operation result info. -type OperationResultInfoBaseResource struct { - autorest.Response `json:"-"` - // Operation - OperationResultInfoBaseResource operation - Operation BasicOperationResultInfoBase `json:"operation,omitempty"` - // StatusCode - 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' - StatusCode HTTPStatusCode `json:"statusCode,omitempty"` - // Headers - HTTP headers associated with this operation. - Headers map[string][]string `json:"headers"` -} - -// MarshalJSON is the custom marshaler for OperationResultInfoBaseResource. -func (oribr OperationResultInfoBaseResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["operation"] = oribr.Operation - if oribr.StatusCode != "" { - objectMap["statusCode"] = oribr.StatusCode - } - if oribr.Headers != nil { - objectMap["headers"] = oribr.Headers - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for OperationResultInfoBaseResource struct. -func (oribr *OperationResultInfoBaseResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "operation": - if v != nil { - operation, err := unmarshalBasicOperationResultInfoBase(*v) - if err != nil { - return err - } - oribr.Operation = operation - } - case "statusCode": - if v != nil { - var statusCode HTTPStatusCode - err = json.Unmarshal(*v, &statusCode) - if err != nil { - return err - } - oribr.StatusCode = statusCode - } - case "headers": - if v != nil { - var headers map[string][]string - err = json.Unmarshal(*v, &headers) - if err != nil { - return err - } - oribr.Headers = headers - } - } - } - - return nil -} - -// OperationStatus operation status. -type OperationStatus struct { - autorest.Response `json:"-"` - // ID - ID of the operation. - ID *string `json:"id,omitempty"` - // Name - Name of the operation. - Name *string `json:"name,omitempty"` - // Status - Operation status. Possible values include: 'OperationStatusValuesInvalid', 'OperationStatusValuesInProgress', 'OperationStatusValuesSucceeded', 'OperationStatusValuesFailed', 'OperationStatusValuesCanceled' - Status OperationStatusValues `json:"status,omitempty"` - // StartTime - Operation start time. Format: ISO-8601. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - Operation end time. Format: ISO-8601. - EndTime *date.Time `json:"endTime,omitempty"` - // Error - Error information related to this operation. - Error *OperationStatusError `json:"error,omitempty"` - // Properties - Additional information associated with this operation. - Properties BasicOperationStatusExtendedInfo `json:"properties,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for OperationStatus struct. -func (osVar *OperationStatus) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - osVar.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - osVar.Name = &name - } - case "status": - if v != nil { - var status OperationStatusValues - err = json.Unmarshal(*v, &status) - if err != nil { - return err - } - osVar.Status = status - } - case "startTime": - if v != nil { - var startTime date.Time - err = json.Unmarshal(*v, &startTime) - if err != nil { - return err - } - osVar.StartTime = &startTime - } - case "endTime": - if v != nil { - var endTime date.Time - err = json.Unmarshal(*v, &endTime) - if err != nil { - return err - } - osVar.EndTime = &endTime - } - case "error": - if v != nil { - var errorVar OperationStatusError - err = json.Unmarshal(*v, &errorVar) - if err != nil { - return err - } - osVar.Error = &errorVar - } - case "properties": - if v != nil { - properties, err := unmarshalBasicOperationStatusExtendedInfo(*v) - if err != nil { - return err - } - osVar.Properties = properties - } - } - } - - return nil -} - -// OperationStatusError error information associated with operation status call. -type OperationStatusError struct { - // Code - Error code of the operation failure. - Code *string `json:"code,omitempty"` - // Message - Error message displayed if the operation failure. - Message *string `json:"message,omitempty"` -} - -// BasicOperationStatusExtendedInfo base class for additional information of operation status. -type BasicOperationStatusExtendedInfo interface { - AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) - AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) - AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) - AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) -} - -// OperationStatusExtendedInfo base class for additional information of operation status. -type OperationStatusExtendedInfo struct { - // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' - ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` -} - -func unmarshalBasicOperationStatusExtendedInfo(body []byte) (BasicOperationStatusExtendedInfo, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeOperationStatusJobExtendedInfo): - var osjei OperationStatusJobExtendedInfo - err := json.Unmarshal(body, &osjei) - return osjei, err - case string(ObjectTypeOperationStatusJobsExtendedInfo): - var osjei OperationStatusJobsExtendedInfo - err := json.Unmarshal(body, &osjei) - return osjei, err - case string(ObjectTypeOperationStatusProvisionILRExtendedInfo): - var ospiei OperationStatusProvisionILRExtendedInfo - err := json.Unmarshal(body, &ospiei) - return ospiei, err - default: - var osei OperationStatusExtendedInfo - err := json.Unmarshal(body, &osei) - return osei, err - } -} -func unmarshalBasicOperationStatusExtendedInfoArray(body []byte) ([]BasicOperationStatusExtendedInfo, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - oseiArray := make([]BasicOperationStatusExtendedInfo, len(rawMessages)) - - for index, rawMessage := range rawMessages { - osei, err := unmarshalBasicOperationStatusExtendedInfo(*rawMessage) - if err != nil { - return nil, err - } - oseiArray[index] = osei - } - return oseiArray, nil -} - -// MarshalJSON is the custom marshaler for OperationStatusExtendedInfo. -func (osei OperationStatusExtendedInfo) MarshalJSON() ([]byte, error) { - osei.ObjectType = ObjectTypeOperationStatusExtendedInfo - objectMap := make(map[string]interface{}) - if osei.ObjectType != "" { - objectMap["objectType"] = osei.ObjectType - } - return json.Marshal(objectMap) -} - -// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. -func (osei OperationStatusExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. -func (osei OperationStatusExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. -func (osei OperationStatusExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. -func (osei OperationStatusExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { - return &osei, true -} - -// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. -func (osei OperationStatusExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { - return &osei, true -} - -// OperationStatusJobExtendedInfo operation status job extended info. -type OperationStatusJobExtendedInfo struct { - // JobID - ID of the job created for this protected item. - JobID *string `json:"jobId,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' - ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationStatusJobExtendedInfo. -func (osjei OperationStatusJobExtendedInfo) MarshalJSON() ([]byte, error) { - osjei.ObjectType = ObjectTypeOperationStatusJobExtendedInfo - objectMap := make(map[string]interface{}) - if osjei.JobID != nil { - objectMap["jobId"] = osjei.JobID - } - if osjei.ObjectType != "" { - objectMap["objectType"] = osjei.ObjectType - } - return json.Marshal(objectMap) -} - -// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. -func (osjei OperationStatusJobExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { - return &osjei, true -} - -// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. -func (osjei OperationStatusJobExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. -func (osjei OperationStatusJobExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. -func (osjei OperationStatusJobExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { - return nil, false -} - -// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. -func (osjei OperationStatusJobExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { - return &osjei, true -} - -// OperationStatusJobsExtendedInfo operation status extended info for list of jobs. -type OperationStatusJobsExtendedInfo struct { - // JobIds - IDs of the jobs created for the protected item. - JobIds *[]string `json:"jobIds,omitempty"` - // FailedJobsError - Stores all the failed jobs along with the corresponding error codes. - FailedJobsError map[string]*string `json:"failedJobsError"` - // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' - ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationStatusJobsExtendedInfo. -func (osjei OperationStatusJobsExtendedInfo) MarshalJSON() ([]byte, error) { - osjei.ObjectType = ObjectTypeOperationStatusJobsExtendedInfo - objectMap := make(map[string]interface{}) - if osjei.JobIds != nil { - objectMap["jobIds"] = osjei.JobIds - } - if osjei.FailedJobsError != nil { - objectMap["failedJobsError"] = osjei.FailedJobsError - } - if osjei.ObjectType != "" { - objectMap["objectType"] = osjei.ObjectType - } - return json.Marshal(objectMap) -} - -// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. -func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. -func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { - return &osjei, true -} - -// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. -func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. -func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { - return nil, false -} - -// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. -func (osjei OperationStatusJobsExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { - return &osjei, true -} - -// OperationStatusProvisionILRExtendedInfo operation status extended info for ILR provision action. -type OperationStatusProvisionILRExtendedInfo struct { - // RecoveryTarget - Target details for file / folder restore. - RecoveryTarget *InstantItemRecoveryTarget `json:"recoveryTarget,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' - ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationStatusProvisionILRExtendedInfo. -func (ospiei OperationStatusProvisionILRExtendedInfo) MarshalJSON() ([]byte, error) { - ospiei.ObjectType = ObjectTypeOperationStatusProvisionILRExtendedInfo - objectMap := make(map[string]interface{}) - if ospiei.RecoveryTarget != nil { - objectMap["recoveryTarget"] = ospiei.RecoveryTarget - } - if ospiei.ObjectType != "" { - objectMap["objectType"] = ospiei.ObjectType - } - return json.Marshal(objectMap) -} - -// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. -func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. -func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. -func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { - return &ospiei, true -} - -// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. -func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { - return nil, false -} - -// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. -func (ospiei OperationStatusProvisionILRExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { - return &ospiei, true -} - -// OperationWorkerResponse this is the base class for operation result responses. -type OperationWorkerResponse struct { - // StatusCode - 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' - StatusCode HTTPStatusCode `json:"statusCode,omitempty"` - // Headers - HTTP headers associated with this operation. - Headers map[string][]string `json:"headers"` -} - -// MarshalJSON is the custom marshaler for OperationWorkerResponse. -func (owr OperationWorkerResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if owr.StatusCode != "" { - objectMap["statusCode"] = owr.StatusCode - } - if owr.Headers != nil { - objectMap["headers"] = owr.Headers - } - return json.Marshal(objectMap) -} - -// PointInTimeRange provides details for log ranges -type PointInTimeRange struct { - // StartTime - Start time of the time range for log recovery. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - End time of the time range for log recovery. - EndTime *date.Time `json:"endTime,omitempty"` -} - -// PreBackupValidation pre-backup validation for Azure VM Workload provider. -type PreBackupValidation struct { - // Status - Status of protectable item, i.e. InProgress,Succeeded,Failed. Possible values include: 'InquiryStatusInvalid', 'InquiryStatusSuccess', 'InquiryStatusFailed' - Status InquiryStatus `json:"status,omitempty"` - // Code - Error code of protectable item - Code *string `json:"code,omitempty"` - // Message - Message corresponding to the error code for the protectable item - Message *string `json:"message,omitempty"` -} - -// PreValidateEnableBackupRequest contract to validate if backup can be enabled on the given resource in a -// given vault and given configuration. -// It will validate followings -// 1. Vault capacity -// 2. VM is already protected -// 3. Any VM related configuration passed in properties. -type PreValidateEnableBackupRequest struct { - // ResourceType - ProtectedItem Type- VM, SqlDataBase, AzureFileShare etc. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - ResourceType DataSourceType `json:"resourceType,omitempty"` - // ResourceID - ARM Virtual Machine Id - ResourceID *string `json:"resourceId,omitempty"` - // VaultID - ARM id of the Recovery Services Vault - VaultID *string `json:"vaultId,omitempty"` - // Properties - Configuration of VM if any needs to be validated like OS type etc - Properties *string `json:"properties,omitempty"` -} - -// PreValidateEnableBackupResponse response contract for enable backup validation request -type PreValidateEnableBackupResponse struct { - autorest.Response `json:"-"` - // Status - Validation Status. Possible values include: 'ValidationStatusInvalid', 'ValidationStatusSucceeded', 'ValidationStatusFailed' - Status ValidationStatus `json:"status,omitempty"` - // ErrorCode - Response error code - ErrorCode *string `json:"errorCode,omitempty"` - // ErrorMessage - Response error message - ErrorMessage *string `json:"errorMessage,omitempty"` - // Recommendation - Recommended action for user - Recommendation *string `json:"recommendation,omitempty"` - // ContainerName - Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is required - // for portal - ContainerName *string `json:"containerName,omitempty"` - // ProtectedItemName - Specifies the product specific ds name. E.g. vm;iaasvmcontainer;rgname;vmname. This is required for portal - ProtectedItemName *string `json:"protectedItemName,omitempty"` -} - -// BasicProtectableContainer protectable Container Class. -type BasicProtectableContainer interface { - AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) - AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) - AsProtectableContainer() (*ProtectableContainer, bool) -} - -// ProtectableContainer protectable Container Class. -type ProtectableContainer struct { - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerID - Fabric Id of the container such as ARM Id. - ContainerID *string `json:"containerId,omitempty"` - // ProtectableContainerType - Possible values include: 'ProtectableContainerTypeProtectableContainer', 'ProtectableContainerTypeStorageContainer', 'ProtectableContainerTypeVMAppContainer' - ProtectableContainerType ProtectableContainerType `json:"protectableContainerType,omitempty"` -} - -func unmarshalBasicProtectableContainer(body []byte) (BasicProtectableContainer, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["protectableContainerType"] { - case string(ProtectableContainerTypeStorageContainer): - var aspc AzureStorageProtectableContainer - err := json.Unmarshal(body, &aspc) - return aspc, err - case string(ProtectableContainerTypeVMAppContainer): - var avacpc AzureVMAppContainerProtectableContainer - err := json.Unmarshal(body, &avacpc) - return avacpc, err - default: - var pc ProtectableContainer - err := json.Unmarshal(body, &pc) - return pc, err - } -} -func unmarshalBasicProtectableContainerArray(body []byte) ([]BasicProtectableContainer, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - pcArray := make([]BasicProtectableContainer, len(rawMessages)) - - for index, rawMessage := range rawMessages { - pc, err := unmarshalBasicProtectableContainer(*rawMessage) - if err != nil { - return nil, err - } - pcArray[index] = pc - } - return pcArray, nil -} - -// MarshalJSON is the custom marshaler for ProtectableContainer. -func (pc ProtectableContainer) MarshalJSON() ([]byte, error) { - pc.ProtectableContainerType = ProtectableContainerTypeProtectableContainer - objectMap := make(map[string]interface{}) - if pc.FriendlyName != nil { - objectMap["friendlyName"] = pc.FriendlyName - } - if pc.BackupManagementType != "" { - objectMap["backupManagementType"] = pc.BackupManagementType - } - if pc.HealthStatus != nil { - objectMap["healthStatus"] = pc.HealthStatus - } - if pc.ContainerID != nil { - objectMap["containerId"] = pc.ContainerID - } - if pc.ProtectableContainerType != "" { - objectMap["protectableContainerType"] = pc.ProtectableContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureStorageProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. -func (pc ProtectableContainer) AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. -func (pc ProtectableContainer) AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) { - return nil, false -} - -// AsProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. -func (pc ProtectableContainer) AsProtectableContainer() (*ProtectableContainer, bool) { - return &pc, true -} - -// AsBasicProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. -func (pc ProtectableContainer) AsBasicProtectableContainer() (BasicProtectableContainer, bool) { - return &pc, true -} - -// ProtectableContainerResource protectable Container Class. -type ProtectableContainerResource struct { - // Properties - ProtectableContainerResource properties - Properties BasicProtectableContainer `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProtectableContainerResource. -func (pcr ProtectableContainerResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = pcr.Properties - if pcr.Location != nil { - objectMap["location"] = pcr.Location - } - if pcr.Tags != nil { - objectMap["tags"] = pcr.Tags - } - if pcr.ETag != nil { - objectMap["eTag"] = pcr.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ProtectableContainerResource struct. -func (pcr *ProtectableContainerResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicProtectableContainer(*v) - if err != nil { - return err - } - pcr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pcr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pcr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pcr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - pcr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - pcr.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - pcr.ETag = &eTag - } - } - } - - return nil -} - -// ProtectableContainerResourceList list of ProtectableContainer resources -type ProtectableContainerResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]ProtectableContainerResource `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"` -} - -// ProtectableContainerResourceListIterator provides access to a complete listing of -// ProtectableContainerResource values. -type ProtectableContainerResourceListIterator struct { - i int - page ProtectableContainerResourceListPage -} - -// NextWithContext 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 *ProtectableContainerResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableContainerResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ProtectableContainerResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ProtectableContainerResourceListIterator) 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 ProtectableContainerResourceListIterator) Response() ProtectableContainerResourceList { - 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 ProtectableContainerResourceListIterator) Value() ProtectableContainerResource { - if !iter.page.NotDone() { - return ProtectableContainerResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ProtectableContainerResourceListIterator type. -func NewProtectableContainerResourceListIterator(page ProtectableContainerResourceListPage) ProtectableContainerResourceListIterator { - return ProtectableContainerResourceListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (pcrl ProtectableContainerResourceList) IsEmpty() bool { - return pcrl.Value == nil || len(*pcrl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (pcrl ProtectableContainerResourceList) hasNextLink() bool { - return pcrl.NextLink != nil && len(*pcrl.NextLink) != 0 -} - -// protectableContainerResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (pcrl ProtectableContainerResourceList) protectableContainerResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !pcrl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(pcrl.NextLink))) -} - -// ProtectableContainerResourceListPage contains a page of ProtectableContainerResource values. -type ProtectableContainerResourceListPage struct { - fn func(context.Context, ProtectableContainerResourceList) (ProtectableContainerResourceList, error) - pcrl ProtectableContainerResourceList -} - -// NextWithContext 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 *ProtectableContainerResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableContainerResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.pcrl) - if err != nil { - return err - } - page.pcrl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *ProtectableContainerResourceListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ProtectableContainerResourceListPage) NotDone() bool { - return !page.pcrl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ProtectableContainerResourceListPage) Response() ProtectableContainerResourceList { - return page.pcrl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ProtectableContainerResourceListPage) Values() []ProtectableContainerResource { - if page.pcrl.IsEmpty() { - return nil - } - return *page.pcrl.Value -} - -// Creates a new instance of the ProtectableContainerResourceListPage type. -func NewProtectableContainerResourceListPage(cur ProtectableContainerResourceList, getNextPage func(context.Context, ProtectableContainerResourceList) (ProtectableContainerResourceList, error)) ProtectableContainerResourceListPage { - return ProtectableContainerResourceListPage{ - fn: getNextPage, - pcrl: cur, - } -} - -// BasicProtectedItem base class for backup items. -type BasicProtectedItem interface { - AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) - AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) - AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) - AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) - AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) - AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) - AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) - AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) - AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) - AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) - AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) - AsDPMProtectedItem() (*DPMProtectedItem, bool) - AsGenericProtectedItem() (*GenericProtectedItem, bool) - AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) - AsProtectedItem() (*ProtectedItem, bool) -} - -// ProtectedItem base class for backup items. -type ProtectedItem struct { - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -func unmarshalBasicProtectedItem(body []byte) (BasicProtectedItem, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["protectedItemType"] { - case string(ProtectedItemTypeAzureFileShareProtectedItem): - var afpi AzureFileshareProtectedItem - err := json.Unmarshal(body, &afpi) - return afpi, err - case string(ProtectedItemTypeMicrosoftClassicComputevirtualMachines): - var aisccvpi AzureIaaSClassicComputeVMProtectedItem - err := json.Unmarshal(body, &aisccvpi) - return aisccvpi, err - case string(ProtectedItemTypeMicrosoftComputevirtualMachines): - var aiscvpi AzureIaaSComputeVMProtectedItem - err := json.Unmarshal(body, &aiscvpi) - return aiscvpi, err - case string(ProtectedItemTypeAzureIaaSVMProtectedItem): - var aispi AzureIaaSVMProtectedItem - err := json.Unmarshal(body, &aispi) - return aispi, err - case string(ProtectedItemTypeMicrosoftSqlserversdatabases): - var aspi AzureSQLProtectedItem - err := json.Unmarshal(body, &aspi) - return aspi, err - case string(ProtectedItemTypeAzureVMWorkloadProtectedItem): - var avwpi AzureVMWorkloadProtectedItem - err := json.Unmarshal(body, &avwpi) - return avwpi, err - case string(ProtectedItemTypeAzureVMWorkloadSAPAseDatabase): - var avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem - err := json.Unmarshal(body, &avwsadpi) - return avwsadpi, err - case string(ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase): - var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem - err := json.Unmarshal(body, &avwshdpi) - return avwshdpi, err - case string(ProtectedItemTypeAzureVMWorkloadSQLDatabase): - var avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem - err := json.Unmarshal(body, &avwsdpi) - return avwsdpi, err - case string(ProtectedItemTypeDPMProtectedItem): - var dpi DPMProtectedItem - err := json.Unmarshal(body, &dpi) - return dpi, err - case string(ProtectedItemTypeGenericProtectedItem): - var gpi GenericProtectedItem - err := json.Unmarshal(body, &gpi) - return gpi, err - case string(ProtectedItemTypeMabFileFolderProtectedItem): - var mffpi MabFileFolderProtectedItem - err := json.Unmarshal(body, &mffpi) - return mffpi, err - default: - var pi ProtectedItem - err := json.Unmarshal(body, &pi) - return pi, err - } -} -func unmarshalBasicProtectedItemArray(body []byte) ([]BasicProtectedItem, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - piArray := make([]BasicProtectedItem, len(rawMessages)) - - for index, rawMessage := range rawMessages { - pi, err := unmarshalBasicProtectedItem(*rawMessage) - if err != nil { - return nil, err - } - piArray[index] = pi - } - return piArray, nil -} - -// MarshalJSON is the custom marshaler for ProtectedItem. -func (pi ProtectedItem) MarshalJSON() ([]byte, error) { - pi.ProtectedItemType = ProtectedItemTypeProtectedItem - objectMap := make(map[string]interface{}) - if pi.BackupManagementType != "" { - objectMap["backupManagementType"] = pi.BackupManagementType - } - if pi.WorkloadType != "" { - objectMap["workloadType"] = pi.WorkloadType - } - if pi.ContainerName != nil { - objectMap["containerName"] = pi.ContainerName - } - if pi.SourceResourceID != nil { - objectMap["sourceResourceId"] = pi.SourceResourceID - } - if pi.PolicyID != nil { - objectMap["policyId"] = pi.PolicyID - } - if pi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = pi.LastRecoveryPoint - } - if pi.BackupSetName != nil { - objectMap["backupSetName"] = pi.BackupSetName - } - if pi.CreateMode != "" { - objectMap["createMode"] = pi.CreateMode - } - if pi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = pi.DeferredDeleteTimeInUTC - } - if pi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = pi.IsScheduledForDeferredDelete - } - if pi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = pi.DeferredDeleteTimeRemaining - } - if pi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = pi.IsDeferredDeleteScheduleUpcoming - } - if pi.IsRehydrate != nil { - objectMap["isRehydrate"] = pi.IsRehydrate - } - if pi.ProtectedItemType != "" { - objectMap["protectedItemType"] = pi.ProtectedItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return nil, false -} - -// AsDPMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return nil, false -} - -// AsGenericProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return nil, false -} - -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return nil, false -} - -// AsProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return &pi, true -} - -// AsBasicProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &pi, true -} - -// ProtectedItemQueryObject filters to list backup items. -type ProtectedItemQueryObject struct { - // HealthState - Health State for the backed up item. Possible values include: 'HealthStatePassed', 'HealthStateActionRequired', 'HealthStateActionSuggested', 'HealthStateInvalid' - HealthState HealthState `json:"healthState,omitempty"` - // BackupManagementType - Backup management type for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' +// JobQueryObject filters to list the jobs. +type JobQueryObject struct { + // Status - Status of the job. Possible values include: 'JobStatusInvalid', 'JobStatusInProgress', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusCompletedWithWarnings', 'JobStatusCancelled', 'JobStatusCancelling' + Status JobStatus `json:"status,omitempty"` + // BackupManagementType - Type of backup management for the job. 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: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - ItemType DataSourceType `json:"itemType,omitempty"` - // PolicyName - Backup policy name associated with the backup item. - PolicyName *string `json:"policyName,omitempty"` - // ContainerName - Name of the container. - ContainerName *string `json:"containerName,omitempty"` - // BackupEngineName - Backup Engine name - BackupEngineName *string `json:"backupEngineName,omitempty"` - // FriendlyName - Friendly name of protected item - FriendlyName *string `json:"friendlyName,omitempty"` - // FabricName - Name of the fabric. - FabricName *string `json:"fabricName,omitempty"` - // BackupSetName - Name of the backup set. - BackupSetName *string `json:"backupSetName,omitempty"` + // Operation - Type of operation. Possible values include: 'JobOperationTypeInvalid', 'JobOperationTypeRegister', 'JobOperationTypeUnRegister', 'JobOperationTypeConfigureBackup', 'JobOperationTypeBackup', 'JobOperationTypeRestore', 'JobOperationTypeDisableBackup', 'JobOperationTypeDeleteBackupData', 'JobOperationTypeCrossRegionRestore', 'JobOperationTypeUndelete' + Operation JobOperationType `json:"operation,omitempty"` + // JobID - JobID represents the job uniquely. + JobID *string `json:"jobId,omitempty"` + // StartTime - Job has started at this time. Value is in UTC. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Job has ended at this time. Value is in UTC. + EndTime *date.Time `json:"endTime,omitempty"` } -// ProtectedItemResource base class for backup items. -type ProtectedItemResource struct { +// JobResource defines workload agnostic properties for a job. +type JobResource struct { autorest.Response `json:"-"` - // Properties - ProtectedItemResource properties - Properties BasicProtectedItem `json:"properties,omitempty"` + // Properties - JobResource properties + Properties BasicJob `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id represents the complete path to the resource. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name associated with the resource. @@ -15150,24 +6309,24 @@ type ProtectedItemResource struct { ETag *string `json:"eTag,omitempty"` } -// MarshalJSON is the custom marshaler for ProtectedItemResource. -func (pir ProtectedItemResource) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for JobResource. +func (jr JobResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["properties"] = pir.Properties - if pir.Location != nil { - objectMap["location"] = pir.Location + objectMap["properties"] = jr.Properties + if jr.Location != nil { + objectMap["location"] = jr.Location } - if pir.Tags != nil { - objectMap["tags"] = pir.Tags + if jr.Tags != nil { + objectMap["tags"] = jr.Tags } - if pir.ETag != nil { - objectMap["eTag"] = pir.ETag + if jr.ETag != nil { + objectMap["eTag"] = jr.ETag } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ProtectedItemResource struct. -func (pir *ProtectedItemResource) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for JobResource struct. +func (jr *JobResource) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -15177,11 +6336,11 @@ func (pir *ProtectedItemResource) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - properties, err := unmarshalBasicProtectedItem(*v) + properties, err := unmarshalBasicJob(*v) if err != nil { return err } - pir.Properties = properties + jr.Properties = properties } case "id": if v != nil { @@ -15190,7 +6349,7 @@ func (pir *ProtectedItemResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - pir.ID = &ID + jr.ID = &ID } case "name": if v != nil { @@ -15199,7 +6358,7 @@ func (pir *ProtectedItemResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - pir.Name = &name + jr.Name = &name } case "type": if v != nil { @@ -15208,7 +6367,7 @@ func (pir *ProtectedItemResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - pir.Type = &typeVar + jr.Type = &typeVar } case "location": if v != nil { @@ -15217,7 +6376,7 @@ func (pir *ProtectedItemResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - pir.Location = &location + jr.Location = &location } case "tags": if v != nil { @@ -15226,7 +6385,7 @@ func (pir *ProtectedItemResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - pir.Tags = tags + jr.Tags = tags } case "eTag": if v != nil { @@ -15235,7 +6394,7 @@ func (pir *ProtectedItemResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - pir.ETag = &eTag + jr.ETag = &eTag } } } @@ -15243,26 +6402,26 @@ func (pir *ProtectedItemResource) UnmarshalJSON(body []byte) error { return nil } -// ProtectedItemResourceList list of ProtectedItem resources -type ProtectedItemResourceList struct { +// JobResourceList list of Job resources +type JobResourceList struct { autorest.Response `json:"-"` // Value - List of resources. - Value *[]ProtectedItemResource `json:"value,omitempty"` + Value *[]JobResource `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"` } -// ProtectedItemResourceListIterator provides access to a complete listing of ProtectedItemResource values. -type ProtectedItemResourceListIterator struct { +// JobResourceListIterator provides access to a complete listing of JobResource values. +type JobResourceListIterator struct { i int - page ProtectedItemResourceListPage + page JobResourceListPage } // NextWithContext 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 *ProtectedItemResourceListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *JobResourceListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemResourceListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/JobResourceListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -15287,67 +6446,67 @@ func (iter *ProtectedItemResourceListIterator) NextWithContext(ctx context.Conte // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *ProtectedItemResourceListIterator) Next() error { +func (iter *JobResourceListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ProtectedItemResourceListIterator) NotDone() bool { +func (iter JobResourceListIterator) 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 ProtectedItemResourceListIterator) Response() ProtectedItemResourceList { +func (iter JobResourceListIterator) Response() JobResourceList { 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 ProtectedItemResourceListIterator) Value() ProtectedItemResource { +func (iter JobResourceListIterator) Value() JobResource { if !iter.page.NotDone() { - return ProtectedItemResource{} + return JobResource{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the ProtectedItemResourceListIterator type. -func NewProtectedItemResourceListIterator(page ProtectedItemResourceListPage) ProtectedItemResourceListIterator { - return ProtectedItemResourceListIterator{page: page} +// Creates a new instance of the JobResourceListIterator type. +func NewJobResourceListIterator(page JobResourceListPage) JobResourceListIterator { + return JobResourceListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (pirl ProtectedItemResourceList) IsEmpty() bool { - return pirl.Value == nil || len(*pirl.Value) == 0 +func (jrl JobResourceList) IsEmpty() bool { + return jrl.Value == nil || len(*jrl.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (pirl ProtectedItemResourceList) hasNextLink() bool { - return pirl.NextLink != nil && len(*pirl.NextLink) != 0 +func (jrl JobResourceList) hasNextLink() bool { + return jrl.NextLink != nil && len(*jrl.NextLink) != 0 } -// protectedItemResourceListPreparer prepares a request to retrieve the next set of results. +// jobResourceListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (pirl ProtectedItemResourceList) protectedItemResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !pirl.hasNextLink() { +func (jrl JobResourceList) jobResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !jrl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(pirl.NextLink))) + autorest.WithBaseURL(to.String(jrl.NextLink))) } -// ProtectedItemResourceListPage contains a page of ProtectedItemResource values. -type ProtectedItemResourceListPage struct { - fn func(context.Context, ProtectedItemResourceList) (ProtectedItemResourceList, error) - pirl ProtectedItemResourceList +// JobResourceListPage contains a page of JobResource values. +type JobResourceListPage struct { + fn func(context.Context, JobResourceList) (JobResourceList, error) + jrl JobResourceList } // NextWithContext 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 *ProtectedItemResourceListPage) NextWithContext(ctx context.Context) (err error) { +func (page *JobResourceListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemResourceListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/JobResourceListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -15357,11 +6516,11 @@ func (page *ProtectedItemResourceListPage) NextWithContext(ctx context.Context) }() } for { - next, err := page.fn(ctx, page.pirl) + next, err := page.fn(ctx, page.jrl) if err != nil { return err } - page.pirl = next + page.jrl = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -15372,723 +6531,654 @@ func (page *ProtectedItemResourceListPage) NextWithContext(ctx context.Context) // 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. // Deprecated: Use NextWithContext() instead. -func (page *ProtectedItemResourceListPage) Next() error { +func (page *JobResourceListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ProtectedItemResourceListPage) NotDone() bool { - return !page.pirl.IsEmpty() +func (page JobResourceListPage) NotDone() bool { + return !page.jrl.IsEmpty() } // Response returns the raw server response from the last page request. -func (page ProtectedItemResourceListPage) Response() ProtectedItemResourceList { - return page.pirl +func (page JobResourceListPage) Response() JobResourceList { + return page.jrl } // Values returns the slice of values for the current page or nil if there are no values. -func (page ProtectedItemResourceListPage) Values() []ProtectedItemResource { - if page.pirl.IsEmpty() { +func (page JobResourceListPage) Values() []JobResource { + if page.jrl.IsEmpty() { return nil } - return *page.pirl.Value + return *page.jrl.Value } -// Creates a new instance of the ProtectedItemResourceListPage type. -func NewProtectedItemResourceListPage(cur ProtectedItemResourceList, getNextPage func(context.Context, ProtectedItemResourceList) (ProtectedItemResourceList, error)) ProtectedItemResourceListPage { - return ProtectedItemResourceListPage{ - fn: getNextPage, - pirl: cur, +// Creates a new instance of the JobResourceListPage type. +func NewJobResourceListPage(cur JobResourceList, getNextPage func(context.Context, JobResourceList) (JobResourceList, error)) JobResourceListPage { + return JobResourceListPage{ + fn: getNextPage, + jrl: cur, } } -// BasicProtectionContainer base class for container with backup items. Containers with specific workloads are derived -// from this class. -type BasicProtectionContainer interface { - AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) - AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) - AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) - AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) - AsAzureSQLContainer() (*AzureSQLContainer, bool) - AsAzureStorageContainer() (*AzureStorageContainer, bool) - AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) - AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) - AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) - AsDpmContainer() (*DpmContainer, bool) - AsBasicDpmContainer() (BasicDpmContainer, bool) - AsGenericContainer() (*GenericContainer, bool) - AsIaaSVMContainer() (*IaaSVMContainer, bool) - AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) - AsMabContainer() (*MabContainer, bool) - AsProtectionContainer() (*ProtectionContainer, bool) -} - -// ProtectionContainer base class for container with backup items. Containers with specific workloads are -// derived from this class. -type ProtectionContainer struct { - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +// KEKDetails KEK is encryption key for BEK. +type KEKDetails struct { + // KeyURL - Key is KEK. + KeyURL *string `json:"keyUrl,omitempty"` + // KeyVaultID - Key Vault ID where this Key is stored. + KeyVaultID *string `json:"keyVaultId,omitempty"` + // KeyBackupData - KEK data. + KeyBackupData *string `json:"keyBackupData,omitempty"` } -func unmarshalBasicProtectionContainer(body []byte) (BasicProtectionContainer, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } +// KeyAndSecretDetails BEK is bitlocker key. +// KEK is encryption key for BEK +// If the VM was encrypted then we will store following details : +// 1. Secret(BEK) - Url + Backup Data + vaultId. +// 2. Key(KEK) - Url + Backup Data + vaultId. +// 3. EncryptionMechanism +// BEK and KEK can potentially have different vault ids. +type KeyAndSecretDetails struct { + // KekDetails - KEK is encryption key for BEK. + KekDetails *KEKDetails `json:"kekDetails,omitempty"` + // BekDetails - BEK is bitlocker encryption key. + BekDetails *BEKDetails `json:"bekDetails,omitempty"` + // EncryptionMechanism - Encryption mechanism: None/ SinglePass/ DoublePass + EncryptionMechanism *string `json:"encryptionMechanism,omitempty"` +} - switch m["containerType"] { - case string(ContainerTypeAzureBackupServerContainer1): - var absc AzureBackupServerContainer - err := json.Unmarshal(body, &absc) - return absc, err - case string(ContainerTypeMicrosoftClassicComputevirtualMachines): - var aisccvc AzureIaaSClassicComputeVMContainer - err := json.Unmarshal(body, &aisccvc) - return aisccvc, err - case string(ContainerTypeMicrosoftComputevirtualMachines): - var aiscvc AzureIaaSComputeVMContainer - err := json.Unmarshal(body, &aiscvc) - return aiscvc, err - case string(ContainerTypeSQLAGWorkLoadContainer1): - var aswcpc AzureSQLAGWorkloadContainerProtectionContainer - err := json.Unmarshal(body, &aswcpc) - return aswcpc, err - case string(ContainerTypeAzureSQLContainer1): - var asc AzureSQLContainer - err := json.Unmarshal(body, &asc) - return asc, err - case string(ContainerTypeStorageContainer1): - var asc AzureStorageContainer - err := json.Unmarshal(body, &asc) - return asc, err - case string(ContainerTypeVMAppContainer1): - var avacpc AzureVMAppContainerProtectionContainer - err := json.Unmarshal(body, &avacpc) - return avacpc, err - case string(ContainerTypeAzureWorkloadContainer): - var awc AzureWorkloadContainer - err := json.Unmarshal(body, &awc) - return awc, err - case string(ContainerTypeDPMContainer1): - var dc DpmContainer - err := json.Unmarshal(body, &dc) - return dc, err - case string(ContainerTypeGenericContainer1): - var gc GenericContainer - err := json.Unmarshal(body, &gc) - return gc, err - case string(ContainerTypeIaaSVMContainer): - var isc IaaSVMContainer - err := json.Unmarshal(body, &isc) - return isc, err - case string(ContainerTypeWindows1): - var mc MabContainer - err := json.Unmarshal(body, &mc) - return mc, err - default: - var pc ProtectionContainer - err := json.Unmarshal(body, &pc) - return pc, err - } +// LogSchedulePolicy log policy schedule. +type LogSchedulePolicy struct { + // ScheduleFrequencyInMins - Frequency of the log schedule operation of this policy in minutes. + ScheduleFrequencyInMins *int32 `json:"scheduleFrequencyInMins,omitempty"` + // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' + SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` } -func unmarshalBasicProtectionContainerArray(body []byte) ([]BasicProtectionContainer, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err + +// MarshalJSON is the custom marshaler for LogSchedulePolicy. +func (lsp LogSchedulePolicy) MarshalJSON() ([]byte, error) { + lsp.SchedulePolicyType = SchedulePolicyTypeLogSchedulePolicy + objectMap := make(map[string]interface{}) + if lsp.ScheduleFrequencyInMins != nil { + objectMap["scheduleFrequencyInMins"] = lsp.ScheduleFrequencyInMins + } + if lsp.SchedulePolicyType != "" { + objectMap["schedulePolicyType"] = lsp.SchedulePolicyType } + return json.Marshal(objectMap) +} + +// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. +func (lsp LogSchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { + return &lsp, true +} - pcArray := make([]BasicProtectionContainer, len(rawMessages)) +// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. +func (lsp LogSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { + return nil, false +} - for index, rawMessage := range rawMessages { - pc, err := unmarshalBasicProtectionContainer(*rawMessage) - if err != nil { - return nil, err - } - pcArray[index] = pc +// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. +func (lsp LogSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { + return nil, false +} + +// AsSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. +func (lsp LogSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { + return nil, false +} + +// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. +func (lsp LogSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { + return &lsp, true +} + +// LongTermRetentionPolicy long term retention policy. +type LongTermRetentionPolicy struct { + // DailySchedule - Daily retention schedule of the protection policy. + DailySchedule *DailyRetentionSchedule `json:"dailySchedule,omitempty"` + // WeeklySchedule - Weekly retention schedule of the protection policy. + WeeklySchedule *WeeklyRetentionSchedule `json:"weeklySchedule,omitempty"` + // MonthlySchedule - Monthly retention schedule of the protection policy. + MonthlySchedule *MonthlyRetentionSchedule `json:"monthlySchedule,omitempty"` + // YearlySchedule - Yearly retention schedule of the protection policy. + YearlySchedule *YearlyRetentionSchedule `json:"yearlySchedule,omitempty"` + // RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy' + RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"` +} + +// MarshalJSON is the custom marshaler for LongTermRetentionPolicy. +func (ltrp LongTermRetentionPolicy) MarshalJSON() ([]byte, error) { + ltrp.RetentionPolicyType = RetentionPolicyTypeLongTermRetentionPolicy + objectMap := make(map[string]interface{}) + if ltrp.DailySchedule != nil { + objectMap["dailySchedule"] = ltrp.DailySchedule + } + if ltrp.WeeklySchedule != nil { + objectMap["weeklySchedule"] = ltrp.WeeklySchedule + } + if ltrp.MonthlySchedule != nil { + objectMap["monthlySchedule"] = ltrp.MonthlySchedule + } + if ltrp.YearlySchedule != nil { + objectMap["yearlySchedule"] = ltrp.YearlySchedule + } + if ltrp.RetentionPolicyType != "" { + objectMap["retentionPolicyType"] = ltrp.RetentionPolicyType } - return pcArray, nil + return json.Marshal(objectMap) +} + +// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. +func (ltrp LongTermRetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) { + return <rp, true +} + +// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. +func (ltrp LongTermRetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) { + return nil, false +} + +// AsRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. +func (ltrp LongTermRetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) { + return nil, false +} + +// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. +func (ltrp LongTermRetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) { + return <rp, true +} + +// LongTermSchedulePolicy long term policy schedule. +type LongTermSchedulePolicy struct { + // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' + SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` } -// MarshalJSON is the custom marshaler for ProtectionContainer. -func (pc ProtectionContainer) MarshalJSON() ([]byte, error) { - pc.ContainerType = ContainerTypeProtectionContainer +// MarshalJSON is the custom marshaler for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) MarshalJSON() ([]byte, error) { + ltsp.SchedulePolicyType = SchedulePolicyTypeLongTermSchedulePolicy objectMap := make(map[string]interface{}) - if pc.FriendlyName != nil { - objectMap["friendlyName"] = pc.FriendlyName - } - if pc.BackupManagementType != "" { - objectMap["backupManagementType"] = pc.BackupManagementType - } - if pc.RegistrationStatus != nil { - objectMap["registrationStatus"] = pc.RegistrationStatus - } - if pc.HealthStatus != nil { - objectMap["healthStatus"] = pc.HealthStatus - } - if pc.ContainerType != "" { - objectMap["containerType"] = pc.ContainerType + if ltsp.SchedulePolicyType != "" { + objectMap["schedulePolicyType"] = ltsp.SchedulePolicyType } return json.Marshal(objectMap) } -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { +// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { return nil, false } -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false +// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { + return <sp, true } -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { +// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { return nil, false } -// AsAzureSQLContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { +// AsSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { return nil, false } -// AsAzureStorageContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false +// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { + return <sp, true } -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false +// MabErrorInfo MAB workload-specific error information. +type MabErrorInfo struct { + // ErrorString - READ-ONLY; Localized error string. + ErrorString *string `json:"errorString,omitempty"` + // Recommendations - READ-ONLY; List of localized recommendations. + Recommendations *[]string `json:"recommendations,omitempty"` } -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false +// MarshalJSON is the custom marshaler for MabErrorInfo. +func (mei MabErrorInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) } -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false +// MabFileFolderProtectedItem MAB workload-specific backup item. +type MabFileFolderProtectedItem struct { + // FriendlyName - Friendly name of this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ComputerName - Name of the computer associated with this backup item. + ComputerName *string `json:"computerName,omitempty"` + // LastBackupStatus - Status of last backup operation. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // ProtectionState - Protected, ProtectionStopped, IRPending or ProtectionError + ProtectionState *string `json:"protectionState,omitempty"` + // DeferredDeleteSyncTimeInUTC - Sync time for deferred deletion in UTC + DeferredDeleteSyncTimeInUTC *int64 `json:"deferredDeleteSyncTimeInUTC,omitempty"` + // ExtendedInfo - Additional information with this backup item. + ExtendedInfo *MabFileFolderProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } -// AsDpmContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false +// MarshalJSON is the custom marshaler for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) MarshalJSON() ([]byte, error) { + mffpi.ProtectedItemType = ProtectedItemTypeMabFileFolderProtectedItem + objectMap := make(map[string]interface{}) + if mffpi.FriendlyName != nil { + objectMap["friendlyName"] = mffpi.FriendlyName + } + if mffpi.ComputerName != nil { + objectMap["computerName"] = mffpi.ComputerName + } + if mffpi.LastBackupStatus != nil { + objectMap["lastBackupStatus"] = mffpi.LastBackupStatus + } + if mffpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = mffpi.LastBackupTime + } + if mffpi.ProtectionState != nil { + objectMap["protectionState"] = mffpi.ProtectionState + } + if mffpi.DeferredDeleteSyncTimeInUTC != nil { + objectMap["deferredDeleteSyncTimeInUTC"] = mffpi.DeferredDeleteSyncTimeInUTC + } + if mffpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = mffpi.ExtendedInfo + } + if mffpi.BackupManagementType != "" { + objectMap["backupManagementType"] = mffpi.BackupManagementType + } + if mffpi.WorkloadType != "" { + objectMap["workloadType"] = mffpi.WorkloadType + } + if mffpi.ContainerName != nil { + objectMap["containerName"] = mffpi.ContainerName + } + if mffpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = mffpi.SourceResourceID + } + if mffpi.PolicyID != nil { + objectMap["policyId"] = mffpi.PolicyID + } + if mffpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = mffpi.LastRecoveryPoint + } + if mffpi.BackupSetName != nil { + objectMap["backupSetName"] = mffpi.BackupSetName + } + if mffpi.CreateMode != "" { + objectMap["createMode"] = mffpi.CreateMode + } + if mffpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = mffpi.DeferredDeleteTimeInUTC + } + if mffpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = mffpi.IsScheduledForDeferredDelete + } + if mffpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = mffpi.DeferredDeleteTimeRemaining + } + if mffpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = mffpi.IsDeferredDeleteScheduleUpcoming + } + if mffpi.IsRehydrate != nil { + objectMap["isRehydrate"] = mffpi.IsRehydrate + } + if mffpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = mffpi.ProtectedItemType + } + return json.Marshal(objectMap) } -// AsBasicDpmContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { return nil, false } -// AsGenericContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsGenericContainer() (*GenericContainer, bool) { +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { return nil, false } -// AsIaaSVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { return nil, false } -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { return nil, false } -// AsMabContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsMabContainer() (*MabContainer, bool) { +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { return nil, false } -// AsProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return &pc, true -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &pc, true -} - -// ProtectionContainerResource base class for container with backup items. Containers with specific -// workloads are derived from this class. -type ProtectionContainerResource struct { - autorest.Response `json:"-"` - // Properties - ProtectionContainerResource properties - Properties BasicProtectionContainer `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProtectionContainerResource. -func (pcr ProtectionContainerResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = pcr.Properties - if pcr.Location != nil { - objectMap["location"] = pcr.Location - } - if pcr.Tags != nil { - objectMap["tags"] = pcr.Tags - } - if pcr.ETag != nil { - objectMap["eTag"] = pcr.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ProtectionContainerResource struct. -func (pcr *ProtectionContainerResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicProtectionContainer(*v) - if err != nil { - return err - } - pcr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pcr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pcr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pcr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - pcr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - pcr.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - pcr.ETag = &eTag - } - } - } - - return nil +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false } -// ProtectionContainerResourceList list of ProtectionContainer resources -type ProtectionContainerResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]ProtectionContainerResource `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"` +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false } -// ProtectionContainerResourceListIterator provides access to a complete listing of -// ProtectionContainerResource values. -type ProtectionContainerResourceListIterator struct { - i int - page ProtectionContainerResourceListPage +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false } -// NextWithContext 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 *ProtectionContainerResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false } -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ProtectionContainerResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false } -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ProtectionContainerResourceListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (iter ProtectionContainerResourceListIterator) Response() ProtectionContainerResourceList { - return iter.page.Response() +// AsDPMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false } -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ProtectionContainerResourceListIterator) Value() ProtectionContainerResource { - if !iter.page.NotDone() { - return ProtectionContainerResource{} - } - return iter.page.Values()[iter.i] +// AsGenericProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false } -// Creates a new instance of the ProtectionContainerResourceListIterator type. -func NewProtectionContainerResourceListIterator(page ProtectionContainerResourceListPage) ProtectionContainerResourceListIterator { - return ProtectionContainerResourceListIterator{page: page} +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return &mffpi, true } -// IsEmpty returns true if the ListResult contains no values. -func (pcrl ProtectionContainerResourceList) IsEmpty() bool { - return pcrl.Value == nil || len(*pcrl.Value) == 0 +// AsProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false } -// hasNextLink returns true if the NextLink is not empty. -func (pcrl ProtectionContainerResourceList) hasNextLink() bool { - return pcrl.NextLink != nil && len(*pcrl.NextLink) != 0 +// AsBasicProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &mffpi, true } -// protectionContainerResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (pcrl ProtectionContainerResourceList) protectionContainerResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !pcrl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(pcrl.NextLink))) +// MabFileFolderProtectedItemExtendedInfo additional information on the backed up item. +type MabFileFolderProtectedItemExtendedInfo struct { + // LastRefreshedAt - Last time when the agent data synced to service. + LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` + // OldestRecoveryPoint - The oldest backup copy available. + OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` + // RecoveryPointCount - Number of backup copies associated with the backup item. + RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` } -// ProtectionContainerResourceListPage contains a page of ProtectionContainerResource values. -type ProtectionContainerResourceListPage struct { - fn func(context.Context, ProtectionContainerResourceList) (ProtectionContainerResourceList, error) - pcrl ProtectionContainerResourceList +// MabJob MAB workload-specific job. +type MabJob struct { + // Duration - Time taken by job to run. + Duration *string `json:"duration,omitempty"` + // ActionsInfo - The state/actions applicable on jobs like cancel/retry. + ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` + // MabServerName - Name of server protecting the DS. + MabServerName *string `json:"mabServerName,omitempty"` + // MabServerType - Server type of MAB container. Possible values include: 'MabServerTypeInvalid', 'MabServerTypeUnknown', 'MabServerTypeIaasVMContainer', 'MabServerTypeIaasVMServiceContainer', 'MabServerTypeDPMContainer', 'MabServerTypeAzureBackupServerContainer', 'MabServerTypeMABContainer', 'MabServerTypeCluster', 'MabServerTypeAzureSQLContainer', 'MabServerTypeWindows', 'MabServerTypeVCenter', 'MabServerTypeVMAppContainer', 'MabServerTypeSQLAGWorkLoadContainer', 'MabServerTypeStorageContainer', 'MabServerTypeGenericContainer' + MabServerType MabServerType `json:"mabServerType,omitempty"` + // WorkloadType - Workload type of backup item. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` + // ErrorDetails - The errors. + ErrorDetails *[]MabErrorInfo `json:"errorDetails,omitempty"` + // ExtendedInfo - Additional information on the job. + ExtendedInfo *MabJobExtendedInfo `json:"extendedInfo,omitempty"` + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' + JobType JobType `json:"jobType,omitempty"` } -// NextWithContext 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 *ProtectionContainerResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() +// MarshalJSON is the custom marshaler for MabJob. +func (mj MabJob) MarshalJSON() ([]byte, error) { + mj.JobType = JobTypeMabJob + objectMap := make(map[string]interface{}) + if mj.Duration != nil { + objectMap["duration"] = mj.Duration } - for { - next, err := page.fn(ctx, page.pcrl) - if err != nil { - return err - } - page.pcrl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } + if mj.ActionsInfo != nil { + objectMap["actionsInfo"] = mj.ActionsInfo } - return nil -} - -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *ProtectionContainerResourceListPage) Next() error { - return page.NextWithContext(context.Background()) + if mj.MabServerName != nil { + objectMap["mabServerName"] = mj.MabServerName + } + if mj.MabServerType != "" { + objectMap["mabServerType"] = mj.MabServerType + } + if mj.WorkloadType != "" { + objectMap["workloadType"] = mj.WorkloadType + } + if mj.ErrorDetails != nil { + objectMap["errorDetails"] = mj.ErrorDetails + } + if mj.ExtendedInfo != nil { + objectMap["extendedInfo"] = mj.ExtendedInfo + } + if mj.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = mj.EntityFriendlyName + } + if mj.BackupManagementType != "" { + objectMap["backupManagementType"] = mj.BackupManagementType + } + if mj.Operation != nil { + objectMap["operation"] = mj.Operation + } + if mj.Status != nil { + objectMap["status"] = mj.Status + } + if mj.StartTime != nil { + objectMap["startTime"] = mj.StartTime + } + if mj.EndTime != nil { + objectMap["endTime"] = mj.EndTime + } + if mj.ActivityID != nil { + objectMap["activityId"] = mj.ActivityID + } + if mj.JobType != "" { + objectMap["jobType"] = mj.JobType + } + return json.Marshal(objectMap) } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ProtectionContainerResourceListPage) NotDone() bool { - return !page.pcrl.IsEmpty() +// AsAzureIaaSVMJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (page ProtectionContainerResourceListPage) Response() ProtectionContainerResourceList { - return page.pcrl +// AsAzureStorageJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsAzureStorageJob() (*AzureStorageJob, bool) { + return nil, false } -// Values returns the slice of values for the current page or nil if there are no values. -func (page ProtectionContainerResourceListPage) Values() []ProtectionContainerResource { - if page.pcrl.IsEmpty() { - return nil - } - return *page.pcrl.Value +// AsAzureWorkloadJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { + return nil, false } -// Creates a new instance of the ProtectionContainerResourceListPage type. -func NewProtectionContainerResourceListPage(cur ProtectionContainerResourceList, getNextPage func(context.Context, ProtectionContainerResourceList) (ProtectionContainerResourceList, error)) ProtectionContainerResourceListPage { - return ProtectionContainerResourceListPage{ - fn: getNextPage, - pcrl: cur, - } +// AsDpmJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsDpmJob() (*DpmJob, bool) { + return nil, false } -// BasicProtectionIntent base class for backup ProtectionIntent. -type BasicProtectionIntent interface { - AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) - AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) - AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) - AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) - AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) - AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) - AsProtectionIntent() (*ProtectionIntent, bool) +// AsMabJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsMabJob() (*MabJob, bool) { + return &mj, true } -// ProtectionIntent base class for backup ProtectionIntent. -type ProtectionIntent struct { - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId - ItemID *string `json:"itemId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' - ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` +// AsJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsJob() (*Job, bool) { + return nil, false } -func unmarshalBasicProtectionIntent(body []byte) (BasicProtectionIntent, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["protectionIntentItemType"] { - case string(ProtectionIntentItemTypeRecoveryServiceVaultItem): - var arsvpi AzureRecoveryServiceVaultProtectionIntent - err := json.Unmarshal(body, &arsvpi) - return arsvpi, err - case string(ProtectionIntentItemTypeAzureResourceItem): - var arpi AzureResourceProtectionIntent - err := json.Unmarshal(body, &arpi) - return arpi, err - case string(ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent): - var awapi AzureWorkloadAutoProtectionIntent - err := json.Unmarshal(body, &awapi) - return awapi, err - case string(ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent): - var awsapi AzureWorkloadSQLAutoProtectionIntent - err := json.Unmarshal(body, &awsapi) - return awsapi, err - default: - var pi ProtectionIntent - err := json.Unmarshal(body, &pi) - return pi, err - } +// AsBasicJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsBasicJob() (BasicJob, bool) { + return &mj, true } -func unmarshalBasicProtectionIntentArray(body []byte) ([]BasicProtectionIntent, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - piArray := make([]BasicProtectionIntent, len(rawMessages)) - - for index, rawMessage := range rawMessages { - pi, err := unmarshalBasicProtectionIntent(*rawMessage) - if err != nil { - return nil, err - } - piArray[index] = pi - } - return piArray, nil +// MabJobExtendedInfo additional information for the MAB workload-specific job. +type MabJobExtendedInfo struct { + // TasksList - List of tasks for this job. + TasksList *[]MabJobTaskDetails `json:"tasksList,omitempty"` + // PropertyBag - The job properties. + PropertyBag map[string]*string `json:"propertyBag"` + // DynamicErrorMessage - Non localized error message specific to this job. + DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` } -// MarshalJSON is the custom marshaler for ProtectionIntent. -func (pi ProtectionIntent) MarshalJSON() ([]byte, error) { - pi.ProtectionIntentItemType = ProtectionIntentItemTypeProtectionIntent +// MarshalJSON is the custom marshaler for MabJobExtendedInfo. +func (mjei MabJobExtendedInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if pi.BackupManagementType != "" { - objectMap["backupManagementType"] = pi.BackupManagementType - } - if pi.SourceResourceID != nil { - objectMap["sourceResourceId"] = pi.SourceResourceID - } - if pi.ItemID != nil { - objectMap["itemId"] = pi.ItemID - } - if pi.PolicyID != nil { - objectMap["policyId"] = pi.PolicyID + if mjei.TasksList != nil { + objectMap["tasksList"] = mjei.TasksList } - if pi.ProtectionState != "" { - objectMap["protectionState"] = pi.ProtectionState + if mjei.PropertyBag != nil { + objectMap["propertyBag"] = mjei.PropertyBag } - if pi.ProtectionIntentItemType != "" { - objectMap["protectionIntentItemType"] = pi.ProtectionIntentItemType + if mjei.DynamicErrorMessage != nil { + objectMap["dynamicErrorMessage"] = mjei.DynamicErrorMessage } return json.Marshal(objectMap) } -// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { - return nil, false +// MabJobTaskDetails MAB workload-specific job task details. +type MabJobTaskDetails struct { + // TaskID - The task display name. + TaskID *string `json:"taskId,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // Duration - Time elapsed for task. + Duration *string `json:"duration,omitempty"` + // Status - The status. + Status *string `json:"status,omitempty"` } -// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { - return nil, false +// MabProtectionPolicy mab container-specific backup policy. +type MabProtectionPolicy struct { + // SchedulePolicy - Backup schedule of backup policy. + SchedulePolicy BasicSchedulePolicy `json:"schedulePolicy,omitempty"` + // RetentionPolicy - Retention policy details. + RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` } -// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { - return nil, false +// MarshalJSON is the custom marshaler for MabProtectionPolicy. +func (mpp MabProtectionPolicy) MarshalJSON() ([]byte, error) { + mpp.BackupManagementType = BackupManagementTypeMAB + objectMap := make(map[string]interface{}) + objectMap["schedulePolicy"] = mpp.SchedulePolicy + objectMap["retentionPolicy"] = mpp.RetentionPolicy + if mpp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = mpp.ProtectedItemsCount + } + if mpp.BackupManagementType != "" { + objectMap["backupManagementType"] = mpp.BackupManagementType + } + return json.Marshal(objectMap) } -// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { return nil, false } -// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { return nil, false } -// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { return nil, false } -// AsProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { - return &pi, true +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { + return nil, false } -// AsBasicProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { - return &pi, true +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { + return nil, false } -// 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"` +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { + return &mpp, true } -// ProtectionIntentResource base class for backup ProtectionIntent. -type ProtectionIntentResource struct { - autorest.Response `json:"-"` - // Properties - ProtectionIntentResource properties - Properties BasicProtectionIntent `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` +// AsProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for ProtectionIntentResource. -func (pir ProtectionIntentResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = pir.Properties - if pir.Location != nil { - objectMap["location"] = pir.Location - } - if pir.Tags != nil { - objectMap["tags"] = pir.Tags - } - if pir.ETag != nil { - objectMap["eTag"] = pir.ETag - } - return json.Marshal(objectMap) +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &mpp, true } -// UnmarshalJSON is the custom unmarshaler for ProtectionIntentResource struct. -func (pir *ProtectionIntentResource) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for MabProtectionPolicy struct. +func (mpp *MabProtectionPolicy) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -16096,412 +7186,211 @@ func (pir *ProtectionIntentResource) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicProtectionIntent(*v) - if err != nil { - return err - } - pir.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pir.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pir.Name = &name - } - case "type": + case "schedulePolicy": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) if err != nil { return err } - pir.Type = &typeVar + mpp.SchedulePolicy = schedulePolicy } - case "location": + case "retentionPolicy": if v != nil { - var location string - err = json.Unmarshal(*v, &location) + retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) if err != nil { return err } - pir.Location = &location + mpp.RetentionPolicy = retentionPolicy } - case "tags": + case "protectedItemsCount": if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) + var protectedItemsCount int32 + err = json.Unmarshal(*v, &protectedItemsCount) if err != nil { return err } - pir.Tags = tags + mpp.ProtectedItemsCount = &protectedItemsCount } - case "eTag": + case "backupManagementType": if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - pir.ETag = &eTag - } - } - } - - 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 -} - -// NextWithContext 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) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionIntentResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ProtectionIntentResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// 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] -} - -// Creates a new instance of the ProtectionIntentResourceListIterator type. -func NewProtectionIntentResourceListIterator(page ProtectionIntentResourceListPage) ProtectionIntentResourceListIterator { - return ProtectionIntentResourceListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (pirl ProtectionIntentResourceList) IsEmpty() bool { - return pirl.Value == nil || len(*pirl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (pirl ProtectionIntentResourceList) hasNextLink() bool { - return pirl.NextLink != nil && len(*pirl.NextLink) != 0 -} - -// protectionIntentResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (pirl ProtectionIntentResourceList) protectionIntentResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !pirl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(pirl.NextLink))) -} - -// ProtectionIntentResourceListPage contains a page of ProtectionIntentResource values. -type ProtectionIntentResourceListPage struct { - fn func(context.Context, ProtectionIntentResourceList) (ProtectionIntentResourceList, error) - pirl ProtectionIntentResourceList -} - -// NextWithContext 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) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionIntentResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode + var backupManagementType ManagementTypeBasicProtectionPolicy + err = json.Unmarshal(*v, &backupManagementType) + if err != nil { + return err + } + mpp.BackupManagementType = backupManagementType } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.pirl) - if err != nil { - return err - } - page.pirl = next - if !next.hasNextLink() || !next.IsEmpty() { - break } } + return nil } -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *ProtectionIntentResourceListPage) Next() error { - return page.NextWithContext(context.Background()) +// MonthlyRetentionSchedule monthly retention schedule. +type MonthlyRetentionSchedule struct { + // RetentionScheduleFormatType - Retention schedule format type for monthly retention policy. Possible values include: 'RetentionScheduleFormatInvalid', 'RetentionScheduleFormatDaily', 'RetentionScheduleFormatWeekly' + RetentionScheduleFormatType RetentionScheduleFormat `json:"retentionScheduleFormatType,omitempty"` + // RetentionScheduleDaily - Daily retention format for monthly retention policy. + RetentionScheduleDaily *DailyRetentionFormat `json:"retentionScheduleDaily,omitempty"` + // RetentionScheduleWeekly - Weekly retention format for monthly retention policy. + RetentionScheduleWeekly *WeeklyRetentionFormat `json:"retentionScheduleWeekly,omitempty"` + // RetentionTimes - Retention times of retention policy. + RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` + // RetentionDuration - Retention duration of retention Policy. + RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ProtectionIntentResourceListPage) NotDone() bool { - return !page.pirl.IsEmpty() +// OperationResultInfo operation result info. +type OperationResultInfo struct { + // JobList - List of jobs created by this operation. + JobList *[]string `json:"jobList,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeOperationResultInfoBase', 'ObjectTypeExportJobsOperationResultInfo', 'ObjectTypeOperationResultInfo' + ObjectType ObjectType `json:"objectType,omitempty"` } -// Response returns the raw server response from the last page request. -func (page ProtectionIntentResourceListPage) Response() ProtectionIntentResourceList { - return page.pirl +// MarshalJSON is the custom marshaler for OperationResultInfo. +func (ori OperationResultInfo) MarshalJSON() ([]byte, error) { + ori.ObjectType = ObjectTypeOperationResultInfo + objectMap := make(map[string]interface{}) + if ori.JobList != nil { + objectMap["jobList"] = ori.JobList + } + if ori.ObjectType != "" { + objectMap["objectType"] = ori.ObjectType + } + return json.Marshal(objectMap) } -// 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 +// AsExportJobsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfo. +func (ori OperationResultInfo) AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) { + return nil, false } -// Creates a new instance of the ProtectionIntentResourceListPage type. -func NewProtectionIntentResourceListPage(cur ProtectionIntentResourceList, getNextPage func(context.Context, ProtectionIntentResourceList) (ProtectionIntentResourceList, error)) ProtectionIntentResourceListPage { - return ProtectionIntentResourceListPage{ - fn: getNextPage, - pirl: cur, - } +// AsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfo. +func (ori OperationResultInfo) AsOperationResultInfo() (*OperationResultInfo, bool) { + return &ori, true } -// BasicProtectionPolicy base class for backup policy. Workload-specific backup policies are derived from this class. -type BasicProtectionPolicy interface { - AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) - AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) - AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) - AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) - AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) - AsMabProtectionPolicy() (*MabProtectionPolicy, bool) - AsProtectionPolicy() (*ProtectionPolicy, bool) +// AsOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfo. +func (ori OperationResultInfo) AsOperationResultInfoBase() (*OperationResultInfoBase, bool) { + return nil, false } -// ProtectionPolicy base class for backup policy. Workload-specific backup policies are derived from this -// class. -type ProtectionPolicy struct { - // ProtectedItemsCount - Number of items associated with this policy. - ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' - BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` +// AsBasicOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfo. +func (ori OperationResultInfo) AsBasicOperationResultInfoBase() (BasicOperationResultInfoBase, bool) { + return &ori, true } -func unmarshalBasicProtectionPolicy(body []byte) (BasicProtectionPolicy, error) { +// BasicOperationResultInfoBase base class for operation result info. +type BasicOperationResultInfoBase interface { + AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) + AsOperationResultInfo() (*OperationResultInfo, bool) + AsOperationResultInfoBase() (*OperationResultInfoBase, bool) +} + +// OperationResultInfoBase base class for operation result info. +type OperationResultInfoBase struct { + // ObjectType - Possible values include: 'ObjectTypeOperationResultInfoBase', 'ObjectTypeExportJobsOperationResultInfo', 'ObjectTypeOperationResultInfo' + ObjectType ObjectType `json:"objectType,omitempty"` +} + +func unmarshalBasicOperationResultInfoBase(body []byte) (BasicOperationResultInfoBase, error) { var m map[string]interface{} err := json.Unmarshal(body, &m) if err != nil { return nil, err } - switch m["backupManagementType"] { - case string(BackupManagementTypeAzureWorkload): - var avwpp AzureVMWorkloadProtectionPolicy - err := json.Unmarshal(body, &avwpp) - return avwpp, err - case string(BackupManagementTypeAzureStorage): - var afspp AzureFileShareProtectionPolicy - err := json.Unmarshal(body, &afspp) - return afspp, err - case string(BackupManagementTypeAzureIaasVM): - var aispp AzureIaaSVMProtectionPolicy - err := json.Unmarshal(body, &aispp) - return aispp, err - case string(BackupManagementTypeAzureSQL): - var aspp AzureSQLProtectionPolicy - err := json.Unmarshal(body, &aspp) - return aspp, err - case string(BackupManagementTypeGenericProtectionPolicy): - var gpp GenericProtectionPolicy - err := json.Unmarshal(body, &gpp) - return gpp, err - case string(BackupManagementTypeMAB): - var mpp MabProtectionPolicy - err := json.Unmarshal(body, &mpp) - return mpp, err + switch m["objectType"] { + case string(ObjectTypeExportJobsOperationResultInfo): + var ejori ExportJobsOperationResultInfo + err := json.Unmarshal(body, &ejori) + return ejori, err + case string(ObjectTypeOperationResultInfo): + var ori OperationResultInfo + err := json.Unmarshal(body, &ori) + return ori, err default: - var pp ProtectionPolicy - err := json.Unmarshal(body, &pp) - return pp, err + var orib OperationResultInfoBase + err := json.Unmarshal(body, &orib) + return orib, err } } -func unmarshalBasicProtectionPolicyArray(body []byte) ([]BasicProtectionPolicy, error) { +func unmarshalBasicOperationResultInfoBaseArray(body []byte) ([]BasicOperationResultInfoBase, error) { var rawMessages []*json.RawMessage err := json.Unmarshal(body, &rawMessages) if err != nil { return nil, err } - ppArray := make([]BasicProtectionPolicy, len(rawMessages)) + oribArray := make([]BasicOperationResultInfoBase, len(rawMessages)) for index, rawMessage := range rawMessages { - pp, err := unmarshalBasicProtectionPolicy(*rawMessage) + orib, err := unmarshalBasicOperationResultInfoBase(*rawMessage) if err != nil { return nil, err } - ppArray[index] = pp + oribArray[index] = orib } - return ppArray, nil + return oribArray, nil } -// MarshalJSON is the custom marshaler for ProtectionPolicy. -func (pp ProtectionPolicy) MarshalJSON() ([]byte, error) { - pp.BackupManagementType = BackupManagementTypeProtectionPolicy +// MarshalJSON is the custom marshaler for OperationResultInfoBase. +func (orib OperationResultInfoBase) MarshalJSON() ([]byte, error) { + orib.ObjectType = ObjectTypeOperationResultInfoBase objectMap := make(map[string]interface{}) - if pp.ProtectedItemsCount != nil { - objectMap["protectedItemsCount"] = pp.ProtectedItemsCount - } - if pp.BackupManagementType != "" { - objectMap["backupManagementType"] = pp.BackupManagementType + if orib.ObjectType != "" { + objectMap["objectType"] = orib.ObjectType } return json.Marshal(objectMap) } -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { - return nil, false -} - -// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { - return nil, false -} - -// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { - return nil, false -} - -// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { +// AsExportJobsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. +func (orib OperationResultInfoBase) AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) { return nil, false } -// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { +// AsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. +func (orib OperationResultInfoBase) AsOperationResultInfo() (*OperationResultInfo, bool) { return nil, false } -// AsProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { - return &pp, true -} - -// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { - return &pp, true +// AsOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. +func (orib OperationResultInfoBase) AsOperationResultInfoBase() (*OperationResultInfoBase, bool) { + return &orib, true } -// ProtectionPolicyQueryObject filters the list backup policies API. -type ProtectionPolicyQueryObject struct { - // BackupManagementType - Backup management type for the backup policy. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // FabricName - Fabric name for filter - FabricName *string `json:"fabricName,omitempty"` - // WorkloadType - Workload type for the backup policy. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` +// AsBasicOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. +func (orib OperationResultInfoBase) AsBasicOperationResultInfoBase() (BasicOperationResultInfoBase, bool) { + return &orib, true } -// ProtectionPolicyResource base class for backup policy. Workload-specific backup policies are derived -// from this class. -type ProtectionPolicyResource struct { +// OperationResultInfoBaseResource base class for operation result info. +type OperationResultInfoBaseResource struct { autorest.Response `json:"-"` - // Properties - ProtectionPolicyResource properties - Properties BasicProtectionPolicy `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` + // Operation - OperationResultInfoBaseResource operation + Operation BasicOperationResultInfoBase `json:"operation,omitempty"` + // StatusCode - 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' + StatusCode HTTPStatusCode `json:"statusCode,omitempty"` + // Headers - HTTP headers associated with this operation. + Headers map[string][]string `json:"headers"` } -// MarshalJSON is the custom marshaler for ProtectionPolicyResource. -func (ppr ProtectionPolicyResource) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for OperationResultInfoBaseResource. +func (oribr OperationResultInfoBaseResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["properties"] = ppr.Properties - if ppr.Location != nil { - objectMap["location"] = ppr.Location - } - if ppr.Tags != nil { - objectMap["tags"] = ppr.Tags + objectMap["operation"] = oribr.Operation + if oribr.StatusCode != "" { + objectMap["statusCode"] = oribr.StatusCode } - if ppr.ETag != nil { - objectMap["eTag"] = ppr.ETag + if oribr.Headers != nil { + objectMap["headers"] = oribr.Headers } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ProtectionPolicyResource struct. -func (ppr *ProtectionPolicyResource) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for OperationResultInfoBaseResource struct. +func (oribr *OperationResultInfoBaseResource) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -16509,67 +7398,31 @@ func (ppr *ProtectionPolicyResource) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicProtectionPolicy(*v) - if err != nil { - return err - } - ppr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ppr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ppr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ppr.Type = &typeVar - } - case "location": + case "operation": if v != nil { - var location string - err = json.Unmarshal(*v, &location) + operation, err := unmarshalBasicOperationResultInfoBase(*v) if err != nil { return err } - ppr.Location = &location + oribr.Operation = operation } - case "tags": + case "statusCode": if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) + var statusCode HTTPStatusCode + err = json.Unmarshal(*v, &statusCode) if err != nil { return err } - ppr.Tags = tags + oribr.StatusCode = statusCode } - case "eTag": + case "headers": if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) + var headers map[string][]string + err = json.Unmarshal(*v, &headers) if err != nil { return err } - ppr.ETag = &eTag + oribr.Headers = headers } } } @@ -16577,356 +7430,322 @@ func (ppr *ProtectionPolicyResource) UnmarshalJSON(body []byte) error { return nil } -// ProtectionPolicyResourceList list of ProtectionPolicy resources -type ProtectionPolicyResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]ProtectionPolicyResource `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"` -} - -// ProtectionPolicyResourceListIterator provides access to a complete listing of ProtectionPolicyResource -// values. -type ProtectionPolicyResourceListIterator struct { - i int - page ProtectionPolicyResourceListPage -} - -// NextWithContext 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 *ProtectionPolicyResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionPolicyResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ProtectionPolicyResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ProtectionPolicyResourceListIterator) 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 ProtectionPolicyResourceListIterator) Response() ProtectionPolicyResourceList { - 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 ProtectionPolicyResourceListIterator) Value() ProtectionPolicyResource { - if !iter.page.NotDone() { - return ProtectionPolicyResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ProtectionPolicyResourceListIterator type. -func NewProtectionPolicyResourceListIterator(page ProtectionPolicyResourceListPage) ProtectionPolicyResourceListIterator { - return ProtectionPolicyResourceListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (pprl ProtectionPolicyResourceList) IsEmpty() bool { - return pprl.Value == nil || len(*pprl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (pprl ProtectionPolicyResourceList) hasNextLink() bool { - return pprl.NextLink != nil && len(*pprl.NextLink) != 0 -} - -// protectionPolicyResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (pprl ProtectionPolicyResourceList) protectionPolicyResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !pprl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(pprl.NextLink))) -} - -// ProtectionPolicyResourceListPage contains a page of ProtectionPolicyResource values. -type ProtectionPolicyResourceListPage struct { - fn func(context.Context, ProtectionPolicyResourceList) (ProtectionPolicyResourceList, error) - pprl ProtectionPolicyResourceList -} - -// NextWithContext 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 *ProtectionPolicyResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionPolicyResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.pprl) - if err != nil { - return err - } - page.pprl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *ProtectionPolicyResourceListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ProtectionPolicyResourceListPage) NotDone() bool { - return !page.pprl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ProtectionPolicyResourceListPage) Response() ProtectionPolicyResourceList { - return page.pprl +// OperationWorkerResponse this is the base class for operation result responses. +type OperationWorkerResponse struct { + // StatusCode - 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' + StatusCode HTTPStatusCode `json:"statusCode,omitempty"` + // Headers - HTTP headers associated with this operation. + Headers map[string][]string `json:"headers"` } -// Values returns the slice of values for the current page or nil if there are no values. -func (page ProtectionPolicyResourceListPage) Values() []ProtectionPolicyResource { - if page.pprl.IsEmpty() { - return nil +// MarshalJSON is the custom marshaler for OperationWorkerResponse. +func (owr OperationWorkerResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if owr.StatusCode != "" { + objectMap["statusCode"] = owr.StatusCode } - return *page.pprl.Value -} - -// Creates a new instance of the ProtectionPolicyResourceListPage type. -func NewProtectionPolicyResourceListPage(cur ProtectionPolicyResourceList, getNextPage func(context.Context, ProtectionPolicyResourceList) (ProtectionPolicyResourceList, error)) ProtectionPolicyResourceListPage { - return ProtectionPolicyResourceListPage{ - fn: getNextPage, - pprl: cur, + if owr.Headers != nil { + objectMap["headers"] = owr.Headers } + return json.Marshal(objectMap) } -// BasicRecoveryPoint base class for backup copies. Workload-specific backup copies are derived from this class. -type BasicRecoveryPoint interface { - AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) - AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) - AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) - AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) - AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) - AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) - AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) - AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) - AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) - AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) - AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) - AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) - AsRecoveryPoint() (*RecoveryPoint, bool) +// PointInTimeRange provides details for log ranges +type PointInTimeRange struct { + // StartTime - Start time of the time range for log recovery. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - End time of the time range for log recovery. + EndTime *date.Time `json:"endTime,omitempty"` } -// RecoveryPoint base class for backup copies. Workload-specific backup copies are derived from this class. -type RecoveryPoint struct { - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +// BasicProtectedItem base class for backup items. +type BasicProtectedItem interface { + AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) + AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) + AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) + AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) + AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) + AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) + AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) + AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) + AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) + AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) + AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) + AsDPMProtectedItem() (*DPMProtectedItem, bool) + AsGenericProtectedItem() (*GenericProtectedItem, bool) + AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) + AsProtectedItem() (*ProtectedItem, bool) } -func unmarshalBasicRecoveryPoint(body []byte) (BasicRecoveryPoint, error) { +// ProtectedItem base class for backup items. +type ProtectedItem struct { + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +func unmarshalBasicProtectedItem(body []byte) (BasicProtectedItem, error) { var m map[string]interface{} err := json.Unmarshal(body, &m) if err != nil { return nil, err } - switch m["objectType"] { - case string(ObjectTypeAzureFileShareRecoveryPoint): - var afsrp AzureFileShareRecoveryPoint - err := json.Unmarshal(body, &afsrp) - return afsrp, err - case string(ObjectTypeAzureWorkloadPointInTimeRecoveryPoint): - var awpitrp AzureWorkloadPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awpitrp) - return awpitrp, err - case string(ObjectTypeAzureWorkloadRecoveryPoint): - var awrp AzureWorkloadRecoveryPoint - err := json.Unmarshal(body, &awrp) - return awrp, err - case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): - var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awshpitrp) - return awshpitrp, err - case string(ObjectTypeAzureWorkloadSAPHanaRecoveryPoint): - var awshrp AzureWorkloadSAPHanaRecoveryPoint - err := json.Unmarshal(body, &awshrp) - return awshrp, err - case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): - var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awspitrp) - return awspitrp, err - case string(ObjectTypeAzureWorkloadSQLRecoveryPoint): - var awsrp AzureWorkloadSQLRecoveryPoint - err := json.Unmarshal(body, &awsrp) - return awsrp, err - case string(ObjectTypeGenericRecoveryPoint): - var grp GenericRecoveryPoint - err := json.Unmarshal(body, &grp) - return grp, err - case string(ObjectTypeIaasVMRecoveryPoint): - var ivrp IaasVMRecoveryPoint - err := json.Unmarshal(body, &ivrp) - return ivrp, err + switch m["protectedItemType"] { + case string(ProtectedItemTypeAzureFileShareProtectedItem): + var afpi AzureFileshareProtectedItem + err := json.Unmarshal(body, &afpi) + return afpi, err + case string(ProtectedItemTypeMicrosoftClassicComputevirtualMachines): + var aisccvpi AzureIaaSClassicComputeVMProtectedItem + err := json.Unmarshal(body, &aisccvpi) + return aisccvpi, err + case string(ProtectedItemTypeMicrosoftComputevirtualMachines): + var aiscvpi AzureIaaSComputeVMProtectedItem + err := json.Unmarshal(body, &aiscvpi) + return aiscvpi, err + case string(ProtectedItemTypeAzureIaaSVMProtectedItem): + var aispi AzureIaaSVMProtectedItem + err := json.Unmarshal(body, &aispi) + return aispi, err + case string(ProtectedItemTypeMicrosoftSqlserversdatabases): + var aspi AzureSQLProtectedItem + err := json.Unmarshal(body, &aspi) + return aspi, err + case string(ProtectedItemTypeAzureVMWorkloadProtectedItem): + var avwpi AzureVMWorkloadProtectedItem + err := json.Unmarshal(body, &avwpi) + return avwpi, err + case string(ProtectedItemTypeAzureVMWorkloadSAPAseDatabase): + var avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem + err := json.Unmarshal(body, &avwsadpi) + return avwsadpi, err + case string(ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase): + var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem + err := json.Unmarshal(body, &avwshdpi) + return avwshdpi, err + case string(ProtectedItemTypeAzureVMWorkloadSQLDatabase): + var avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem + err := json.Unmarshal(body, &avwsdpi) + return avwsdpi, err + case string(ProtectedItemTypeDPMProtectedItem): + var dpi DPMProtectedItem + err := json.Unmarshal(body, &dpi) + return dpi, err + case string(ProtectedItemTypeGenericProtectedItem): + var gpi GenericProtectedItem + err := json.Unmarshal(body, &gpi) + return gpi, err + case string(ProtectedItemTypeMabFileFolderProtectedItem): + var mffpi MabFileFolderProtectedItem + err := json.Unmarshal(body, &mffpi) + return mffpi, err default: - var rp RecoveryPoint - err := json.Unmarshal(body, &rp) - return rp, err + var pi ProtectedItem + err := json.Unmarshal(body, &pi) + return pi, err } } -func unmarshalBasicRecoveryPointArray(body []byte) ([]BasicRecoveryPoint, error) { +func unmarshalBasicProtectedItemArray(body []byte) ([]BasicProtectedItem, error) { var rawMessages []*json.RawMessage err := json.Unmarshal(body, &rawMessages) if err != nil { return nil, err } - rpArray := make([]BasicRecoveryPoint, len(rawMessages)) + piArray := make([]BasicProtectedItem, len(rawMessages)) for index, rawMessage := range rawMessages { - rp, err := unmarshalBasicRecoveryPoint(*rawMessage) + pi, err := unmarshalBasicProtectedItem(*rawMessage) if err != nil { return nil, err } - rpArray[index] = rp + piArray[index] = pi } - return rpArray, nil + return piArray, nil } -// MarshalJSON is the custom marshaler for RecoveryPoint. -func (rp RecoveryPoint) MarshalJSON() ([]byte, error) { - rp.ObjectType = ObjectTypeRecoveryPoint +// MarshalJSON is the custom marshaler for ProtectedItem. +func (pi ProtectedItem) MarshalJSON() ([]byte, error) { + pi.ProtectedItemType = ProtectedItemTypeProtectedItem objectMap := make(map[string]interface{}) - if rp.ObjectType != "" { - objectMap["objectType"] = rp.ObjectType + if pi.BackupManagementType != "" { + objectMap["backupManagementType"] = pi.BackupManagementType + } + if pi.WorkloadType != "" { + objectMap["workloadType"] = pi.WorkloadType + } + if pi.ContainerName != nil { + objectMap["containerName"] = pi.ContainerName + } + if pi.SourceResourceID != nil { + objectMap["sourceResourceId"] = pi.SourceResourceID + } + if pi.PolicyID != nil { + objectMap["policyId"] = pi.PolicyID + } + if pi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = pi.LastRecoveryPoint + } + if pi.BackupSetName != nil { + objectMap["backupSetName"] = pi.BackupSetName + } + if pi.CreateMode != "" { + objectMap["createMode"] = pi.CreateMode + } + if pi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = pi.DeferredDeleteTimeInUTC + } + if pi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = pi.IsScheduledForDeferredDelete + } + if pi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = pi.DeferredDeleteTimeRemaining + } + if pi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = pi.IsDeferredDeleteScheduleUpcoming + } + if pi.IsRehydrate != nil { + objectMap["isRehydrate"] = pi.IsRehydrate + } + if pi.ProtectedItemType != "" { + objectMap["protectedItemType"] = pi.ProtectedItemType } return json.Marshal(objectMap) } -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { return nil, false } -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { return nil, false } -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { return nil, false } -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { return nil, false } -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { return nil, false } -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { return nil, false } -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { return nil, false } -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { return nil, false } -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { return nil, false } -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { return nil, false } -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { +// AsGenericProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { return nil, false } -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { return nil, false } -// AsRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return &rp, true +// AsProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return &pi, true } -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &rp, true +// AsBasicProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &pi, true } -// RecoveryPointDiskConfiguration disk configuration -type RecoveryPointDiskConfiguration struct { - // NumberOfDisksIncludedInBackup - Number of disks included in backup - NumberOfDisksIncludedInBackup *int32 `json:"numberOfDisksIncludedInBackup,omitempty"` - // NumberOfDisksAttachedToVM - Number of disks attached to the VM - NumberOfDisksAttachedToVM *int32 `json:"numberOfDisksAttachedToVm,omitempty"` - // IncludedDiskList - Information of disks included in backup - IncludedDiskList *[]DiskInformation `json:"includedDiskList,omitempty"` - // ExcludedDiskList - Information of disks excluded from backup - ExcludedDiskList *[]DiskInformation `json:"excludedDiskList,omitempty"` +// ProtectedItemQueryObject filters to list backup items. +type ProtectedItemQueryObject struct { + // HealthState - Health State for the backed up item. Possible values include: 'HealthStatePassed', 'HealthStateActionRequired', 'HealthStateActionSuggested', 'HealthStateInvalid' + HealthState HealthState `json:"healthState,omitempty"` + // 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: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + ItemType DataSourceType `json:"itemType,omitempty"` + // PolicyName - Backup policy name associated with the backup item. + PolicyName *string `json:"policyName,omitempty"` + // ContainerName - Name of the container. + ContainerName *string `json:"containerName,omitempty"` + // BackupEngineName - Backup Engine name + BackupEngineName *string `json:"backupEngineName,omitempty"` + // FriendlyName - Friendly name of protected item + FriendlyName *string `json:"friendlyName,omitempty"` + // FabricName - Name of the fabric. + FabricName *string `json:"fabricName,omitempty"` + // BackupSetName - Name of the backup set. + BackupSetName *string `json:"backupSetName,omitempty"` } -// RecoveryPointResource base class for backup copies. Workload-specific backup copies are derived from -// this class. -type RecoveryPointResource struct { +// ProtectedItemResource base class for backup items. +type ProtectedItemResource struct { autorest.Response `json:"-"` - // Properties - RecoveryPointResource properties - Properties BasicRecoveryPoint `json:"properties,omitempty"` + // Properties - ProtectedItemResource properties + Properties BasicProtectedItem `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id represents the complete path to the resource. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name associated with the resource. @@ -16941,24 +7760,24 @@ type RecoveryPointResource struct { ETag *string `json:"eTag,omitempty"` } -// MarshalJSON is the custom marshaler for RecoveryPointResource. -func (rpr RecoveryPointResource) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ProtectedItemResource. +func (pir ProtectedItemResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["properties"] = rpr.Properties - if rpr.Location != nil { - objectMap["location"] = rpr.Location + objectMap["properties"] = pir.Properties + if pir.Location != nil { + objectMap["location"] = pir.Location } - if rpr.Tags != nil { - objectMap["tags"] = rpr.Tags + if pir.Tags != nil { + objectMap["tags"] = pir.Tags } - if rpr.ETag != nil { - objectMap["eTag"] = rpr.ETag + if pir.ETag != nil { + objectMap["eTag"] = pir.ETag } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for RecoveryPointResource struct. -func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ProtectedItemResource struct. +func (pir *ProtectedItemResource) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -16968,11 +7787,11 @@ func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - properties, err := unmarshalBasicRecoveryPoint(*v) + properties, err := unmarshalBasicProtectedItem(*v) if err != nil { return err } - rpr.Properties = properties + pir.Properties = properties } case "id": if v != nil { @@ -16981,7 +7800,7 @@ func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rpr.ID = &ID + pir.ID = &ID } case "name": if v != nil { @@ -16990,7 +7809,7 @@ func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rpr.Name = &name + pir.Name = &name } case "type": if v != nil { @@ -16999,7 +7818,7 @@ func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rpr.Type = &typeVar + pir.Type = &typeVar } case "location": if v != nil { @@ -17008,7 +7827,7 @@ func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rpr.Location = &location + pir.Location = &location } case "tags": if v != nil { @@ -17017,7 +7836,7 @@ func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rpr.Tags = tags + pir.Tags = tags } case "eTag": if v != nil { @@ -17026,7 +7845,7 @@ func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rpr.ETag = &eTag + pir.ETag = &eTag } } } @@ -17034,26 +7853,26 @@ func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { return nil } -// RecoveryPointResourceList list of RecoveryPoint resources -type RecoveryPointResourceList struct { +// ProtectedItemResourceList list of ProtectedItem resources +type ProtectedItemResourceList struct { autorest.Response `json:"-"` // Value - List of resources. - Value *[]RecoveryPointResource `json:"value,omitempty"` + Value *[]ProtectedItemResource `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"` } -// RecoveryPointResourceListIterator provides access to a complete listing of RecoveryPointResource values. -type RecoveryPointResourceListIterator struct { +// ProtectedItemResourceListIterator provides access to a complete listing of ProtectedItemResource values. +type ProtectedItemResourceListIterator struct { i int - page RecoveryPointResourceListPage + page ProtectedItemResourceListPage } // NextWithContext 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 *RecoveryPointResourceListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *ProtectedItemResourceListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointResourceListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemResourceListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -17078,67 +7897,67 @@ func (iter *RecoveryPointResourceListIterator) NextWithContext(ctx context.Conte // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *RecoveryPointResourceListIterator) Next() error { +func (iter *ProtectedItemResourceListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RecoveryPointResourceListIterator) NotDone() bool { +func (iter ProtectedItemResourceListIterator) 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 RecoveryPointResourceListIterator) Response() RecoveryPointResourceList { +func (iter ProtectedItemResourceListIterator) Response() ProtectedItemResourceList { 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 RecoveryPointResourceListIterator) Value() RecoveryPointResource { +func (iter ProtectedItemResourceListIterator) Value() ProtectedItemResource { if !iter.page.NotDone() { - return RecoveryPointResource{} + return ProtectedItemResource{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the RecoveryPointResourceListIterator type. -func NewRecoveryPointResourceListIterator(page RecoveryPointResourceListPage) RecoveryPointResourceListIterator { - return RecoveryPointResourceListIterator{page: page} +// Creates a new instance of the ProtectedItemResourceListIterator type. +func NewProtectedItemResourceListIterator(page ProtectedItemResourceListPage) ProtectedItemResourceListIterator { + return ProtectedItemResourceListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (rprl RecoveryPointResourceList) IsEmpty() bool { - return rprl.Value == nil || len(*rprl.Value) == 0 +func (pirl ProtectedItemResourceList) IsEmpty() bool { + return pirl.Value == nil || len(*pirl.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (rprl RecoveryPointResourceList) hasNextLink() bool { - return rprl.NextLink != nil && len(*rprl.NextLink) != 0 +func (pirl ProtectedItemResourceList) hasNextLink() bool { + return pirl.NextLink != nil && len(*pirl.NextLink) != 0 } -// recoveryPointResourceListPreparer prepares a request to retrieve the next set of results. +// protectedItemResourceListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (rprl RecoveryPointResourceList) recoveryPointResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !rprl.hasNextLink() { +func (pirl ProtectedItemResourceList) protectedItemResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !pirl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(rprl.NextLink))) + autorest.WithBaseURL(to.String(pirl.NextLink))) } -// RecoveryPointResourceListPage contains a page of RecoveryPointResource values. -type RecoveryPointResourceListPage struct { - fn func(context.Context, RecoveryPointResourceList) (RecoveryPointResourceList, error) - rprl RecoveryPointResourceList +// ProtectedItemResourceListPage contains a page of ProtectedItemResource values. +type ProtectedItemResourceListPage struct { + fn func(context.Context, ProtectedItemResourceList) (ProtectedItemResourceList, error) + pirl ProtectedItemResourceList } // NextWithContext 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 *RecoveryPointResourceListPage) NextWithContext(ctx context.Context) (err error) { +func (page *ProtectedItemResourceListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointResourceListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemResourceListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -17148,11 +7967,11 @@ func (page *RecoveryPointResourceListPage) NextWithContext(ctx context.Context) }() } for { - next, err := page.fn(ctx, page.rprl) + next, err := page.fn(ctx, page.pirl) if err != nil { return err } - page.rprl = next + page.pirl = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -17163,143 +7982,182 @@ func (page *RecoveryPointResourceListPage) NextWithContext(ctx context.Context) // 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. // Deprecated: Use NextWithContext() instead. -func (page *RecoveryPointResourceListPage) Next() error { +func (page *ProtectedItemResourceListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RecoveryPointResourceListPage) NotDone() bool { - return !page.rprl.IsEmpty() +func (page ProtectedItemResourceListPage) NotDone() bool { + return !page.pirl.IsEmpty() } // Response returns the raw server response from the last page request. -func (page RecoveryPointResourceListPage) Response() RecoveryPointResourceList { - return page.rprl +func (page ProtectedItemResourceListPage) Response() ProtectedItemResourceList { + return page.pirl } // Values returns the slice of values for the current page or nil if there are no values. -func (page RecoveryPointResourceListPage) Values() []RecoveryPointResource { - if page.rprl.IsEmpty() { +func (page ProtectedItemResourceListPage) Values() []ProtectedItemResource { + if page.pirl.IsEmpty() { return nil } - return *page.rprl.Value + return *page.pirl.Value } -// Creates a new instance of the RecoveryPointResourceListPage type. -func NewRecoveryPointResourceListPage(cur RecoveryPointResourceList, getNextPage func(context.Context, RecoveryPointResourceList) (RecoveryPointResourceList, error)) RecoveryPointResourceListPage { - return RecoveryPointResourceListPage{ +// Creates a new instance of the ProtectedItemResourceListPage type. +func NewProtectedItemResourceListPage(cur ProtectedItemResourceList, getNextPage func(context.Context, ProtectedItemResourceList) (ProtectedItemResourceList, error)) ProtectedItemResourceListPage { + return ProtectedItemResourceListPage{ fn: getNextPage, - rprl: cur, + pirl: cur, } } -// RecoveryPointTierInformation recovery point tier information. -type RecoveryPointTierInformation struct { - // Type - Recovery point tier type. Possible values include: 'RecoveryPointTierTypeInvalid', 'RecoveryPointTierTypeInstantRP', 'RecoveryPointTierTypeHardenedRP' - Type RecoveryPointTierType `json:"type,omitempty"` - // Status - Recovery point tier status. Possible values include: 'RecoveryPointTierStatusInvalid', 'RecoveryPointTierStatusValid', 'RecoveryPointTierStatusDisabled', 'RecoveryPointTierStatusDeleted' - Status RecoveryPointTierStatus `json:"status,omitempty"` -} - -// BasicRequest base class for backup request. Workload-specific backup requests are derived from this class. -type BasicRequest interface { - AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) - AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) - AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) - AsRequest() (*Request, bool) +// BasicProtectionPolicy base class for backup policy. Workload-specific backup policies are derived from this class. +type BasicProtectionPolicy interface { + AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) + AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) + AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) + AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) + AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) + AsMabProtectionPolicy() (*MabProtectionPolicy, bool) + AsProtectionPolicy() (*ProtectionPolicy, bool) } -// Request base class for backup request. Workload-specific backup requests are derived from this class. -type Request struct { - // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' - ObjectType ObjectTypeBasicRequest `json:"objectType,omitempty"` +// ProtectionPolicy base class for backup policy. Workload-specific backup policies are derived from this +// class. +type ProtectionPolicy struct { + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` } -func unmarshalBasicRequest(body []byte) (BasicRequest, error) { +func unmarshalBasicProtectionPolicy(body []byte) (BasicProtectionPolicy, error) { var m map[string]interface{} err := json.Unmarshal(body, &m) if err != nil { return nil, err } - switch m["objectType"] { - case string(ObjectTypeAzureFileShareBackupRequest): - var afsbr AzureFileShareBackupRequest - err := json.Unmarshal(body, &afsbr) - return afsbr, err - case string(ObjectTypeAzureWorkloadBackupRequest): - var awbr AzureWorkloadBackupRequest - err := json.Unmarshal(body, &awbr) - return awbr, err - case string(ObjectTypeIaasVMBackupRequest): - var ivbr IaasVMBackupRequest - err := json.Unmarshal(body, &ivbr) - return ivbr, err + switch m["backupManagementType"] { + case string(BackupManagementTypeAzureWorkload): + var avwpp AzureVMWorkloadProtectionPolicy + err := json.Unmarshal(body, &avwpp) + return avwpp, err + case string(BackupManagementTypeAzureStorage): + var afspp AzureFileShareProtectionPolicy + err := json.Unmarshal(body, &afspp) + return afspp, err + case string(BackupManagementTypeAzureIaasVM): + var aispp AzureIaaSVMProtectionPolicy + err := json.Unmarshal(body, &aispp) + return aispp, err + case string(BackupManagementTypeAzureSQL): + var aspp AzureSQLProtectionPolicy + err := json.Unmarshal(body, &aspp) + return aspp, err + case string(BackupManagementTypeGenericProtectionPolicy): + var gpp GenericProtectionPolicy + err := json.Unmarshal(body, &gpp) + return gpp, err + case string(BackupManagementTypeMAB): + var mpp MabProtectionPolicy + err := json.Unmarshal(body, &mpp) + return mpp, err default: - var r Request - err := json.Unmarshal(body, &r) - return r, err + var pp ProtectionPolicy + err := json.Unmarshal(body, &pp) + return pp, err } } -func unmarshalBasicRequestArray(body []byte) ([]BasicRequest, error) { +func unmarshalBasicProtectionPolicyArray(body []byte) ([]BasicProtectionPolicy, error) { var rawMessages []*json.RawMessage err := json.Unmarshal(body, &rawMessages) if err != nil { return nil, err } - rArray := make([]BasicRequest, len(rawMessages)) + ppArray := make([]BasicProtectionPolicy, len(rawMessages)) for index, rawMessage := range rawMessages { - r, err := unmarshalBasicRequest(*rawMessage) + pp, err := unmarshalBasicProtectionPolicy(*rawMessage) if err != nil { return nil, err } - rArray[index] = r + ppArray[index] = pp + } + return ppArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectionPolicy. +func (pp ProtectionPolicy) MarshalJSON() ([]byte, error) { + pp.BackupManagementType = BackupManagementTypeProtectionPolicy + objectMap := make(map[string]interface{}) + if pp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = pp.ProtectedItemsCount + } + if pp.BackupManagementType != "" { + objectMap["backupManagementType"] = pp.BackupManagementType } - return rArray, nil + return json.Marshal(objectMap) } -// MarshalJSON is the custom marshaler for Request. -func (r Request) MarshalJSON() ([]byte, error) { - r.ObjectType = ObjectTypeBackupRequest - objectMap := make(map[string]interface{}) - if r.ObjectType != "" { - objectMap["objectType"] = r.ObjectType - } - return json.Marshal(objectMap) +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return nil, false +} + +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { + return nil, false } -// AsAzureFileShareBackupRequest is the BasicRequest implementation for Request. -func (r Request) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { return nil, false } -// AsAzureWorkloadBackupRequest is the BasicRequest implementation for Request. -func (r Request) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { return nil, false } -// AsIaasVMBackupRequest is the BasicRequest implementation for Request. -func (r Request) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { return nil, false } -// AsRequest is the BasicRequest implementation for Request. -func (r Request) AsRequest() (*Request, bool) { - return &r, true +// AsProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { + return &pp, true } -// AsBasicRequest is the BasicRequest implementation for Request. -func (r Request) AsBasicRequest() (BasicRequest, bool) { - return &r, true +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &pp, true } -// RequestResource base class for backup request. Workload-specific backup requests are derived from this -// class. -type RequestResource struct { - // Properties - BackupRequestResource properties - Properties BasicRequest `json:"properties,omitempty"` +// ProtectionPolicyQueryObject filters the list backup policies API. +type ProtectionPolicyQueryObject struct { + // BackupManagementType - Backup management type for the backup policy. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // FabricName - Fabric name for filter + FabricName *string `json:"fabricName,omitempty"` + // WorkloadType - Workload type for the backup policy. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` +} + +// ProtectionPolicyResource base class for backup policy. Workload-specific backup policies are derived +// from this class. +type ProtectionPolicyResource struct { + autorest.Response `json:"-"` + // Properties - ProtectionPolicyResource properties + Properties BasicProtectionPolicy `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id represents the complete path to the resource. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name associated with the resource. @@ -17314,24 +8172,24 @@ type RequestResource struct { ETag *string `json:"eTag,omitempty"` } -// MarshalJSON is the custom marshaler for RequestResource. -func (rr RequestResource) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ProtectionPolicyResource. +func (ppr ProtectionPolicyResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["properties"] = rr.Properties - if rr.Location != nil { - objectMap["location"] = rr.Location + objectMap["properties"] = ppr.Properties + if ppr.Location != nil { + objectMap["location"] = ppr.Location } - if rr.Tags != nil { - objectMap["tags"] = rr.Tags + if ppr.Tags != nil { + objectMap["tags"] = ppr.Tags } - if rr.ETag != nil { - objectMap["eTag"] = rr.ETag + if ppr.ETag != nil { + objectMap["eTag"] = ppr.ETag } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for RequestResource struct. -func (rr *RequestResource) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ProtectionPolicyResource struct. +func (ppr *ProtectionPolicyResource) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -17341,11 +8199,11 @@ func (rr *RequestResource) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - properties, err := unmarshalBasicRequest(*v) + properties, err := unmarshalBasicProtectionPolicy(*v) if err != nil { return err } - rr.Properties = properties + ppr.Properties = properties } case "id": if v != nil { @@ -17354,7 +8212,7 @@ func (rr *RequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rr.ID = &ID + ppr.ID = &ID } case "name": if v != nil { @@ -17363,7 +8221,7 @@ func (rr *RequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rr.Name = &name + ppr.Name = &name } case "type": if v != nil { @@ -17372,7 +8230,7 @@ func (rr *RequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rr.Type = &typeVar + ppr.Type = &typeVar } case "location": if v != nil { @@ -17381,7 +8239,7 @@ func (rr *RequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rr.Location = &location + ppr.Location = &location } case "tags": if v != nil { @@ -17390,7 +8248,7 @@ func (rr *RequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rr.Tags = tags + ppr.Tags = tags } case "eTag": if v != nil { @@ -17399,7 +8257,7 @@ func (rr *RequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rr.ETag = &eTag + ppr.ETag = &eTag } } } @@ -17407,175 +8265,190 @@ func (rr *RequestResource) UnmarshalJSON(body []byte) error { return nil } -// Resource ARM Resource. -type Resource struct { - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` +// ProtectionPolicyResourceList list of ProtectionPolicy resources +type ProtectionPolicyResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]ProtectionPolicyResource `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"` } -// MarshalJSON is the custom marshaler for Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if r.Location != nil { - objectMap["location"] = r.Location +// ProtectionPolicyResourceListIterator provides access to a complete listing of ProtectionPolicyResource +// values. +type ProtectionPolicyResourceListIterator struct { + i int + page ProtectionPolicyResourceListPage +} + +// NextWithContext 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 *ProtectionPolicyResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionPolicyResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } - if r.Tags != nil { - objectMap["tags"] = r.Tags + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil } - if r.ETag != nil { - objectMap["eTag"] = r.ETag + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err } - return json.Marshal(objectMap) + iter.i = 0 + return nil } -// ResourceConfig the resource storage details. -type ResourceConfig struct { - // StorageModelType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant' - StorageModelType StorageType `json:"storageModelType,omitempty"` - // StorageType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant' - StorageType StorageType `json:"storageType,omitempty"` - // StorageTypeState - Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. Possible values include: 'StorageTypeStateInvalid', 'StorageTypeStateLocked', 'StorageTypeStateUnlocked' - StorageTypeState StorageTypeState `json:"storageTypeState,omitempty"` +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectionPolicyResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) } -// ResourceConfigResource the resource storage details. -type ResourceConfigResource struct { - autorest.Response `json:"-"` - // Properties - BackupResourceConfigResource properties - Properties *ResourceConfig `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectionPolicyResourceListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) } -// MarshalJSON is the custom marshaler for ResourceConfigResource. -func (rcr ResourceConfigResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rcr.Properties != nil { - objectMap["properties"] = rcr.Properties - } - if rcr.Location != nil { - objectMap["location"] = rcr.Location - } - if rcr.Tags != nil { - objectMap["tags"] = rcr.Tags +// Response returns the raw server response from the last page request. +func (iter ProtectionPolicyResourceListIterator) Response() ProtectionPolicyResourceList { + 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 ProtectionPolicyResourceListIterator) Value() ProtectionPolicyResource { + if !iter.page.NotDone() { + return ProtectionPolicyResource{} } - if rcr.ETag != nil { - objectMap["eTag"] = rcr.ETag + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectionPolicyResourceListIterator type. +func NewProtectionPolicyResourceListIterator(page ProtectionPolicyResourceListPage) ProtectionPolicyResourceListIterator { + return ProtectionPolicyResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pprl ProtectionPolicyResourceList) IsEmpty() bool { + return pprl.Value == nil || len(*pprl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pprl ProtectionPolicyResourceList) hasNextLink() bool { + return pprl.NextLink != nil && len(*pprl.NextLink) != 0 +} + +// protectionPolicyResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pprl ProtectionPolicyResourceList) protectionPolicyResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !pprl.hasNextLink() { + return nil, nil } - return json.Marshal(objectMap) + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pprl.NextLink))) } -// ResourceList base for all lists of resources. -type ResourceList struct { - // NextLink - The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. - NextLink *string `json:"nextLink,omitempty"` +// ProtectionPolicyResourceListPage contains a page of ProtectionPolicyResource values. +type ProtectionPolicyResourceListPage struct { + fn func(context.Context, ProtectionPolicyResourceList) (ProtectionPolicyResourceList, error) + pprl ProtectionPolicyResourceList } -// ResourceVaultConfig backup resource vault config details. -type ResourceVaultConfig struct { - // StorageModelType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant' - StorageModelType StorageType `json:"storageModelType,omitempty"` - // StorageType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant' - StorageType StorageType `json:"storageType,omitempty"` - // StorageTypeState - Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. Possible values include: 'StorageTypeStateInvalid', 'StorageTypeStateLocked', 'StorageTypeStateUnlocked' - StorageTypeState StorageTypeState `json:"storageTypeState,omitempty"` - // EnhancedSecurityState - Enabled or Disabled. Possible values include: 'EnhancedSecurityStateInvalid', 'EnhancedSecurityStateEnabled', 'EnhancedSecurityStateDisabled' - EnhancedSecurityState EnhancedSecurityState `json:"enhancedSecurityState,omitempty"` - // SoftDeleteFeatureState - Soft Delete feature state. Possible values include: 'SoftDeleteFeatureStateInvalid', 'SoftDeleteFeatureStateEnabled', 'SoftDeleteFeatureStateDisabled' - SoftDeleteFeatureState SoftDeleteFeatureState `json:"softDeleteFeatureState,omitempty"` +// NextWithContext 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 *ProtectionPolicyResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionPolicyResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pprl) + if err != nil { + return err + } + page.pprl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil } -// ResourceVaultConfigResource backup resource vault config details. -type ResourceVaultConfigResource struct { - autorest.Response `json:"-"` - // Properties - BackupResourceVaultConfigResource properties - Properties *ResourceVaultConfig `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectionPolicyResourceListPage) Next() error { + return page.NextWithContext(context.Background()) } -// MarshalJSON is the custom marshaler for ResourceVaultConfigResource. -func (rvcr ResourceVaultConfigResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rvcr.Properties != nil { - objectMap["properties"] = rvcr.Properties - } - if rvcr.Location != nil { - objectMap["location"] = rvcr.Location - } - if rvcr.Tags != nil { - objectMap["tags"] = rvcr.Tags - } - if rvcr.ETag != nil { - objectMap["eTag"] = rvcr.ETag +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectionPolicyResourceListPage) NotDone() bool { + return !page.pprl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectionPolicyResourceListPage) Response() ProtectionPolicyResourceList { + return page.pprl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectionPolicyResourceListPage) Values() []ProtectionPolicyResource { + if page.pprl.IsEmpty() { + return nil } - return json.Marshal(objectMap) + return *page.pprl.Value } -// RestoreFileSpecs restore file specs like file path, type and target folder path info. -type RestoreFileSpecs struct { - // Path - Source File/Folder path - Path *string `json:"path,omitempty"` - // FileSpecType - Indicates what the Path variable stands for - FileSpecType *string `json:"fileSpecType,omitempty"` - // TargetFolderPath - Destination folder path in target FileShare - TargetFolderPath *string `json:"targetFolderPath,omitempty"` +// Creates a new instance of the ProtectionPolicyResourceListPage type. +func NewProtectionPolicyResourceListPage(cur ProtectionPolicyResourceList, getNextPage func(context.Context, ProtectionPolicyResourceList) (ProtectionPolicyResourceList, error)) ProtectionPolicyResourceListPage { + return ProtectionPolicyResourceListPage{ + fn: getNextPage, + pprl: cur, + } } -// BasicRestoreRequest base class for restore request. Workload-specific restore requests are derived from this class. -type BasicRestoreRequest interface { - AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) - AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) - AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) - AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) - AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) - AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) - AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) - AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) - AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) - AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) - AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) - AsRestoreRequest() (*RestoreRequest, bool) +// BasicRecoveryPoint base class for backup copies. Workload-specific backup copies are derived from this class. +type BasicRecoveryPoint interface { + AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) + AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) + AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) + AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) + AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) + AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) + AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) + AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) + AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) + AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) + AsRecoveryPoint() (*RecoveryPoint, bool) } -// RestoreRequest base class for restore request. Workload-specific restore requests are derived from this -// class. -type RestoreRequest struct { - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +// RecoveryPoint base class for backup copies. Workload-specific backup copies are derived from this class. +type RecoveryPoint struct { + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` } -func unmarshalBasicRestoreRequest(body []byte) (BasicRestoreRequest, error) { +func unmarshalBasicRecoveryPoint(body []byte) (BasicRecoveryPoint, error) { var m map[string]interface{} err := json.Unmarshal(body, &m) if err != nil { @@ -17583,143 +8456,165 @@ func unmarshalBasicRestoreRequest(body []byte) (BasicRestoreRequest, error) { } switch m["objectType"] { - case string(ObjectTypeAzureFileShareRestoreRequest): - var afsrr AzureFileShareRestoreRequest - err := json.Unmarshal(body, &afsrr) - return afsrr, err - case string(ObjectTypeAzureWorkloadPointInTimeRestoreRequest): - var awpitrr AzureWorkloadPointInTimeRestoreRequest - err := json.Unmarshal(body, &awpitrr) - return awpitrr, err - case string(ObjectTypeAzureWorkloadRestoreRequest): - var awrr AzureWorkloadRestoreRequest - err := json.Unmarshal(body, &awrr) - return awrr, err - case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): - var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest - err := json.Unmarshal(body, &awshpitrr) - return awshpitrr, err - case string(ObjectTypeAzureWorkloadSAPHanaRestoreRequest): - var awshrr AzureWorkloadSAPHanaRestoreRequest - err := json.Unmarshal(body, &awshrr) - return awshrr, err - case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): - var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest - err := json.Unmarshal(body, &awspitrr) - return awspitrr, err - case string(ObjectTypeAzureWorkloadSQLRestoreRequest): - var awsrr AzureWorkloadSQLRestoreRequest - err := json.Unmarshal(body, &awsrr) - return awsrr, err - case string(ObjectTypeIaasVMRestoreRequest): - var ivrr IaasVMRestoreRequest - err := json.Unmarshal(body, &ivrr) - return ivrr, err + case string(ObjectTypeAzureFileShareRecoveryPoint): + var afsrp AzureFileShareRecoveryPoint + err := json.Unmarshal(body, &afsrp) + return afsrp, err + case string(ObjectTypeAzureWorkloadPointInTimeRecoveryPoint): + var awpitrp AzureWorkloadPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awpitrp) + return awpitrp, err + case string(ObjectTypeAzureWorkloadRecoveryPoint): + var awrp AzureWorkloadRecoveryPoint + err := json.Unmarshal(body, &awrp) + return awrp, err + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): + var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awshpitrp) + return awshpitrp, err + case string(ObjectTypeAzureWorkloadSAPHanaRecoveryPoint): + var awshrp AzureWorkloadSAPHanaRecoveryPoint + err := json.Unmarshal(body, &awshrp) + return awshrp, err + case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): + var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awspitrp) + return awspitrp, err + case string(ObjectTypeAzureWorkloadSQLRecoveryPoint): + var awsrp AzureWorkloadSQLRecoveryPoint + err := json.Unmarshal(body, &awsrp) + return awsrp, err + case string(ObjectTypeGenericRecoveryPoint): + var grp GenericRecoveryPoint + err := json.Unmarshal(body, &grp) + return grp, err + case string(ObjectTypeIaasVMRecoveryPoint): + var ivrp IaasVMRecoveryPoint + err := json.Unmarshal(body, &ivrp) + return ivrp, err default: - var rr RestoreRequest - err := json.Unmarshal(body, &rr) - return rr, err + var rp RecoveryPoint + err := json.Unmarshal(body, &rp) + return rp, err } } -func unmarshalBasicRestoreRequestArray(body []byte) ([]BasicRestoreRequest, error) { +func unmarshalBasicRecoveryPointArray(body []byte) ([]BasicRecoveryPoint, error) { var rawMessages []*json.RawMessage err := json.Unmarshal(body, &rawMessages) if err != nil { return nil, err } - rrArray := make([]BasicRestoreRequest, len(rawMessages)) + rpArray := make([]BasicRecoveryPoint, len(rawMessages)) for index, rawMessage := range rawMessages { - rr, err := unmarshalBasicRestoreRequest(*rawMessage) + rp, err := unmarshalBasicRecoveryPoint(*rawMessage) if err != nil { return nil, err } - rrArray[index] = rr + rpArray[index] = rp } - return rrArray, nil + return rpArray, nil } -// MarshalJSON is the custom marshaler for RestoreRequest. -func (rr RestoreRequest) MarshalJSON() ([]byte, error) { - rr.ObjectType = ObjectTypeRestoreRequest +// MarshalJSON is the custom marshaler for RecoveryPoint. +func (rp RecoveryPoint) MarshalJSON() ([]byte, error) { + rp.ObjectType = ObjectTypeRecoveryPoint objectMap := make(map[string]interface{}) - if rr.ObjectType != "" { - objectMap["objectType"] = rr.ObjectType + if rp.ObjectType != "" { + objectMap["objectType"] = rp.ObjectType } return json.Marshal(objectMap) } -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { return nil, false } -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { return nil, false } -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { return nil, false } -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { return nil, false } -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { return nil, false } -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { return nil, false } -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { return nil, false } -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { return nil, false } -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { return nil, false } -// AsRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return &rr, true +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false } -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &rr, true +// AsRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return &rp, true } -// RestoreRequestResource base class for restore request. Workload-specific restore requests are derived -// from this class. -type RestoreRequestResource struct { - // Properties - RestoreRequestResource properties - Properties BasicRestoreRequest `json:"properties,omitempty"` +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &rp, true +} + +// RecoveryPointDiskConfiguration disk configuration +type RecoveryPointDiskConfiguration struct { + // NumberOfDisksIncludedInBackup - Number of disks included in backup + NumberOfDisksIncludedInBackup *int32 `json:"numberOfDisksIncludedInBackup,omitempty"` + // NumberOfDisksAttachedToVM - Number of disks attached to the VM + NumberOfDisksAttachedToVM *int32 `json:"numberOfDisksAttachedToVm,omitempty"` + // IncludedDiskList - Information of disks included in backup + IncludedDiskList *[]DiskInformation `json:"includedDiskList,omitempty"` + // ExcludedDiskList - Information of disks excluded from backup + ExcludedDiskList *[]DiskInformation `json:"excludedDiskList,omitempty"` +} + +// RecoveryPointResource base class for backup copies. Workload-specific backup copies are derived from +// this class. +type RecoveryPointResource struct { + autorest.Response `json:"-"` + // Properties - RecoveryPointResource properties + Properties BasicRecoveryPoint `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id represents the complete path to the resource. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name associated with the resource. @@ -17734,24 +8629,24 @@ type RestoreRequestResource struct { ETag *string `json:"eTag,omitempty"` } -// MarshalJSON is the custom marshaler for RestoreRequestResource. -func (rrr RestoreRequestResource) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for RecoveryPointResource. +func (rpr RecoveryPointResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["properties"] = rrr.Properties - if rrr.Location != nil { - objectMap["location"] = rrr.Location + objectMap["properties"] = rpr.Properties + if rpr.Location != nil { + objectMap["location"] = rpr.Location } - if rrr.Tags != nil { - objectMap["tags"] = rrr.Tags + if rpr.Tags != nil { + objectMap["tags"] = rpr.Tags } - if rrr.ETag != nil { - objectMap["eTag"] = rrr.ETag + if rpr.ETag != nil { + objectMap["eTag"] = rpr.ETag } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for RestoreRequestResource struct. -func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for RecoveryPointResource struct. +func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -17761,11 +8656,11 @@ func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - properties, err := unmarshalBasicRestoreRequest(*v) + properties, err := unmarshalBasicRecoveryPoint(*v) if err != nil { return err } - rrr.Properties = properties + rpr.Properties = properties } case "id": if v != nil { @@ -17774,7 +8669,7 @@ func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rrr.ID = &ID + rpr.ID = &ID } case "name": if v != nil { @@ -17783,7 +8678,7 @@ func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rrr.Name = &name + rpr.Name = &name } case "type": if v != nil { @@ -17792,7 +8687,7 @@ func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rrr.Type = &typeVar + rpr.Type = &typeVar } case "location": if v != nil { @@ -17801,7 +8696,7 @@ func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rrr.Location = &location + rpr.Location = &location } case "tags": if v != nil { @@ -17810,7 +8705,7 @@ func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rrr.Tags = tags + rpr.Tags = tags } case "eTag": if v != nil { @@ -17819,7 +8714,7 @@ func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rrr.ETag = &eTag + rpr.ETag = &eTag } } } @@ -17827,373 +8722,471 @@ func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { return nil } -// RetentionDuration retention duration. -type RetentionDuration struct { - // Count - Count of duration types. Retention duration is obtained by the counting the duration type Count times. - // For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks. - Count *int32 `json:"count,omitempty"` - // DurationType - Retention duration type of retention policy. Possible values include: 'RetentionDurationTypeInvalid', 'RetentionDurationTypeDays', 'RetentionDurationTypeWeeks', 'RetentionDurationTypeMonths', 'RetentionDurationTypeYears' - DurationType RetentionDurationType `json:"durationType,omitempty"` -} - -// BasicRetentionPolicy base class for retention policy. -type BasicRetentionPolicy interface { - AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) - AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) - AsRetentionPolicy() (*RetentionPolicy, bool) +// RecoveryPointResourceList list of RecoveryPoint resources +type RecoveryPointResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]RecoveryPointResource `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"` } -// RetentionPolicy base class for retention policy. -type RetentionPolicy struct { - // RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy' - RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"` +// RecoveryPointResourceListIterator provides access to a complete listing of RecoveryPointResource values. +type RecoveryPointResourceListIterator struct { + i int + page RecoveryPointResourceListPage } -func unmarshalBasicRetentionPolicy(body []byte) (BasicRetentionPolicy, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) +// NextWithContext 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 *RecoveryPointResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) if err != nil { - return nil, err + iter.i-- + return err } + iter.i = 0 + return nil +} - switch m["retentionPolicyType"] { - case string(RetentionPolicyTypeLongTermRetentionPolicy): - var ltrp LongTermRetentionPolicy - err := json.Unmarshal(body, <rp) - return ltrp, err - case string(RetentionPolicyTypeSimpleRetentionPolicy): - var srp SimpleRetentionPolicy - err := json.Unmarshal(body, &srp) - return srp, err - default: - var rp RetentionPolicy - err := json.Unmarshal(body, &rp) - return rp, err +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryPointResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryPointResourceListIterator) 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 RecoveryPointResourceListIterator) Response() RecoveryPointResourceList { + 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 RecoveryPointResourceListIterator) Value() RecoveryPointResource { + if !iter.page.NotDone() { + return RecoveryPointResource{} } + return iter.page.Values()[iter.i] } -func unmarshalBasicRetentionPolicyArray(body []byte) ([]BasicRetentionPolicy, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err + +// Creates a new instance of the RecoveryPointResourceListIterator type. +func NewRecoveryPointResourceListIterator(page RecoveryPointResourceListPage) RecoveryPointResourceListIterator { + return RecoveryPointResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rprl RecoveryPointResourceList) IsEmpty() bool { + return rprl.Value == nil || len(*rprl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rprl RecoveryPointResourceList) hasNextLink() bool { + return rprl.NextLink != nil && len(*rprl.NextLink) != 0 +} + +// recoveryPointResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rprl RecoveryPointResourceList) recoveryPointResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !rprl.hasNextLink() { + return nil, nil } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rprl.NextLink))) +} - rpArray := make([]BasicRetentionPolicy, len(rawMessages)) +// RecoveryPointResourceListPage contains a page of RecoveryPointResource values. +type RecoveryPointResourceListPage struct { + fn func(context.Context, RecoveryPointResourceList) (RecoveryPointResourceList, error) + rprl RecoveryPointResourceList +} - for index, rawMessage := range rawMessages { - rp, err := unmarshalBasicRetentionPolicy(*rawMessage) +// NextWithContext 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 *RecoveryPointResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rprl) if err != nil { - return nil, err + return err + } + page.rprl = next + if !next.hasNextLink() || !next.IsEmpty() { + break } - rpArray[index] = rp } - return rpArray, nil + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryPointResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryPointResourceListPage) NotDone() bool { + return !page.rprl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryPointResourceListPage) Response() RecoveryPointResourceList { + return page.rprl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryPointResourceListPage) Values() []RecoveryPointResource { + if page.rprl.IsEmpty() { + return nil + } + return *page.rprl.Value +} + +// Creates a new instance of the RecoveryPointResourceListPage type. +func NewRecoveryPointResourceListPage(cur RecoveryPointResourceList, getNextPage func(context.Context, RecoveryPointResourceList) (RecoveryPointResourceList, error)) RecoveryPointResourceListPage { + return RecoveryPointResourceListPage{ + fn: getNextPage, + rprl: cur, + } +} + +// RecoveryPointTierInformation recovery point tier information. +type RecoveryPointTierInformation struct { + // Type - Recovery point tier type. Possible values include: 'RecoveryPointTierTypeInvalid', 'RecoveryPointTierTypeInstantRP', 'RecoveryPointTierTypeHardenedRP' + Type RecoveryPointTierType `json:"type,omitempty"` + // Status - Recovery point tier status. Possible values include: 'RecoveryPointTierStatusInvalid', 'RecoveryPointTierStatusValid', 'RecoveryPointTierStatusDisabled', 'RecoveryPointTierStatusDeleted' + Status RecoveryPointTierStatus `json:"status,omitempty"` +} + +// Resource ARM Resource. +type Resource struct { + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` } -// MarshalJSON is the custom marshaler for RetentionPolicy. -func (rp RetentionPolicy) MarshalJSON() ([]byte, error) { - rp.RetentionPolicyType = RetentionPolicyTypeRetentionPolicy +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if rp.RetentionPolicyType != "" { - objectMap["retentionPolicyType"] = rp.RetentionPolicyType + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + if r.ETag != nil { + objectMap["eTag"] = r.ETag } return json.Marshal(objectMap) } -// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. -func (rp RetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) { - return nil, false +// ResourceList base for all lists of resources. +type ResourceList struct { + // NextLink - The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + NextLink *string `json:"nextLink,omitempty"` } -// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. -func (rp RetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) { - return nil, false +// ResourceVaultConfig backup resource vault config details. +type ResourceVaultConfig struct { + // StorageModelType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant' + StorageModelType StorageType `json:"storageModelType,omitempty"` + // StorageType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant' + StorageType StorageType `json:"storageType,omitempty"` + // StorageTypeState - Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. Possible values include: 'StorageTypeStateInvalid', 'StorageTypeStateLocked', 'StorageTypeStateUnlocked' + StorageTypeState StorageTypeState `json:"storageTypeState,omitempty"` + // EnhancedSecurityState - Enabled or Disabled. Possible values include: 'EnhancedSecurityStateInvalid', 'EnhancedSecurityStateEnabled', 'EnhancedSecurityStateDisabled' + EnhancedSecurityState EnhancedSecurityState `json:"enhancedSecurityState,omitempty"` + // SoftDeleteFeatureState - Soft Delete feature state. Possible values include: 'SoftDeleteFeatureStateInvalid', 'SoftDeleteFeatureStateEnabled', 'SoftDeleteFeatureStateDisabled' + SoftDeleteFeatureState SoftDeleteFeatureState `json:"softDeleteFeatureState,omitempty"` } -// AsRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. -func (rp RetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) { - return &rp, true +// ResourceVaultConfigResource backup resource vault config details. +type ResourceVaultConfigResource struct { + autorest.Response `json:"-"` + // Properties - BackupResourceVaultConfigResource properties + Properties *ResourceVaultConfig `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` } -// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. -func (rp RetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) { - return &rp, true +// MarshalJSON is the custom marshaler for ResourceVaultConfigResource. +func (rvcr ResourceVaultConfigResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rvcr.Properties != nil { + objectMap["properties"] = rvcr.Properties + } + if rvcr.Location != nil { + objectMap["location"] = rvcr.Location + } + if rvcr.Tags != nil { + objectMap["tags"] = rvcr.Tags + } + if rvcr.ETag != nil { + objectMap["eTag"] = rvcr.ETag + } + return json.Marshal(objectMap) } -// BasicSchedulePolicy base class for backup schedule. -type BasicSchedulePolicy interface { - AsLogSchedulePolicy() (*LogSchedulePolicy, bool) - AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) - AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) - AsSchedulePolicy() (*SchedulePolicy, bool) +// RestoreFileSpecs restore file specs like file path, type and target folder path info. +type RestoreFileSpecs struct { + // Path - Source File/Folder path + Path *string `json:"path,omitempty"` + // FileSpecType - Indicates what the Path variable stands for + FileSpecType *string `json:"fileSpecType,omitempty"` + // TargetFolderPath - Destination folder path in target FileShare + TargetFolderPath *string `json:"targetFolderPath,omitempty"` } -// SchedulePolicy base class for backup schedule. -type SchedulePolicy struct { - // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' - SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` +// BasicRestoreRequest base class for restore request. Workload-specific restore requests are derived from this class. +type BasicRestoreRequest interface { + AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) + AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) + AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) + AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) + AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) + AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) + AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) + AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) + AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) + AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) + AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) + AsRestoreRequest() (*RestoreRequest, bool) } -func unmarshalBasicSchedulePolicy(body []byte) (BasicSchedulePolicy, error) { +// RestoreRequest base class for restore request. Workload-specific restore requests are derived from this +// class. +type RestoreRequest struct { + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicRestoreRequest(body []byte) (BasicRestoreRequest, error) { var m map[string]interface{} err := json.Unmarshal(body, &m) if err != nil { return nil, err } - switch m["schedulePolicyType"] { - case string(SchedulePolicyTypeLogSchedulePolicy): - var lsp LogSchedulePolicy - err := json.Unmarshal(body, &lsp) - return lsp, err - case string(SchedulePolicyTypeLongTermSchedulePolicy): - var ltsp LongTermSchedulePolicy - err := json.Unmarshal(body, <sp) - return ltsp, err - case string(SchedulePolicyTypeSimpleSchedulePolicy): - var ssp SimpleSchedulePolicy - err := json.Unmarshal(body, &ssp) - return ssp, err + switch m["objectType"] { + case string(ObjectTypeAzureFileShareRestoreRequest): + var afsrr AzureFileShareRestoreRequest + err := json.Unmarshal(body, &afsrr) + return afsrr, err + case string(ObjectTypeAzureWorkloadPointInTimeRestoreRequest): + var awpitrr AzureWorkloadPointInTimeRestoreRequest + err := json.Unmarshal(body, &awpitrr) + return awpitrr, err + case string(ObjectTypeAzureWorkloadRestoreRequest): + var awrr AzureWorkloadRestoreRequest + err := json.Unmarshal(body, &awrr) + return awrr, err + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): + var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest + err := json.Unmarshal(body, &awshpitrr) + return awshpitrr, err + case string(ObjectTypeAzureWorkloadSAPHanaRestoreRequest): + var awshrr AzureWorkloadSAPHanaRestoreRequest + err := json.Unmarshal(body, &awshrr) + return awshrr, err + case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): + var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest + err := json.Unmarshal(body, &awspitrr) + return awspitrr, err + case string(ObjectTypeAzureWorkloadSQLRestoreRequest): + var awsrr AzureWorkloadSQLRestoreRequest + err := json.Unmarshal(body, &awsrr) + return awsrr, err + case string(ObjectTypeIaasVMRestoreRequest): + var ivrr IaasVMRestoreRequest + err := json.Unmarshal(body, &ivrr) + return ivrr, err default: - var sp SchedulePolicy - err := json.Unmarshal(body, &sp) - return sp, err + var rr RestoreRequest + err := json.Unmarshal(body, &rr) + return rr, err } } -func unmarshalBasicSchedulePolicyArray(body []byte) ([]BasicSchedulePolicy, error) { +func unmarshalBasicRestoreRequestArray(body []byte) ([]BasicRestoreRequest, error) { var rawMessages []*json.RawMessage err := json.Unmarshal(body, &rawMessages) if err != nil { return nil, err } - spArray := make([]BasicSchedulePolicy, len(rawMessages)) + rrArray := make([]BasicRestoreRequest, len(rawMessages)) for index, rawMessage := range rawMessages { - sp, err := unmarshalBasicSchedulePolicy(*rawMessage) + rr, err := unmarshalBasicRestoreRequest(*rawMessage) if err != nil { return nil, err } - spArray[index] = sp - } - return spArray, nil -} - -// MarshalJSON is the custom marshaler for SchedulePolicy. -func (sp SchedulePolicy) MarshalJSON() ([]byte, error) { - sp.SchedulePolicyType = SchedulePolicyTypeSchedulePolicy - objectMap := make(map[string]interface{}) - if sp.SchedulePolicyType != "" { - objectMap["schedulePolicyType"] = sp.SchedulePolicyType + rrArray[index] = rr } - return json.Marshal(objectMap) -} - -// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. -func (sp SchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { - return nil, false -} - -// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. -func (sp SchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { - return nil, false -} - -// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. -func (sp SchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { - return nil, false -} - -// AsSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. -func (sp SchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { - return &sp, true -} - -// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. -func (sp SchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { - return &sp, true -} - -// Settings common settings field for backup management -type Settings struct { - // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". - TimeZone *string `json:"timeZone,omitempty"` - // Issqlcompression - SQL compression flag - Issqlcompression *bool `json:"issqlcompression,omitempty"` - // IsCompression - Workload compression flag. This has been added so that 'isSqlCompression' - // will be deprecated once clients upgrade to consider this flag. - IsCompression *bool `json:"isCompression,omitempty"` -} - -// SimpleRetentionPolicy simple policy retention. -type SimpleRetentionPolicy struct { - // RetentionDuration - Retention duration of the protection policy. - RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` - // RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy' - RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"` + return rrArray, nil } -// MarshalJSON is the custom marshaler for SimpleRetentionPolicy. -func (srp SimpleRetentionPolicy) MarshalJSON() ([]byte, error) { - srp.RetentionPolicyType = RetentionPolicyTypeSimpleRetentionPolicy +// MarshalJSON is the custom marshaler for RestoreRequest. +func (rr RestoreRequest) MarshalJSON() ([]byte, error) { + rr.ObjectType = ObjectTypeRestoreRequest objectMap := make(map[string]interface{}) - if srp.RetentionDuration != nil { - objectMap["retentionDuration"] = srp.RetentionDuration - } - if srp.RetentionPolicyType != "" { - objectMap["retentionPolicyType"] = srp.RetentionPolicyType + if rr.ObjectType != "" { + objectMap["objectType"] = rr.ObjectType } return json.Marshal(objectMap) } -// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. -func (srp SimpleRetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) { - return nil, false -} - -// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. -func (srp SimpleRetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) { - return &srp, true +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false } -// AsRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. -func (srp SimpleRetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) { +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { return nil, false } -// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. -func (srp SimpleRetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) { - return &srp, true +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false } -// SimpleSchedulePolicy simple policy schedule. -type SimpleSchedulePolicy struct { - // ScheduleRunFrequency - Frequency of the schedule operation of this policy. Possible values include: 'ScheduleRunTypeInvalid', 'ScheduleRunTypeDaily', 'ScheduleRunTypeWeekly' - ScheduleRunFrequency ScheduleRunType `json:"scheduleRunFrequency,omitempty"` - // ScheduleRunDays - List of days of week this schedule has to be run. - ScheduleRunDays *[]DayOfWeek `json:"scheduleRunDays,omitempty"` - // ScheduleRunTimes - List of times of day this schedule has to be run. - ScheduleRunTimes *[]date.Time `json:"scheduleRunTimes,omitempty"` - // ScheduleWeeklyFrequency - At every number weeks this schedule has to be run. - ScheduleWeeklyFrequency *int32 `json:"scheduleWeeklyFrequency,omitempty"` - // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' - SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for SimpleSchedulePolicy. -func (ssp SimpleSchedulePolicy) MarshalJSON() ([]byte, error) { - ssp.SchedulePolicyType = SchedulePolicyTypeSimpleSchedulePolicy - objectMap := make(map[string]interface{}) - if ssp.ScheduleRunFrequency != "" { - objectMap["scheduleRunFrequency"] = ssp.ScheduleRunFrequency - } - if ssp.ScheduleRunDays != nil { - objectMap["scheduleRunDays"] = ssp.ScheduleRunDays - } - if ssp.ScheduleRunTimes != nil { - objectMap["scheduleRunTimes"] = ssp.ScheduleRunTimes - } - if ssp.ScheduleWeeklyFrequency != nil { - objectMap["scheduleWeeklyFrequency"] = ssp.ScheduleWeeklyFrequency - } - if ssp.SchedulePolicyType != "" { - objectMap["schedulePolicyType"] = ssp.SchedulePolicyType - } - return json.Marshal(objectMap) +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false } -// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. -func (ssp SimpleSchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { return nil, false } -// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. -func (ssp SimpleSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { return nil, false } -// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. -func (ssp SimpleSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { - return &ssp, true +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false } -// AsSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. -func (ssp SimpleSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { return nil, false } -// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. -func (ssp SimpleSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { - return &ssp, true +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return nil, false } -// SQLDataDirectory sQLDataDirectory info -type SQLDataDirectory struct { - // Type - Type of data directory mapping. Possible values include: 'SQLDataDirectoryTypeInvalid', 'SQLDataDirectoryTypeData', 'SQLDataDirectoryTypeLog' - Type SQLDataDirectoryType `json:"type,omitempty"` - // Path - File path - Path *string `json:"path,omitempty"` - // LogicalName - Logical name of the file - LogicalName *string `json:"logicalName,omitempty"` +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false } -// SQLDataDirectoryMapping encapsulates information regarding data directory -type SQLDataDirectoryMapping struct { - // MappingType - Type of data directory mapping. Possible values include: 'SQLDataDirectoryTypeInvalid', 'SQLDataDirectoryTypeData', 'SQLDataDirectoryTypeLog' - MappingType SQLDataDirectoryType `json:"mappingType,omitempty"` - // SourceLogicalName - Restore source logical name path - SourceLogicalName *string `json:"sourceLogicalName,omitempty"` - // SourcePath - Restore source path - SourcePath *string `json:"sourcePath,omitempty"` - // TargetPath - Target path - TargetPath *string `json:"targetPath,omitempty"` +// AsRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return &rr, true } -// StatusRequest backupStatus request. -type StatusRequest struct { - // ResourceType - Container Type - VM, SQLPaaS, DPM, AzureFileShare. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - ResourceType DataSourceType `json:"resourceType,omitempty"` - // ResourceID - Entire ARM resource id of the resource - ResourceID *string `json:"resourceId,omitempty"` - // PoLogicalName - Protectable Item Logical Name - PoLogicalName *string `json:"poLogicalName,omitempty"` +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &rr, true } -// StatusResponse backupStatus response. -type StatusResponse struct { - autorest.Response `json:"-"` - // ProtectionStatus - Specifies whether the container is registered or not. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionStatus ProtectionStatus `json:"protectionStatus,omitempty"` - // VaultID - Specifies the arm resource id of the vault - VaultID *string `json:"vaultId,omitempty"` - // FabricName - Specifies the fabric name - Azure or AD. Possible values include: 'FabricNameInvalid', 'FabricNameAzure' - FabricName FabricName `json:"fabricName,omitempty"` - // ContainerName - Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;csname;vmname. - ContainerName *string `json:"containerName,omitempty"` - // ProtectedItemName - Specifies the product specific ds name. E.g. vm;iaasvmcontainer;csname;vmname. - ProtectedItemName *string `json:"protectedItemName,omitempty"` - // ErrorCode - ErrorCode in case of intent failed - ErrorCode *string `json:"errorCode,omitempty"` - // ErrorMessage - ErrorMessage in case of intent failed. - ErrorMessage *string `json:"errorMessage,omitempty"` - // PolicyName - Specifies the policy name which is used for protection - PolicyName *string `json:"policyName,omitempty"` - // RegistrationStatus - Container registration status - RegistrationStatus *string `json:"registrationStatus,omitempty"` +// RestoreRequestResource base class for restore request. Workload-specific restore requests are derived +// from this class. +type RestoreRequestResource struct { + // Properties - RestoreRequestResource properties + Properties BasicRestoreRequest `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` } -// SubProtectionPolicy sub-protection policy which includes schedule and retention -type SubProtectionPolicy struct { - // 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. - RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` +// MarshalJSON is the custom marshaler for RestoreRequestResource. +func (rrr RestoreRequestResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = rrr.Properties + if rrr.Location != nil { + objectMap["location"] = rrr.Location + } + if rrr.Tags != nil { + objectMap["tags"] = rrr.Tags + } + if rrr.ETag != nil { + objectMap["eTag"] = rrr.ETag + } + return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for SubProtectionPolicy struct. -func (spp *SubProtectionPolicy) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for RestoreRequestResource struct. +func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -18201,30 +9194,67 @@ func (spp *SubProtectionPolicy) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "policyType": + case "properties": if v != nil { - var policyType PolicyType - err = json.Unmarshal(*v, &policyType) + properties, err := unmarshalBasicRestoreRequest(*v) if err != nil { return err } - spp.PolicyType = policyType + rrr.Properties = properties } - case "schedulePolicy": + case "id": if v != nil { - schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) + var ID string + err = json.Unmarshal(*v, &ID) if err != nil { return err } - spp.SchedulePolicy = schedulePolicy + rrr.ID = &ID } - case "retentionPolicy": + case "name": if v != nil { - retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - spp.RetentionPolicy = retentionPolicy + rrr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rrr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rrr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rrr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + rrr.ETag = &eTag } } } @@ -18232,302 +9262,340 @@ func (spp *SubProtectionPolicy) UnmarshalJSON(body []byte) error { return nil } -// TargetAFSRestoreInfo target Azure File Share Info. -type TargetAFSRestoreInfo struct { - // Name - File share name - Name *string `json:"name,omitempty"` - // TargetResourceID - Target file share resource ARM ID - TargetResourceID *string `json:"targetResourceId,omitempty"` +// RetentionDuration retention duration. +type RetentionDuration struct { + // Count - Count of duration types. Retention duration is obtained by the counting the duration type Count times. + // For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks. + Count *int32 `json:"count,omitempty"` + // DurationType - Retention duration type of retention policy. Possible values include: 'RetentionDurationTypeInvalid', 'RetentionDurationTypeDays', 'RetentionDurationTypeWeeks', 'RetentionDurationTypeMonths', 'RetentionDurationTypeYears' + DurationType RetentionDurationType `json:"durationType,omitempty"` } -// TargetRestoreInfo details about target workload during restore operation. -type TargetRestoreInfo struct { - // OverwriteOption - Can Overwrite if Target DataBase already exists. Possible values include: 'OverwriteOptionsInvalid', 'OverwriteOptionsFailOnConflict', 'OverwriteOptionsOverwrite' - OverwriteOption OverwriteOptions `json:"overwriteOption,omitempty"` - // ContainerID - Resource Id name of the container in which Target DataBase resides - ContainerID *string `json:"containerId,omitempty"` - // DatabaseName - Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana - DatabaseName *string `json:"databaseName,omitempty"` +// BasicRetentionPolicy base class for retention policy. +type BasicRetentionPolicy interface { + AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) + AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) + AsRetentionPolicy() (*RetentionPolicy, bool) +} + +// RetentionPolicy base class for retention policy. +type RetentionPolicy struct { + // RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy' + RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"` +} + +func unmarshalBasicRetentionPolicy(body []byte) (BasicRetentionPolicy, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["retentionPolicyType"] { + case string(RetentionPolicyTypeLongTermRetentionPolicy): + var ltrp LongTermRetentionPolicy + err := json.Unmarshal(body, <rp) + return ltrp, err + case string(RetentionPolicyTypeSimpleRetentionPolicy): + var srp SimpleRetentionPolicy + err := json.Unmarshal(body, &srp) + return srp, err + default: + var rp RetentionPolicy + err := json.Unmarshal(body, &rp) + return rp, err + } } +func unmarshalBasicRetentionPolicyArray(body []byte) ([]BasicRetentionPolicy, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } -// TokenInformation the token information details. -type TokenInformation struct { - autorest.Response `json:"-"` - // Token - Token value. - Token *string `json:"token,omitempty"` - // ExpiryTimeInUtcTicks - Expiry time of token. - ExpiryTimeInUtcTicks *int64 `json:"expiryTimeInUtcTicks,omitempty"` - // SecurityPIN - Security PIN - SecurityPIN *string `json:"securityPIN,omitempty"` -} + rpArray := make([]BasicRetentionPolicy, len(rawMessages)) -// ValidateIaasVMRestoreOperationRequest azureRestoreValidation request. -type ValidateIaasVMRestoreOperationRequest struct { - // RestoreRequest - Sets restore request to be validated - RestoreRequest BasicRestoreRequest `json:"restoreRequest,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeValidateOperationRequest', 'ObjectTypeValidateIaasVMRestoreOperationRequest', 'ObjectTypeValidateRestoreOperationRequest' - ObjectType ObjectTypeBasicValidateOperationRequest `json:"objectType,omitempty"` + for index, rawMessage := range rawMessages { + rp, err := unmarshalBasicRetentionPolicy(*rawMessage) + if err != nil { + return nil, err + } + rpArray[index] = rp + } + return rpArray, nil } -// MarshalJSON is the custom marshaler for ValidateIaasVMRestoreOperationRequest. -func (vivror ValidateIaasVMRestoreOperationRequest) MarshalJSON() ([]byte, error) { - vivror.ObjectType = ObjectTypeValidateIaasVMRestoreOperationRequest +// MarshalJSON is the custom marshaler for RetentionPolicy. +func (rp RetentionPolicy) MarshalJSON() ([]byte, error) { + rp.RetentionPolicyType = RetentionPolicyTypeRetentionPolicy objectMap := make(map[string]interface{}) - objectMap["restoreRequest"] = vivror.RestoreRequest - if vivror.ObjectType != "" { - objectMap["objectType"] = vivror.ObjectType + if rp.RetentionPolicyType != "" { + objectMap["retentionPolicyType"] = rp.RetentionPolicyType } return json.Marshal(objectMap) } -// AsValidateIaasVMRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. -func (vivror ValidateIaasVMRestoreOperationRequest) AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) { - return &vivror, true -} - -// AsValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. -func (vivror ValidateIaasVMRestoreOperationRequest) AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) { +// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. +func (rp RetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) { return nil, false } -// AsBasicValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. -func (vivror ValidateIaasVMRestoreOperationRequest) AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) { - return &vivror, true -} - -// AsValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. -func (vivror ValidateIaasVMRestoreOperationRequest) AsValidateOperationRequest() (*ValidateOperationRequest, bool) { +// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. +func (rp RetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) { return nil, false } -// AsBasicValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. -func (vivror ValidateIaasVMRestoreOperationRequest) AsBasicValidateOperationRequest() (BasicValidateOperationRequest, bool) { - return &vivror, true +// AsRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. +func (rp RetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) { + return &rp, true } -// UnmarshalJSON is the custom unmarshaler for ValidateIaasVMRestoreOperationRequest struct. -func (vivror *ValidateIaasVMRestoreOperationRequest) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "restoreRequest": - if v != nil { - restoreRequest, err := unmarshalBasicRestoreRequest(*v) - if err != nil { - return err - } - vivror.RestoreRequest = restoreRequest - } - case "objectType": - if v != nil { - var objectType ObjectTypeBasicValidateOperationRequest - err = json.Unmarshal(*v, &objectType) - if err != nil { - return err - } - vivror.ObjectType = objectType - } - } - } - - return nil +// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. +func (rp RetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) { + return &rp, true } -// BasicValidateOperationRequest base class for validate operation request. -type BasicValidateOperationRequest interface { - AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) - AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) - AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) - AsValidateOperationRequest() (*ValidateOperationRequest, bool) +// BasicSchedulePolicy base class for backup schedule. +type BasicSchedulePolicy interface { + AsLogSchedulePolicy() (*LogSchedulePolicy, bool) + AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) + AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) + AsSchedulePolicy() (*SchedulePolicy, bool) } -// ValidateOperationRequest base class for validate operation request. -type ValidateOperationRequest struct { - // ObjectType - Possible values include: 'ObjectTypeValidateOperationRequest', 'ObjectTypeValidateIaasVMRestoreOperationRequest', 'ObjectTypeValidateRestoreOperationRequest' - ObjectType ObjectTypeBasicValidateOperationRequest `json:"objectType,omitempty"` +// SchedulePolicy base class for backup schedule. +type SchedulePolicy struct { + // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' + SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` } -func unmarshalBasicValidateOperationRequest(body []byte) (BasicValidateOperationRequest, error) { +func unmarshalBasicSchedulePolicy(body []byte) (BasicSchedulePolicy, error) { var m map[string]interface{} err := json.Unmarshal(body, &m) if err != nil { return nil, err } - switch m["objectType"] { - case string(ObjectTypeValidateIaasVMRestoreOperationRequest): - var vivror ValidateIaasVMRestoreOperationRequest - err := json.Unmarshal(body, &vivror) - return vivror, err - case string(ObjectTypeValidateRestoreOperationRequest): - var vror ValidateRestoreOperationRequest - err := json.Unmarshal(body, &vror) - return vror, err + switch m["schedulePolicyType"] { + case string(SchedulePolicyTypeLogSchedulePolicy): + var lsp LogSchedulePolicy + err := json.Unmarshal(body, &lsp) + return lsp, err + case string(SchedulePolicyTypeLongTermSchedulePolicy): + var ltsp LongTermSchedulePolicy + err := json.Unmarshal(body, <sp) + return ltsp, err + case string(SchedulePolicyTypeSimpleSchedulePolicy): + var ssp SimpleSchedulePolicy + err := json.Unmarshal(body, &ssp) + return ssp, err default: - var vor ValidateOperationRequest - err := json.Unmarshal(body, &vor) - return vor, err + var sp SchedulePolicy + err := json.Unmarshal(body, &sp) + return sp, err } } -func unmarshalBasicValidateOperationRequestArray(body []byte) ([]BasicValidateOperationRequest, error) { +func unmarshalBasicSchedulePolicyArray(body []byte) ([]BasicSchedulePolicy, error) { var rawMessages []*json.RawMessage err := json.Unmarshal(body, &rawMessages) if err != nil { return nil, err } - vorArray := make([]BasicValidateOperationRequest, len(rawMessages)) + spArray := make([]BasicSchedulePolicy, len(rawMessages)) for index, rawMessage := range rawMessages { - vor, err := unmarshalBasicValidateOperationRequest(*rawMessage) + sp, err := unmarshalBasicSchedulePolicy(*rawMessage) if err != nil { return nil, err } - vorArray[index] = vor + spArray[index] = sp } - return vorArray, nil + return spArray, nil } -// MarshalJSON is the custom marshaler for ValidateOperationRequest. -func (vor ValidateOperationRequest) MarshalJSON() ([]byte, error) { - vor.ObjectType = ObjectTypeValidateOperationRequest +// MarshalJSON is the custom marshaler for SchedulePolicy. +func (sp SchedulePolicy) MarshalJSON() ([]byte, error) { + sp.SchedulePolicyType = SchedulePolicyTypeSchedulePolicy objectMap := make(map[string]interface{}) - if vor.ObjectType != "" { - objectMap["objectType"] = vor.ObjectType + if sp.SchedulePolicyType != "" { + objectMap["schedulePolicyType"] = sp.SchedulePolicyType } return json.Marshal(objectMap) } -// AsValidateIaasVMRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. -func (vor ValidateOperationRequest) AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) { +// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. +func (sp SchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { return nil, false } -// AsValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. -func (vor ValidateOperationRequest) AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) { +// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. +func (sp SchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { return nil, false } -// AsBasicValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. -func (vor ValidateOperationRequest) AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) { +// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. +func (sp SchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { return nil, false } -// AsValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. -func (vor ValidateOperationRequest) AsValidateOperationRequest() (*ValidateOperationRequest, bool) { - return &vor, true +// AsSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. +func (sp SchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { + return &sp, true } -// AsBasicValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. -func (vor ValidateOperationRequest) AsBasicValidateOperationRequest() (BasicValidateOperationRequest, bool) { - return &vor, true +// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. +func (sp SchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { + return &sp, true } -// ValidateOperationResponse base class for validate operation response. -type ValidateOperationResponse struct { - // ValidationResults - Gets the validation result - ValidationResults *[]ErrorDetail `json:"validationResults,omitempty"` +// Settings common settings field for backup management +type Settings struct { + // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + TimeZone *string `json:"timeZone,omitempty"` + // Issqlcompression - SQL compression flag + Issqlcompression *bool `json:"issqlcompression,omitempty"` + // IsCompression - Workload compression flag. This has been added so that 'isSqlCompression' + // will be deprecated once clients upgrade to consider this flag. + IsCompression *bool `json:"isCompression,omitempty"` } -// ValidateOperationsResponse ... -type ValidateOperationsResponse struct { - autorest.Response `json:"-"` - ValidateOperationResponse *ValidateOperationResponse `json:"validateOperationResponse,omitempty"` +// SimpleRetentionPolicy simple policy retention. +type SimpleRetentionPolicy struct { + // RetentionDuration - Retention duration of the protection policy. + RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` + // RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy' + RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"` } -// BasicValidateRestoreOperationRequest azureRestoreValidation request. -type BasicValidateRestoreOperationRequest interface { - AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) - AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) +// MarshalJSON is the custom marshaler for SimpleRetentionPolicy. +func (srp SimpleRetentionPolicy) MarshalJSON() ([]byte, error) { + srp.RetentionPolicyType = RetentionPolicyTypeSimpleRetentionPolicy + objectMap := make(map[string]interface{}) + if srp.RetentionDuration != nil { + objectMap["retentionDuration"] = srp.RetentionDuration + } + if srp.RetentionPolicyType != "" { + objectMap["retentionPolicyType"] = srp.RetentionPolicyType + } + return json.Marshal(objectMap) } -// ValidateRestoreOperationRequest azureRestoreValidation request. -type ValidateRestoreOperationRequest struct { - // RestoreRequest - Sets restore request to be validated - RestoreRequest BasicRestoreRequest `json:"restoreRequest,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeValidateOperationRequest', 'ObjectTypeValidateIaasVMRestoreOperationRequest', 'ObjectTypeValidateRestoreOperationRequest' - ObjectType ObjectTypeBasicValidateOperationRequest `json:"objectType,omitempty"` +// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. +func (srp SimpleRetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) { + return nil, false } -func unmarshalBasicValidateRestoreOperationRequest(body []byte) (BasicValidateRestoreOperationRequest, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeValidateIaasVMRestoreOperationRequest): - var vivror ValidateIaasVMRestoreOperationRequest - err := json.Unmarshal(body, &vivror) - return vivror, err - default: - var vror ValidateRestoreOperationRequest - err := json.Unmarshal(body, &vror) - return vror, err - } +// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. +func (srp SimpleRetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) { + return &srp, true } -func unmarshalBasicValidateRestoreOperationRequestArray(body []byte) ([]BasicValidateRestoreOperationRequest, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - vrorArray := make([]BasicValidateRestoreOperationRequest, len(rawMessages)) +// AsRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. +func (srp SimpleRetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) { + return nil, false +} - for index, rawMessage := range rawMessages { - vror, err := unmarshalBasicValidateRestoreOperationRequest(*rawMessage) - if err != nil { - return nil, err - } - vrorArray[index] = vror - } - return vrorArray, nil +// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. +func (srp SimpleRetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) { + return &srp, true } -// MarshalJSON is the custom marshaler for ValidateRestoreOperationRequest. -func (vror ValidateRestoreOperationRequest) MarshalJSON() ([]byte, error) { - vror.ObjectType = ObjectTypeValidateRestoreOperationRequest +// SimpleSchedulePolicy simple policy schedule. +type SimpleSchedulePolicy struct { + // ScheduleRunFrequency - Frequency of the schedule operation of this policy. Possible values include: 'ScheduleRunTypeInvalid', 'ScheduleRunTypeDaily', 'ScheduleRunTypeWeekly' + ScheduleRunFrequency ScheduleRunType `json:"scheduleRunFrequency,omitempty"` + // ScheduleRunDays - List of days of week this schedule has to be run. + ScheduleRunDays *[]DayOfWeek `json:"scheduleRunDays,omitempty"` + // ScheduleRunTimes - List of times of day this schedule has to be run. + ScheduleRunTimes *[]date.Time `json:"scheduleRunTimes,omitempty"` + // ScheduleWeeklyFrequency - At every number weeks this schedule has to be run. + ScheduleWeeklyFrequency *int32 `json:"scheduleWeeklyFrequency,omitempty"` + // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' + SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) MarshalJSON() ([]byte, error) { + ssp.SchedulePolicyType = SchedulePolicyTypeSimpleSchedulePolicy objectMap := make(map[string]interface{}) - objectMap["restoreRequest"] = vror.RestoreRequest - if vror.ObjectType != "" { - objectMap["objectType"] = vror.ObjectType + if ssp.ScheduleRunFrequency != "" { + objectMap["scheduleRunFrequency"] = ssp.ScheduleRunFrequency + } + if ssp.ScheduleRunDays != nil { + objectMap["scheduleRunDays"] = ssp.ScheduleRunDays + } + if ssp.ScheduleRunTimes != nil { + objectMap["scheduleRunTimes"] = ssp.ScheduleRunTimes + } + if ssp.ScheduleWeeklyFrequency != nil { + objectMap["scheduleWeeklyFrequency"] = ssp.ScheduleWeeklyFrequency + } + if ssp.SchedulePolicyType != "" { + objectMap["schedulePolicyType"] = ssp.SchedulePolicyType } return json.Marshal(objectMap) } -// AsValidateIaasVMRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. -func (vror ValidateRestoreOperationRequest) AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) { +// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { return nil, false } -// AsValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. -func (vror ValidateRestoreOperationRequest) AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) { - return &vror, true +// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { + return nil, false } -// AsBasicValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. -func (vror ValidateRestoreOperationRequest) AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) { - return &vror, true +// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { + return &ssp, true } -// AsValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. -func (vror ValidateRestoreOperationRequest) AsValidateOperationRequest() (*ValidateOperationRequest, bool) { +// AsSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { return nil, false } -// AsBasicValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. -func (vror ValidateRestoreOperationRequest) AsBasicValidateOperationRequest() (BasicValidateOperationRequest, bool) { - return &vror, true +// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { + return &ssp, true } -// UnmarshalJSON is the custom unmarshaler for ValidateRestoreOperationRequest struct. -func (vror *ValidateRestoreOperationRequest) UnmarshalJSON(body []byte) error { +// SQLDataDirectory sQLDataDirectory info +type SQLDataDirectory struct { + // Type - Type of data directory mapping. Possible values include: 'SQLDataDirectoryTypeInvalid', 'SQLDataDirectoryTypeData', 'SQLDataDirectoryTypeLog' + Type SQLDataDirectoryType `json:"type,omitempty"` + // Path - File path + Path *string `json:"path,omitempty"` + // LogicalName - Logical name of the file + LogicalName *string `json:"logicalName,omitempty"` +} + +// SQLDataDirectoryMapping encapsulates information regarding data directory +type SQLDataDirectoryMapping struct { + // MappingType - Type of data directory mapping. Possible values include: 'SQLDataDirectoryTypeInvalid', 'SQLDataDirectoryTypeData', 'SQLDataDirectoryTypeLog' + MappingType SQLDataDirectoryType `json:"mappingType,omitempty"` + // SourceLogicalName - Restore source logical name path + SourceLogicalName *string `json:"sourceLogicalName,omitempty"` + // SourcePath - Restore source path + SourcePath *string `json:"sourcePath,omitempty"` + // TargetPath - Target path + TargetPath *string `json:"targetPath,omitempty"` +} + +// SubProtectionPolicy sub-protection policy which includes schedule and retention +type SubProtectionPolicy struct { + // 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. + RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SubProtectionPolicy struct. +func (spp *SubProtectionPolicy) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -18535,22 +9603,30 @@ func (vror *ValidateRestoreOperationRequest) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "restoreRequest": + case "policyType": if v != nil { - restoreRequest, err := unmarshalBasicRestoreRequest(*v) + var policyType PolicyType + err = json.Unmarshal(*v, &policyType) if err != nil { return err } - vror.RestoreRequest = restoreRequest + spp.PolicyType = policyType } - case "objectType": + case "schedulePolicy": if v != nil { - var objectType ObjectTypeBasicValidateOperationRequest - err = json.Unmarshal(*v, &objectType) + schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) if err != nil { return err } - vror.ObjectType = objectType + spp.SchedulePolicy = schedulePolicy + } + case "retentionPolicy": + if v != nil { + retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) + if err != nil { + return err + } + spp.RetentionPolicy = retentionPolicy } } } @@ -18558,231 +9634,70 @@ func (vror *ValidateRestoreOperationRequest) UnmarshalJSON(body []byte) error { return nil } -// WeeklyRetentionFormat weekly retention format. -type WeeklyRetentionFormat struct { - // DaysOfTheWeek - List of days of the week. - DaysOfTheWeek *[]DayOfWeek `json:"daysOfTheWeek,omitempty"` - // WeeksOfTheMonth - List of weeks of month. - WeeksOfTheMonth *[]WeekOfMonth `json:"weeksOfTheMonth,omitempty"` -} - -// WeeklyRetentionSchedule weekly retention schedule. -type WeeklyRetentionSchedule struct { - // DaysOfTheWeek - List of days of week for weekly retention policy. - DaysOfTheWeek *[]DayOfWeek `json:"daysOfTheWeek,omitempty"` - // RetentionTimes - Retention times of retention policy. - RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` - // RetentionDuration - Retention duration of retention Policy. - RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` -} - -// WorkloadInquiryDetails details of an inquired protectable item. -type WorkloadInquiryDetails struct { - // Type - Type of the Workload such as SQL, Oracle etc. - Type *string `json:"type,omitempty"` - // ItemCount - Contains the protectable item Count inside this Container. - ItemCount *int64 `json:"itemCount,omitempty"` - // InquiryValidation - Inquiry validation such as permissions and other backup validations. - InquiryValidation *InquiryValidation `json:"inquiryValidation,omitempty"` -} - -// BasicWorkloadItem base class for backup item. Workload-specific backup items are derived from this class. -type BasicWorkloadItem interface { - AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) - AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) - AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) - AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) - AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) - AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) - AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) - AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) - AsWorkloadItem() (*WorkloadItem, bool) -} - -// WorkloadItem base class for backup item. Workload-specific backup items are derived from this class. -type WorkloadItem struct { - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +// TargetAFSRestoreInfo target Azure File Share Info. +type TargetAFSRestoreInfo struct { + // Name - File share name + Name *string `json:"name,omitempty"` + // TargetResourceID - Target file share resource ARM ID + TargetResourceID *string `json:"targetResourceId,omitempty"` } -func unmarshalBasicWorkloadItem(body []byte) (BasicWorkloadItem, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["workloadItemType"] { - case string(WorkloadItemTypeAzureVMWorkloadItem): - var avwi AzureVMWorkloadItem - err := json.Unmarshal(body, &avwi) - return avwi, err - case string(WorkloadItemTypeSAPAseDatabase1): - var avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem - err := json.Unmarshal(body, &avwsadwi) - return avwsadwi, err - case string(WorkloadItemTypeSAPAseSystem1): - var avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem - err := json.Unmarshal(body, &avwsaswi) - return avwsaswi, err - case string(WorkloadItemTypeSAPHanaDatabase1): - var avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem - err := json.Unmarshal(body, &avwshdwi) - return avwshdwi, err - case string(WorkloadItemTypeSAPHanaSystem1): - var avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem - err := json.Unmarshal(body, &avwshswi) - return avwshswi, err - case string(WorkloadItemTypeSQLDataBase1): - var avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem - err := json.Unmarshal(body, &avwsdwi) - return avwsdwi, err - case string(WorkloadItemTypeSQLInstance1): - var avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem - err := json.Unmarshal(body, &avwsiwi) - return avwsiwi, err - default: - var wi WorkloadItem - err := json.Unmarshal(body, &wi) - return wi, err - } +// TargetRestoreInfo details about target workload during restore operation. +type TargetRestoreInfo struct { + // OverwriteOption - Can Overwrite if Target DataBase already exists. Possible values include: 'OverwriteOptionsInvalid', 'OverwriteOptionsFailOnConflict', 'OverwriteOptionsOverwrite' + OverwriteOption OverwriteOptions `json:"overwriteOption,omitempty"` + // ContainerID - Resource Id name of the container in which Target DataBase resides + ContainerID *string `json:"containerId,omitempty"` + // DatabaseName - Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana + DatabaseName *string `json:"databaseName,omitempty"` } -func unmarshalBasicWorkloadItemArray(body []byte) ([]BasicWorkloadItem, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - wiArray := make([]BasicWorkloadItem, len(rawMessages)) - for index, rawMessage := range rawMessages { - wi, err := unmarshalBasicWorkloadItem(*rawMessage) - if err != nil { - return nil, err - } - wiArray[index] = wi - } - return wiArray, nil +// ValidateIaasVMRestoreOperationRequest azureRestoreValidation request. +type ValidateIaasVMRestoreOperationRequest struct { + // RestoreRequest - Sets restore request to be validated + RestoreRequest BasicRestoreRequest `json:"restoreRequest,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeValidateOperationRequest', 'ObjectTypeValidateIaasVMRestoreOperationRequest', 'ObjectTypeValidateRestoreOperationRequest' + ObjectType ObjectTypeBasicValidateOperationRequest `json:"objectType,omitempty"` } -// MarshalJSON is the custom marshaler for WorkloadItem. -func (wi WorkloadItem) MarshalJSON() ([]byte, error) { - wi.WorkloadItemType = WorkloadItemTypeWorkloadItem +// MarshalJSON is the custom marshaler for ValidateIaasVMRestoreOperationRequest. +func (vivror ValidateIaasVMRestoreOperationRequest) MarshalJSON() ([]byte, error) { + vivror.ObjectType = ObjectTypeValidateIaasVMRestoreOperationRequest objectMap := make(map[string]interface{}) - if wi.BackupManagementType != nil { - objectMap["backupManagementType"] = wi.BackupManagementType - } - if wi.WorkloadType != nil { - objectMap["workloadType"] = wi.WorkloadType - } - if wi.FriendlyName != nil { - objectMap["friendlyName"] = wi.FriendlyName - } - if wi.ProtectionState != "" { - objectMap["protectionState"] = wi.ProtectionState - } - if wi.WorkloadItemType != "" { - objectMap["workloadItemType"] = wi.WorkloadItemType + objectMap["restoreRequest"] = vivror.RestoreRequest + if vivror.ObjectType != "" { + objectMap["objectType"] = vivror.ObjectType } return json.Marshal(objectMap) } -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { - return nil, false +// AsValidateIaasVMRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. +func (vivror ValidateIaasVMRestoreOperationRequest) AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) { + return &vivror, true } -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { +// AsValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. +func (vivror ValidateIaasVMRestoreOperationRequest) AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) { return nil, false } -// AsWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { - return &wi, true -} - -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &wi, true +// AsBasicValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. +func (vivror ValidateIaasVMRestoreOperationRequest) AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) { + return &vivror, true } - -// WorkloadItemResource base class for backup item. Workload-specific backup items are derived from this -// class. -type WorkloadItemResource struct { - // Properties - WorkloadItemResource properties - Properties BasicWorkloadItem `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` + +// AsValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. +func (vivror ValidateIaasVMRestoreOperationRequest) AsValidateOperationRequest() (*ValidateOperationRequest, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for WorkloadItemResource. -func (wir WorkloadItemResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = wir.Properties - if wir.Location != nil { - objectMap["location"] = wir.Location - } - if wir.Tags != nil { - objectMap["tags"] = wir.Tags - } - if wir.ETag != nil { - objectMap["eTag"] = wir.ETag - } - return json.Marshal(objectMap) +// AsBasicValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. +func (vivror ValidateIaasVMRestoreOperationRequest) AsBasicValidateOperationRequest() (BasicValidateOperationRequest, bool) { + return &vivror, true } -// UnmarshalJSON is the custom unmarshaler for WorkloadItemResource struct. -func (wir *WorkloadItemResource) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ValidateIaasVMRestoreOperationRequest struct. +func (vivror *ValidateIaasVMRestoreOperationRequest) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -18790,67 +9705,22 @@ func (wir *WorkloadItemResource) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicWorkloadItem(*v) - if err != nil { - return err - } - wir.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - wir.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - wir.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - wir.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - wir.Location = &location - } - case "tags": + case "restoreRequest": if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) + restoreRequest, err := unmarshalBasicRestoreRequest(*v) if err != nil { return err } - wir.Tags = tags + vivror.RestoreRequest = restoreRequest } - case "eTag": + case "objectType": if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) + var objectType ObjectTypeBasicValidateOperationRequest + err = json.Unmarshal(*v, &objectType) if err != nil { return err } - wir.ETag = &eTag + vivror.ObjectType = objectType } } } @@ -18858,409 +9728,197 @@ func (wir *WorkloadItemResource) UnmarshalJSON(body []byte) error { return nil } -// WorkloadItemResourceList list of WorkloadItem resources -type WorkloadItemResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]WorkloadItemResource `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"` +// BasicValidateOperationRequest base class for validate operation request. +type BasicValidateOperationRequest interface { + AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) + AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) + AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) + AsValidateOperationRequest() (*ValidateOperationRequest, bool) } -// WorkloadItemResourceListIterator provides access to a complete listing of WorkloadItemResource values. -type WorkloadItemResourceListIterator struct { - i int - page WorkloadItemResourceListPage +// ValidateOperationRequest base class for validate operation request. +type ValidateOperationRequest struct { + // ObjectType - Possible values include: 'ObjectTypeValidateOperationRequest', 'ObjectTypeValidateIaasVMRestoreOperationRequest', 'ObjectTypeValidateRestoreOperationRequest' + ObjectType ObjectTypeBasicValidateOperationRequest `json:"objectType,omitempty"` } -// NextWithContext 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 *WorkloadItemResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadItemResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) +func unmarshalBasicValidateOperationRequest(body []byte) (BasicValidateOperationRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) if err != nil { - iter.i-- - return err + return nil, err } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *WorkloadItemResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter WorkloadItemResourceListIterator) 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 WorkloadItemResourceListIterator) Response() WorkloadItemResourceList { - 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 WorkloadItemResourceListIterator) Value() WorkloadItemResource { - if !iter.page.NotDone() { - return WorkloadItemResource{} + switch m["objectType"] { + case string(ObjectTypeValidateIaasVMRestoreOperationRequest): + var vivror ValidateIaasVMRestoreOperationRequest + err := json.Unmarshal(body, &vivror) + return vivror, err + case string(ObjectTypeValidateRestoreOperationRequest): + var vror ValidateRestoreOperationRequest + err := json.Unmarshal(body, &vror) + return vror, err + default: + var vor ValidateOperationRequest + err := json.Unmarshal(body, &vor) + return vor, err } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the WorkloadItemResourceListIterator type. -func NewWorkloadItemResourceListIterator(page WorkloadItemResourceListPage) WorkloadItemResourceListIterator { - return WorkloadItemResourceListIterator{page: page} } +func unmarshalBasicValidateOperationRequestArray(body []byte) ([]BasicValidateOperationRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } -// IsEmpty returns true if the ListResult contains no values. -func (wirl WorkloadItemResourceList) IsEmpty() bool { - return wirl.Value == nil || len(*wirl.Value) == 0 -} + vorArray := make([]BasicValidateOperationRequest, len(rawMessages)) -// hasNextLink returns true if the NextLink is not empty. -func (wirl WorkloadItemResourceList) hasNextLink() bool { - return wirl.NextLink != nil && len(*wirl.NextLink) != 0 + for index, rawMessage := range rawMessages { + vor, err := unmarshalBasicValidateOperationRequest(*rawMessage) + if err != nil { + return nil, err + } + vorArray[index] = vor + } + return vorArray, nil } -// workloadItemResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (wirl WorkloadItemResourceList) workloadItemResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !wirl.hasNextLink() { - return nil, nil +// MarshalJSON is the custom marshaler for ValidateOperationRequest. +func (vor ValidateOperationRequest) MarshalJSON() ([]byte, error) { + vor.ObjectType = ObjectTypeValidateOperationRequest + objectMap := make(map[string]interface{}) + if vor.ObjectType != "" { + objectMap["objectType"] = vor.ObjectType } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(wirl.NextLink))) + return json.Marshal(objectMap) } -// WorkloadItemResourceListPage contains a page of WorkloadItemResource values. -type WorkloadItemResourceListPage struct { - fn func(context.Context, WorkloadItemResourceList) (WorkloadItemResourceList, error) - wirl WorkloadItemResourceList +// AsValidateIaasVMRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. +func (vor ValidateOperationRequest) AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) { + return nil, false } -// NextWithContext 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 *WorkloadItemResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadItemResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.wirl) - if err != nil { - return err - } - page.wirl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil +// AsValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. +func (vor ValidateOperationRequest) AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) { + return nil, false } -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *WorkloadItemResourceListPage) Next() error { - return page.NextWithContext(context.Background()) +// AsBasicValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. +func (vor ValidateOperationRequest) AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) { + return nil, false } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page WorkloadItemResourceListPage) NotDone() bool { - return !page.wirl.IsEmpty() +// AsValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. +func (vor ValidateOperationRequest) AsValidateOperationRequest() (*ValidateOperationRequest, bool) { + return &vor, true } -// Response returns the raw server response from the last page request. -func (page WorkloadItemResourceListPage) Response() WorkloadItemResourceList { - return page.wirl +// AsBasicValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. +func (vor ValidateOperationRequest) AsBasicValidateOperationRequest() (BasicValidateOperationRequest, bool) { + return &vor, true } -// Values returns the slice of values for the current page or nil if there are no values. -func (page WorkloadItemResourceListPage) Values() []WorkloadItemResource { - if page.wirl.IsEmpty() { - return nil - } - return *page.wirl.Value +// ValidateOperationResponse base class for validate operation response. +type ValidateOperationResponse struct { + // ValidationResults - Gets the validation result + ValidationResults *[]ErrorDetail `json:"validationResults,omitempty"` } -// Creates a new instance of the WorkloadItemResourceListPage type. -func NewWorkloadItemResourceListPage(cur WorkloadItemResourceList, getNextPage func(context.Context, WorkloadItemResourceList) (WorkloadItemResourceList, error)) WorkloadItemResourceListPage { - return WorkloadItemResourceListPage{ - fn: getNextPage, - wirl: cur, - } +// ValidateOperationsResponse ... +type ValidateOperationsResponse struct { + autorest.Response `json:"-"` + ValidateOperationResponse *ValidateOperationResponse `json:"validateOperationResponse,omitempty"` } -// BasicWorkloadProtectableItem base class for backup item. Workload-specific backup items are derived from this class. -type BasicWorkloadProtectableItem interface { - AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) - AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) - AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) - AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) - AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) - AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) - AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) - AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) - AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) - AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) - AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) - AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) - AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) - AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +// BasicValidateRestoreOperationRequest azureRestoreValidation request. +type BasicValidateRestoreOperationRequest interface { + AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) + AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) } -// WorkloadProtectableItem base class for backup item. Workload-specific backup items are derived from this -// class. -type WorkloadProtectableItem struct { - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +// ValidateRestoreOperationRequest azureRestoreValidation request. +type ValidateRestoreOperationRequest struct { + // RestoreRequest - Sets restore request to be validated + RestoreRequest BasicRestoreRequest `json:"restoreRequest,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeValidateOperationRequest', 'ObjectTypeValidateIaasVMRestoreOperationRequest', 'ObjectTypeValidateRestoreOperationRequest' + ObjectType ObjectTypeBasicValidateOperationRequest `json:"objectType,omitempty"` } -func unmarshalBasicWorkloadProtectableItem(body []byte) (BasicWorkloadProtectableItem, error) { +func unmarshalBasicValidateRestoreOperationRequest(body []byte) (BasicValidateRestoreOperationRequest, error) { var m map[string]interface{} err := json.Unmarshal(body, &m) if err != nil { return nil, err } - switch m["protectableItemType"] { - case string(ProtectableItemTypeAzureFileShare): - var afspi AzureFileShareProtectableItem - err := json.Unmarshal(body, &afspi) - return afspi, err - case string(ProtectableItemTypeMicrosoftClassicComputevirtualMachines): - var aisccvpi AzureIaaSClassicComputeVMProtectableItem - err := json.Unmarshal(body, &aisccvpi) - return aisccvpi, err - case string(ProtectableItemTypeMicrosoftComputevirtualMachines): - var aiscvpi AzureIaaSComputeVMProtectableItem - err := json.Unmarshal(body, &aiscvpi) - return aiscvpi, err - case string(ProtectableItemTypeAzureVMWorkloadProtectableItem): - var avwpi AzureVMWorkloadProtectableItem - err := json.Unmarshal(body, &avwpi) - return avwpi, err - case string(ProtectableItemTypeSAPAseSystem): - var avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem - err := json.Unmarshal(body, &avwsaspi) - return avwsaspi, err - case string(ProtectableItemTypeSAPHanaDatabase): - var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem - err := json.Unmarshal(body, &avwshdpi) - return avwshdpi, err - case string(ProtectableItemTypeSAPHanaSystem): - var avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem - err := json.Unmarshal(body, &avwshspi) - return avwshspi, err - case string(ProtectableItemTypeSQLAvailabilityGroupContainer): - var avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem - err := json.Unmarshal(body, &avwsagpi) - return avwsagpi, err - case string(ProtectableItemTypeSQLDataBase): - var avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem - err := json.Unmarshal(body, &avwsdpi) - return avwsdpi, err - case string(ProtectableItemTypeSQLInstance): - var avwsipi AzureVMWorkloadSQLInstanceProtectableItem - err := json.Unmarshal(body, &avwsipi) - return avwsipi, err - case string(ProtectableItemTypeIaaSVMProtectableItem): - var ispi IaaSVMProtectableItem - err := json.Unmarshal(body, &ispi) - return ispi, err + switch m["objectType"] { + case string(ObjectTypeValidateIaasVMRestoreOperationRequest): + var vivror ValidateIaasVMRestoreOperationRequest + err := json.Unmarshal(body, &vivror) + return vivror, err default: - var wpi WorkloadProtectableItem - err := json.Unmarshal(body, &wpi) - return wpi, err + var vror ValidateRestoreOperationRequest + err := json.Unmarshal(body, &vror) + return vror, err } } -func unmarshalBasicWorkloadProtectableItemArray(body []byte) ([]BasicWorkloadProtectableItem, error) { +func unmarshalBasicValidateRestoreOperationRequestArray(body []byte) ([]BasicValidateRestoreOperationRequest, error) { var rawMessages []*json.RawMessage err := json.Unmarshal(body, &rawMessages) if err != nil { return nil, err } - wpiArray := make([]BasicWorkloadProtectableItem, len(rawMessages)) + vrorArray := make([]BasicValidateRestoreOperationRequest, len(rawMessages)) for index, rawMessage := range rawMessages { - wpi, err := unmarshalBasicWorkloadProtectableItem(*rawMessage) + vror, err := unmarshalBasicValidateRestoreOperationRequest(*rawMessage) if err != nil { return nil, err } - wpiArray[index] = wpi + vrorArray[index] = vror } - return wpiArray, nil + return vrorArray, nil } -// MarshalJSON is the custom marshaler for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) MarshalJSON() ([]byte, error) { - wpi.ProtectableItemType = ProtectableItemTypeWorkloadProtectableItem +// MarshalJSON is the custom marshaler for ValidateRestoreOperationRequest. +func (vror ValidateRestoreOperationRequest) MarshalJSON() ([]byte, error) { + vror.ObjectType = ObjectTypeValidateRestoreOperationRequest objectMap := make(map[string]interface{}) - if wpi.BackupManagementType != nil { - objectMap["backupManagementType"] = wpi.BackupManagementType - } - if wpi.WorkloadType != nil { - objectMap["workloadType"] = wpi.WorkloadType - } - if wpi.FriendlyName != nil { - objectMap["friendlyName"] = wpi.FriendlyName - } - if wpi.ProtectionState != "" { - objectMap["protectionState"] = wpi.ProtectionState - } - if wpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = wpi.ProtectableItemType + objectMap["restoreRequest"] = vror.RestoreRequest + if vror.ObjectType != "" { + objectMap["objectType"] = vror.ObjectType } return json.Marshal(objectMap) } -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { +// AsValidateIaasVMRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. +func (vror ValidateRestoreOperationRequest) AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) { return nil, false } -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false +// AsValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. +func (vror ValidateRestoreOperationRequest) AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) { + return &vror, true } -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return nil, false +// AsBasicValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. +func (vror ValidateRestoreOperationRequest) AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) { + return &vror, true } -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { +// AsValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. +func (vror ValidateRestoreOperationRequest) AsValidateOperationRequest() (*ValidateOperationRequest, bool) { return nil, false } -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return &wpi, true -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &wpi, true -} - -// WorkloadProtectableItemResource base class for backup item. Workload-specific backup items are derived -// from this class. -type WorkloadProtectableItemResource struct { - // Properties - WorkloadProtectableItemResource properties - Properties BasicWorkloadProtectableItem `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for WorkloadProtectableItemResource. -func (wpir WorkloadProtectableItemResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = wpir.Properties - if wpir.Location != nil { - objectMap["location"] = wpir.Location - } - if wpir.Tags != nil { - objectMap["tags"] = wpir.Tags - } - if wpir.ETag != nil { - objectMap["eTag"] = wpir.ETag - } - return json.Marshal(objectMap) +// AsBasicValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. +func (vror ValidateRestoreOperationRequest) AsBasicValidateOperationRequest() (BasicValidateOperationRequest, bool) { + return &vror, true } -// UnmarshalJSON is the custom unmarshaler for WorkloadProtectableItemResource struct. -func (wpir *WorkloadProtectableItemResource) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ValidateRestoreOperationRequest struct. +func (vror *ValidateRestoreOperationRequest) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -19268,67 +9926,22 @@ func (wpir *WorkloadProtectableItemResource) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicWorkloadProtectableItem(*v) - if err != nil { - return err - } - wpir.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - wpir.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - wpir.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - wpir.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - wpir.Location = &location - } - case "tags": + case "restoreRequest": if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) + restoreRequest, err := unmarshalBasicRestoreRequest(*v) if err != nil { return err } - wpir.Tags = tags + vror.RestoreRequest = restoreRequest } - case "eTag": + case "objectType": if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) + var objectType ObjectTypeBasicValidateOperationRequest + err = json.Unmarshal(*v, &objectType) if err != nil { return err } - wpir.ETag = &eTag + vror.ObjectType = objectType } } } @@ -19336,164 +9949,22 @@ func (wpir *WorkloadProtectableItemResource) UnmarshalJSON(body []byte) error { return nil } -// WorkloadProtectableItemResourceList list of WorkloadProtectableItem resources -type WorkloadProtectableItemResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]WorkloadProtectableItemResource `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"` -} - -// WorkloadProtectableItemResourceListIterator provides access to a complete listing of -// WorkloadProtectableItemResource values. -type WorkloadProtectableItemResourceListIterator struct { - i int - page WorkloadProtectableItemResourceListPage -} - -// NextWithContext 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 *WorkloadProtectableItemResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadProtectableItemResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *WorkloadProtectableItemResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter WorkloadProtectableItemResourceListIterator) 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 WorkloadProtectableItemResourceListIterator) Response() WorkloadProtectableItemResourceList { - 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 WorkloadProtectableItemResourceListIterator) Value() WorkloadProtectableItemResource { - if !iter.page.NotDone() { - return WorkloadProtectableItemResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the WorkloadProtectableItemResourceListIterator type. -func NewWorkloadProtectableItemResourceListIterator(page WorkloadProtectableItemResourceListPage) WorkloadProtectableItemResourceListIterator { - return WorkloadProtectableItemResourceListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (wpirl WorkloadProtectableItemResourceList) IsEmpty() bool { - return wpirl.Value == nil || len(*wpirl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (wpirl WorkloadProtectableItemResourceList) hasNextLink() bool { - return wpirl.NextLink != nil && len(*wpirl.NextLink) != 0 -} - -// workloadProtectableItemResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (wpirl WorkloadProtectableItemResourceList) workloadProtectableItemResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !wpirl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(wpirl.NextLink))) -} - -// WorkloadProtectableItemResourceListPage contains a page of WorkloadProtectableItemResource values. -type WorkloadProtectableItemResourceListPage struct { - fn func(context.Context, WorkloadProtectableItemResourceList) (WorkloadProtectableItemResourceList, error) - wpirl WorkloadProtectableItemResourceList -} - -// NextWithContext 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 *WorkloadProtectableItemResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadProtectableItemResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.wpirl) - if err != nil { - return err - } - page.wpirl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *WorkloadProtectableItemResourceListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page WorkloadProtectableItemResourceListPage) NotDone() bool { - return !page.wpirl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page WorkloadProtectableItemResourceListPage) Response() WorkloadProtectableItemResourceList { - return page.wpirl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page WorkloadProtectableItemResourceListPage) Values() []WorkloadProtectableItemResource { - if page.wpirl.IsEmpty() { - return nil - } - return *page.wpirl.Value +// WeeklyRetentionFormat weekly retention format. +type WeeklyRetentionFormat struct { + // DaysOfTheWeek - List of days of the week. + DaysOfTheWeek *[]DayOfWeek `json:"daysOfTheWeek,omitempty"` + // WeeksOfTheMonth - List of weeks of month. + WeeksOfTheMonth *[]WeekOfMonth `json:"weeksOfTheMonth,omitempty"` } -// Creates a new instance of the WorkloadProtectableItemResourceListPage type. -func NewWorkloadProtectableItemResourceListPage(cur WorkloadProtectableItemResourceList, getNextPage func(context.Context, WorkloadProtectableItemResourceList) (WorkloadProtectableItemResourceList, error)) WorkloadProtectableItemResourceListPage { - return WorkloadProtectableItemResourceListPage{ - fn: getNextPage, - wpirl: cur, - } +// WeeklyRetentionSchedule weekly retention schedule. +type WeeklyRetentionSchedule struct { + // DaysOfTheWeek - List of days of week for weekly retention policy. + DaysOfTheWeek *[]DayOfWeek `json:"daysOfTheWeek,omitempty"` + // RetentionTimes - Retention times of retention policy. + RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` + // RetentionDuration - Retention duration of retention Policy. + RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` } // YearlyRetentionSchedule yearly retention schedule. diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/protectionpolicies.go b/services/recoveryservices/mgmt/2019-05-13/backup/protectionpolicies.go index 27df97f12e98..07aad7b43bc3 100644 --- a/services/recoveryservices/mgmt/2019-05-13/backup/protectionpolicies.go +++ b/services/recoveryservices/mgmt/2019-05-13/backup/protectionpolicies.go @@ -114,85 +114,6 @@ func (client ProtectionPoliciesClient) CreateOrUpdateResponder(resp *http.Respon return } -// Delete deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status -// of the -// operation can be fetched using GetPolicyOperationResult API. -// Parameters: -// vaultName - the name of the recovery services vault. -// resourceGroupName - the name of the resource group where the recovery services vault is present. -// policyName - backup policy to be deleted. -func (client ProtectionPoliciesClient) Delete(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionPoliciesClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, vaultName, resourceGroupName, policyName) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ProtectionPoliciesClient) DeletePreparer(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "policyName": autorest.Encode("path", policyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-12-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}/backupPolicies/{policyName}", 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 ProtectionPoliciesClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ProtectionPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - // Get provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous // operation. Status of the operation can be fetched using GetPolicyOperationResult API. // Parameters: diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/CHANGELOG.md b/services/recoveryservices/mgmt/2019-06-15/backup/CHANGELOG.md index 52911e4cc5e4..927cd960f0ee 100644 --- a/services/recoveryservices/mgmt/2019-06-15/backup/CHANGELOG.md +++ b/services/recoveryservices/mgmt/2019-06-15/backup/CHANGELOG.md @@ -1,2 +1,1314 @@ -# Change History +# Unreleased +## Breaking Changes + +### Removed Constants + +1. AzureFileShareType.XSMB +1. AzureFileShareType.XSync +1. ContainerType.ContainerTypeAzureBackupServerContainer +1. ContainerType.ContainerTypeAzureSQLContainer +1. ContainerType.ContainerTypeCluster +1. ContainerType.ContainerTypeDPMContainer +1. ContainerType.ContainerTypeGenericContainer +1. ContainerType.ContainerTypeIaasVMContainer +1. ContainerType.ContainerTypeIaasVMServiceContainer +1. ContainerType.ContainerTypeInvalid +1. ContainerType.ContainerTypeMABContainer +1. ContainerType.ContainerTypeSQLAGWorkLoadContainer +1. ContainerType.ContainerTypeStorageContainer +1. ContainerType.ContainerTypeUnknown +1. ContainerType.ContainerTypeVCenter +1. ContainerType.ContainerTypeVMAppContainer +1. ContainerType.ContainerTypeWindows +1. ContainerTypeBasicProtectionContainer.ContainerTypeAzureBackupServerContainer1 +1. ContainerTypeBasicProtectionContainer.ContainerTypeAzureSQLContainer1 +1. ContainerTypeBasicProtectionContainer.ContainerTypeAzureWorkloadContainer +1. ContainerTypeBasicProtectionContainer.ContainerTypeDPMContainer1 +1. ContainerTypeBasicProtectionContainer.ContainerTypeGenericContainer1 +1. ContainerTypeBasicProtectionContainer.ContainerTypeIaaSVMContainer +1. ContainerTypeBasicProtectionContainer.ContainerTypeMicrosoftClassicComputevirtualMachines +1. ContainerTypeBasicProtectionContainer.ContainerTypeMicrosoftComputevirtualMachines +1. ContainerTypeBasicProtectionContainer.ContainerTypeProtectionContainer +1. ContainerTypeBasicProtectionContainer.ContainerTypeSQLAGWorkLoadContainer1 +1. ContainerTypeBasicProtectionContainer.ContainerTypeStorageContainer1 +1. ContainerTypeBasicProtectionContainer.ContainerTypeVMAppContainer1 +1. ContainerTypeBasicProtectionContainer.ContainerTypeWindows1 +1. CopyOptions.CopyOptionsCreateCopy +1. CopyOptions.CopyOptionsFailOnConflict +1. CopyOptions.CopyOptionsInvalid +1. CopyOptions.CopyOptionsOverwrite +1. CopyOptions.CopyOptionsSkip +1. EngineType.BackupEngineTypeAzureBackupServerEngine +1. EngineType.BackupEngineTypeBackupEngineBase +1. EngineType.BackupEngineTypeDpmBackupEngine +1. FabricName.FabricNameAzure +1. FabricName.FabricNameInvalid +1. FeatureType.FeatureTypeAzureBackupGoals +1. FeatureType.FeatureTypeAzureVMResourceBackup +1. FeatureType.FeatureTypeFeatureSupportRequest +1. InquiryStatus.InquiryStatusFailed +1. InquiryStatus.InquiryStatusInvalid +1. InquiryStatus.InquiryStatusSuccess +1. IntentItemType.IntentItemTypeInvalid +1. IntentItemType.IntentItemTypeSQLAvailabilityGroupContainer +1. IntentItemType.IntentItemTypeSQLInstance +1. ItemType.ItemTypeAzureFileShare +1. ItemType.ItemTypeAzureSQLDb +1. ItemType.ItemTypeClient +1. ItemType.ItemTypeExchange +1. ItemType.ItemTypeFileFolder +1. ItemType.ItemTypeGenericDataSource +1. ItemType.ItemTypeInvalid +1. ItemType.ItemTypeSAPAseDatabase +1. ItemType.ItemTypeSAPHanaDatabase +1. ItemType.ItemTypeSQLDB +1. ItemType.ItemTypeSQLDataBase +1. ItemType.ItemTypeSharepoint +1. ItemType.ItemTypeSystemState +1. ItemType.ItemTypeVM +1. ItemType.ItemTypeVMwareVM +1. ObjectTypeBasicILRRequest.ObjectTypeAzureFileShareProvisionILRRequest +1. ObjectTypeBasicILRRequest.ObjectTypeILRRequest +1. ObjectTypeBasicILRRequest.ObjectTypeIaasVMILRRegistrationRequest +1. ObjectTypeBasicOperationStatusExtendedInfo.ObjectTypeOperationStatusExtendedInfo +1. ObjectTypeBasicOperationStatusExtendedInfo.ObjectTypeOperationStatusJobExtendedInfo +1. ObjectTypeBasicOperationStatusExtendedInfo.ObjectTypeOperationStatusJobsExtendedInfo +1. ObjectTypeBasicOperationStatusExtendedInfo.ObjectTypeOperationStatusProvisionILRExtendedInfo +1. ObjectTypeBasicRequest.ObjectTypeAzureFileShareBackupRequest +1. ObjectTypeBasicRequest.ObjectTypeAzureWorkloadBackupRequest +1. ObjectTypeBasicRequest.ObjectTypeBackupRequest +1. ObjectTypeBasicRequest.ObjectTypeIaasVMBackupRequest +1. OperationStatusValues.OperationStatusValuesCanceled +1. OperationStatusValues.OperationStatusValuesFailed +1. OperationStatusValues.OperationStatusValuesInProgress +1. OperationStatusValues.OperationStatusValuesInvalid +1. OperationStatusValues.OperationStatusValuesSucceeded +1. OperationType.OperationTypeInvalid +1. OperationType.OperationTypeRegister +1. OperationType.OperationTypeReregister +1. ProtectableContainerType.ProtectableContainerTypeProtectableContainer +1. ProtectableContainerType.ProtectableContainerTypeStorageContainer +1. ProtectableContainerType.ProtectableContainerTypeVMAppContainer +1. ProtectableItemType.ProtectableItemTypeAzureFileShare +1. ProtectableItemType.ProtectableItemTypeAzureVMWorkloadProtectableItem +1. ProtectableItemType.ProtectableItemTypeIaaSVMProtectableItem +1. ProtectableItemType.ProtectableItemTypeMicrosoftClassicComputevirtualMachines +1. ProtectableItemType.ProtectableItemTypeMicrosoftComputevirtualMachines +1. ProtectableItemType.ProtectableItemTypeSAPAseSystem +1. ProtectableItemType.ProtectableItemTypeSAPHanaDatabase +1. ProtectableItemType.ProtectableItemTypeSAPHanaSystem +1. ProtectableItemType.ProtectableItemTypeSQLAvailabilityGroupContainer +1. ProtectableItemType.ProtectableItemTypeSQLDataBase +1. ProtectableItemType.ProtectableItemTypeSQLInstance +1. ProtectableItemType.ProtectableItemTypeWorkloadProtectableItem +1. ProtectionIntentItemType.ProtectionIntentItemTypeAzureResourceItem +1. ProtectionIntentItemType.ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent +1. ProtectionIntentItemType.ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent +1. ProtectionIntentItemType.ProtectionIntentItemTypeProtectionIntent +1. ProtectionIntentItemType.ProtectionIntentItemTypeRecoveryServiceVaultItem +1. ProtectionStatus.ProtectionStatusInvalid +1. ProtectionStatus.ProtectionStatusNotProtected +1. ProtectionStatus.ProtectionStatusProtected +1. ProtectionStatus.ProtectionStatusProtecting +1. ProtectionStatus.ProtectionStatusProtectionFailed +1. SupportStatus.SupportStatusDefaultOFF +1. SupportStatus.SupportStatusDefaultON +1. SupportStatus.SupportStatusInvalid +1. SupportStatus.SupportStatusNotSupported +1. SupportStatus.SupportStatusSupported +1. Type.TypeBackupProtectedItemCountSummary +1. Type.TypeBackupProtectionContainerCountSummary +1. Type.TypeInvalid +1. TypeEnum.TypeEnumCopyOnlyFull +1. TypeEnum.TypeEnumDifferential +1. TypeEnum.TypeEnumFull +1. TypeEnum.TypeEnumInvalid +1. TypeEnum.TypeEnumLog +1. UsagesUnit.Bytes +1. UsagesUnit.BytesPerSecond +1. UsagesUnit.Count +1. UsagesUnit.CountPerSecond +1. UsagesUnit.Percent +1. UsagesUnit.Seconds +1. ValidationStatus.ValidationStatusFailed +1. ValidationStatus.ValidationStatusInvalid +1. ValidationStatus.ValidationStatusSucceeded +1. WorkloadItemType.WorkloadItemTypeInvalid +1. WorkloadItemType.WorkloadItemTypeSAPAseDatabase +1. WorkloadItemType.WorkloadItemTypeSAPAseSystem +1. WorkloadItemType.WorkloadItemTypeSAPHanaDatabase +1. WorkloadItemType.WorkloadItemTypeSAPHanaSystem +1. WorkloadItemType.WorkloadItemTypeSQLDataBase +1. WorkloadItemType.WorkloadItemTypeSQLInstance +1. WorkloadItemTypeBasicWorkloadItem.WorkloadItemTypeAzureVMWorkloadItem +1. WorkloadItemTypeBasicWorkloadItem.WorkloadItemTypeSAPAseDatabase1 +1. WorkloadItemTypeBasicWorkloadItem.WorkloadItemTypeSAPAseSystem1 +1. WorkloadItemTypeBasicWorkloadItem.WorkloadItemTypeSAPHanaDatabase1 +1. WorkloadItemTypeBasicWorkloadItem.WorkloadItemTypeSAPHanaSystem1 +1. WorkloadItemTypeBasicWorkloadItem.WorkloadItemTypeSQLDataBase1 +1. WorkloadItemTypeBasicWorkloadItem.WorkloadItemTypeSQLInstance1 +1. WorkloadItemTypeBasicWorkloadItem.WorkloadItemTypeWorkloadItem + +### Removed Funcs + +1. *ClientDiscoveryResponseIterator.Next() error +1. *ClientDiscoveryResponseIterator.NextWithContext(context.Context) error +1. *ClientDiscoveryResponsePage.Next() error +1. *ClientDiscoveryResponsePage.NextWithContext(context.Context) error +1. *EngineBaseResource.UnmarshalJSON([]byte) error +1. *EngineBaseResourceListIterator.Next() error +1. *EngineBaseResourceListIterator.NextWithContext(context.Context) error +1. *EngineBaseResourceListPage.Next() error +1. *EngineBaseResourceListPage.NextWithContext(context.Context) error +1. *ILRRequestResource.UnmarshalJSON([]byte) error +1. *OperationStatus.UnmarshalJSON([]byte) error +1. *ProtectableContainerResource.UnmarshalJSON([]byte) error +1. *ProtectableContainerResourceListIterator.Next() error +1. *ProtectableContainerResourceListIterator.NextWithContext(context.Context) error +1. *ProtectableContainerResourceListPage.Next() error +1. *ProtectableContainerResourceListPage.NextWithContext(context.Context) error +1. *ProtectionContainerResource.UnmarshalJSON([]byte) error +1. *ProtectionContainerResourceListIterator.Next() error +1. *ProtectionContainerResourceListIterator.NextWithContext(context.Context) error +1. *ProtectionContainerResourceListPage.Next() error +1. *ProtectionContainerResourceListPage.NextWithContext(context.Context) error +1. *ProtectionIntentResource.UnmarshalJSON([]byte) error +1. *ProtectionIntentResourceListIterator.Next() error +1. *ProtectionIntentResourceListIterator.NextWithContext(context.Context) error +1. *ProtectionIntentResourceListPage.Next() error +1. *ProtectionIntentResourceListPage.NextWithContext(context.Context) error +1. *RequestResource.UnmarshalJSON([]byte) error +1. *WorkloadItemResource.UnmarshalJSON([]byte) error +1. *WorkloadItemResourceListIterator.Next() error +1. *WorkloadItemResourceListIterator.NextWithContext(context.Context) error +1. *WorkloadItemResourceListPage.Next() error +1. *WorkloadItemResourceListPage.NextWithContext(context.Context) error +1. *WorkloadProtectableItemResource.UnmarshalJSON([]byte) error +1. *WorkloadProtectableItemResourceListIterator.Next() error +1. *WorkloadProtectableItemResourceListIterator.NextWithContext(context.Context) error +1. *WorkloadProtectableItemResourceListPage.Next() error +1. *WorkloadProtectableItemResourceListPage.NextWithContext(context.Context) error +1. AzureBackupGoalFeatureSupportRequest.AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) +1. AzureBackupGoalFeatureSupportRequest.AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) +1. AzureBackupGoalFeatureSupportRequest.AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) +1. AzureBackupGoalFeatureSupportRequest.AsFeatureSupportRequest() (*FeatureSupportRequest, bool) +1. AzureBackupGoalFeatureSupportRequest.MarshalJSON() ([]byte, error) +1. AzureBackupServerContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. AzureBackupServerContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. AzureBackupServerContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. AzureBackupServerContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. AzureBackupServerContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. AzureBackupServerContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. AzureBackupServerContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. AzureBackupServerContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. AzureBackupServerContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. AzureBackupServerContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. AzureBackupServerContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. AzureBackupServerContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. AzureBackupServerContainer.AsDpmContainer() (*DpmContainer, bool) +1. AzureBackupServerContainer.AsGenericContainer() (*GenericContainer, bool) +1. AzureBackupServerContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. AzureBackupServerContainer.AsMabContainer() (*MabContainer, bool) +1. AzureBackupServerContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. AzureBackupServerContainer.MarshalJSON() ([]byte, error) +1. AzureBackupServerEngine.AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) +1. AzureBackupServerEngine.AsBasicEngineBase() (BasicEngineBase, bool) +1. AzureBackupServerEngine.AsDpmBackupEngine() (*DpmBackupEngine, bool) +1. AzureBackupServerEngine.AsEngineBase() (*EngineBase, bool) +1. AzureBackupServerEngine.MarshalJSON() ([]byte, error) +1. AzureFileShareBackupRequest.AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) +1. AzureFileShareBackupRequest.AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) +1. AzureFileShareBackupRequest.AsBasicRequest() (BasicRequest, bool) +1. AzureFileShareBackupRequest.AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) +1. AzureFileShareBackupRequest.AsRequest() (*Request, bool) +1. AzureFileShareBackupRequest.MarshalJSON() ([]byte, error) +1. AzureFileShareProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureFileShareProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureFileShareProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureFileShareProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureFileShareProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureFileShareProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureFileShareProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureFileShareProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureFileShareProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureFileShareProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureFileShareProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureFileShareProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureFileShareProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureFileShareProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureFileShareProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureFileShareProtectableItem.MarshalJSON() ([]byte, error) +1. AzureFileShareProvisionILRRequest.AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) +1. AzureFileShareProvisionILRRequest.AsBasicILRRequest() (BasicILRRequest, bool) +1. AzureFileShareProvisionILRRequest.AsILRRequest() (*ILRRequest, bool) +1. AzureFileShareProvisionILRRequest.AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) +1. AzureFileShareProvisionILRRequest.MarshalJSON() ([]byte, error) +1. AzureIaaSClassicComputeVMContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsDpmContainer() (*DpmContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsGenericContainer() (*GenericContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsMabContainer() (*MabContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. AzureIaaSClassicComputeVMContainer.MarshalJSON() ([]byte, error) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.MarshalJSON() ([]byte, error) +1. AzureIaaSComputeVMContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. AzureIaaSComputeVMContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. AzureIaaSComputeVMContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. AzureIaaSComputeVMContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. AzureIaaSComputeVMContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. AzureIaaSComputeVMContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. AzureIaaSComputeVMContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. AzureIaaSComputeVMContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. AzureIaaSComputeVMContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. AzureIaaSComputeVMContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. AzureIaaSComputeVMContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. AzureIaaSComputeVMContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. AzureIaaSComputeVMContainer.AsDpmContainer() (*DpmContainer, bool) +1. AzureIaaSComputeVMContainer.AsGenericContainer() (*GenericContainer, bool) +1. AzureIaaSComputeVMContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. AzureIaaSComputeVMContainer.AsMabContainer() (*MabContainer, bool) +1. AzureIaaSComputeVMContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. AzureIaaSComputeVMContainer.MarshalJSON() ([]byte, error) +1. AzureIaaSComputeVMProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.MarshalJSON() ([]byte, error) +1. AzureRecoveryServiceVaultProtectionIntent.AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsBasicProtectionIntent() (BasicProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsProtectionIntent() (*ProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.MarshalJSON() ([]byte, error) +1. AzureResourceProtectionIntent.AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsBasicProtectionIntent() (BasicProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsProtectionIntent() (*ProtectionIntent, bool) +1. AzureResourceProtectionIntent.MarshalJSON() ([]byte, error) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsDpmContainer() (*DpmContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsGenericContainer() (*GenericContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsMabContainer() (*MabContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.MarshalJSON() ([]byte, error) +1. AzureSQLContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. AzureSQLContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. AzureSQLContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. AzureSQLContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. AzureSQLContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. AzureSQLContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. AzureSQLContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. AzureSQLContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. AzureSQLContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. AzureSQLContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. AzureSQLContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. AzureSQLContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. AzureSQLContainer.AsDpmContainer() (*DpmContainer, bool) +1. AzureSQLContainer.AsGenericContainer() (*GenericContainer, bool) +1. AzureSQLContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. AzureSQLContainer.AsMabContainer() (*MabContainer, bool) +1. AzureSQLContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. AzureSQLContainer.MarshalJSON() ([]byte, error) +1. AzureStorageContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. AzureStorageContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. AzureStorageContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. AzureStorageContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. AzureStorageContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. AzureStorageContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. AzureStorageContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. AzureStorageContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. AzureStorageContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. AzureStorageContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. AzureStorageContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. AzureStorageContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. AzureStorageContainer.AsDpmContainer() (*DpmContainer, bool) +1. AzureStorageContainer.AsGenericContainer() (*GenericContainer, bool) +1. AzureStorageContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. AzureStorageContainer.AsMabContainer() (*MabContainer, bool) +1. AzureStorageContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. AzureStorageContainer.MarshalJSON() ([]byte, error) +1. AzureStorageProtectableContainer.AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) +1. AzureStorageProtectableContainer.AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) +1. AzureStorageProtectableContainer.AsBasicProtectableContainer() (BasicProtectableContainer, bool) +1. AzureStorageProtectableContainer.AsProtectableContainer() (*ProtectableContainer, bool) +1. AzureStorageProtectableContainer.MarshalJSON() ([]byte, error) +1. AzureVMAppContainerProtectableContainer.AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) +1. AzureVMAppContainerProtectableContainer.AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) +1. AzureVMAppContainerProtectableContainer.AsBasicProtectableContainer() (BasicProtectableContainer, bool) +1. AzureVMAppContainerProtectableContainer.AsProtectableContainer() (*ProtectableContainer, bool) +1. AzureVMAppContainerProtectableContainer.MarshalJSON() ([]byte, error) +1. AzureVMAppContainerProtectionContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsDpmContainer() (*DpmContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsGenericContainer() (*GenericContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsMabContainer() (*MabContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. AzureVMAppContainerProtectionContainer.MarshalJSON() ([]byte, error) +1. AzureVMResourceFeatureSupportRequest.AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) +1. AzureVMResourceFeatureSupportRequest.AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) +1. AzureVMResourceFeatureSupportRequest.AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) +1. AzureVMResourceFeatureSupportRequest.AsFeatureSupportRequest() (*FeatureSupportRequest, bool) +1. AzureVMResourceFeatureSupportRequest.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadItem.AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +1. AzureVMWorkloadItem.AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) +1. AzureVMWorkloadItem.AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) +1. AzureVMWorkloadItem.AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) +1. AzureVMWorkloadItem.AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) +1. AzureVMWorkloadItem.AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) +1. AzureVMWorkloadItem.AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) +1. AzureVMWorkloadItem.AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) +1. AzureVMWorkloadItem.AsBasicWorkloadItem() (BasicWorkloadItem, bool) +1. AzureVMWorkloadItem.AsWorkloadItem() (*WorkloadItem, bool) +1. AzureVMWorkloadItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsBasicWorkloadItem() (BasicWorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsWorkloadItem() (*WorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsBasicWorkloadItem() (BasicWorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsWorkloadItem() (*WorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsBasicWorkloadItem() (BasicWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsWorkloadItem() (*WorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsBasicWorkloadItem() (BasicWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsWorkloadItem() (*WorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsBasicWorkloadItem() (BasicWorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsWorkloadItem() (*WorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsBasicWorkloadItem() (BasicWorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsWorkloadItem() (*WorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.MarshalJSON() ([]byte, error) +1. AzureWorkloadAutoProtectionIntent.AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsBasicProtectionIntent() (BasicProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsProtectionIntent() (*ProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.MarshalJSON() ([]byte, error) +1. AzureWorkloadBackupRequest.AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) +1. AzureWorkloadBackupRequest.AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) +1. AzureWorkloadBackupRequest.AsBasicRequest() (BasicRequest, bool) +1. AzureWorkloadBackupRequest.AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) +1. AzureWorkloadBackupRequest.AsRequest() (*Request, bool) +1. AzureWorkloadBackupRequest.MarshalJSON() ([]byte, error) +1. AzureWorkloadContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. AzureWorkloadContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. AzureWorkloadContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. AzureWorkloadContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. AzureWorkloadContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. AzureWorkloadContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. AzureWorkloadContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. AzureWorkloadContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. AzureWorkloadContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. AzureWorkloadContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. AzureWorkloadContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. AzureWorkloadContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. AzureWorkloadContainer.AsDpmContainer() (*DpmContainer, bool) +1. AzureWorkloadContainer.AsGenericContainer() (*GenericContainer, bool) +1. AzureWorkloadContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. AzureWorkloadContainer.AsMabContainer() (*MabContainer, bool) +1. AzureWorkloadContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. AzureWorkloadContainer.MarshalJSON() ([]byte, error) +1. AzureWorkloadSQLAutoProtectionIntent.AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsBasicProtectionIntent() (BasicProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsProtectionIntent() (*ProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.MarshalJSON() ([]byte, error) +1. BackupsClient.Trigger(context.Context, string, string, string, string, string, RequestResource) (autorest.Response, error) +1. BackupsClient.TriggerPreparer(context.Context, string, string, string, string, string, RequestResource) (*http.Request, error) +1. BackupsClient.TriggerResponder(*http.Response) (autorest.Response, error) +1. BackupsClient.TriggerSender(*http.Request) (*http.Response, error) +1. ClientDiscoveryResponse.IsEmpty() bool +1. ClientDiscoveryResponseIterator.NotDone() bool +1. ClientDiscoveryResponseIterator.Response() ClientDiscoveryResponse +1. ClientDiscoveryResponseIterator.Value() ClientDiscoveryValueForSingleAPI +1. ClientDiscoveryResponsePage.NotDone() bool +1. ClientDiscoveryResponsePage.Response() ClientDiscoveryResponse +1. ClientDiscoveryResponsePage.Values() []ClientDiscoveryValueForSingleAPI +1. DpmBackupEngine.AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) +1. DpmBackupEngine.AsBasicEngineBase() (BasicEngineBase, bool) +1. DpmBackupEngine.AsDpmBackupEngine() (*DpmBackupEngine, bool) +1. DpmBackupEngine.AsEngineBase() (*EngineBase, bool) +1. DpmBackupEngine.MarshalJSON() ([]byte, error) +1. DpmContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. DpmContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. DpmContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. DpmContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. DpmContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. DpmContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. DpmContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. DpmContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. DpmContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. DpmContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. DpmContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. DpmContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. DpmContainer.AsDpmContainer() (*DpmContainer, bool) +1. DpmContainer.AsGenericContainer() (*GenericContainer, bool) +1. DpmContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. DpmContainer.AsMabContainer() (*MabContainer, bool) +1. DpmContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. DpmContainer.MarshalJSON() ([]byte, error) +1. EngineBase.AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) +1. EngineBase.AsBasicEngineBase() (BasicEngineBase, bool) +1. EngineBase.AsDpmBackupEngine() (*DpmBackupEngine, bool) +1. EngineBase.AsEngineBase() (*EngineBase, bool) +1. EngineBase.MarshalJSON() ([]byte, error) +1. EngineBaseResource.MarshalJSON() ([]byte, error) +1. EngineBaseResourceList.IsEmpty() bool +1. EngineBaseResourceListIterator.NotDone() bool +1. EngineBaseResourceListIterator.Response() EngineBaseResourceList +1. EngineBaseResourceListIterator.Value() EngineBaseResource +1. EngineBaseResourceListPage.NotDone() bool +1. EngineBaseResourceListPage.Response() EngineBaseResourceList +1. EngineBaseResourceListPage.Values() []EngineBaseResource +1. EnginesClient.Get(context.Context, string, string, string, string, string) (EngineBaseResource, error) +1. EnginesClient.GetPreparer(context.Context, string, string, string, string, string) (*http.Request, error) +1. EnginesClient.GetResponder(*http.Response) (EngineBaseResource, error) +1. EnginesClient.GetSender(*http.Request) (*http.Response, error) +1. EnginesClient.List(context.Context, string, string, string, string) (EngineBaseResourceListPage, error) +1. EnginesClient.ListComplete(context.Context, string, string, string, string) (EngineBaseResourceListIterator, error) +1. EnginesClient.ListPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. EnginesClient.ListResponder(*http.Response) (EngineBaseResourceList, error) +1. EnginesClient.ListSender(*http.Request) (*http.Response, error) +1. FeatureSupportClient.Validate(context.Context, string, BasicFeatureSupportRequest) (AzureVMResourceFeatureSupportResponse, error) +1. FeatureSupportClient.ValidatePreparer(context.Context, string, BasicFeatureSupportRequest) (*http.Request, error) +1. FeatureSupportClient.ValidateResponder(*http.Response) (AzureVMResourceFeatureSupportResponse, error) +1. FeatureSupportClient.ValidateSender(*http.Request) (*http.Response, error) +1. FeatureSupportRequest.AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) +1. FeatureSupportRequest.AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) +1. FeatureSupportRequest.AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) +1. FeatureSupportRequest.AsFeatureSupportRequest() (*FeatureSupportRequest, bool) +1. FeatureSupportRequest.MarshalJSON() ([]byte, error) +1. GenericContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. GenericContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. GenericContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. GenericContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. GenericContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. GenericContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. GenericContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. GenericContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. GenericContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. GenericContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. GenericContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. GenericContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. GenericContainer.AsDpmContainer() (*DpmContainer, bool) +1. GenericContainer.AsGenericContainer() (*GenericContainer, bool) +1. GenericContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. GenericContainer.AsMabContainer() (*MabContainer, bool) +1. GenericContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. GenericContainer.MarshalJSON() ([]byte, error) +1. GenericContainerExtendedInfo.MarshalJSON() ([]byte, error) +1. ILRRequest.AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) +1. ILRRequest.AsBasicILRRequest() (BasicILRRequest, bool) +1. ILRRequest.AsILRRequest() (*ILRRequest, bool) +1. ILRRequest.AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) +1. ILRRequest.MarshalJSON() ([]byte, error) +1. ILRRequestResource.MarshalJSON() ([]byte, error) +1. IaaSVMContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. IaaSVMContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. IaaSVMContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. IaaSVMContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. IaaSVMContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. IaaSVMContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. IaaSVMContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. IaaSVMContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. IaaSVMContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. IaaSVMContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. IaaSVMContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. IaaSVMContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. IaaSVMContainer.AsDpmContainer() (*DpmContainer, bool) +1. IaaSVMContainer.AsGenericContainer() (*GenericContainer, bool) +1. IaaSVMContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. IaaSVMContainer.AsMabContainer() (*MabContainer, bool) +1. IaaSVMContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. IaaSVMContainer.MarshalJSON() ([]byte, error) +1. IaaSVMProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. IaaSVMProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. IaaSVMProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. IaaSVMProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. IaaSVMProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. IaaSVMProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. IaaSVMProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. IaaSVMProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. IaaSVMProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. IaaSVMProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. IaaSVMProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. IaaSVMProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. IaaSVMProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. IaaSVMProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. IaaSVMProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. IaaSVMProtectableItem.MarshalJSON() ([]byte, error) +1. IaasVMBackupRequest.AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) +1. IaasVMBackupRequest.AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) +1. IaasVMBackupRequest.AsBasicRequest() (BasicRequest, bool) +1. IaasVMBackupRequest.AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) +1. IaasVMBackupRequest.AsRequest() (*Request, bool) +1. IaasVMBackupRequest.MarshalJSON() ([]byte, error) +1. IaasVMILRRegistrationRequest.AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) +1. IaasVMILRRegistrationRequest.AsBasicILRRequest() (BasicILRRequest, bool) +1. IaasVMILRRegistrationRequest.AsILRRequest() (*ILRRequest, bool) +1. IaasVMILRRegistrationRequest.AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) +1. IaasVMILRRegistrationRequest.MarshalJSON() ([]byte, error) +1. InquiryValidation.MarshalJSON() ([]byte, error) +1. ItemLevelRecoveryConnectionsClient.Provision(context.Context, string, string, string, string, string, string, ILRRequestResource) (autorest.Response, error) +1. ItemLevelRecoveryConnectionsClient.ProvisionPreparer(context.Context, string, string, string, string, string, string, ILRRequestResource) (*http.Request, error) +1. ItemLevelRecoveryConnectionsClient.ProvisionResponder(*http.Response) (autorest.Response, error) +1. ItemLevelRecoveryConnectionsClient.ProvisionSender(*http.Request) (*http.Response, error) +1. ItemLevelRecoveryConnectionsClient.Revoke(context.Context, string, string, string, string, string, string) (autorest.Response, error) +1. ItemLevelRecoveryConnectionsClient.RevokePreparer(context.Context, string, string, string, string, string, string) (*http.Request, error) +1. ItemLevelRecoveryConnectionsClient.RevokeResponder(*http.Response) (autorest.Response, error) +1. ItemLevelRecoveryConnectionsClient.RevokeSender(*http.Request) (*http.Response, error) +1. MabContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. MabContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. MabContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. MabContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. MabContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. MabContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. MabContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. MabContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. MabContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. MabContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. MabContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. MabContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. MabContainer.AsDpmContainer() (*DpmContainer, bool) +1. MabContainer.AsGenericContainer() (*GenericContainer, bool) +1. MabContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. MabContainer.AsMabContainer() (*MabContainer, bool) +1. MabContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. MabContainer.MarshalJSON() ([]byte, error) +1. NewBackupsClient(string) BackupsClient +1. NewBackupsClientWithBaseURI(string, string) BackupsClient +1. NewClientDiscoveryResponseIterator(ClientDiscoveryResponsePage) ClientDiscoveryResponseIterator +1. NewClientDiscoveryResponsePage(ClientDiscoveryResponse, func(context.Context, ClientDiscoveryResponse) (ClientDiscoveryResponse, error)) ClientDiscoveryResponsePage +1. NewEngineBaseResourceListIterator(EngineBaseResourceListPage) EngineBaseResourceListIterator +1. NewEngineBaseResourceListPage(EngineBaseResourceList, func(context.Context, EngineBaseResourceList) (EngineBaseResourceList, error)) EngineBaseResourceListPage +1. NewEnginesClient(string) EnginesClient +1. NewEnginesClientWithBaseURI(string, string) EnginesClient +1. NewFeatureSupportClient(string) FeatureSupportClient +1. NewFeatureSupportClientWithBaseURI(string, string) FeatureSupportClient +1. NewItemLevelRecoveryConnectionsClient(string) ItemLevelRecoveryConnectionsClient +1. NewItemLevelRecoveryConnectionsClientWithBaseURI(string, string) ItemLevelRecoveryConnectionsClient +1. NewOperationResultsClient(string) OperationResultsClient +1. NewOperationResultsClientWithBaseURI(string, string) OperationResultsClient +1. NewOperationStatusesClient(string) OperationStatusesClient +1. NewOperationStatusesClientWithBaseURI(string, string) OperationStatusesClient +1. NewOperationsClient(string) OperationsClient +1. NewOperationsClientWithBaseURI(string, string) OperationsClient +1. NewProtectableContainerResourceListIterator(ProtectableContainerResourceListPage) ProtectableContainerResourceListIterator +1. NewProtectableContainerResourceListPage(ProtectableContainerResourceList, func(context.Context, ProtectableContainerResourceList) (ProtectableContainerResourceList, error)) ProtectableContainerResourceListPage +1. NewProtectableContainersClient(string) ProtectableContainersClient +1. NewProtectableContainersClientWithBaseURI(string, string) ProtectableContainersClient +1. NewProtectableItemsClient(string) ProtectableItemsClient +1. NewProtectableItemsClientWithBaseURI(string, string) ProtectableItemsClient +1. NewProtectedItemOperationStatusesClient(string) ProtectedItemOperationStatusesClient +1. NewProtectedItemOperationStatusesClientWithBaseURI(string, string) ProtectedItemOperationStatusesClient +1. NewProtectionContainerOperationResultsClient(string) ProtectionContainerOperationResultsClient +1. NewProtectionContainerOperationResultsClientWithBaseURI(string, string) ProtectionContainerOperationResultsClient +1. NewProtectionContainerRefreshOperationResultsClient(string) ProtectionContainerRefreshOperationResultsClient +1. NewProtectionContainerRefreshOperationResultsClientWithBaseURI(string, string) ProtectionContainerRefreshOperationResultsClient +1. NewProtectionContainerResourceListIterator(ProtectionContainerResourceListPage) ProtectionContainerResourceListIterator +1. NewProtectionContainerResourceListPage(ProtectionContainerResourceList, func(context.Context, ProtectionContainerResourceList) (ProtectionContainerResourceList, error)) ProtectionContainerResourceListPage +1. NewProtectionContainersClient(string) ProtectionContainersClient +1. NewProtectionContainersClientWithBaseURI(string, string) ProtectionContainersClient +1. NewProtectionContainersGroupClient(string) ProtectionContainersGroupClient +1. NewProtectionContainersGroupClientWithBaseURI(string, string) ProtectionContainersGroupClient +1. NewProtectionIntentClient(string) ProtectionIntentClient +1. NewProtectionIntentClientWithBaseURI(string, string) ProtectionIntentClient +1. NewProtectionIntentGroupClient(string) ProtectionIntentGroupClient +1. NewProtectionIntentGroupClientWithBaseURI(string, string) ProtectionIntentGroupClient +1. NewProtectionIntentResourceListIterator(ProtectionIntentResourceListPage) ProtectionIntentResourceListIterator +1. NewProtectionIntentResourceListPage(ProtectionIntentResourceList, func(context.Context, ProtectionIntentResourceList) (ProtectionIntentResourceList, error)) ProtectionIntentResourceListPage +1. NewProtectionPolicyOperationStatusesClient(string) ProtectionPolicyOperationStatusesClient +1. NewProtectionPolicyOperationStatusesClientWithBaseURI(string, string) ProtectionPolicyOperationStatusesClient +1. NewResourceStorageConfigsClient(string) ResourceStorageConfigsClient +1. NewResourceStorageConfigsClientWithBaseURI(string, string) ResourceStorageConfigsClient +1. NewSecurityPINsClient(string) SecurityPINsClient +1. NewSecurityPINsClientWithBaseURI(string, string) SecurityPINsClient +1. NewStatusClient(string) StatusClient +1. NewStatusClientWithBaseURI(string, string) StatusClient +1. NewUsageSummariesClient(string) UsageSummariesClient +1. NewUsageSummariesClientWithBaseURI(string, string) UsageSummariesClient +1. NewWorkloadItemResourceListIterator(WorkloadItemResourceListPage) WorkloadItemResourceListIterator +1. NewWorkloadItemResourceListPage(WorkloadItemResourceList, func(context.Context, WorkloadItemResourceList) (WorkloadItemResourceList, error)) WorkloadItemResourceListPage +1. NewWorkloadItemsClient(string) WorkloadItemsClient +1. NewWorkloadItemsClientWithBaseURI(string, string) WorkloadItemsClient +1. NewWorkloadProtectableItemResourceListIterator(WorkloadProtectableItemResourceListPage) WorkloadProtectableItemResourceListIterator +1. NewWorkloadProtectableItemResourceListPage(WorkloadProtectableItemResourceList, func(context.Context, WorkloadProtectableItemResourceList) (WorkloadProtectableItemResourceList, error)) WorkloadProtectableItemResourceListPage +1. OperationResultsClient.Get(context.Context, string, string, string) (autorest.Response, error) +1. OperationResultsClient.GetPreparer(context.Context, string, string, string) (*http.Request, error) +1. OperationResultsClient.GetResponder(*http.Response) (autorest.Response, error) +1. OperationResultsClient.GetSender(*http.Request) (*http.Response, error) +1. OperationStatusExtendedInfo.AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) +1. OperationStatusExtendedInfo.AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) +1. OperationStatusExtendedInfo.AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) +1. OperationStatusExtendedInfo.AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) +1. OperationStatusExtendedInfo.AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) +1. OperationStatusExtendedInfo.MarshalJSON() ([]byte, error) +1. OperationStatusJobExtendedInfo.AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) +1. OperationStatusJobExtendedInfo.AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) +1. OperationStatusJobExtendedInfo.AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) +1. OperationStatusJobExtendedInfo.AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) +1. OperationStatusJobExtendedInfo.AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) +1. OperationStatusJobExtendedInfo.MarshalJSON() ([]byte, error) +1. OperationStatusJobsExtendedInfo.AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) +1. OperationStatusJobsExtendedInfo.AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) +1. OperationStatusJobsExtendedInfo.AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) +1. OperationStatusJobsExtendedInfo.AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) +1. OperationStatusJobsExtendedInfo.AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) +1. OperationStatusJobsExtendedInfo.MarshalJSON() ([]byte, error) +1. OperationStatusProvisionILRExtendedInfo.AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) +1. OperationStatusProvisionILRExtendedInfo.AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) +1. OperationStatusProvisionILRExtendedInfo.AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) +1. OperationStatusProvisionILRExtendedInfo.AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) +1. OperationStatusProvisionILRExtendedInfo.AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) +1. OperationStatusProvisionILRExtendedInfo.MarshalJSON() ([]byte, error) +1. OperationStatusesClient.Get(context.Context, string, string, string) (OperationStatus, error) +1. OperationStatusesClient.GetPreparer(context.Context, string, string, string) (*http.Request, error) +1. OperationStatusesClient.GetResponder(*http.Response) (OperationStatus, error) +1. OperationStatusesClient.GetSender(*http.Request) (*http.Response, error) +1. OperationsClient.List(context.Context) (ClientDiscoveryResponsePage, error) +1. OperationsClient.ListComplete(context.Context) (ClientDiscoveryResponseIterator, error) +1. OperationsClient.ListPreparer(context.Context) (*http.Request, error) +1. OperationsClient.ListResponder(*http.Response) (ClientDiscoveryResponse, error) +1. OperationsClient.ListSender(*http.Request) (*http.Response, error) +1. PossibleAzureFileShareTypeValues() []AzureFileShareType +1. PossibleContainerTypeBasicProtectionContainerValues() []ContainerTypeBasicProtectionContainer +1. PossibleContainerTypeValues() []ContainerType +1. PossibleEngineTypeValues() []EngineType +1. PossibleFabricNameValues() []FabricName +1. PossibleFeatureTypeValues() []FeatureType +1. PossibleInquiryStatusValues() []InquiryStatus +1. PossibleIntentItemTypeValues() []IntentItemType +1. PossibleItemTypeValues() []ItemType +1. PossibleObjectTypeBasicILRRequestValues() []ObjectTypeBasicILRRequest +1. PossibleObjectTypeBasicOperationStatusExtendedInfoValues() []ObjectTypeBasicOperationStatusExtendedInfo +1. PossibleObjectTypeBasicRequestValues() []ObjectTypeBasicRequest +1. PossibleOperationStatusValuesValues() []OperationStatusValues +1. PossibleOperationTypeValues() []OperationType +1. PossibleProtectableContainerTypeValues() []ProtectableContainerType +1. PossibleProtectableItemTypeValues() []ProtectableItemType +1. PossibleProtectionIntentItemTypeValues() []ProtectionIntentItemType +1. PossibleProtectionStatusValues() []ProtectionStatus +1. PossibleSupportStatusValues() []SupportStatus +1. PossibleTypeEnumValues() []TypeEnum +1. PossibleTypeValues() []Type +1. PossibleUsagesUnitValues() []UsagesUnit +1. PossibleValidationStatusValues() []ValidationStatus +1. PossibleWorkloadItemTypeBasicWorkloadItemValues() []WorkloadItemTypeBasicWorkloadItem +1. PossibleWorkloadItemTypeValues() []WorkloadItemType +1. ProtectableContainer.AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) +1. ProtectableContainer.AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) +1. ProtectableContainer.AsBasicProtectableContainer() (BasicProtectableContainer, bool) +1. ProtectableContainer.AsProtectableContainer() (*ProtectableContainer, bool) +1. ProtectableContainer.MarshalJSON() ([]byte, error) +1. ProtectableContainerResource.MarshalJSON() ([]byte, error) +1. ProtectableContainerResourceList.IsEmpty() bool +1. ProtectableContainerResourceListIterator.NotDone() bool +1. ProtectableContainerResourceListIterator.Response() ProtectableContainerResourceList +1. ProtectableContainerResourceListIterator.Value() ProtectableContainerResource +1. ProtectableContainerResourceListPage.NotDone() bool +1. ProtectableContainerResourceListPage.Response() ProtectableContainerResourceList +1. ProtectableContainerResourceListPage.Values() []ProtectableContainerResource +1. ProtectableContainersClient.List(context.Context, string, string, string, string) (ProtectableContainerResourceListPage, error) +1. ProtectableContainersClient.ListComplete(context.Context, string, string, string, string) (ProtectableContainerResourceListIterator, error) +1. ProtectableContainersClient.ListPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectableContainersClient.ListResponder(*http.Response) (ProtectableContainerResourceList, error) +1. ProtectableContainersClient.ListSender(*http.Request) (*http.Response, error) +1. ProtectableItemsClient.List(context.Context, string, string, string, string) (WorkloadProtectableItemResourceListPage, error) +1. ProtectableItemsClient.ListComplete(context.Context, string, string, string, string) (WorkloadProtectableItemResourceListIterator, error) +1. ProtectableItemsClient.ListPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectableItemsClient.ListResponder(*http.Response) (WorkloadProtectableItemResourceList, error) +1. ProtectableItemsClient.ListSender(*http.Request) (*http.Response, error) +1. ProtectedItemOperationStatusesClient.Get(context.Context, string, string, string, string, string, string) (OperationStatus, error) +1. ProtectedItemOperationStatusesClient.GetPreparer(context.Context, string, string, string, string, string, string) (*http.Request, error) +1. ProtectedItemOperationStatusesClient.GetResponder(*http.Response) (OperationStatus, error) +1. ProtectedItemOperationStatusesClient.GetSender(*http.Request) (*http.Response, error) +1. ProtectionContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. ProtectionContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. ProtectionContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. ProtectionContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. ProtectionContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. ProtectionContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. ProtectionContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. ProtectionContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. ProtectionContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. ProtectionContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. ProtectionContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. ProtectionContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. ProtectionContainer.AsDpmContainer() (*DpmContainer, bool) +1. ProtectionContainer.AsGenericContainer() (*GenericContainer, bool) +1. ProtectionContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. ProtectionContainer.AsMabContainer() (*MabContainer, bool) +1. ProtectionContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. ProtectionContainer.MarshalJSON() ([]byte, error) +1. ProtectionContainerOperationResultsClient.Get(context.Context, string, string, string, string, string) (ProtectionContainerResource, error) +1. ProtectionContainerOperationResultsClient.GetPreparer(context.Context, string, string, string, string, string) (*http.Request, error) +1. ProtectionContainerOperationResultsClient.GetResponder(*http.Response) (ProtectionContainerResource, error) +1. ProtectionContainerOperationResultsClient.GetSender(*http.Request) (*http.Response, error) +1. ProtectionContainerRefreshOperationResultsClient.Get(context.Context, string, string, string, string) (autorest.Response, error) +1. ProtectionContainerRefreshOperationResultsClient.GetPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionContainerRefreshOperationResultsClient.GetResponder(*http.Response) (autorest.Response, error) +1. ProtectionContainerRefreshOperationResultsClient.GetSender(*http.Request) (*http.Response, error) +1. ProtectionContainerResource.MarshalJSON() ([]byte, error) +1. ProtectionContainerResourceList.IsEmpty() bool +1. ProtectionContainerResourceListIterator.NotDone() bool +1. ProtectionContainerResourceListIterator.Response() ProtectionContainerResourceList +1. ProtectionContainerResourceListIterator.Value() ProtectionContainerResource +1. ProtectionContainerResourceListPage.NotDone() bool +1. ProtectionContainerResourceListPage.Response() ProtectionContainerResourceList +1. ProtectionContainerResourceListPage.Values() []ProtectionContainerResource +1. ProtectionContainersClient.Get(context.Context, string, string, string, string) (ProtectionContainerResource, error) +1. ProtectionContainersClient.GetPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionContainersClient.GetResponder(*http.Response) (ProtectionContainerResource, error) +1. ProtectionContainersClient.GetSender(*http.Request) (*http.Response, error) +1. ProtectionContainersClient.Inquire(context.Context, string, string, string, string, string) (autorest.Response, error) +1. ProtectionContainersClient.InquirePreparer(context.Context, string, string, string, string, string) (*http.Request, error) +1. ProtectionContainersClient.InquireResponder(*http.Response) (autorest.Response, error) +1. ProtectionContainersClient.InquireSender(*http.Request) (*http.Response, error) +1. ProtectionContainersClient.Refresh(context.Context, string, string, string, string) (autorest.Response, error) +1. ProtectionContainersClient.RefreshPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionContainersClient.RefreshResponder(*http.Response) (autorest.Response, error) +1. ProtectionContainersClient.RefreshSender(*http.Request) (*http.Response, error) +1. ProtectionContainersClient.Register(context.Context, string, string, string, string, ProtectionContainerResource) (ProtectionContainerResource, error) +1. ProtectionContainersClient.RegisterPreparer(context.Context, string, string, string, string, ProtectionContainerResource) (*http.Request, error) +1. ProtectionContainersClient.RegisterResponder(*http.Response) (ProtectionContainerResource, error) +1. ProtectionContainersClient.RegisterSender(*http.Request) (*http.Response, error) +1. ProtectionContainersClient.Unregister(context.Context, string, string, string, string) (autorest.Response, error) +1. ProtectionContainersClient.UnregisterPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionContainersClient.UnregisterResponder(*http.Response) (autorest.Response, error) +1. ProtectionContainersClient.UnregisterSender(*http.Request) (*http.Response, error) +1. ProtectionContainersGroupClient.List(context.Context, string, string, string) (ProtectionContainerResourceListPage, error) +1. ProtectionContainersGroupClient.ListComplete(context.Context, string, string, string) (ProtectionContainerResourceListIterator, error) +1. ProtectionContainersGroupClient.ListPreparer(context.Context, string, string, string) (*http.Request, error) +1. ProtectionContainersGroupClient.ListResponder(*http.Response) (ProtectionContainerResourceList, error) +1. ProtectionContainersGroupClient.ListSender(*http.Request) (*http.Response, error) +1. ProtectionIntent.AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) +1. ProtectionIntent.AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) +1. ProtectionIntent.AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) +1. ProtectionIntent.AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) +1. ProtectionIntent.AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) +1. ProtectionIntent.AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) +1. ProtectionIntent.AsBasicProtectionIntent() (BasicProtectionIntent, bool) +1. ProtectionIntent.AsProtectionIntent() (*ProtectionIntent, bool) +1. ProtectionIntent.MarshalJSON() ([]byte, error) +1. ProtectionIntentClient.CreateOrUpdate(context.Context, string, string, string, string, ProtectionIntentResource) (ProtectionIntentResource, error) +1. ProtectionIntentClient.CreateOrUpdatePreparer(context.Context, string, string, string, string, ProtectionIntentResource) (*http.Request, error) +1. ProtectionIntentClient.CreateOrUpdateResponder(*http.Response) (ProtectionIntentResource, error) +1. ProtectionIntentClient.CreateOrUpdateSender(*http.Request) (*http.Response, error) +1. ProtectionIntentClient.Delete(context.Context, string, string, string, string) (autorest.Response, error) +1. ProtectionIntentClient.DeletePreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionIntentClient.DeleteResponder(*http.Response) (autorest.Response, error) +1. ProtectionIntentClient.DeleteSender(*http.Request) (*http.Response, error) +1. ProtectionIntentClient.Get(context.Context, string, string, string, string) (ProtectionIntentResource, error) +1. ProtectionIntentClient.GetPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionIntentClient.GetResponder(*http.Response) (ProtectionIntentResource, error) +1. ProtectionIntentClient.GetSender(*http.Request) (*http.Response, error) +1. ProtectionIntentClient.Validate(context.Context, string, PreValidateEnableBackupRequest) (PreValidateEnableBackupResponse, error) +1. ProtectionIntentClient.ValidatePreparer(context.Context, string, PreValidateEnableBackupRequest) (*http.Request, error) +1. ProtectionIntentClient.ValidateResponder(*http.Response) (PreValidateEnableBackupResponse, error) +1. ProtectionIntentClient.ValidateSender(*http.Request) (*http.Response, error) +1. ProtectionIntentGroupClient.List(context.Context, string, string, string, string) (ProtectionIntentResourceListPage, error) +1. ProtectionIntentGroupClient.ListComplete(context.Context, string, string, string, string) (ProtectionIntentResourceListIterator, error) +1. ProtectionIntentGroupClient.ListPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionIntentGroupClient.ListResponder(*http.Response) (ProtectionIntentResourceList, error) +1. ProtectionIntentGroupClient.ListSender(*http.Request) (*http.Response, error) +1. ProtectionIntentResource.MarshalJSON() ([]byte, error) +1. ProtectionIntentResourceList.IsEmpty() bool +1. ProtectionIntentResourceListIterator.NotDone() bool +1. ProtectionIntentResourceListIterator.Response() ProtectionIntentResourceList +1. ProtectionIntentResourceListIterator.Value() ProtectionIntentResource +1. ProtectionIntentResourceListPage.NotDone() bool +1. ProtectionIntentResourceListPage.Response() ProtectionIntentResourceList +1. ProtectionIntentResourceListPage.Values() []ProtectionIntentResource +1. ProtectionPoliciesClient.Delete(context.Context, string, string, string) (autorest.Response, error) +1. ProtectionPoliciesClient.DeletePreparer(context.Context, string, string, string) (*http.Request, error) +1. ProtectionPoliciesClient.DeleteResponder(*http.Response) (autorest.Response, error) +1. ProtectionPoliciesClient.DeleteSender(*http.Request) (*http.Response, error) +1. ProtectionPolicyOperationStatusesClient.Get(context.Context, string, string, string, string) (OperationStatus, error) +1. ProtectionPolicyOperationStatusesClient.GetPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionPolicyOperationStatusesClient.GetResponder(*http.Response) (OperationStatus, error) +1. ProtectionPolicyOperationStatusesClient.GetSender(*http.Request) (*http.Response, error) +1. Request.AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) +1. Request.AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) +1. Request.AsBasicRequest() (BasicRequest, bool) +1. Request.AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) +1. Request.AsRequest() (*Request, bool) +1. Request.MarshalJSON() ([]byte, error) +1. RequestResource.MarshalJSON() ([]byte, error) +1. ResourceConfigResource.MarshalJSON() ([]byte, error) +1. ResourceStorageConfigsClient.Get(context.Context, string, string) (ResourceConfigResource, error) +1. ResourceStorageConfigsClient.GetPreparer(context.Context, string, string) (*http.Request, error) +1. ResourceStorageConfigsClient.GetResponder(*http.Response) (ResourceConfigResource, error) +1. ResourceStorageConfigsClient.GetSender(*http.Request) (*http.Response, error) +1. ResourceStorageConfigsClient.Patch(context.Context, string, string, ResourceConfigResource) (autorest.Response, error) +1. ResourceStorageConfigsClient.PatchPreparer(context.Context, string, string, ResourceConfigResource) (*http.Request, error) +1. ResourceStorageConfigsClient.PatchResponder(*http.Response) (autorest.Response, error) +1. ResourceStorageConfigsClient.PatchSender(*http.Request) (*http.Response, error) +1. ResourceStorageConfigsClient.Update(context.Context, string, string, ResourceConfigResource) (ResourceConfigResource, error) +1. ResourceStorageConfigsClient.UpdatePreparer(context.Context, string, string, ResourceConfigResource) (*http.Request, error) +1. ResourceStorageConfigsClient.UpdateResponder(*http.Response) (ResourceConfigResource, error) +1. ResourceStorageConfigsClient.UpdateSender(*http.Request) (*http.Response, error) +1. SecurityPINsClient.Get(context.Context, string, string) (TokenInformation, error) +1. SecurityPINsClient.GetPreparer(context.Context, string, string) (*http.Request, error) +1. SecurityPINsClient.GetResponder(*http.Response) (TokenInformation, error) +1. SecurityPINsClient.GetSender(*http.Request) (*http.Response, error) +1. StatusClient.Get(context.Context, string, StatusRequest) (StatusResponse, error) +1. StatusClient.GetPreparer(context.Context, string, StatusRequest) (*http.Request, error) +1. StatusClient.GetResponder(*http.Response) (StatusResponse, error) +1. StatusClient.GetSender(*http.Request) (*http.Response, error) +1. UsageSummariesClient.List(context.Context, string, string, string, string) (ManagementUsageList, error) +1. UsageSummariesClient.ListPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. UsageSummariesClient.ListResponder(*http.Response) (ManagementUsageList, error) +1. UsageSummariesClient.ListSender(*http.Request) (*http.Response, error) +1. WorkloadItem.AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +1. WorkloadItem.AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) +1. WorkloadItem.AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) +1. WorkloadItem.AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) +1. WorkloadItem.AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) +1. WorkloadItem.AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) +1. WorkloadItem.AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) +1. WorkloadItem.AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) +1. WorkloadItem.AsBasicWorkloadItem() (BasicWorkloadItem, bool) +1. WorkloadItem.AsWorkloadItem() (*WorkloadItem, bool) +1. WorkloadItem.MarshalJSON() ([]byte, error) +1. WorkloadItemResource.MarshalJSON() ([]byte, error) +1. WorkloadItemResourceList.IsEmpty() bool +1. WorkloadItemResourceListIterator.NotDone() bool +1. WorkloadItemResourceListIterator.Response() WorkloadItemResourceList +1. WorkloadItemResourceListIterator.Value() WorkloadItemResource +1. WorkloadItemResourceListPage.NotDone() bool +1. WorkloadItemResourceListPage.Response() WorkloadItemResourceList +1. WorkloadItemResourceListPage.Values() []WorkloadItemResource +1. WorkloadItemsClient.List(context.Context, string, string, string, string, string, string) (WorkloadItemResourceListPage, error) +1. WorkloadItemsClient.ListComplete(context.Context, string, string, string, string, string, string) (WorkloadItemResourceListIterator, error) +1. WorkloadItemsClient.ListPreparer(context.Context, string, string, string, string, string, string) (*http.Request, error) +1. WorkloadItemsClient.ListResponder(*http.Response) (WorkloadItemResourceList, error) +1. WorkloadItemsClient.ListSender(*http.Request) (*http.Response, error) +1. WorkloadProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. WorkloadProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. WorkloadProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. WorkloadProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. WorkloadProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. WorkloadProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. WorkloadProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. WorkloadProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. WorkloadProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. WorkloadProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. WorkloadProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. WorkloadProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. WorkloadProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. WorkloadProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. WorkloadProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. WorkloadProtectableItem.MarshalJSON() ([]byte, error) +1. WorkloadProtectableItemResource.MarshalJSON() ([]byte, error) +1. WorkloadProtectableItemResourceList.IsEmpty() bool +1. WorkloadProtectableItemResourceListIterator.NotDone() bool +1. WorkloadProtectableItemResourceListIterator.Response() WorkloadProtectableItemResourceList +1. WorkloadProtectableItemResourceListIterator.Value() WorkloadProtectableItemResource +1. WorkloadProtectableItemResourceListPage.NotDone() bool +1. WorkloadProtectableItemResourceListPage.Response() WorkloadProtectableItemResourceList +1. WorkloadProtectableItemResourceListPage.Values() []WorkloadProtectableItemResource + +### Struct Changes + +#### Removed Structs + +1. AzureBackupGoalFeatureSupportRequest +1. AzureBackupServerContainer +1. AzureBackupServerEngine +1. AzureFileShareBackupRequest +1. AzureFileShareProtectableItem +1. AzureFileShareProvisionILRRequest +1. AzureIaaSClassicComputeVMContainer +1. AzureIaaSClassicComputeVMProtectableItem +1. AzureIaaSComputeVMContainer +1. AzureIaaSComputeVMProtectableItem +1. AzureRecoveryServiceVaultProtectionIntent +1. AzureResourceProtectionIntent +1. AzureSQLAGWorkloadContainerProtectionContainer +1. AzureSQLContainer +1. AzureStorageContainer +1. AzureStorageProtectableContainer +1. AzureVMAppContainerProtectableContainer +1. AzureVMAppContainerProtectionContainer +1. AzureVMResourceFeatureSupportRequest +1. AzureVMResourceFeatureSupportResponse +1. AzureVMWorkloadItem +1. AzureVMWorkloadProtectableItem +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem +1. AzureVMWorkloadSAPAseSystemProtectableItem +1. AzureVMWorkloadSAPAseSystemWorkloadItem +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem +1. AzureVMWorkloadSAPHanaSystemProtectableItem +1. AzureVMWorkloadSAPHanaSystemWorkloadItem +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem +1. AzureVMWorkloadSQLDatabaseProtectableItem +1. AzureVMWorkloadSQLDatabaseWorkloadItem +1. AzureVMWorkloadSQLInstanceProtectableItem +1. AzureVMWorkloadSQLInstanceWorkloadItem +1. AzureWorkloadAutoProtectionIntent +1. AzureWorkloadBackupRequest +1. AzureWorkloadContainer +1. AzureWorkloadContainerExtendedInfo +1. AzureWorkloadSQLAutoProtectionIntent +1. BMSBackupEngineQueryObject +1. BMSBackupEnginesQueryObject +1. BMSBackupSummariesQueryObject +1. BMSContainerQueryObject +1. BMSContainersInquiryQueryObject +1. BMSPOQueryObject +1. BMSRefreshContainersQueryObject +1. BMSWorkloadItemQueryObject +1. BackupsClient +1. ClientDiscoveryDisplay +1. ClientDiscoveryForLogSpecification +1. ClientDiscoveryForProperties +1. ClientDiscoveryForServiceSpecification +1. ClientDiscoveryResponse +1. ClientDiscoveryResponseIterator +1. ClientDiscoveryResponsePage +1. ClientDiscoveryValueForSingleAPI +1. ClientScriptForConnect +1. ContainerIdentityInfo +1. DPMContainerExtendedInfo +1. DistributedNodesInfo +1. DpmBackupEngine +1. DpmContainer +1. EngineBase +1. EngineBaseResource +1. EngineBaseResourceList +1. EngineBaseResourceListIterator +1. EngineBaseResourceListPage +1. EngineExtendedInfo +1. EnginesClient +1. FeatureSupportClient +1. FeatureSupportRequest +1. GenericContainer +1. GenericContainerExtendedInfo +1. ILRRequest +1. ILRRequestResource +1. IaaSVMContainer +1. IaaSVMProtectableItem +1. IaasVMBackupRequest +1. IaasVMILRRegistrationRequest +1. InquiryInfo +1. InquiryValidation +1. InstantItemRecoveryTarget +1. ItemLevelRecoveryConnectionsClient +1. MABContainerHealthDetails +1. MabContainer +1. MabContainerExtendedInfo +1. ManagementUsage +1. ManagementUsageList +1. NameInfo +1. OperationResultsClient +1. OperationStatus +1. OperationStatusError +1. OperationStatusExtendedInfo +1. OperationStatusJobExtendedInfo +1. OperationStatusJobsExtendedInfo +1. OperationStatusProvisionILRExtendedInfo +1. OperationStatusesClient +1. OperationsClient +1. PreBackupValidation +1. PreValidateEnableBackupRequest +1. PreValidateEnableBackupResponse +1. ProtectableContainer +1. ProtectableContainerResource +1. ProtectableContainerResourceList +1. ProtectableContainerResourceListIterator +1. ProtectableContainerResourceListPage +1. ProtectableContainersClient +1. ProtectableItemsClient +1. ProtectedItemOperationStatusesClient +1. ProtectionContainer +1. ProtectionContainerOperationResultsClient +1. ProtectionContainerRefreshOperationResultsClient +1. ProtectionContainerResource +1. ProtectionContainerResourceList +1. ProtectionContainerResourceListIterator +1. ProtectionContainerResourceListPage +1. ProtectionContainersClient +1. ProtectionContainersGroupClient +1. ProtectionIntent +1. ProtectionIntentClient +1. ProtectionIntentGroupClient +1. ProtectionIntentQueryObject +1. ProtectionIntentResource +1. ProtectionIntentResourceList +1. ProtectionIntentResourceListIterator +1. ProtectionIntentResourceListPage +1. ProtectionPolicyOperationStatusesClient +1. Request +1. RequestResource +1. ResourceConfig +1. ResourceConfigResource +1. ResourceStorageConfigsClient +1. SecurityPINsClient +1. StatusClient +1. StatusRequest +1. StatusResponse +1. TokenInformation +1. UsageSummariesClient +1. WorkloadInquiryDetails +1. WorkloadItem +1. WorkloadItemResource +1. WorkloadItemResourceList +1. WorkloadItemResourceListIterator +1. WorkloadItemResourceListPage +1. WorkloadItemsClient +1. WorkloadProtectableItem +1. WorkloadProtectableItemResource +1. WorkloadProtectableItemResourceList +1. WorkloadProtectableItemResourceListIterator +1. WorkloadProtectableItemResourceListPage + +### Signature Changes + +#### Const Types + +1. Invalid changed type from AzureFileShareType to CopyOptions + +## Additive Changes + +### New Constants + +1. CopyOptions.CreateCopy +1. CopyOptions.FailOnConflict +1. CopyOptions.Overwrite +1. CopyOptions.Skip diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/_meta.json b/services/recoveryservices/mgmt/2019-06-15/backup/_meta.json index e4697957f24a..f4495a866a16 100644 --- a/services/recoveryservices/mgmt/2019-06-15/backup/_meta.json +++ b/services/recoveryservices/mgmt/2019-06-15/backup/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "4742065e8d48160292fbce6790710c6835f8dc4f", "readme": "/_/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/readme.md", "tag": "package-2019-06", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/backupapi/interfaces.go b/services/recoveryservices/mgmt/2019-06-15/backup/backupapi/interfaces.go index e25a9babdf8d..19a9548b2f5a 100644 --- a/services/recoveryservices/mgmt/2019-06-15/backup/backupapi/interfaces.go +++ b/services/recoveryservices/mgmt/2019-06-15/backup/backupapi/interfaces.go @@ -64,7 +64,6 @@ var _ PoliciesClientAPI = (*backup.PoliciesClient)(nil) // ProtectionPoliciesClientAPI contains the set of methods on the ProtectionPoliciesClient type. type ProtectionPoliciesClientAPI interface { CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, policyName string, parameters backup.ProtectionPolicyResource) (result backup.ProtectionPolicyResource, err error) - Delete(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (result autorest.Response, err error) Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (result backup.ProtectionPolicyResource, err error) } @@ -134,175 +133,3 @@ type OperationClientAPI interface { } var _ OperationClientAPI = (*backup.OperationClient)(nil) - -// ProtectionIntentClientAPI contains the set of methods on the ProtectionIntentClient type. -type ProtectionIntentClientAPI interface { - CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string, parameters backup.ProtectionIntentResource) (result backup.ProtectionIntentResource, err error) - Delete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string) (result autorest.Response, err error) - Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string) (result backup.ProtectionIntentResource, err error) - Validate(ctx context.Context, azureRegion string, parameters backup.PreValidateEnableBackupRequest) (result backup.PreValidateEnableBackupResponse, err error) -} - -var _ ProtectionIntentClientAPI = (*backup.ProtectionIntentClient)(nil) - -// StatusClientAPI contains the set of methods on the StatusClient type. -type StatusClientAPI interface { - Get(ctx context.Context, azureRegion string, parameters backup.StatusRequest) (result backup.StatusResponse, err error) -} - -var _ StatusClientAPI = (*backup.StatusClient)(nil) - -// FeatureSupportClientAPI contains the set of methods on the FeatureSupportClient type. -type FeatureSupportClientAPI interface { - Validate(ctx context.Context, azureRegion string, parameters backup.BasicFeatureSupportRequest) (result backup.AzureVMResourceFeatureSupportResponse, err error) -} - -var _ FeatureSupportClientAPI = (*backup.FeatureSupportClient)(nil) - -// ProtectionIntentGroupClientAPI contains the set of methods on the ProtectionIntentGroupClient type. -type ProtectionIntentGroupClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ProtectionIntentResourceListPage, err error) - ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ProtectionIntentResourceListIterator, err error) -} - -var _ ProtectionIntentGroupClientAPI = (*backup.ProtectionIntentGroupClient)(nil) - -// UsageSummariesClientAPI contains the set of methods on the UsageSummariesClient type. -type UsageSummariesClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ManagementUsageList, err error) -} - -var _ UsageSummariesClientAPI = (*backup.UsageSummariesClient)(nil) - -// EnginesClientAPI contains the set of methods on the EnginesClient type. -type EnginesClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, backupEngineName string, filter string, skipToken string) (result backup.EngineBaseResource, err error) - List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.EngineBaseResourceListPage, err error) - ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.EngineBaseResourceListIterator, err error) -} - -var _ EnginesClientAPI = (*backup.EnginesClient)(nil) - -// ProtectionContainerRefreshOperationResultsClientAPI contains the set of methods on the ProtectionContainerRefreshOperationResultsClient type. -type ProtectionContainerRefreshOperationResultsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, operationID string) (result autorest.Response, err error) -} - -var _ ProtectionContainerRefreshOperationResultsClientAPI = (*backup.ProtectionContainerRefreshOperationResultsClient)(nil) - -// ProtectableContainersClientAPI contains the set of methods on the ProtectableContainersClient type. -type ProtectableContainersClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, filter string) (result backup.ProtectableContainerResourceListPage, err error) - ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, filter string) (result backup.ProtectableContainerResourceListIterator, err error) -} - -var _ ProtectableContainersClientAPI = (*backup.ProtectableContainersClient)(nil) - -// ProtectionContainersClientAPI contains the set of methods on the ProtectionContainersClient type. -type ProtectionContainersClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string) (result backup.ProtectionContainerResource, err error) - Inquire(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, filter string) (result autorest.Response, err error) - Refresh(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, filter string) (result autorest.Response, err error) - Register(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, parameters backup.ProtectionContainerResource) (result backup.ProtectionContainerResource, err error) - Unregister(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string) (result autorest.Response, err error) -} - -var _ ProtectionContainersClientAPI = (*backup.ProtectionContainersClient)(nil) - -// WorkloadItemsClientAPI contains the set of methods on the WorkloadItemsClient type. -type WorkloadItemsClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, filter string, skipToken string) (result backup.WorkloadItemResourceListPage, err error) - ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, filter string, skipToken string) (result backup.WorkloadItemResourceListIterator, err error) -} - -var _ WorkloadItemsClientAPI = (*backup.WorkloadItemsClient)(nil) - -// ProtectionContainerOperationResultsClientAPI contains the set of methods on the ProtectionContainerOperationResultsClient type. -type ProtectionContainerOperationResultsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, operationID string) (result backup.ProtectionContainerResource, err error) -} - -var _ ProtectionContainerOperationResultsClientAPI = (*backup.ProtectionContainerOperationResultsClient)(nil) - -// BackupsClientAPI contains the set of methods on the BackupsClient type. -type BackupsClientAPI interface { - Trigger(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters backup.RequestResource) (result autorest.Response, err error) -} - -var _ BackupsClientAPI = (*backup.BackupsClient)(nil) - -// ProtectedItemOperationStatusesClientAPI contains the set of methods on the ProtectedItemOperationStatusesClient type. -type ProtectedItemOperationStatusesClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, operationID string) (result backup.OperationStatus, err error) -} - -var _ ProtectedItemOperationStatusesClientAPI = (*backup.ProtectedItemOperationStatusesClient)(nil) - -// ItemLevelRecoveryConnectionsClientAPI contains the set of methods on the ItemLevelRecoveryConnectionsClient type. -type ItemLevelRecoveryConnectionsClientAPI interface { - Provision(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters backup.ILRRequestResource) (result autorest.Response, err error) - Revoke(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string) (result autorest.Response, err error) -} - -var _ ItemLevelRecoveryConnectionsClientAPI = (*backup.ItemLevelRecoveryConnectionsClient)(nil) - -// OperationResultsClientAPI contains the set of methods on the OperationResultsClient type. -type OperationResultsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result autorest.Response, err error) -} - -var _ OperationResultsClientAPI = (*backup.OperationResultsClient)(nil) - -// OperationStatusesClientAPI contains the set of methods on the OperationStatusesClient type. -type OperationStatusesClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result backup.OperationStatus, err error) -} - -var _ OperationStatusesClientAPI = (*backup.OperationStatusesClient)(nil) - -// ProtectionPolicyOperationStatusesClientAPI contains the set of methods on the ProtectionPolicyOperationStatusesClient type. -type ProtectionPolicyOperationStatusesClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string) (result backup.OperationStatus, err error) -} - -var _ ProtectionPolicyOperationStatusesClientAPI = (*backup.ProtectionPolicyOperationStatusesClient)(nil) - -// ProtectableItemsClientAPI contains the set of methods on the ProtectableItemsClient type. -type ProtectableItemsClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.WorkloadProtectableItemResourceListPage, err error) - ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.WorkloadProtectableItemResourceListIterator, err error) -} - -var _ ProtectableItemsClientAPI = (*backup.ProtectableItemsClient)(nil) - -// ProtectionContainersGroupClientAPI contains the set of methods on the ProtectionContainersGroupClient type. -type ProtectionContainersGroupClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result backup.ProtectionContainerResourceListPage, err error) - ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result backup.ProtectionContainerResourceListIterator, err error) -} - -var _ ProtectionContainersGroupClientAPI = (*backup.ProtectionContainersGroupClient)(nil) - -// SecurityPINsClientAPI contains the set of methods on the SecurityPINsClient type. -type SecurityPINsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string) (result backup.TokenInformation, err error) -} - -var _ SecurityPINsClientAPI = (*backup.SecurityPINsClient)(nil) - -// ResourceStorageConfigsClientAPI contains the set of methods on the ResourceStorageConfigsClient type. -type ResourceStorageConfigsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string) (result backup.ResourceConfigResource, err error) - Patch(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.ResourceConfigResource) (result autorest.Response, err error) - Update(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.ResourceConfigResource) (result backup.ResourceConfigResource, err error) -} - -var _ ResourceStorageConfigsClientAPI = (*backup.ResourceStorageConfigsClient)(nil) - -// OperationsClientAPI contains the set of methods on the OperationsClient type. -type OperationsClientAPI interface { - List(ctx context.Context) (result backup.ClientDiscoveryResponsePage, err error) - ListComplete(ctx context.Context) (result backup.ClientDiscoveryResponseIterator, err error) -} - -var _ OperationsClientAPI = (*backup.OperationsClient)(nil) diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/backups.go b/services/recoveryservices/mgmt/2019-06-15/backup/backups.go deleted file mode 100644 index 504816876e30..000000000000 --- a/services/recoveryservices/mgmt/2019-06-15/backup/backups.go +++ /dev/null @@ -1,116 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// BackupsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type BackupsClient struct { - BaseClient -} - -// NewBackupsClient creates an instance of the BackupsClient client. -func NewBackupsClient(subscriptionID string) BackupsClient { - return NewBackupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewBackupsClientWithBaseURI creates an instance of the BackupsClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewBackupsClientWithBaseURI(baseURI string, subscriptionID string) BackupsClient { - return BackupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Trigger triggers backup for specified backed up item. This is an asynchronous operation. To know the status of the -// operation, call GetProtectedItemOperationResult 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 backup item. -// containerName - container name associated with the backup item. -// protectedItemName - backup item for which backup needs to be triggered. -// parameters - resource backup request -func (client BackupsClient) Trigger(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters RequestResource) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.Trigger") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.TriggerPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.BackupsClient", "Trigger", nil, "Failure preparing request") - return - } - - resp, err := client.TriggerSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "backup.BackupsClient", "Trigger", resp, "Failure sending request") - return - } - - result, err = client.TriggerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.BackupsClient", "Trigger", resp, "Failure responding to request") - return - } - - return -} - -// TriggerPreparer prepares the Trigger request. -func (client BackupsClient) TriggerPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters RequestResource) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "containerName": autorest.Encode("path", containerName), - "fabricName": autorest.Encode("path", fabricName), - "protectedItemName": autorest.Encode("path", protectedItemName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/backup", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TriggerSender sends the Trigger request. The method will close the -// http.Response Body if it receives an error. -func (client BackupsClient) TriggerSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// TriggerResponder handles the response to the Trigger request. The method always -// closes the http.Response Body. -func (client BackupsClient) TriggerResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/client.go b/services/recoveryservices/mgmt/2019-06-15/backup/client.go index da72c8e24482..715cb78d3049 100644 --- a/services/recoveryservices/mgmt/2019-06-15/backup/client.go +++ b/services/recoveryservices/mgmt/2019-06-15/backup/client.go @@ -1,4 +1,4 @@ -// Package backup implements the Azure ARM Backup service API version . +// Package backup implements the Azure ARM Backup service API version 2019-06-15. // // Open API 2.0 Specs for Azure RecoveryServices Backup service package backup diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/enums.go b/services/recoveryservices/mgmt/2019-06-15/backup/enums.go index 326d814a2c49..5b78b2cffc35 100644 --- a/services/recoveryservices/mgmt/2019-06-15/backup/enums.go +++ b/services/recoveryservices/mgmt/2019-06-15/backup/enums.go @@ -6,120 +6,25 @@ package backup // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// AzureFileShareType enumerates the values for azure file share type. -type AzureFileShareType string - -const ( - // Invalid ... - Invalid AzureFileShareType = "Invalid" - // XSMB ... - XSMB AzureFileShareType = "XSMB" - // XSync ... - XSync AzureFileShareType = "XSync" -) - -// PossibleAzureFileShareTypeValues returns an array of possible values for the AzureFileShareType const type. -func PossibleAzureFileShareTypeValues() []AzureFileShareType { - return []AzureFileShareType{Invalid, XSMB, XSync} -} - -// ContainerType enumerates the values for container type. -type ContainerType string - -const ( - // ContainerTypeAzureBackupServerContainer ... - ContainerTypeAzureBackupServerContainer ContainerType = "AzureBackupServerContainer" - // ContainerTypeAzureSQLContainer ... - ContainerTypeAzureSQLContainer ContainerType = "AzureSqlContainer" - // ContainerTypeCluster ... - ContainerTypeCluster ContainerType = "Cluster" - // ContainerTypeDPMContainer ... - ContainerTypeDPMContainer ContainerType = "DPMContainer" - // ContainerTypeGenericContainer ... - ContainerTypeGenericContainer ContainerType = "GenericContainer" - // ContainerTypeIaasVMContainer ... - ContainerTypeIaasVMContainer ContainerType = "IaasVMContainer" - // ContainerTypeIaasVMServiceContainer ... - ContainerTypeIaasVMServiceContainer ContainerType = "IaasVMServiceContainer" - // ContainerTypeInvalid ... - ContainerTypeInvalid ContainerType = "Invalid" - // ContainerTypeMABContainer ... - ContainerTypeMABContainer ContainerType = "MABContainer" - // ContainerTypeSQLAGWorkLoadContainer ... - ContainerTypeSQLAGWorkLoadContainer ContainerType = "SQLAGWorkLoadContainer" - // ContainerTypeStorageContainer ... - ContainerTypeStorageContainer ContainerType = "StorageContainer" - // ContainerTypeUnknown ... - ContainerTypeUnknown ContainerType = "Unknown" - // ContainerTypeVCenter ... - ContainerTypeVCenter ContainerType = "VCenter" - // ContainerTypeVMAppContainer ... - ContainerTypeVMAppContainer ContainerType = "VMAppContainer" - // ContainerTypeWindows ... - ContainerTypeWindows ContainerType = "Windows" -) - -// PossibleContainerTypeValues returns an array of possible values for the ContainerType const type. -func PossibleContainerTypeValues() []ContainerType { - return []ContainerType{ContainerTypeAzureBackupServerContainer, ContainerTypeAzureSQLContainer, ContainerTypeCluster, ContainerTypeDPMContainer, ContainerTypeGenericContainer, ContainerTypeIaasVMContainer, ContainerTypeIaasVMServiceContainer, ContainerTypeInvalid, ContainerTypeMABContainer, ContainerTypeSQLAGWorkLoadContainer, ContainerTypeStorageContainer, ContainerTypeUnknown, ContainerTypeVCenter, ContainerTypeVMAppContainer, ContainerTypeWindows} -} - -// ContainerTypeBasicProtectionContainer enumerates the values for container type basic protection container. -type ContainerTypeBasicProtectionContainer string - -const ( - // ContainerTypeAzureBackupServerContainer1 ... - ContainerTypeAzureBackupServerContainer1 ContainerTypeBasicProtectionContainer = "AzureBackupServerContainer" - // ContainerTypeAzureSQLContainer1 ... - ContainerTypeAzureSQLContainer1 ContainerTypeBasicProtectionContainer = "AzureSqlContainer" - // ContainerTypeAzureWorkloadContainer ... - ContainerTypeAzureWorkloadContainer ContainerTypeBasicProtectionContainer = "AzureWorkloadContainer" - // ContainerTypeDPMContainer1 ... - ContainerTypeDPMContainer1 ContainerTypeBasicProtectionContainer = "DPMContainer" - // ContainerTypeGenericContainer1 ... - ContainerTypeGenericContainer1 ContainerTypeBasicProtectionContainer = "GenericContainer" - // ContainerTypeIaaSVMContainer ... - ContainerTypeIaaSVMContainer ContainerTypeBasicProtectionContainer = "IaaSVMContainer" - // ContainerTypeMicrosoftClassicComputevirtualMachines ... - ContainerTypeMicrosoftClassicComputevirtualMachines ContainerTypeBasicProtectionContainer = "Microsoft.ClassicCompute/virtualMachines" - // ContainerTypeMicrosoftComputevirtualMachines ... - ContainerTypeMicrosoftComputevirtualMachines ContainerTypeBasicProtectionContainer = "Microsoft.Compute/virtualMachines" - // ContainerTypeProtectionContainer ... - ContainerTypeProtectionContainer ContainerTypeBasicProtectionContainer = "ProtectionContainer" - // ContainerTypeSQLAGWorkLoadContainer1 ... - ContainerTypeSQLAGWorkLoadContainer1 ContainerTypeBasicProtectionContainer = "SQLAGWorkLoadContainer" - // ContainerTypeStorageContainer1 ... - ContainerTypeStorageContainer1 ContainerTypeBasicProtectionContainer = "StorageContainer" - // ContainerTypeVMAppContainer1 ... - ContainerTypeVMAppContainer1 ContainerTypeBasicProtectionContainer = "VMAppContainer" - // ContainerTypeWindows1 ... - ContainerTypeWindows1 ContainerTypeBasicProtectionContainer = "Windows" -) - -// PossibleContainerTypeBasicProtectionContainerValues returns an array of possible values for the ContainerTypeBasicProtectionContainer const type. -func PossibleContainerTypeBasicProtectionContainerValues() []ContainerTypeBasicProtectionContainer { - return []ContainerTypeBasicProtectionContainer{ContainerTypeAzureBackupServerContainer1, ContainerTypeAzureSQLContainer1, ContainerTypeAzureWorkloadContainer, ContainerTypeDPMContainer1, ContainerTypeGenericContainer1, ContainerTypeIaaSVMContainer, ContainerTypeMicrosoftClassicComputevirtualMachines, ContainerTypeMicrosoftComputevirtualMachines, ContainerTypeProtectionContainer, ContainerTypeSQLAGWorkLoadContainer1, ContainerTypeStorageContainer1, ContainerTypeVMAppContainer1, ContainerTypeWindows1} -} - // CopyOptions enumerates the values for copy options. type CopyOptions string const ( - // CopyOptionsCreateCopy ... - CopyOptionsCreateCopy CopyOptions = "CreateCopy" - // CopyOptionsFailOnConflict ... - CopyOptionsFailOnConflict CopyOptions = "FailOnConflict" - // CopyOptionsInvalid ... - CopyOptionsInvalid CopyOptions = "Invalid" - // CopyOptionsOverwrite ... - CopyOptionsOverwrite CopyOptions = "Overwrite" - // CopyOptionsSkip ... - CopyOptionsSkip CopyOptions = "Skip" + // CreateCopy ... + CreateCopy CopyOptions = "CreateCopy" + // FailOnConflict ... + FailOnConflict CopyOptions = "FailOnConflict" + // Invalid ... + Invalid CopyOptions = "Invalid" + // Overwrite ... + Overwrite CopyOptions = "Overwrite" + // Skip ... + Skip CopyOptions = "Skip" ) // PossibleCopyOptionsValues returns an array of possible values for the CopyOptions const type. func PossibleCopyOptionsValues() []CopyOptions { - return []CopyOptions{CopyOptionsCreateCopy, CopyOptionsFailOnConflict, CopyOptionsInvalid, CopyOptionsOverwrite, CopyOptionsSkip} + return []CopyOptions{CreateCopy, FailOnConflict, Invalid, Overwrite, Skip} } // CreateMode enumerates the values for create mode. @@ -205,23 +110,6 @@ func PossibleDayOfWeekValues() []DayOfWeek { return []DayOfWeek{Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday} } -// EngineType enumerates the values for engine type. -type EngineType string - -const ( - // BackupEngineTypeAzureBackupServerEngine ... - BackupEngineTypeAzureBackupServerEngine EngineType = "AzureBackupServerEngine" - // BackupEngineTypeBackupEngineBase ... - BackupEngineTypeBackupEngineBase EngineType = "BackupEngineBase" - // BackupEngineTypeDpmBackupEngine ... - BackupEngineTypeDpmBackupEngine EngineType = "DpmBackupEngine" -) - -// PossibleEngineTypeValues returns an array of possible values for the EngineType const type. -func PossibleEngineTypeValues() []EngineType { - return []EngineType{BackupEngineTypeAzureBackupServerEngine, BackupEngineTypeBackupEngineBase, BackupEngineTypeDpmBackupEngine} -} - // EnhancedSecurityState enumerates the values for enhanced security state. type EnhancedSecurityState string @@ -239,38 +127,6 @@ func PossibleEnhancedSecurityStateValues() []EnhancedSecurityState { return []EnhancedSecurityState{EnhancedSecurityStateDisabled, EnhancedSecurityStateEnabled, EnhancedSecurityStateInvalid} } -// FabricName enumerates the values for fabric name. -type FabricName string - -const ( - // FabricNameAzure ... - FabricNameAzure FabricName = "Azure" - // FabricNameInvalid ... - FabricNameInvalid FabricName = "Invalid" -) - -// PossibleFabricNameValues returns an array of possible values for the FabricName const type. -func PossibleFabricNameValues() []FabricName { - return []FabricName{FabricNameAzure, FabricNameInvalid} -} - -// FeatureType enumerates the values for feature type. -type FeatureType string - -const ( - // FeatureTypeAzureBackupGoals ... - FeatureTypeAzureBackupGoals FeatureType = "AzureBackupGoals" - // FeatureTypeAzureVMResourceBackup ... - FeatureTypeAzureVMResourceBackup FeatureType = "AzureVMResourceBackup" - // FeatureTypeFeatureSupportRequest ... - FeatureTypeFeatureSupportRequest FeatureType = "FeatureSupportRequest" -) - -// PossibleFeatureTypeValues returns an array of possible values for the FeatureType const type. -func PossibleFeatureTypeValues() []FeatureType { - return []FeatureType{FeatureTypeAzureBackupGoals, FeatureTypeAzureVMResourceBackup, FeatureTypeFeatureSupportRequest} -} - // HealthState enumerates the values for health state. type HealthState string @@ -414,81 +270,6 @@ func PossibleHTTPStatusCodeValues() []HTTPStatusCode { 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} } -// InquiryStatus enumerates the values for inquiry status. -type InquiryStatus string - -const ( - // InquiryStatusFailed ... - InquiryStatusFailed InquiryStatus = "Failed" - // InquiryStatusInvalid ... - InquiryStatusInvalid InquiryStatus = "Invalid" - // InquiryStatusSuccess ... - InquiryStatusSuccess InquiryStatus = "Success" -) - -// PossibleInquiryStatusValues returns an array of possible values for the InquiryStatus const type. -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 - -const ( - // ItemTypeAzureFileShare ... - ItemTypeAzureFileShare ItemType = "AzureFileShare" - // ItemTypeAzureSQLDb ... - ItemTypeAzureSQLDb ItemType = "AzureSqlDb" - // ItemTypeClient ... - ItemTypeClient ItemType = "Client" - // ItemTypeExchange ... - ItemTypeExchange ItemType = "Exchange" - // ItemTypeFileFolder ... - ItemTypeFileFolder ItemType = "FileFolder" - // ItemTypeGenericDataSource ... - ItemTypeGenericDataSource ItemType = "GenericDataSource" - // ItemTypeInvalid ... - ItemTypeInvalid ItemType = "Invalid" - // ItemTypeSAPAseDatabase ... - ItemTypeSAPAseDatabase ItemType = "SAPAseDatabase" - // ItemTypeSAPHanaDatabase ... - ItemTypeSAPHanaDatabase ItemType = "SAPHanaDatabase" - // ItemTypeSharepoint ... - ItemTypeSharepoint ItemType = "Sharepoint" - // ItemTypeSQLDataBase ... - ItemTypeSQLDataBase ItemType = "SQLDataBase" - // ItemTypeSQLDB ... - ItemTypeSQLDB ItemType = "SQLDB" - // ItemTypeSystemState ... - ItemTypeSystemState ItemType = "SystemState" - // ItemTypeVM ... - ItemTypeVM ItemType = "VM" - // ItemTypeVMwareVM ... - ItemTypeVMwareVM ItemType = "VMwareVM" -) - -// PossibleItemTypeValues returns an array of possible values for the ItemType const type. -func PossibleItemTypeValues() []ItemType { - return []ItemType{ItemTypeAzureFileShare, ItemTypeAzureSQLDb, ItemTypeClient, ItemTypeExchange, ItemTypeFileFolder, ItemTypeGenericDataSource, ItemTypeInvalid, ItemTypeSAPAseDatabase, ItemTypeSAPHanaDatabase, ItemTypeSharepoint, ItemTypeSQLDataBase, ItemTypeSQLDB, ItemTypeSystemState, ItemTypeVM, ItemTypeVMwareVM} -} - // JobOperationType enumerates the values for job operation type. type JobOperationType string @@ -753,43 +534,6 @@ func PossibleObjectTypeValues() []ObjectType { return []ObjectType{ObjectTypeExportJobsOperationResultInfo, ObjectTypeOperationResultInfo, ObjectTypeOperationResultInfoBase} } -// ObjectTypeBasicILRRequest enumerates the values for object type basic ilr request. -type ObjectTypeBasicILRRequest string - -const ( - // ObjectTypeAzureFileShareProvisionILRRequest ... - ObjectTypeAzureFileShareProvisionILRRequest ObjectTypeBasicILRRequest = "AzureFileShareProvisionILRRequest" - // ObjectTypeIaasVMILRRegistrationRequest ... - ObjectTypeIaasVMILRRegistrationRequest ObjectTypeBasicILRRequest = "IaasVMILRRegistrationRequest" - // ObjectTypeILRRequest ... - ObjectTypeILRRequest ObjectTypeBasicILRRequest = "ILRRequest" -) - -// PossibleObjectTypeBasicILRRequestValues returns an array of possible values for the ObjectTypeBasicILRRequest const type. -func PossibleObjectTypeBasicILRRequestValues() []ObjectTypeBasicILRRequest { - return []ObjectTypeBasicILRRequest{ObjectTypeAzureFileShareProvisionILRRequest, ObjectTypeIaasVMILRRegistrationRequest, ObjectTypeILRRequest} -} - -// ObjectTypeBasicOperationStatusExtendedInfo enumerates the values for object type basic operation status -// extended info. -type ObjectTypeBasicOperationStatusExtendedInfo string - -const ( - // ObjectTypeOperationStatusExtendedInfo ... - ObjectTypeOperationStatusExtendedInfo ObjectTypeBasicOperationStatusExtendedInfo = "OperationStatusExtendedInfo" - // ObjectTypeOperationStatusJobExtendedInfo ... - ObjectTypeOperationStatusJobExtendedInfo ObjectTypeBasicOperationStatusExtendedInfo = "OperationStatusJobExtendedInfo" - // ObjectTypeOperationStatusJobsExtendedInfo ... - ObjectTypeOperationStatusJobsExtendedInfo ObjectTypeBasicOperationStatusExtendedInfo = "OperationStatusJobsExtendedInfo" - // ObjectTypeOperationStatusProvisionILRExtendedInfo ... - ObjectTypeOperationStatusProvisionILRExtendedInfo ObjectTypeBasicOperationStatusExtendedInfo = "OperationStatusProvisionILRExtendedInfo" -) - -// PossibleObjectTypeBasicOperationStatusExtendedInfoValues returns an array of possible values for the ObjectTypeBasicOperationStatusExtendedInfo const type. -func PossibleObjectTypeBasicOperationStatusExtendedInfoValues() []ObjectTypeBasicOperationStatusExtendedInfo { - return []ObjectTypeBasicOperationStatusExtendedInfo{ObjectTypeOperationStatusExtendedInfo, ObjectTypeOperationStatusJobExtendedInfo, ObjectTypeOperationStatusJobsExtendedInfo, ObjectTypeOperationStatusProvisionILRExtendedInfo} -} - // ObjectTypeBasicRecoveryPoint enumerates the values for object type basic recovery point. type ObjectTypeBasicRecoveryPoint string @@ -821,25 +565,6 @@ func PossibleObjectTypeBasicRecoveryPointValues() []ObjectTypeBasicRecoveryPoint return []ObjectTypeBasicRecoveryPoint{ObjectTypeAzureFileShareRecoveryPoint, ObjectTypeAzureWorkloadPointInTimeRecoveryPoint, ObjectTypeAzureWorkloadRecoveryPoint, ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint, ObjectTypeAzureWorkloadSAPHanaRecoveryPoint, ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint, ObjectTypeAzureWorkloadSQLRecoveryPoint, ObjectTypeGenericRecoveryPoint, ObjectTypeIaasVMRecoveryPoint, ObjectTypeRecoveryPoint} } -// ObjectTypeBasicRequest enumerates the values for object type basic request. -type ObjectTypeBasicRequest string - -const ( - // ObjectTypeAzureFileShareBackupRequest ... - ObjectTypeAzureFileShareBackupRequest ObjectTypeBasicRequest = "AzureFileShareBackupRequest" - // ObjectTypeAzureWorkloadBackupRequest ... - ObjectTypeAzureWorkloadBackupRequest ObjectTypeBasicRequest = "AzureWorkloadBackupRequest" - // ObjectTypeBackupRequest ... - ObjectTypeBackupRequest ObjectTypeBasicRequest = "BackupRequest" - // ObjectTypeIaasVMBackupRequest ... - ObjectTypeIaasVMBackupRequest ObjectTypeBasicRequest = "IaasVMBackupRequest" -) - -// PossibleObjectTypeBasicRequestValues returns an array of possible values for the ObjectTypeBasicRequest const type. -func PossibleObjectTypeBasicRequestValues() []ObjectTypeBasicRequest { - return []ObjectTypeBasicRequest{ObjectTypeAzureFileShareBackupRequest, ObjectTypeAzureWorkloadBackupRequest, ObjectTypeBackupRequest, ObjectTypeIaasVMBackupRequest} -} - // ObjectTypeBasicRestoreRequest enumerates the values for object type basic restore request. type ObjectTypeBasicRestoreRequest string @@ -887,44 +612,6 @@ func PossibleObjectTypeBasicValidateOperationRequestValues() []ObjectTypeBasicVa return []ObjectTypeBasicValidateOperationRequest{ObjectTypeValidateIaasVMRestoreOperationRequest, ObjectTypeValidateOperationRequest, ObjectTypeValidateRestoreOperationRequest} } -// OperationStatusValues enumerates the values for operation status values. -type OperationStatusValues string - -const ( - // OperationStatusValuesCanceled ... - OperationStatusValuesCanceled OperationStatusValues = "Canceled" - // OperationStatusValuesFailed ... - OperationStatusValuesFailed OperationStatusValues = "Failed" - // OperationStatusValuesInProgress ... - OperationStatusValuesInProgress OperationStatusValues = "InProgress" - // OperationStatusValuesInvalid ... - OperationStatusValuesInvalid OperationStatusValues = "Invalid" - // OperationStatusValuesSucceeded ... - OperationStatusValuesSucceeded OperationStatusValues = "Succeeded" -) - -// PossibleOperationStatusValuesValues returns an array of possible values for the OperationStatusValues const type. -func PossibleOperationStatusValuesValues() []OperationStatusValues { - return []OperationStatusValues{OperationStatusValuesCanceled, OperationStatusValuesFailed, OperationStatusValuesInProgress, OperationStatusValuesInvalid, OperationStatusValuesSucceeded} -} - -// OperationType enumerates the values for operation type. -type OperationType string - -const ( - // OperationTypeInvalid ... - OperationTypeInvalid OperationType = "Invalid" - // OperationTypeRegister ... - OperationTypeRegister OperationType = "Register" - // OperationTypeReregister ... - OperationTypeReregister OperationType = "Reregister" -) - -// PossibleOperationTypeValues returns an array of possible values for the OperationType const type. -func PossibleOperationTypeValues() []OperationType { - return []OperationType{OperationTypeInvalid, OperationTypeRegister, OperationTypeReregister} -} - // OverwriteOptions enumerates the values for overwrite options. type OverwriteOptions string @@ -963,58 +650,6 @@ func PossiblePolicyTypeValues() []PolicyType { return []PolicyType{PolicyTypeCopyOnlyFull, PolicyTypeDifferential, PolicyTypeFull, PolicyTypeInvalid, PolicyTypeLog} } -// ProtectableContainerType enumerates the values for protectable container type. -type ProtectableContainerType string - -const ( - // ProtectableContainerTypeProtectableContainer ... - ProtectableContainerTypeProtectableContainer ProtectableContainerType = "ProtectableContainer" - // ProtectableContainerTypeStorageContainer ... - ProtectableContainerTypeStorageContainer ProtectableContainerType = "StorageContainer" - // ProtectableContainerTypeVMAppContainer ... - ProtectableContainerTypeVMAppContainer ProtectableContainerType = "VMAppContainer" -) - -// PossibleProtectableContainerTypeValues returns an array of possible values for the ProtectableContainerType const type. -func PossibleProtectableContainerTypeValues() []ProtectableContainerType { - return []ProtectableContainerType{ProtectableContainerTypeProtectableContainer, ProtectableContainerTypeStorageContainer, ProtectableContainerTypeVMAppContainer} -} - -// ProtectableItemType enumerates the values for protectable item type. -type ProtectableItemType string - -const ( - // ProtectableItemTypeAzureFileShare ... - ProtectableItemTypeAzureFileShare ProtectableItemType = "AzureFileShare" - // ProtectableItemTypeAzureVMWorkloadProtectableItem ... - ProtectableItemTypeAzureVMWorkloadProtectableItem ProtectableItemType = "AzureVmWorkloadProtectableItem" - // ProtectableItemTypeIaaSVMProtectableItem ... - ProtectableItemTypeIaaSVMProtectableItem ProtectableItemType = "IaaSVMProtectableItem" - // ProtectableItemTypeMicrosoftClassicComputevirtualMachines ... - ProtectableItemTypeMicrosoftClassicComputevirtualMachines ProtectableItemType = "Microsoft.ClassicCompute/virtualMachines" - // ProtectableItemTypeMicrosoftComputevirtualMachines ... - ProtectableItemTypeMicrosoftComputevirtualMachines ProtectableItemType = "Microsoft.Compute/virtualMachines" - // ProtectableItemTypeSAPAseSystem ... - ProtectableItemTypeSAPAseSystem ProtectableItemType = "SAPAseSystem" - // ProtectableItemTypeSAPHanaDatabase ... - ProtectableItemTypeSAPHanaDatabase ProtectableItemType = "SAPHanaDatabase" - // ProtectableItemTypeSAPHanaSystem ... - ProtectableItemTypeSAPHanaSystem ProtectableItemType = "SAPHanaSystem" - // ProtectableItemTypeSQLAvailabilityGroupContainer ... - ProtectableItemTypeSQLAvailabilityGroupContainer ProtectableItemType = "SQLAvailabilityGroupContainer" - // ProtectableItemTypeSQLDataBase ... - ProtectableItemTypeSQLDataBase ProtectableItemType = "SQLDataBase" - // ProtectableItemTypeSQLInstance ... - ProtectableItemTypeSQLInstance ProtectableItemType = "SQLInstance" - // ProtectableItemTypeWorkloadProtectableItem ... - ProtectableItemTypeWorkloadProtectableItem ProtectableItemType = "WorkloadProtectableItem" -) - -// PossibleProtectableItemTypeValues returns an array of possible values for the ProtectableItemType const type. -func PossibleProtectableItemTypeValues() []ProtectableItemType { - return []ProtectableItemType{ProtectableItemTypeAzureFileShare, ProtectableItemTypeAzureVMWorkloadProtectableItem, ProtectableItemTypeIaaSVMProtectableItem, ProtectableItemTypeMicrosoftClassicComputevirtualMachines, ProtectableItemTypeMicrosoftComputevirtualMachines, ProtectableItemTypeSAPAseSystem, ProtectableItemTypeSAPHanaDatabase, ProtectableItemTypeSAPHanaSystem, ProtectableItemTypeSQLAvailabilityGroupContainer, ProtectableItemTypeSQLDataBase, ProtectableItemTypeSQLInstance, ProtectableItemTypeWorkloadProtectableItem} -} - // ProtectedItemHealthStatus enumerates the values for protected item health status. type ProtectedItemHealthStatus string @@ -1096,27 +731,6 @@ func PossibleProtectedItemTypeValues() []ProtectedItemType { return []ProtectedItemType{ProtectedItemTypeAzureFileShareProtectedItem, ProtectedItemTypeAzureIaaSVMProtectedItem, ProtectedItemTypeAzureVMWorkloadProtectedItem, ProtectedItemTypeAzureVMWorkloadSAPAseDatabase, ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase, ProtectedItemTypeAzureVMWorkloadSQLDatabase, ProtectedItemTypeDPMProtectedItem, ProtectedItemTypeGenericProtectedItem, ProtectedItemTypeMabFileFolderProtectedItem, ProtectedItemTypeMicrosoftClassicComputevirtualMachines, ProtectedItemTypeMicrosoftComputevirtualMachines, ProtectedItemTypeMicrosoftSqlserversdatabases, ProtectedItemTypeProtectedItem} } -// ProtectionIntentItemType enumerates the values for protection intent item type. -type ProtectionIntentItemType string - -const ( - // ProtectionIntentItemTypeAzureResourceItem ... - ProtectionIntentItemTypeAzureResourceItem ProtectionIntentItemType = "AzureResourceItem" - // ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent ... - ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent ProtectionIntentItemType = "AzureWorkloadAutoProtectionIntent" - // ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent ... - ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent ProtectionIntentItemType = "AzureWorkloadSQLAutoProtectionIntent" - // ProtectionIntentItemTypeProtectionIntent ... - ProtectionIntentItemTypeProtectionIntent ProtectionIntentItemType = "ProtectionIntent" - // ProtectionIntentItemTypeRecoveryServiceVaultItem ... - ProtectionIntentItemTypeRecoveryServiceVaultItem ProtectionIntentItemType = "RecoveryServiceVaultItem" -) - -// PossibleProtectionIntentItemTypeValues returns an array of possible values for the ProtectionIntentItemType const type. -func PossibleProtectionIntentItemTypeValues() []ProtectionIntentItemType { - return []ProtectionIntentItemType{ProtectionIntentItemTypeAzureResourceItem, ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent, ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent, ProtectionIntentItemTypeProtectionIntent, ProtectionIntentItemTypeRecoveryServiceVaultItem} -} - // ProtectionState enumerates the values for protection state. type ProtectionState string @@ -1140,27 +754,6 @@ func PossibleProtectionStateValues() []ProtectionState { return []ProtectionState{ProtectionStateInvalid, ProtectionStateIRPending, ProtectionStateProtected, ProtectionStateProtectionError, ProtectionStateProtectionPaused, ProtectionStateProtectionStopped} } -// ProtectionStatus enumerates the values for protection status. -type ProtectionStatus string - -const ( - // ProtectionStatusInvalid ... - ProtectionStatusInvalid ProtectionStatus = "Invalid" - // ProtectionStatusNotProtected ... - ProtectionStatusNotProtected ProtectionStatus = "NotProtected" - // ProtectionStatusProtected ... - ProtectionStatusProtected ProtectionStatus = "Protected" - // ProtectionStatusProtecting ... - ProtectionStatusProtecting ProtectionStatus = "Protecting" - // ProtectionStatusProtectionFailed ... - ProtectionStatusProtectionFailed ProtectionStatus = "ProtectionFailed" -) - -// PossibleProtectionStatusValues returns an array of possible values for the ProtectionStatus const type. -func PossibleProtectionStatusValues() []ProtectionStatus { - return []ProtectionStatus{ProtectionStatusInvalid, ProtectionStatusNotProtected, ProtectionStatusProtected, ProtectionStatusProtecting, ProtectionStatusProtectionFailed} -} - // RecoveryMode enumerates the values for recovery mode. type RecoveryMode string @@ -1476,105 +1069,6 @@ func PossibleStorageTypeStateValues() []StorageTypeState { return []StorageTypeState{StorageTypeStateInvalid, StorageTypeStateLocked, StorageTypeStateUnlocked} } -// SupportStatus enumerates the values for support status. -type SupportStatus string - -const ( - // SupportStatusDefaultOFF ... - SupportStatusDefaultOFF SupportStatus = "DefaultOFF" - // SupportStatusDefaultON ... - SupportStatusDefaultON SupportStatus = "DefaultON" - // SupportStatusInvalid ... - SupportStatusInvalid SupportStatus = "Invalid" - // SupportStatusNotSupported ... - SupportStatusNotSupported SupportStatus = "NotSupported" - // SupportStatusSupported ... - SupportStatusSupported SupportStatus = "Supported" -) - -// PossibleSupportStatusValues returns an array of possible values for the SupportStatus const type. -func PossibleSupportStatusValues() []SupportStatus { - return []SupportStatus{SupportStatusDefaultOFF, SupportStatusDefaultON, SupportStatusInvalid, SupportStatusNotSupported, SupportStatusSupported} -} - -// Type enumerates the values for type. -type Type string - -const ( - // TypeBackupProtectedItemCountSummary ... - TypeBackupProtectedItemCountSummary Type = "BackupProtectedItemCountSummary" - // TypeBackupProtectionContainerCountSummary ... - TypeBackupProtectionContainerCountSummary Type = "BackupProtectionContainerCountSummary" - // TypeInvalid ... - TypeInvalid Type = "Invalid" -) - -// PossibleTypeValues returns an array of possible values for the Type const type. -func PossibleTypeValues() []Type { - return []Type{TypeBackupProtectedItemCountSummary, TypeBackupProtectionContainerCountSummary, TypeInvalid} -} - -// TypeEnum enumerates the values for type enum. -type TypeEnum string - -const ( - // TypeEnumCopyOnlyFull ... - TypeEnumCopyOnlyFull TypeEnum = "CopyOnlyFull" - // TypeEnumDifferential ... - TypeEnumDifferential TypeEnum = "Differential" - // TypeEnumFull ... - TypeEnumFull TypeEnum = "Full" - // TypeEnumInvalid ... - TypeEnumInvalid TypeEnum = "Invalid" - // TypeEnumLog ... - TypeEnumLog TypeEnum = "Log" -) - -// PossibleTypeEnumValues returns an array of possible values for the TypeEnum const type. -func PossibleTypeEnumValues() []TypeEnum { - return []TypeEnum{TypeEnumCopyOnlyFull, TypeEnumDifferential, TypeEnumFull, TypeEnumInvalid, TypeEnumLog} -} - -// UsagesUnit enumerates the values for usages unit. -type UsagesUnit string - -const ( - // Bytes ... - Bytes UsagesUnit = "Bytes" - // BytesPerSecond ... - BytesPerSecond UsagesUnit = "BytesPerSecond" - // Count ... - Count UsagesUnit = "Count" - // CountPerSecond ... - CountPerSecond UsagesUnit = "CountPerSecond" - // Percent ... - Percent UsagesUnit = "Percent" - // Seconds ... - Seconds UsagesUnit = "Seconds" -) - -// PossibleUsagesUnitValues returns an array of possible values for the UsagesUnit const type. -func PossibleUsagesUnitValues() []UsagesUnit { - return []UsagesUnit{Bytes, BytesPerSecond, Count, CountPerSecond, Percent, Seconds} -} - -// ValidationStatus enumerates the values for validation status. -type ValidationStatus string - -const ( - // ValidationStatusFailed ... - ValidationStatusFailed ValidationStatus = "Failed" - // ValidationStatusInvalid ... - ValidationStatusInvalid ValidationStatus = "Invalid" - // ValidationStatusSucceeded ... - ValidationStatusSucceeded ValidationStatus = "Succeeded" -) - -// PossibleValidationStatusValues returns an array of possible values for the ValidationStatus const type. -func PossibleValidationStatusValues() []ValidationStatus { - return []ValidationStatus{ValidationStatusFailed, ValidationStatusInvalid, ValidationStatusSucceeded} -} - // WeekOfMonth enumerates the values for week of month. type WeekOfMonth string @@ -1598,58 +1092,6 @@ func PossibleWeekOfMonthValues() []WeekOfMonth { return []WeekOfMonth{WeekOfMonthFirst, WeekOfMonthFourth, WeekOfMonthInvalid, WeekOfMonthLast, WeekOfMonthSecond, WeekOfMonthThird} } -// WorkloadItemType enumerates the values for workload item type. -type WorkloadItemType string - -const ( - // WorkloadItemTypeInvalid ... - WorkloadItemTypeInvalid WorkloadItemType = "Invalid" - // WorkloadItemTypeSAPAseDatabase ... - WorkloadItemTypeSAPAseDatabase WorkloadItemType = "SAPAseDatabase" - // WorkloadItemTypeSAPAseSystem ... - WorkloadItemTypeSAPAseSystem WorkloadItemType = "SAPAseSystem" - // WorkloadItemTypeSAPHanaDatabase ... - WorkloadItemTypeSAPHanaDatabase WorkloadItemType = "SAPHanaDatabase" - // WorkloadItemTypeSAPHanaSystem ... - WorkloadItemTypeSAPHanaSystem WorkloadItemType = "SAPHanaSystem" - // WorkloadItemTypeSQLDataBase ... - WorkloadItemTypeSQLDataBase WorkloadItemType = "SQLDataBase" - // WorkloadItemTypeSQLInstance ... - WorkloadItemTypeSQLInstance WorkloadItemType = "SQLInstance" -) - -// PossibleWorkloadItemTypeValues returns an array of possible values for the WorkloadItemType const type. -func PossibleWorkloadItemTypeValues() []WorkloadItemType { - return []WorkloadItemType{WorkloadItemTypeInvalid, WorkloadItemTypeSAPAseDatabase, WorkloadItemTypeSAPAseSystem, WorkloadItemTypeSAPHanaDatabase, WorkloadItemTypeSAPHanaSystem, WorkloadItemTypeSQLDataBase, WorkloadItemTypeSQLInstance} -} - -// WorkloadItemTypeBasicWorkloadItem enumerates the values for workload item type basic workload item. -type WorkloadItemTypeBasicWorkloadItem string - -const ( - // WorkloadItemTypeAzureVMWorkloadItem ... - WorkloadItemTypeAzureVMWorkloadItem WorkloadItemTypeBasicWorkloadItem = "AzureVmWorkloadItem" - // WorkloadItemTypeSAPAseDatabase1 ... - WorkloadItemTypeSAPAseDatabase1 WorkloadItemTypeBasicWorkloadItem = "SAPAseDatabase" - // WorkloadItemTypeSAPAseSystem1 ... - WorkloadItemTypeSAPAseSystem1 WorkloadItemTypeBasicWorkloadItem = "SAPAseSystem" - // WorkloadItemTypeSAPHanaDatabase1 ... - WorkloadItemTypeSAPHanaDatabase1 WorkloadItemTypeBasicWorkloadItem = "SAPHanaDatabase" - // WorkloadItemTypeSAPHanaSystem1 ... - WorkloadItemTypeSAPHanaSystem1 WorkloadItemTypeBasicWorkloadItem = "SAPHanaSystem" - // WorkloadItemTypeSQLDataBase1 ... - WorkloadItemTypeSQLDataBase1 WorkloadItemTypeBasicWorkloadItem = "SQLDataBase" - // WorkloadItemTypeSQLInstance1 ... - WorkloadItemTypeSQLInstance1 WorkloadItemTypeBasicWorkloadItem = "SQLInstance" - // WorkloadItemTypeWorkloadItem ... - WorkloadItemTypeWorkloadItem WorkloadItemTypeBasicWorkloadItem = "WorkloadItem" -) - -// PossibleWorkloadItemTypeBasicWorkloadItemValues returns an array of possible values for the WorkloadItemTypeBasicWorkloadItem const type. -func PossibleWorkloadItemTypeBasicWorkloadItemValues() []WorkloadItemTypeBasicWorkloadItem { - return []WorkloadItemTypeBasicWorkloadItem{WorkloadItemTypeAzureVMWorkloadItem, WorkloadItemTypeSAPAseDatabase1, WorkloadItemTypeSAPAseSystem1, WorkloadItemTypeSAPHanaDatabase1, WorkloadItemTypeSAPHanaSystem1, WorkloadItemTypeSQLDataBase1, WorkloadItemTypeSQLInstance1, WorkloadItemTypeWorkloadItem} -} - // WorkloadType enumerates the values for workload type. type WorkloadType string diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/featuresupport.go b/services/recoveryservices/mgmt/2019-06-15/backup/featuresupport.go deleted file mode 100644 index 89bd19a91d48..000000000000 --- a/services/recoveryservices/mgmt/2019-06-15/backup/featuresupport.go +++ /dev/null @@ -1,108 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// FeatureSupportClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type FeatureSupportClient struct { - BaseClient -} - -// NewFeatureSupportClient creates an instance of the FeatureSupportClient client. -func NewFeatureSupportClient(subscriptionID string) FeatureSupportClient { - return NewFeatureSupportClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewFeatureSupportClientWithBaseURI creates an instance of the FeatureSupportClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewFeatureSupportClientWithBaseURI(baseURI string, subscriptionID string) FeatureSupportClient { - return FeatureSupportClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Validate sends the validate request. -// Parameters: -// azureRegion - azure region to hit Api -// parameters - feature support request object -func (client FeatureSupportClient) Validate(ctx context.Context, azureRegion string, parameters BasicFeatureSupportRequest) (result AzureVMResourceFeatureSupportResponse, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FeatureSupportClient.Validate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ValidatePreparer(ctx, azureRegion, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.FeatureSupportClient", "Validate", nil, "Failure preparing request") - return - } - - resp, err := client.ValidateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.FeatureSupportClient", "Validate", resp, "Failure sending request") - return - } - - result, err = client.ValidateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.FeatureSupportClient", "Validate", resp, "Failure responding to request") - return - } - - return -} - -// ValidatePreparer prepares the Validate request. -func (client FeatureSupportClient) ValidatePreparer(ctx context.Context, azureRegion string, parameters BasicFeatureSupportRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "azureRegion": autorest.Encode("path", azureRegion), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupValidateFeatures", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ValidateSender sends the Validate request. The method will close the -// http.Response Body if it receives an error. -func (client FeatureSupportClient) ValidateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ValidateResponder handles the response to the Validate request. The method always -// closes the http.Response Body. -func (client FeatureSupportClient) ValidateResponder(resp *http.Response) (result AzureVMResourceFeatureSupportResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/models.go b/services/recoveryservices/mgmt/2019-06-15/backup/models.go index f6ecf3209844..565b22a6083b 100644 --- a/services/recoveryservices/mgmt/2019-06-15/backup/models.go +++ b/services/recoveryservices/mgmt/2019-06-15/backup/models.go @@ -19,471 +19,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2019-06-15/backup" -// AzureBackupGoalFeatureSupportRequest azure backup goal feature specific request. -type AzureBackupGoalFeatureSupportRequest struct { - // FeatureType - Possible values include: 'FeatureTypeFeatureSupportRequest', 'FeatureTypeAzureBackupGoals', 'FeatureTypeAzureVMResourceBackup' - FeatureType FeatureType `json:"featureType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureBackupGoalFeatureSupportRequest. -func (abgfsr AzureBackupGoalFeatureSupportRequest) MarshalJSON() ([]byte, error) { - abgfsr.FeatureType = FeatureTypeAzureBackupGoals - objectMap := make(map[string]interface{}) - if abgfsr.FeatureType != "" { - objectMap["featureType"] = abgfsr.FeatureType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupGoalFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. -func (abgfsr AzureBackupGoalFeatureSupportRequest) AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) { - return &abgfsr, true -} - -// AsAzureVMResourceFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. -func (abgfsr AzureBackupGoalFeatureSupportRequest) AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) { - return nil, false -} - -// AsFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. -func (abgfsr AzureBackupGoalFeatureSupportRequest) AsFeatureSupportRequest() (*FeatureSupportRequest, bool) { - return nil, false -} - -// AsBasicFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. -func (abgfsr AzureBackupGoalFeatureSupportRequest) AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) { - return &abgfsr, true -} - -// AzureBackupServerContainer azureBackupServer (DPMVenus) workload-specific protection container. -type AzureBackupServerContainer struct { - // CanReRegister - Specifies whether the container is re-registrable. - CanReRegister *bool `json:"canReRegister,omitempty"` - // ContainerID - ID of container. - ContainerID *string `json:"containerId,omitempty"` - // ProtectedItemCount - Number of protected items in the BackupEngine - ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` - // DpmAgentVersion - Backup engine Agent version - DpmAgentVersion *string `json:"dpmAgentVersion,omitempty"` - // DpmServers - List of BackupEngines protecting the container - DpmServers *[]string `json:"dpmServers,omitempty"` - // UpgradeAvailable - To check if upgrade available - UpgradeAvailable *bool `json:"upgradeAvailable,omitempty"` - // ProtectionStatus - Protection status of the container. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ExtendedInfo - Extended Info of the container. - ExtendedInfo *DPMContainerExtendedInfo `json:"extendedInfo,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) MarshalJSON() ([]byte, error) { - absc.ContainerType = ContainerTypeAzureBackupServerContainer1 - objectMap := make(map[string]interface{}) - if absc.CanReRegister != nil { - objectMap["canReRegister"] = absc.CanReRegister - } - if absc.ContainerID != nil { - objectMap["containerId"] = absc.ContainerID - } - if absc.ProtectedItemCount != nil { - objectMap["protectedItemCount"] = absc.ProtectedItemCount - } - if absc.DpmAgentVersion != nil { - objectMap["dpmAgentVersion"] = absc.DpmAgentVersion - } - if absc.DpmServers != nil { - objectMap["dpmServers"] = absc.DpmServers - } - if absc.UpgradeAvailable != nil { - objectMap["upgradeAvailable"] = absc.UpgradeAvailable - } - if absc.ProtectionStatus != nil { - objectMap["protectionStatus"] = absc.ProtectionStatus - } - if absc.ExtendedInfo != nil { - objectMap["extendedInfo"] = absc.ExtendedInfo - } - if absc.FriendlyName != nil { - objectMap["friendlyName"] = absc.FriendlyName - } - if absc.BackupManagementType != "" { - objectMap["backupManagementType"] = absc.BackupManagementType - } - if absc.RegistrationStatus != nil { - objectMap["registrationStatus"] = absc.RegistrationStatus - } - if absc.HealthStatus != nil { - objectMap["healthStatus"] = absc.HealthStatus - } - if absc.ContainerType != "" { - objectMap["containerType"] = absc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return &absc, true -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return &absc, true -} - -// AsGenericContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false -} - -// AsMabContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &absc, true -} - -// AzureBackupServerEngine backup engine type when Azure Backup Server is used to manage the backups. -type AzureBackupServerEngine struct { - // FriendlyName - Friendly name of the backup engine. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Registration status of the backup engine with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // BackupEngineState - Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} - BackupEngineState *string `json:"backupEngineState,omitempty"` - // HealthStatus - Backup status of the backup engine. - HealthStatus *string `json:"healthStatus,omitempty"` - // CanReRegister - Flag indicating if the backup engine be registered, once already registered. - CanReRegister *bool `json:"canReRegister,omitempty"` - // BackupEngineID - ID of the backup engine. - BackupEngineID *string `json:"backupEngineId,omitempty"` - // DpmVersion - Backup engine version - DpmVersion *string `json:"dpmVersion,omitempty"` - // AzureBackupAgentVersion - Backup agent version - AzureBackupAgentVersion *string `json:"azureBackupAgentVersion,omitempty"` - // IsAzureBackupAgentUpgradeAvailable - To check if backup agent upgrade available - IsAzureBackupAgentUpgradeAvailable *bool `json:"isAzureBackupAgentUpgradeAvailable,omitempty"` - // IsDpmUpgradeAvailable - To check if backup engine upgrade available - IsDpmUpgradeAvailable *bool `json:"isDpmUpgradeAvailable,omitempty"` - // ExtendedInfo - Extended info of the backupengine - ExtendedInfo *EngineExtendedInfo `json:"extendedInfo,omitempty"` - // BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine' - BackupEngineType EngineType `json:"backupEngineType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureBackupServerEngine. -func (abse AzureBackupServerEngine) MarshalJSON() ([]byte, error) { - abse.BackupEngineType = BackupEngineTypeAzureBackupServerEngine - objectMap := make(map[string]interface{}) - if abse.FriendlyName != nil { - objectMap["friendlyName"] = abse.FriendlyName - } - if abse.BackupManagementType != "" { - objectMap["backupManagementType"] = abse.BackupManagementType - } - if abse.RegistrationStatus != nil { - objectMap["registrationStatus"] = abse.RegistrationStatus - } - if abse.BackupEngineState != nil { - objectMap["backupEngineState"] = abse.BackupEngineState - } - if abse.HealthStatus != nil { - objectMap["healthStatus"] = abse.HealthStatus - } - if abse.CanReRegister != nil { - objectMap["canReRegister"] = abse.CanReRegister - } - if abse.BackupEngineID != nil { - objectMap["backupEngineId"] = abse.BackupEngineID - } - if abse.DpmVersion != nil { - objectMap["dpmVersion"] = abse.DpmVersion - } - if abse.AzureBackupAgentVersion != nil { - objectMap["azureBackupAgentVersion"] = abse.AzureBackupAgentVersion - } - if abse.IsAzureBackupAgentUpgradeAvailable != nil { - objectMap["isAzureBackupAgentUpgradeAvailable"] = abse.IsAzureBackupAgentUpgradeAvailable - } - if abse.IsDpmUpgradeAvailable != nil { - objectMap["isDpmUpgradeAvailable"] = abse.IsDpmUpgradeAvailable - } - if abse.ExtendedInfo != nil { - objectMap["extendedInfo"] = abse.ExtendedInfo - } - if abse.BackupEngineType != "" { - objectMap["backupEngineType"] = abse.BackupEngineType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerEngine is the BasicEngineBase implementation for AzureBackupServerEngine. -func (abse AzureBackupServerEngine) AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) { - return &abse, true -} - -// AsDpmBackupEngine is the BasicEngineBase implementation for AzureBackupServerEngine. -func (abse AzureBackupServerEngine) AsDpmBackupEngine() (*DpmBackupEngine, bool) { - return nil, false -} - -// AsEngineBase is the BasicEngineBase implementation for AzureBackupServerEngine. -func (abse AzureBackupServerEngine) AsEngineBase() (*EngineBase, bool) { - return nil, false -} - -// AsBasicEngineBase is the BasicEngineBase implementation for AzureBackupServerEngine. -func (abse AzureBackupServerEngine) AsBasicEngineBase() (BasicEngineBase, bool) { - return &abse, true -} - -// AzureFileShareBackupRequest azureFileShare workload-specific backup request. -type AzureFileShareBackupRequest struct { - // RecoveryPointExpiryTimeInUTC - Backup copy will expire after the time specified (UTC). - RecoveryPointExpiryTimeInUTC *date.Time `json:"recoveryPointExpiryTimeInUTC,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' - ObjectType ObjectTypeBasicRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFileShareBackupRequest. -func (afsbr AzureFileShareBackupRequest) MarshalJSON() ([]byte, error) { - afsbr.ObjectType = ObjectTypeAzureFileShareBackupRequest - objectMap := make(map[string]interface{}) - if afsbr.RecoveryPointExpiryTimeInUTC != nil { - objectMap["recoveryPointExpiryTimeInUTC"] = afsbr.RecoveryPointExpiryTimeInUTC - } - if afsbr.ObjectType != "" { - objectMap["objectType"] = afsbr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareBackupRequest is the BasicRequest implementation for AzureFileShareBackupRequest. -func (afsbr AzureFileShareBackupRequest) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { - return &afsbr, true -} - -// AsAzureWorkloadBackupRequest is the BasicRequest implementation for AzureFileShareBackupRequest. -func (afsbr AzureFileShareBackupRequest) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { - return nil, false -} - -// AsIaasVMBackupRequest is the BasicRequest implementation for AzureFileShareBackupRequest. -func (afsbr AzureFileShareBackupRequest) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { - return nil, false -} - -// AsRequest is the BasicRequest implementation for AzureFileShareBackupRequest. -func (afsbr AzureFileShareBackupRequest) AsRequest() (*Request, bool) { - return nil, false -} - -// AsBasicRequest is the BasicRequest implementation for AzureFileShareBackupRequest. -func (afsbr AzureFileShareBackupRequest) AsBasicRequest() (BasicRequest, bool) { - return &afsbr, true -} - -// AzureFileShareProtectableItem protectable item for Azure Fileshare workloads. -type AzureFileShareProtectableItem struct { - // ParentContainerFabricID - Full Fabric ID of container to which this protectable item belongs. For example, ARM ID. - ParentContainerFabricID *string `json:"parentContainerFabricId,omitempty"` - // ParentContainerFriendlyName - Friendly name of container to which this protectable item belongs. - ParentContainerFriendlyName *string `json:"parentContainerFriendlyName,omitempty"` - // AzureFileShareType - File Share type XSync or XSMB. Possible values include: 'Invalid', 'XSMB', 'XSync' - AzureFileShareType AzureFileShareType `json:"azureFileShareType,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) MarshalJSON() ([]byte, error) { - afspi.ProtectableItemType = ProtectableItemTypeAzureFileShare - objectMap := make(map[string]interface{}) - if afspi.ParentContainerFabricID != nil { - objectMap["parentContainerFabricId"] = afspi.ParentContainerFabricID - } - if afspi.ParentContainerFriendlyName != nil { - objectMap["parentContainerFriendlyName"] = afspi.ParentContainerFriendlyName - } - if afspi.AzureFileShareType != "" { - objectMap["azureFileShareType"] = afspi.AzureFileShareType - } - if afspi.BackupManagementType != nil { - objectMap["backupManagementType"] = afspi.BackupManagementType - } - if afspi.WorkloadType != nil { - objectMap["workloadType"] = afspi.WorkloadType - } - if afspi.FriendlyName != nil { - objectMap["friendlyName"] = afspi.FriendlyName - } - if afspi.ProtectionState != "" { - objectMap["protectionState"] = afspi.ProtectionState - } - if afspi.ProtectableItemType != "" { - objectMap["protectableItemType"] = afspi.ProtectableItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return &afspi, true -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false -} - -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return nil, false -} - -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return nil, false -} - -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &afspi, true -} - // AzureFileshareProtectedItem azure File Share workload-specific backup item. type AzureFileshareProtectedItem struct { // FriendlyName - Friendly name of the fileshare represented by this backup item. @@ -853,53 +388,6 @@ func (afspp *AzureFileShareProtectionPolicy) UnmarshalJSON(body []byte) error { return nil } -// AzureFileShareProvisionILRRequest update snapshot Uri with the correct friendly Name of the source Azure -// file share. -type AzureFileShareProvisionILRRequest struct { - // RecoveryPointID - Recovery point ID. - RecoveryPointID *string `json:"recoveryPointId,omitempty"` - // SourceResourceID - Source Storage account ARM Id - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeAzureFileShareProvisionILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest' - ObjectType ObjectTypeBasicILRRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFileShareProvisionILRRequest. -func (afspir AzureFileShareProvisionILRRequest) MarshalJSON() ([]byte, error) { - afspir.ObjectType = ObjectTypeAzureFileShareProvisionILRRequest - objectMap := make(map[string]interface{}) - if afspir.RecoveryPointID != nil { - objectMap["recoveryPointId"] = afspir.RecoveryPointID - } - if afspir.SourceResourceID != nil { - objectMap["sourceResourceId"] = afspir.SourceResourceID - } - if afspir.ObjectType != "" { - objectMap["objectType"] = afspir.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProvisionILRRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. -func (afspir AzureFileShareProvisionILRRequest) AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) { - return &afspir, true -} - -// AsIaasVMILRRegistrationRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. -func (afspir AzureFileShareProvisionILRRequest) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) { - return nil, false -} - -// AsILRRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. -func (afspir AzureFileShareProvisionILRRequest) AsILRRequest() (*ILRRequest, bool) { - return nil, false -} - -// AsBasicILRRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. -func (afspir AzureFileShareProvisionILRRequest) AsBasicILRRequest() (BasicILRRequest, bool) { - return &afspir, true -} - // AzureFileShareRecoveryPoint azure File Share workload specific backup copy. type AzureFileShareRecoveryPoint struct { // RecoveryPointType - READ-ONLY; Type of the backup copy. Specifies whether it is a crash consistent backup or app consistent. @@ -1000,7 +488,7 @@ type AzureFileShareRestoreRequest struct { RecoveryType RecoveryType `json:"recoveryType,omitempty"` // SourceResourceID - Source storage account ARM Id SourceResourceID *string `json:"sourceResourceId,omitempty"` - // CopyOptions - Options to resolve copy conflicts. Possible values include: 'CopyOptionsInvalid', 'CopyOptionsCreateCopy', 'CopyOptionsSkip', 'CopyOptionsOverwrite', 'CopyOptionsFailOnConflict' + // CopyOptions - Options to resolve copy conflicts. Possible values include: 'Invalid', 'CreateCopy', 'Skip', 'Overwrite', 'FailOnConflict' CopyOptions CopyOptions `json:"copyOptions,omitempty"` // RestoreRequestType - Restore Type (FullShareRestore or ItemLevelRestore). Possible values include: 'RestoreRequestTypeInvalid', 'RestoreRequestTypeFullShareRestore', 'RestoreRequestTypeItemLevelRestore' RestoreRequestType RestoreRequestType `json:"restoreRequestType,omitempty"` @@ -1105,287 +593,33 @@ func (afsrr AzureFileShareRestoreRequest) AsBasicRestoreRequest() (BasicRestoreR return &afsrr, true } -// AzureIaaSClassicComputeVMContainer iaaS VM workload-specific backup item representing a classic virtual -// machine. -type AzureIaaSClassicComputeVMContainer struct { - // VirtualMachineID - Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // VirtualMachineVersion - Specifies whether the container represents a Classic or an Azure Resource Manager VM. - VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` - // ResourceGroup - Resource group name of Recovery Services Vault. - ResourceGroup *string `json:"resourceGroup,omitempty"` - // FriendlyName - Friendly name of the container. +// AzureIaaSClassicComputeVMProtectedItem iaaS VM workload-specific backup item representing the Classic +// Compute VM. +type AzureIaaSClassicComputeVMProtectedItem struct { + // FriendlyName - Friendly name of the VM represented by this backup item. FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) MarshalJSON() ([]byte, error) { - aisccvc.ContainerType = ContainerTypeMicrosoftClassicComputevirtualMachines - objectMap := make(map[string]interface{}) - if aisccvc.VirtualMachineID != nil { - objectMap["virtualMachineId"] = aisccvc.VirtualMachineID - } - if aisccvc.VirtualMachineVersion != nil { - objectMap["virtualMachineVersion"] = aisccvc.VirtualMachineVersion - } - if aisccvc.ResourceGroup != nil { - objectMap["resourceGroup"] = aisccvc.ResourceGroup - } - if aisccvc.FriendlyName != nil { - objectMap["friendlyName"] = aisccvc.FriendlyName - } - if aisccvc.BackupManagementType != "" { - objectMap["backupManagementType"] = aisccvc.BackupManagementType - } - if aisccvc.RegistrationStatus != nil { - objectMap["registrationStatus"] = aisccvc.RegistrationStatus - } - if aisccvc.HealthStatus != nil { - objectMap["healthStatus"] = aisccvc.HealthStatus - } - if aisccvc.ContainerType != "" { - objectMap["containerType"] = aisccvc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return &aisccvc, true -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return &aisccvc, true -} - -// AsMabContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &aisccvc, true -} - -// AzureIaaSClassicComputeVMProtectableItem iaaS VM workload-specific backup item representing the Classic -// Compute VM. -type AzureIaaSClassicComputeVMProtectableItem struct { - // VirtualMachineID - Fully qualified ARM ID of the virtual machine. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) MarshalJSON() ([]byte, error) { - aisccvpi.ProtectableItemType = ProtectableItemTypeMicrosoftClassicComputevirtualMachines - objectMap := make(map[string]interface{}) - if aisccvpi.VirtualMachineID != nil { - objectMap["virtualMachineId"] = aisccvpi.VirtualMachineID - } - if aisccvpi.BackupManagementType != nil { - objectMap["backupManagementType"] = aisccvpi.BackupManagementType - } - if aisccvpi.WorkloadType != nil { - objectMap["workloadType"] = aisccvpi.WorkloadType - } - if aisccvpi.FriendlyName != nil { - objectMap["friendlyName"] = aisccvpi.FriendlyName - } - if aisccvpi.ProtectionState != "" { - objectMap["protectionState"] = aisccvpi.ProtectionState - } - if aisccvpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = aisccvpi.ProtectableItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return &aisccvpi, true -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false -} - -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return nil, false -} - -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return &aisccvpi, true -} - -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &aisccvpi, true -} - -// AzureIaaSClassicComputeVMProtectedItem iaaS VM workload-specific backup item representing the Classic -// Compute VM. -type AzureIaaSClassicComputeVMProtectedItem struct { - // FriendlyName - Friendly name of the VM represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // VirtualMachineID - Fully qualified ARM ID of the virtual machine represented by this item. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // ProtectionStatus - Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // HealthStatus - Health status of protected item. Possible values include: 'HealthStatusPassed', 'HealthStatusActionRequired', 'HealthStatusActionSuggested', 'HealthStatusInvalid' - HealthStatus HealthStatus `json:"healthStatus,omitempty"` - // HealthDetails - Health details on this backup item. - HealthDetails *[]AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` - // KpisHealths - Health details of different KPIs - KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` - // LastBackupStatus - Last backup operation status. - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // ProtectedItemDataID - Data ID of the protected item. - ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` - // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + // VirtualMachineID - Fully qualified ARM ID of the virtual machine represented by this item. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // HealthStatus - Health status of protected item. Possible values include: 'HealthStatusPassed', 'HealthStatusActionRequired', 'HealthStatusActionSuggested', 'HealthStatusInvalid' + HealthStatus HealthStatus `json:"healthStatus,omitempty"` + // HealthDetails - Health details on this backup item. + HealthDetails *[]AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` + // KpisHealths - Health details of different KPIs + KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` + // LastBackupStatus - Last backup operation status. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // ProtectedItemDataID - Data ID of the protected item. + ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' WorkloadType DataSourceType `json:"workloadType,omitempty"` @@ -1580,343 +814,89 @@ func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsBasicProtectedItem() (B return &aisccvpi, true } -// AzureIaaSComputeVMContainer iaaS VM workload-specific backup item representing an Azure Resource Manager -// virtual machine. -type AzureIaaSComputeVMContainer struct { - // VirtualMachineID - Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // VirtualMachineVersion - Specifies whether the container represents a Classic or an Azure Resource Manager VM. - VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` - // ResourceGroup - Resource group name of Recovery Services Vault. - ResourceGroup *string `json:"resourceGroup,omitempty"` - // FriendlyName - Friendly name of the container. +// AzureIaaSComputeVMProtectedItem iaaS VM workload-specific backup item representing the Azure Resource +// Manager VM. +type AzureIaaSComputeVMProtectedItem struct { + // FriendlyName - Friendly name of the VM represented by this backup item. FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + // VirtualMachineID - Fully qualified ARM ID of the virtual machine represented by this item. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // HealthStatus - Health status of protected item. Possible values include: 'HealthStatusPassed', 'HealthStatusActionRequired', 'HealthStatusActionSuggested', 'HealthStatusInvalid' + HealthStatus HealthStatus `json:"healthStatus,omitempty"` + // HealthDetails - Health details on this backup item. + HealthDetails *[]AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` + // KpisHealths - Health details of different KPIs + KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` + // LastBackupStatus - Last backup operation status. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // ProtectedItemDataID - Data ID of the protected item. + ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) MarshalJSON() ([]byte, error) { - aiscvc.ContainerType = ContainerTypeMicrosoftComputevirtualMachines +// MarshalJSON is the custom marshaler for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) MarshalJSON() ([]byte, error) { + aiscvpi.ProtectedItemType = ProtectedItemTypeMicrosoftComputevirtualMachines objectMap := make(map[string]interface{}) - if aiscvc.VirtualMachineID != nil { - objectMap["virtualMachineId"] = aiscvc.VirtualMachineID + if aiscvpi.FriendlyName != nil { + objectMap["friendlyName"] = aiscvpi.FriendlyName } - if aiscvc.VirtualMachineVersion != nil { - objectMap["virtualMachineVersion"] = aiscvc.VirtualMachineVersion + if aiscvpi.VirtualMachineID != nil { + objectMap["virtualMachineId"] = aiscvpi.VirtualMachineID } - if aiscvc.ResourceGroup != nil { - objectMap["resourceGroup"] = aiscvc.ResourceGroup + if aiscvpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = aiscvpi.ProtectionStatus } - if aiscvc.FriendlyName != nil { - objectMap["friendlyName"] = aiscvc.FriendlyName + if aiscvpi.ProtectionState != "" { + objectMap["protectionState"] = aiscvpi.ProtectionState } - if aiscvc.BackupManagementType != "" { - objectMap["backupManagementType"] = aiscvc.BackupManagementType + if aiscvpi.HealthStatus != "" { + objectMap["healthStatus"] = aiscvpi.HealthStatus } - if aiscvc.RegistrationStatus != nil { - objectMap["registrationStatus"] = aiscvc.RegistrationStatus + if aiscvpi.HealthDetails != nil { + objectMap["healthDetails"] = aiscvpi.HealthDetails } - if aiscvc.HealthStatus != nil { - objectMap["healthStatus"] = aiscvc.HealthStatus + if aiscvpi.KpisHealths != nil { + objectMap["kpisHealths"] = aiscvpi.KpisHealths } - if aiscvc.ContainerType != "" { - objectMap["containerType"] = aiscvc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return &aiscvc, true -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return &aiscvc, true -} - -// AsMabContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &aiscvc, true -} - -// AzureIaaSComputeVMProtectableItem iaaS VM workload-specific backup item representing the Azure Resource -// Manager VM. -type AzureIaaSComputeVMProtectableItem struct { - // VirtualMachineID - Fully qualified ARM ID of the virtual machine. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) MarshalJSON() ([]byte, error) { - aiscvpi.ProtectableItemType = ProtectableItemTypeMicrosoftComputevirtualMachines - objectMap := make(map[string]interface{}) - if aiscvpi.VirtualMachineID != nil { - objectMap["virtualMachineId"] = aiscvpi.VirtualMachineID - } - if aiscvpi.BackupManagementType != nil { - objectMap["backupManagementType"] = aiscvpi.BackupManagementType - } - if aiscvpi.WorkloadType != nil { - objectMap["workloadType"] = aiscvpi.WorkloadType - } - if aiscvpi.FriendlyName != nil { - objectMap["friendlyName"] = aiscvpi.FriendlyName - } - if aiscvpi.ProtectionState != "" { - objectMap["protectionState"] = aiscvpi.ProtectionState - } - if aiscvpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = aiscvpi.ProtectableItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return &aiscvpi, true -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false -} - -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return nil, false -} - -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return &aiscvpi, true -} - -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &aiscvpi, true -} - -// AzureIaaSComputeVMProtectedItem iaaS VM workload-specific backup item representing the Azure Resource -// Manager VM. -type AzureIaaSComputeVMProtectedItem struct { - // FriendlyName - Friendly name of the VM represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // VirtualMachineID - Fully qualified ARM ID of the virtual machine represented by this item. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // ProtectionStatus - Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // HealthStatus - Health status of protected item. Possible values include: 'HealthStatusPassed', 'HealthStatusActionRequired', 'HealthStatusActionSuggested', 'HealthStatusInvalid' - HealthStatus HealthStatus `json:"healthStatus,omitempty"` - // HealthDetails - Health details on this backup item. - HealthDetails *[]AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` - // KpisHealths - Health details of different KPIs - KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` - // LastBackupStatus - Last backup operation status. - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // ProtectedItemDataID - Data ID of the protected item. - ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` - // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) MarshalJSON() ([]byte, error) { - aiscvpi.ProtectedItemType = ProtectedItemTypeMicrosoftComputevirtualMachines - objectMap := make(map[string]interface{}) - if aiscvpi.FriendlyName != nil { - objectMap["friendlyName"] = aiscvpi.FriendlyName - } - if aiscvpi.VirtualMachineID != nil { - objectMap["virtualMachineId"] = aiscvpi.VirtualMachineID - } - if aiscvpi.ProtectionStatus != nil { - objectMap["protectionStatus"] = aiscvpi.ProtectionStatus - } - if aiscvpi.ProtectionState != "" { - objectMap["protectionState"] = aiscvpi.ProtectionState - } - if aiscvpi.HealthStatus != "" { - objectMap["healthStatus"] = aiscvpi.HealthStatus - } - if aiscvpi.HealthDetails != nil { - objectMap["healthDetails"] = aiscvpi.HealthDetails - } - if aiscvpi.KpisHealths != nil { - objectMap["kpisHealths"] = aiscvpi.KpisHealths - } - if aiscvpi.LastBackupStatus != nil { - objectMap["lastBackupStatus"] = aiscvpi.LastBackupStatus + if aiscvpi.LastBackupStatus != nil { + objectMap["lastBackupStatus"] = aiscvpi.LastBackupStatus } if aiscvpi.LastBackupTime != nil { objectMap["lastBackupTime"] = aiscvpi.LastBackupTime @@ -2698,497 +1678,492 @@ func (aispp *AzureIaaSVMProtectionPolicy) UnmarshalJSON(body []byte) error { return nil } -// BasicAzureRecoveryServiceVaultProtectionIntent azure Recovery Services Vault specific protection intent item. -type BasicAzureRecoveryServiceVaultProtectionIntent interface { - AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) - AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) - AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) - AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) -} - -// AzureRecoveryServiceVaultProtectionIntent azure Recovery Services Vault specific protection intent item. -type AzureRecoveryServiceVaultProtectionIntent struct { +// AzureSQLProtectedItem azure SQL workload-specific backup item. +type AzureSQLProtectedItem struct { + // ProtectedItemDataID - Internal ID of a backup item. Used by Azure SQL Backup engine to contact Recovery Services. + ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` + // ProtectionState - Backup state of the backed up item. Possible values include: 'ProtectedItemStateInvalid', 'ProtectedItemStateIRPending', 'ProtectedItemStateProtected', 'ProtectedItemStateProtectionError', 'ProtectedItemStateProtectionStopped', 'ProtectedItemStateProtectionPaused' + ProtectionState ProtectedItemState `json:"protectionState,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureSQLProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` // SourceResourceID - ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId - ItemID *string `json:"itemId,omitempty"` // PolicyID - ID of the backup policy with which this item is backed up. PolicyID *string `json:"policyId,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' - ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } -func unmarshalBasicAzureRecoveryServiceVaultProtectionIntent(body []byte) (BasicAzureRecoveryServiceVaultProtectionIntent, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err +// MarshalJSON is the custom marshaler for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) MarshalJSON() ([]byte, error) { + aspi.ProtectedItemType = ProtectedItemTypeMicrosoftSqlserversdatabases + objectMap := make(map[string]interface{}) + if aspi.ProtectedItemDataID != nil { + objectMap["protectedItemDataId"] = aspi.ProtectedItemDataID } - - switch m["protectionIntentItemType"] { - case string(ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent): - var awapi AzureWorkloadAutoProtectionIntent - err := json.Unmarshal(body, &awapi) - return awapi, err - case string(ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent): - var awsapi AzureWorkloadSQLAutoProtectionIntent - err := json.Unmarshal(body, &awsapi) - return awsapi, err - default: - var arsvpi AzureRecoveryServiceVaultProtectionIntent - err := json.Unmarshal(body, &arsvpi) - return arsvpi, err + if aspi.ProtectionState != "" { + objectMap["protectionState"] = aspi.ProtectionState } -} -func unmarshalBasicAzureRecoveryServiceVaultProtectionIntentArray(body []byte) ([]BasicAzureRecoveryServiceVaultProtectionIntent, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err + if aspi.ExtendedInfo != nil { + objectMap["extendedInfo"] = aspi.ExtendedInfo } - - arsvpiArray := make([]BasicAzureRecoveryServiceVaultProtectionIntent, len(rawMessages)) - - for index, rawMessage := range rawMessages { - arsvpi, err := unmarshalBasicAzureRecoveryServiceVaultProtectionIntent(*rawMessage) - if err != nil { - return nil, err - } - arsvpiArray[index] = arsvpi + if aspi.BackupManagementType != "" { + objectMap["backupManagementType"] = aspi.BackupManagementType } - return arsvpiArray, nil -} - -// MarshalJSON is the custom marshaler for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) MarshalJSON() ([]byte, error) { - arsvpi.ProtectionIntentItemType = ProtectionIntentItemTypeRecoveryServiceVaultItem - objectMap := make(map[string]interface{}) - if arsvpi.BackupManagementType != "" { - objectMap["backupManagementType"] = arsvpi.BackupManagementType + if aspi.WorkloadType != "" { + objectMap["workloadType"] = aspi.WorkloadType } - if arsvpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = arsvpi.SourceResourceID + if aspi.ContainerName != nil { + objectMap["containerName"] = aspi.ContainerName } - if arsvpi.ItemID != nil { - objectMap["itemId"] = arsvpi.ItemID + if aspi.SourceResourceID != nil { + objectMap["sourceResourceId"] = aspi.SourceResourceID } - if arsvpi.PolicyID != nil { - objectMap["policyId"] = arsvpi.PolicyID + if aspi.PolicyID != nil { + objectMap["policyId"] = aspi.PolicyID } - if arsvpi.ProtectionState != "" { - objectMap["protectionState"] = arsvpi.ProtectionState + if aspi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = aspi.LastRecoveryPoint } - if arsvpi.ProtectionIntentItemType != "" { - objectMap["protectionIntentItemType"] = arsvpi.ProtectionIntentItemType + if aspi.BackupSetName != nil { + objectMap["backupSetName"] = aspi.BackupSetName } - return json.Marshal(objectMap) -} - -// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { - return &arsvpi, true -} - -// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { - return &arsvpi, true -} - -// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { - return nil, false -} - -// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { - return nil, false -} - -// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { - return nil, false -} - -// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { - return nil, false -} - -// AsProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { - return nil, false -} - -// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { - return &arsvpi, true -} - -// AzureResourceProtectionIntent iaaS VM specific backup protection intent item. -type AzureResourceProtectionIntent struct { - // FriendlyName - Friendly name of the VM represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId - ItemID *string `json:"itemId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' - ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) MarshalJSON() ([]byte, error) { - arpi.ProtectionIntentItemType = ProtectionIntentItemTypeAzureResourceItem - objectMap := make(map[string]interface{}) - if arpi.FriendlyName != nil { - objectMap["friendlyName"] = arpi.FriendlyName + if aspi.CreateMode != "" { + objectMap["createMode"] = aspi.CreateMode } - if arpi.BackupManagementType != "" { - objectMap["backupManagementType"] = arpi.BackupManagementType + if aspi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = aspi.DeferredDeleteTimeInUTC } - if arpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = arpi.SourceResourceID + if aspi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = aspi.IsScheduledForDeferredDelete } - if arpi.ItemID != nil { - objectMap["itemId"] = arpi.ItemID + if aspi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = aspi.DeferredDeleteTimeRemaining } - if arpi.PolicyID != nil { - objectMap["policyId"] = arpi.PolicyID + if aspi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = aspi.IsDeferredDeleteScheduleUpcoming } - if arpi.ProtectionState != "" { - objectMap["protectionState"] = arpi.ProtectionState + if aspi.IsRehydrate != nil { + objectMap["isRehydrate"] = aspi.IsRehydrate } - if arpi.ProtectionIntentItemType != "" { - objectMap["protectionIntentItemType"] = arpi.ProtectionIntentItemType + if aspi.ProtectedItemType != "" { + objectMap["protectedItemType"] = aspi.ProtectedItemType } return json.Marshal(objectMap) } -// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { - return nil, false -} - -// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { - return nil, false -} - -// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { - return &arpi, true -} - -// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { - return nil, false -} - -// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { - return nil, false -} - -// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { return nil, false } -// AsProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { return nil, false } -// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { - return &arpi, true -} - -// AzureSQLAGWorkloadContainerProtectionContainer container for SQL workloads under SQL Availability Group. -type AzureSQLAGWorkloadContainerProtectionContainer struct { - // SourceResourceID - ARM ID of the virtual machine represented by this Azure Workload Container - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // LastUpdatedTime - Time stamp when this container was updated. - LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` - // ExtendedInfo - Additional details of a workload container. - ExtendedInfo *AzureWorkloadContainerExtendedInfo `json:"extendedInfo,omitempty"` - // WorkloadType - Workload type for which registration was sent. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` - // OperationType - Re-Do Operation. Possible values include: 'OperationTypeInvalid', 'OperationTypeRegister', 'OperationTypeReregister' - OperationType OperationType `json:"operationType,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) MarshalJSON() ([]byte, error) { - aswcpc.ContainerType = ContainerTypeSQLAGWorkLoadContainer1 - objectMap := make(map[string]interface{}) - if aswcpc.SourceResourceID != nil { - objectMap["sourceResourceId"] = aswcpc.SourceResourceID - } - if aswcpc.LastUpdatedTime != nil { - objectMap["lastUpdatedTime"] = aswcpc.LastUpdatedTime - } - if aswcpc.ExtendedInfo != nil { - objectMap["extendedInfo"] = aswcpc.ExtendedInfo - } - if aswcpc.WorkloadType != "" { - objectMap["workloadType"] = aswcpc.WorkloadType - } - if aswcpc.OperationType != "" { - objectMap["operationType"] = aswcpc.OperationType - } - if aswcpc.FriendlyName != nil { - objectMap["friendlyName"] = aswcpc.FriendlyName - } - if aswcpc.BackupManagementType != "" { - objectMap["backupManagementType"] = aswcpc.BackupManagementType - } - if aswcpc.RegistrationStatus != nil { - objectMap["registrationStatus"] = aswcpc.RegistrationStatus - } - if aswcpc.HealthStatus != nil { - objectMap["healthStatus"] = aswcpc.HealthStatus - } - if aswcpc.ContainerType != "" { - objectMap["containerType"] = aswcpc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { return nil, false } -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { return nil, false } -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return &aswcpc, true -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return &aspi, true } -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { return nil, false } -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { return nil, false } -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { return nil, false } -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return &aswcpc, true -} - -// AsDpmContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsDpmContainer() (*DpmContainer, bool) { +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { return nil, false } -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { return nil, false } -// AsGenericContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsGenericContainer() (*GenericContainer, bool) { +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { return nil, false } -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { return nil, false } -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { return nil, false } -// AsMabContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsMabContainer() (*MabContainer, bool) { +// AsProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { return nil, false } -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &aspi, true } -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &aswcpc, true +// AzureSQLProtectedItemExtendedInfo additional information on Azure Sql specific protected item. +type AzureSQLProtectedItemExtendedInfo struct { + // OldestRecoveryPoint - The oldest backup copy available for this item in the service. + OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` + // RecoveryPointCount - Number of available backup copies associated with this backup item. + RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` + // PolicyState - State of the backup policy associated with this backup item. + PolicyState *string `json:"policyState,omitempty"` } -// AzureSQLContainer azure Sql workload-specific container. -type AzureSQLContainer struct { - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +// AzureSQLProtectionPolicy azure SQL workload-specific backup policy. +type AzureSQLProtectionPolicy struct { + // RetentionPolicy - Retention policy details. + RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureSQLContainer. -func (asc AzureSQLContainer) MarshalJSON() ([]byte, error) { - asc.ContainerType = ContainerTypeAzureSQLContainer1 +// MarshalJSON is the custom marshaler for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) MarshalJSON() ([]byte, error) { + aspp.BackupManagementType = BackupManagementTypeAzureSQL objectMap := make(map[string]interface{}) - if asc.FriendlyName != nil { - objectMap["friendlyName"] = asc.FriendlyName - } - if asc.BackupManagementType != "" { - objectMap["backupManagementType"] = asc.BackupManagementType - } - if asc.RegistrationStatus != nil { - objectMap["registrationStatus"] = asc.RegistrationStatus - } - if asc.HealthStatus != nil { - objectMap["healthStatus"] = asc.HealthStatus + objectMap["retentionPolicy"] = aspp.RetentionPolicy + if aspp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = aspp.ProtectedItemsCount } - if asc.ContainerType != "" { - objectMap["containerType"] = asc.ContainerType + if aspp.BackupManagementType != "" { + objectMap["backupManagementType"] = aspp.BackupManagementType } return json.Marshal(objectMap) } -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { return nil, false } -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { return nil, false } -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { return nil, false } -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return &asc, true -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { + return &aspp, true } -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { return nil, false } -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { return nil, false } -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { +// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { return nil, false } -// AsDpmContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &aspp, true } -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} +// UnmarshalJSON is the custom unmarshaler for AzureSQLProtectionPolicy struct. +func (aspp *AzureSQLProtectionPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "retentionPolicy": + if v != nil { + retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) + if err != nil { + return err + } + aspp.RetentionPolicy = retentionPolicy + } + case "protectedItemsCount": + if v != nil { + var protectedItemsCount int32 + err = json.Unmarshal(*v, &protectedItemsCount) + if err != nil { + return err + } + aspp.ProtectedItemsCount = &protectedItemsCount + } + case "backupManagementType": + if v != nil { + var backupManagementType ManagementTypeBasicProtectionPolicy + err = json.Unmarshal(*v, &backupManagementType) + if err != nil { + return err + } + aspp.BackupManagementType = backupManagementType + } + } + } -// AsGenericContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false + return nil } -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false +// AzureStorageErrorInfo azure storage specific error information +type AzureStorageErrorInfo struct { + // ErrorCode - Error code. + ErrorCode *int32 `json:"errorCode,omitempty"` + // ErrorString - Localized error string. + ErrorString *string `json:"errorString,omitempty"` + // Recommendations - List of localized recommendations for above error code. + Recommendations *[]string `json:"recommendations,omitempty"` } -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false +// AzureStorageJob azure storage specific job. +type AzureStorageJob struct { + // Duration - Time elapsed during the execution of this job. + Duration *string `json:"duration,omitempty"` + // ActionsInfo - Gets or sets the state/actions applicable on this job like cancel/retry. + ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` + // ErrorDetails - Error details on execution of this job. + ErrorDetails *[]AzureStorageErrorInfo `json:"errorDetails,omitempty"` + // StorageAccountName - Specifies friendly name of the storage account. + StorageAccountName *string `json:"storageAccountName,omitempty"` + // StorageAccountVersion - Specifies whether the Storage account is a Classic or an Azure Resource Manager Storage account. + StorageAccountVersion *string `json:"storageAccountVersion,omitempty"` + // ExtendedInfo - Additional information about the job. + ExtendedInfo *AzureStorageJobExtendedInfo `json:"extendedInfo,omitempty"` + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' + JobType JobType `json:"jobType,omitempty"` } -// AsMabContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false +// MarshalJSON is the custom marshaler for AzureStorageJob. +func (asj AzureStorageJob) MarshalJSON() ([]byte, error) { + asj.JobType = JobTypeAzureStorageJob + objectMap := make(map[string]interface{}) + if asj.Duration != nil { + objectMap["duration"] = asj.Duration + } + if asj.ActionsInfo != nil { + objectMap["actionsInfo"] = asj.ActionsInfo + } + if asj.ErrorDetails != nil { + objectMap["errorDetails"] = asj.ErrorDetails + } + if asj.StorageAccountName != nil { + objectMap["storageAccountName"] = asj.StorageAccountName + } + if asj.StorageAccountVersion != nil { + objectMap["storageAccountVersion"] = asj.StorageAccountVersion + } + if asj.ExtendedInfo != nil { + objectMap["extendedInfo"] = asj.ExtendedInfo + } + if asj.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = asj.EntityFriendlyName + } + if asj.BackupManagementType != "" { + objectMap["backupManagementType"] = asj.BackupManagementType + } + if asj.Operation != nil { + objectMap["operation"] = asj.Operation + } + if asj.Status != nil { + objectMap["status"] = asj.Status + } + if asj.StartTime != nil { + objectMap["startTime"] = asj.StartTime + } + if asj.EndTime != nil { + objectMap["endTime"] = asj.EndTime + } + if asj.ActivityID != nil { + objectMap["activityId"] = asj.ActivityID + } + if asj.JobType != "" { + objectMap["jobType"] = asj.JobType + } + return json.Marshal(objectMap) } -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsProtectionContainer() (*ProtectionContainer, bool) { +// AsAzureIaaSVMJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { return nil, false } -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &asc, true +// AsAzureStorageJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsAzureStorageJob() (*AzureStorageJob, bool) { + return &asj, true } -// AzureSQLProtectedItem azure SQL workload-specific backup item. -type AzureSQLProtectedItem struct { - // ProtectedItemDataID - Internal ID of a backup item. Used by Azure SQL Backup engine to contact Recovery Services. - ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` - // ProtectionState - Backup state of the backed up item. Possible values include: 'ProtectedItemStateInvalid', 'ProtectedItemStateIRPending', 'ProtectedItemStateProtected', 'ProtectedItemStateProtectionError', 'ProtectedItemStateProtectionStopped', 'ProtectedItemStateProtectionPaused' - ProtectionState ProtectedItemState `json:"protectionState,omitempty"` +// AsAzureWorkloadJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { + return nil, false +} + +// AsDpmJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsDpmJob() (*DpmJob, bool) { + return nil, false +} + +// AsMabJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsMabJob() (*MabJob, bool) { + return nil, false +} + +// AsJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsJob() (*Job, bool) { + return nil, false +} + +// AsBasicJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsBasicJob() (BasicJob, bool) { + return &asj, true +} + +// AzureStorageJobExtendedInfo azure Storage workload-specific additional information for job. +type AzureStorageJobExtendedInfo struct { + // TasksList - List of tasks for this job + TasksList *[]AzureStorageJobTaskDetails `json:"tasksList,omitempty"` + // PropertyBag - Job properties. + PropertyBag map[string]*string `json:"propertyBag"` + // DynamicErrorMessage - Non localized error message on job execution. + DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureStorageJobExtendedInfo. +func (asjei AzureStorageJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asjei.TasksList != nil { + objectMap["tasksList"] = asjei.TasksList + } + if asjei.PropertyBag != nil { + objectMap["propertyBag"] = asjei.PropertyBag + } + if asjei.DynamicErrorMessage != nil { + objectMap["dynamicErrorMessage"] = asjei.DynamicErrorMessage + } + return json.Marshal(objectMap) +} + +// AzureStorageJobTaskDetails azure storage workload specific job task details. +type AzureStorageJobTaskDetails struct { + // TaskID - The task display name. + TaskID *string `json:"taskId,omitempty"` + // Status - The status. + Status *string `json:"status,omitempty"` +} + +// BasicAzureVMWorkloadProtectedItem azure VM workload-specific protected item. +type BasicAzureVMWorkloadProtectedItem interface { + AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) + AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) + AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) + AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) +} + +// AzureVMWorkloadProtectedItem azure VM workload-specific protected item. +type AzureVMWorkloadProtectedItem struct { + // FriendlyName - Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // ParentName - Parent name of the DB such as Instance or Availability Group. + ParentName *string `json:"parentName,omitempty"` + // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed + ParentType *string `json:"parentType,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' + LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // LastBackupErrorDetail - Error details in last backup + LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` + // ProtectedItemDataSourceID - Data ID of the protected item. + ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` + // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' + ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureSQLProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // KpisHealths - Health details of different KPIs + KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' @@ -3219,13380 +2194,5088 @@ type AzureSQLProtectedItem struct { ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) MarshalJSON() ([]byte, error) { - aspi.ProtectedItemType = ProtectedItemTypeMicrosoftSqlserversdatabases - objectMap := make(map[string]interface{}) - if aspi.ProtectedItemDataID != nil { - objectMap["protectedItemDataId"] = aspi.ProtectedItemDataID - } - if aspi.ProtectionState != "" { - objectMap["protectionState"] = aspi.ProtectionState +func unmarshalBasicAzureVMWorkloadProtectedItem(body []byte) (BasicAzureVMWorkloadProtectedItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err } - if aspi.ExtendedInfo != nil { - objectMap["extendedInfo"] = aspi.ExtendedInfo + + switch m["protectedItemType"] { + case string(ProtectedItemTypeAzureVMWorkloadSAPAseDatabase): + var avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem + err := json.Unmarshal(body, &avwsadpi) + return avwsadpi, err + case string(ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase): + var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem + err := json.Unmarshal(body, &avwshdpi) + return avwshdpi, err + case string(ProtectedItemTypeAzureVMWorkloadSQLDatabase): + var avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem + err := json.Unmarshal(body, &avwsdpi) + return avwsdpi, err + default: + var avwpi AzureVMWorkloadProtectedItem + err := json.Unmarshal(body, &avwpi) + return avwpi, err } - if aspi.BackupManagementType != "" { - objectMap["backupManagementType"] = aspi.BackupManagementType +} +func unmarshalBasicAzureVMWorkloadProtectedItemArray(body []byte) ([]BasicAzureVMWorkloadProtectedItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err } - if aspi.WorkloadType != "" { - objectMap["workloadType"] = aspi.WorkloadType + + avwpiArray := make([]BasicAzureVMWorkloadProtectedItem, len(rawMessages)) + + for index, rawMessage := range rawMessages { + avwpi, err := unmarshalBasicAzureVMWorkloadProtectedItem(*rawMessage) + if err != nil { + return nil, err + } + avwpiArray[index] = avwpi } - if aspi.ContainerName != nil { - objectMap["containerName"] = aspi.ContainerName + return avwpiArray, nil +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) MarshalJSON() ([]byte, error) { + avwpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadProtectedItem + objectMap := make(map[string]interface{}) + if avwpi.FriendlyName != nil { + objectMap["friendlyName"] = avwpi.FriendlyName } - if aspi.SourceResourceID != nil { - objectMap["sourceResourceId"] = aspi.SourceResourceID + if avwpi.ServerName != nil { + objectMap["serverName"] = avwpi.ServerName } - if aspi.PolicyID != nil { - objectMap["policyId"] = aspi.PolicyID + if avwpi.ParentName != nil { + objectMap["parentName"] = avwpi.ParentName } - if aspi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = aspi.LastRecoveryPoint + if avwpi.ParentType != nil { + objectMap["parentType"] = avwpi.ParentType } - if aspi.BackupSetName != nil { - objectMap["backupSetName"] = aspi.BackupSetName + if avwpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = avwpi.ProtectionStatus } - if aspi.CreateMode != "" { - objectMap["createMode"] = aspi.CreateMode + if avwpi.ProtectionState != "" { + objectMap["protectionState"] = avwpi.ProtectionState } - if aspi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = aspi.DeferredDeleteTimeInUTC + if avwpi.LastBackupStatus != "" { + objectMap["lastBackupStatus"] = avwpi.LastBackupStatus } - if aspi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = aspi.IsScheduledForDeferredDelete + if avwpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = avwpi.LastBackupTime } - if aspi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = aspi.DeferredDeleteTimeRemaining + if avwpi.LastBackupErrorDetail != nil { + objectMap["lastBackupErrorDetail"] = avwpi.LastBackupErrorDetail } - if aspi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = aspi.IsDeferredDeleteScheduleUpcoming + if avwpi.ProtectedItemDataSourceID != nil { + objectMap["protectedItemDataSourceId"] = avwpi.ProtectedItemDataSourceID } - if aspi.IsRehydrate != nil { - objectMap["isRehydrate"] = aspi.IsRehydrate + if avwpi.ProtectedItemHealthStatus != "" { + objectMap["protectedItemHealthStatus"] = avwpi.ProtectedItemHealthStatus } - if aspi.ProtectedItemType != "" { - objectMap["protectedItemType"] = aspi.ProtectedItemType + if avwpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = avwpi.ExtendedInfo + } + if avwpi.KpisHealths != nil { + objectMap["kpisHealths"] = avwpi.KpisHealths + } + if avwpi.BackupManagementType != "" { + objectMap["backupManagementType"] = avwpi.BackupManagementType + } + if avwpi.WorkloadType != "" { + objectMap["workloadType"] = avwpi.WorkloadType + } + if avwpi.ContainerName != nil { + objectMap["containerName"] = avwpi.ContainerName + } + if avwpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = avwpi.SourceResourceID + } + if avwpi.PolicyID != nil { + objectMap["policyId"] = avwpi.PolicyID + } + if avwpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = avwpi.LastRecoveryPoint + } + if avwpi.BackupSetName != nil { + objectMap["backupSetName"] = avwpi.BackupSetName + } + if avwpi.CreateMode != "" { + objectMap["createMode"] = avwpi.CreateMode + } + if avwpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = avwpi.DeferredDeleteTimeInUTC + } + if avwpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = avwpi.IsScheduledForDeferredDelete + } + if avwpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = avwpi.DeferredDeleteTimeRemaining + } + if avwpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = avwpi.IsDeferredDeleteScheduleUpcoming + } + if avwpi.IsRehydrate != nil { + objectMap["isRehydrate"] = avwpi.IsRehydrate + } + if avwpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = avwpi.ProtectedItemType } return json.Marshal(objectMap) } -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { return nil, false } -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { return nil, false } -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { return nil, false } -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { return nil, false } -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return &aspi, true +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false } -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return &avwpi, true } -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return nil, false +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return &avwpi, true } -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { return nil, false } -// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { return nil, false } -// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { return nil, false } -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { return nil, false } -// AsProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { +// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { return nil, false } -// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &aspi, true +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &avwpi, true } -// AzureSQLProtectedItemExtendedInfo additional information on Azure Sql specific protected item. -type AzureSQLProtectedItemExtendedInfo struct { - // OldestRecoveryPoint - The oldest backup copy available for this item in the service. +// AzureVMWorkloadProtectedItemExtendedInfo additional information on Azure Workload for SQL specific +// backup item. +type AzureVMWorkloadProtectedItemExtendedInfo struct { + // OldestRecoveryPoint - The oldest backup copy available for this backup item. OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` - // RecoveryPointCount - Number of available backup copies associated with this backup item. + // RecoveryPointCount - Number of backup copies available for this backup item. RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` - // PolicyState - State of the backup policy associated with this backup item. + // PolicyState - Indicates consistency of policy object and policy applied to this backup item. PolicyState *string `json:"policyState,omitempty"` } -// AzureSQLProtectionPolicy azure SQL workload-specific backup policy. -type AzureSQLProtectionPolicy struct { - // RetentionPolicy - Retention policy details. - RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` +// AzureVMWorkloadProtectionPolicy azure VM (Mercury) workload-specific backup policy. +type AzureVMWorkloadProtectionPolicy struct { + // 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', 'WorkloadTypeSAPAseDatabase' + 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 + SubProtectionPolicy *[]SubProtectionPolicy `json:"subProtectionPolicy,omitempty"` + // MakePolicyConsistent - Fix the policy inconsistency + MakePolicyConsistent *bool `json:"makePolicyConsistent,omitempty"` // ProtectedItemsCount - Number of items associated with this policy. ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) MarshalJSON() ([]byte, error) { - aspp.BackupManagementType = BackupManagementTypeAzureSQL +// MarshalJSON is the custom marshaler for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) MarshalJSON() ([]byte, error) { + avwpp.BackupManagementType = BackupManagementTypeAzureWorkload objectMap := make(map[string]interface{}) - objectMap["retentionPolicy"] = aspp.RetentionPolicy - if aspp.ProtectedItemsCount != nil { - objectMap["protectedItemsCount"] = aspp.ProtectedItemsCount + if avwpp.WorkLoadType != "" { + objectMap["workLoadType"] = avwpp.WorkLoadType } - if aspp.BackupManagementType != "" { - objectMap["backupManagementType"] = aspp.BackupManagementType + if avwpp.Settings != nil { + objectMap["settings"] = avwpp.Settings + } + if avwpp.SubProtectionPolicy != nil { + objectMap["subProtectionPolicy"] = avwpp.SubProtectionPolicy + } + if avwpp.MakePolicyConsistent != nil { + objectMap["makePolicyConsistent"] = avwpp.MakePolicyConsistent + } + if avwpp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = avwpp.ProtectedItemsCount + } + if avwpp.BackupManagementType != "" { + objectMap["backupManagementType"] = avwpp.BackupManagementType } return json.Marshal(objectMap) } -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { - return nil, false +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return &avwpp, true } -// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { return nil, false } -// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { return nil, false } -// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { - return &aspp, true -} - -// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { return nil, false } -// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { return nil, false } -// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { return nil, false } -// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { - return &aspp, true +// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { + return nil, false } -// UnmarshalJSON is the custom unmarshaler for AzureSQLProtectionPolicy struct. -func (aspp *AzureSQLProtectionPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "retentionPolicy": - if v != nil { - retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) - if err != nil { - return err - } - aspp.RetentionPolicy = retentionPolicy - } - case "protectedItemsCount": - if v != nil { - var protectedItemsCount int32 - err = json.Unmarshal(*v, &protectedItemsCount) - if err != nil { - return err - } - aspp.ProtectedItemsCount = &protectedItemsCount - } - case "backupManagementType": - if v != nil { - var backupManagementType ManagementTypeBasicProtectionPolicy - err = json.Unmarshal(*v, &backupManagementType) - if err != nil { - return err - } - aspp.BackupManagementType = backupManagementType - } - } - } - - return nil +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &avwpp, true } -// AzureStorageContainer azure Storage Account workload-specific container. -type AzureStorageContainer struct { - // SourceResourceID - Fully qualified ARM url. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // StorageAccountVersion - Storage account version. - StorageAccountVersion *string `json:"storageAccountVersion,omitempty"` - // ResourceGroup - Resource group name of Recovery Services Vault. - ResourceGroup *string `json:"resourceGroup,omitempty"` - // ProtectedItemCount - Number of items backed up in this container. - ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' +// AzureVMWorkloadSAPAseDatabaseProtectedItem azure VM workload-specific protected item representing SAP +// ASE Database. +type AzureVMWorkloadSAPAseDatabaseProtectedItem struct { + // FriendlyName - Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // ParentName - Parent name of the DB such as Instance or Availability Group. + ParentName *string `json:"parentName,omitempty"` + // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed + ParentType *string `json:"parentType,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' + LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // LastBackupErrorDetail - Error details in last backup + LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` + // ProtectedItemDataSourceID - Data ID of the protected item. + ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` + // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' + ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // KpisHealths - Health details of different KPIs + KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureStorageContainer. -func (asc AzureStorageContainer) MarshalJSON() ([]byte, error) { - asc.ContainerType = ContainerTypeStorageContainer1 +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) MarshalJSON() ([]byte, error) { + avwsadpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadSAPAseDatabase objectMap := make(map[string]interface{}) - if asc.SourceResourceID != nil { - objectMap["sourceResourceId"] = asc.SourceResourceID + if avwsadpi.FriendlyName != nil { + objectMap["friendlyName"] = avwsadpi.FriendlyName + } + if avwsadpi.ServerName != nil { + objectMap["serverName"] = avwsadpi.ServerName } - if asc.StorageAccountVersion != nil { - objectMap["storageAccountVersion"] = asc.StorageAccountVersion + if avwsadpi.ParentName != nil { + objectMap["parentName"] = avwsadpi.ParentName + } + if avwsadpi.ParentType != nil { + objectMap["parentType"] = avwsadpi.ParentType + } + if avwsadpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = avwsadpi.ProtectionStatus + } + if avwsadpi.ProtectionState != "" { + objectMap["protectionState"] = avwsadpi.ProtectionState + } + if avwsadpi.LastBackupStatus != "" { + objectMap["lastBackupStatus"] = avwsadpi.LastBackupStatus + } + if avwsadpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = avwsadpi.LastBackupTime + } + if avwsadpi.LastBackupErrorDetail != nil { + objectMap["lastBackupErrorDetail"] = avwsadpi.LastBackupErrorDetail + } + if avwsadpi.ProtectedItemDataSourceID != nil { + objectMap["protectedItemDataSourceId"] = avwsadpi.ProtectedItemDataSourceID + } + if avwsadpi.ProtectedItemHealthStatus != "" { + objectMap["protectedItemHealthStatus"] = avwsadpi.ProtectedItemHealthStatus + } + if avwsadpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = avwsadpi.ExtendedInfo + } + if avwsadpi.KpisHealths != nil { + objectMap["kpisHealths"] = avwsadpi.KpisHealths } - if asc.ResourceGroup != nil { - objectMap["resourceGroup"] = asc.ResourceGroup + if avwsadpi.BackupManagementType != "" { + objectMap["backupManagementType"] = avwsadpi.BackupManagementType + } + if avwsadpi.WorkloadType != "" { + objectMap["workloadType"] = avwsadpi.WorkloadType + } + if avwsadpi.ContainerName != nil { + objectMap["containerName"] = avwsadpi.ContainerName + } + if avwsadpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = avwsadpi.SourceResourceID + } + if avwsadpi.PolicyID != nil { + objectMap["policyId"] = avwsadpi.PolicyID + } + if avwsadpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = avwsadpi.LastRecoveryPoint + } + if avwsadpi.BackupSetName != nil { + objectMap["backupSetName"] = avwsadpi.BackupSetName } - if asc.ProtectedItemCount != nil { - objectMap["protectedItemCount"] = asc.ProtectedItemCount + if avwsadpi.CreateMode != "" { + objectMap["createMode"] = avwsadpi.CreateMode + } + if avwsadpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = avwsadpi.DeferredDeleteTimeInUTC } - if asc.FriendlyName != nil { - objectMap["friendlyName"] = asc.FriendlyName + if avwsadpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = avwsadpi.IsScheduledForDeferredDelete } - if asc.BackupManagementType != "" { - objectMap["backupManagementType"] = asc.BackupManagementType + if avwsadpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = avwsadpi.DeferredDeleteTimeRemaining } - if asc.RegistrationStatus != nil { - objectMap["registrationStatus"] = asc.RegistrationStatus + if avwsadpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = avwsadpi.IsDeferredDeleteScheduleUpcoming } - if asc.HealthStatus != nil { - objectMap["healthStatus"] = asc.HealthStatus + if avwsadpi.IsRehydrate != nil { + objectMap["isRehydrate"] = avwsadpi.IsRehydrate } - if asc.ContainerType != "" { - objectMap["containerType"] = asc.ContainerType + if avwsadpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = avwsadpi.ProtectedItemType } return json.Marshal(objectMap) } -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { return nil, false } -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { return nil, false } -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { return nil, false } -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { return nil, false } -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return &asc, true -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { return nil, false } -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { return nil, false } -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return &avwsadpi, true } -// AsDpmContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return &avwsadpi, true } -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { return nil, false } -// AsGenericContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsGenericContainer() (*GenericContainer, bool) { +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { return nil, false } -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { return nil, false } -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { return nil, false } -// AsMabContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsMabContainer() (*MabContainer, bool) { +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { return nil, false } -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsProtectionContainer() (*ProtectionContainer, bool) { +// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { return nil, false } -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &asc, true +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &avwsadpi, true } -// AzureStorageErrorInfo azure storage specific error information -type AzureStorageErrorInfo struct { - // ErrorCode - Error code. - ErrorCode *int32 `json:"errorCode,omitempty"` - // ErrorString - Localized error string. - ErrorString *string `json:"errorString,omitempty"` - // Recommendations - List of localized recommendations for above error code. - Recommendations *[]string `json:"recommendations,omitempty"` +// AzureVMWorkloadSAPHanaDatabaseProtectedItem azure VM workload-specific protected item representing SAP +// HANA Database. +type AzureVMWorkloadSAPHanaDatabaseProtectedItem struct { + // FriendlyName - Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // ParentName - Parent name of the DB such as Instance or Availability Group. + ParentName *string `json:"parentName,omitempty"` + // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed + ParentType *string `json:"parentType,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' + LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // LastBackupErrorDetail - Error details in last backup + LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` + // ProtectedItemDataSourceID - Data ID of the protected item. + ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` + // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' + ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // KpisHealths - Health details of different KPIs + KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } -// AzureStorageJob azure storage specific job. -type AzureStorageJob struct { - // Duration - Time elapsed during the execution of this job. - Duration *string `json:"duration,omitempty"` - // ActionsInfo - Gets or sets the state/actions applicable on this job like cancel/retry. - ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` - // ErrorDetails - Error details on execution of this job. - ErrorDetails *[]AzureStorageErrorInfo `json:"errorDetails,omitempty"` - // StorageAccountName - Specifies friendly name of the storage account. - StorageAccountName *string `json:"storageAccountName,omitempty"` - // StorageAccountVersion - Specifies whether the Storage account is a Classic or an Azure Resource Manager Storage account. - StorageAccountVersion *string `json:"storageAccountVersion,omitempty"` - // ExtendedInfo - Additional information about the job. - ExtendedInfo *AzureStorageJobExtendedInfo `json:"extendedInfo,omitempty"` - // EntityFriendlyName - Friendly name of the entity on which the current job is executing. - EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` - // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // Operation - The operation name. - Operation *string `json:"operation,omitempty"` - // Status - Job status. - Status *string `json:"status,omitempty"` - // StartTime - The start time. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time. - EndTime *date.Time `json:"endTime,omitempty"` - // ActivityID - ActivityId of job. - ActivityID *string `json:"activityId,omitempty"` - // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' - JobType JobType `json:"jobType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureStorageJob. -func (asj AzureStorageJob) MarshalJSON() ([]byte, error) { - asj.JobType = JobTypeAzureStorageJob +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) MarshalJSON() ([]byte, error) { + avwshdpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase objectMap := make(map[string]interface{}) - if asj.Duration != nil { - objectMap["duration"] = asj.Duration + if avwshdpi.FriendlyName != nil { + objectMap["friendlyName"] = avwshdpi.FriendlyName } - if asj.ActionsInfo != nil { - objectMap["actionsInfo"] = asj.ActionsInfo + if avwshdpi.ServerName != nil { + objectMap["serverName"] = avwshdpi.ServerName } - if asj.ErrorDetails != nil { - objectMap["errorDetails"] = asj.ErrorDetails + if avwshdpi.ParentName != nil { + objectMap["parentName"] = avwshdpi.ParentName } - if asj.StorageAccountName != nil { - objectMap["storageAccountName"] = asj.StorageAccountName + if avwshdpi.ParentType != nil { + objectMap["parentType"] = avwshdpi.ParentType } - if asj.StorageAccountVersion != nil { - objectMap["storageAccountVersion"] = asj.StorageAccountVersion + if avwshdpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = avwshdpi.ProtectionStatus } - if asj.ExtendedInfo != nil { - objectMap["extendedInfo"] = asj.ExtendedInfo + if avwshdpi.ProtectionState != "" { + objectMap["protectionState"] = avwshdpi.ProtectionState } - if asj.EntityFriendlyName != nil { - objectMap["entityFriendlyName"] = asj.EntityFriendlyName + if avwshdpi.LastBackupStatus != "" { + objectMap["lastBackupStatus"] = avwshdpi.LastBackupStatus } - if asj.BackupManagementType != "" { - objectMap["backupManagementType"] = asj.BackupManagementType + if avwshdpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = avwshdpi.LastBackupTime } - if asj.Operation != nil { - objectMap["operation"] = asj.Operation + if avwshdpi.LastBackupErrorDetail != nil { + objectMap["lastBackupErrorDetail"] = avwshdpi.LastBackupErrorDetail } - if asj.Status != nil { - objectMap["status"] = asj.Status + if avwshdpi.ProtectedItemDataSourceID != nil { + objectMap["protectedItemDataSourceId"] = avwshdpi.ProtectedItemDataSourceID } - if asj.StartTime != nil { - objectMap["startTime"] = asj.StartTime + if avwshdpi.ProtectedItemHealthStatus != "" { + objectMap["protectedItemHealthStatus"] = avwshdpi.ProtectedItemHealthStatus } - if asj.EndTime != nil { - objectMap["endTime"] = asj.EndTime + if avwshdpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = avwshdpi.ExtendedInfo } - if asj.ActivityID != nil { - objectMap["activityId"] = asj.ActivityID + if avwshdpi.KpisHealths != nil { + objectMap["kpisHealths"] = avwshdpi.KpisHealths } - if asj.JobType != "" { - objectMap["jobType"] = asj.JobType + if avwshdpi.BackupManagementType != "" { + objectMap["backupManagementType"] = avwshdpi.BackupManagementType } - return json.Marshal(objectMap) -} - -// AsAzureIaaSVMJob is the BasicJob implementation for AzureStorageJob. -func (asj AzureStorageJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { - return nil, false -} - -// AsAzureStorageJob is the BasicJob implementation for AzureStorageJob. -func (asj AzureStorageJob) AsAzureStorageJob() (*AzureStorageJob, bool) { - return &asj, true -} - -// AsAzureWorkloadJob is the BasicJob implementation for AzureStorageJob. -func (asj AzureStorageJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { - return nil, false -} - -// AsDpmJob is the BasicJob implementation for AzureStorageJob. -func (asj AzureStorageJob) AsDpmJob() (*DpmJob, bool) { - return nil, false -} - -// AsMabJob is the BasicJob implementation for AzureStorageJob. -func (asj AzureStorageJob) AsMabJob() (*MabJob, bool) { - return nil, false -} - -// AsJob is the BasicJob implementation for AzureStorageJob. -func (asj AzureStorageJob) AsJob() (*Job, bool) { - return nil, false -} - -// AsBasicJob is the BasicJob implementation for AzureStorageJob. -func (asj AzureStorageJob) AsBasicJob() (BasicJob, bool) { - return &asj, true -} - -// AzureStorageJobExtendedInfo azure Storage workload-specific additional information for job. -type AzureStorageJobExtendedInfo struct { - // TasksList - List of tasks for this job - TasksList *[]AzureStorageJobTaskDetails `json:"tasksList,omitempty"` - // PropertyBag - Job properties. - PropertyBag map[string]*string `json:"propertyBag"` - // DynamicErrorMessage - Non localized error message on job execution. - DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureStorageJobExtendedInfo. -func (asjei AzureStorageJobExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if asjei.TasksList != nil { - objectMap["tasksList"] = asjei.TasksList + if avwshdpi.WorkloadType != "" { + objectMap["workloadType"] = avwshdpi.WorkloadType } - if asjei.PropertyBag != nil { - objectMap["propertyBag"] = asjei.PropertyBag + if avwshdpi.ContainerName != nil { + objectMap["containerName"] = avwshdpi.ContainerName } - if asjei.DynamicErrorMessage != nil { - objectMap["dynamicErrorMessage"] = asjei.DynamicErrorMessage + if avwshdpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = avwshdpi.SourceResourceID } - return json.Marshal(objectMap) -} - -// AzureStorageJobTaskDetails azure storage workload specific job task details. -type AzureStorageJobTaskDetails struct { - // TaskID - The task display name. - TaskID *string `json:"taskId,omitempty"` - // Status - The status. - Status *string `json:"status,omitempty"` -} - -// AzureStorageProtectableContainer azure Storage-specific protectable containers -type AzureStorageProtectableContainer struct { - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerID - Fabric Id of the container such as ARM Id. - ContainerID *string `json:"containerId,omitempty"` - // ProtectableContainerType - Possible values include: 'ProtectableContainerTypeProtectableContainer', 'ProtectableContainerTypeStorageContainer', 'ProtectableContainerTypeVMAppContainer' - ProtectableContainerType ProtectableContainerType `json:"protectableContainerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureStorageProtectableContainer. -func (aspc AzureStorageProtectableContainer) MarshalJSON() ([]byte, error) { - aspc.ProtectableContainerType = ProtectableContainerTypeStorageContainer - objectMap := make(map[string]interface{}) - if aspc.FriendlyName != nil { - objectMap["friendlyName"] = aspc.FriendlyName + if avwshdpi.PolicyID != nil { + objectMap["policyId"] = avwshdpi.PolicyID } - if aspc.BackupManagementType != "" { - objectMap["backupManagementType"] = aspc.BackupManagementType + if avwshdpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = avwshdpi.LastRecoveryPoint } - if aspc.HealthStatus != nil { - objectMap["healthStatus"] = aspc.HealthStatus + if avwshdpi.BackupSetName != nil { + objectMap["backupSetName"] = avwshdpi.BackupSetName } - if aspc.ContainerID != nil { - objectMap["containerId"] = aspc.ContainerID + if avwshdpi.CreateMode != "" { + objectMap["createMode"] = avwshdpi.CreateMode } - if aspc.ProtectableContainerType != "" { - objectMap["protectableContainerType"] = aspc.ProtectableContainerType + if avwshdpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = avwshdpi.DeferredDeleteTimeInUTC } - return json.Marshal(objectMap) -} - -// AsAzureStorageProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. -func (aspc AzureStorageProtectableContainer) AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) { - return &aspc, true -} - -// AsAzureVMAppContainerProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. -func (aspc AzureStorageProtectableContainer) AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) { - return nil, false -} - -// AsProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. -func (aspc AzureStorageProtectableContainer) AsProtectableContainer() (*ProtectableContainer, bool) { - return nil, false -} - -// AsBasicProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. -func (aspc AzureStorageProtectableContainer) AsBasicProtectableContainer() (BasicProtectableContainer, bool) { - return &aspc, true -} - -// AzureVMAppContainerProtectableContainer azure workload-specific container -type AzureVMAppContainerProtectableContainer struct { - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerID - Fabric Id of the container such as ARM Id. - ContainerID *string `json:"containerId,omitempty"` - // ProtectableContainerType - Possible values include: 'ProtectableContainerTypeProtectableContainer', 'ProtectableContainerTypeStorageContainer', 'ProtectableContainerTypeVMAppContainer' - ProtectableContainerType ProtectableContainerType `json:"protectableContainerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMAppContainerProtectableContainer. -func (avacpc AzureVMAppContainerProtectableContainer) MarshalJSON() ([]byte, error) { - avacpc.ProtectableContainerType = ProtectableContainerTypeVMAppContainer - objectMap := make(map[string]interface{}) - if avacpc.FriendlyName != nil { - objectMap["friendlyName"] = avacpc.FriendlyName + if avwshdpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = avwshdpi.IsScheduledForDeferredDelete } - if avacpc.BackupManagementType != "" { - objectMap["backupManagementType"] = avacpc.BackupManagementType + if avwshdpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = avwshdpi.DeferredDeleteTimeRemaining } - if avacpc.HealthStatus != nil { - objectMap["healthStatus"] = avacpc.HealthStatus + if avwshdpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = avwshdpi.IsDeferredDeleteScheduleUpcoming } - if avacpc.ContainerID != nil { - objectMap["containerId"] = avacpc.ContainerID + if avwshdpi.IsRehydrate != nil { + objectMap["isRehydrate"] = avwshdpi.IsRehydrate } - if avacpc.ProtectableContainerType != "" { - objectMap["protectableContainerType"] = avacpc.ProtectableContainerType + if avwshdpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = avwshdpi.ProtectedItemType } return json.Marshal(objectMap) } -// AsAzureStorageProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. -func (avacpc AzureVMAppContainerProtectableContainer) AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. -func (avacpc AzureVMAppContainerProtectableContainer) AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) { - return &avacpc, true -} - -// AsProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. -func (avacpc AzureVMAppContainerProtectableContainer) AsProtectableContainer() (*ProtectableContainer, bool) { +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { return nil, false } -// AsBasicProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. -func (avacpc AzureVMAppContainerProtectableContainer) AsBasicProtectableContainer() (BasicProtectableContainer, bool) { - return &avacpc, true -} - -// AzureVMAppContainerProtectionContainer container for SQL workloads under Azure Virtual Machines. -type AzureVMAppContainerProtectionContainer struct { - // SourceResourceID - ARM ID of the virtual machine represented by this Azure Workload Container - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // LastUpdatedTime - Time stamp when this container was updated. - LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` - // ExtendedInfo - Additional details of a workload container. - ExtendedInfo *AzureWorkloadContainerExtendedInfo `json:"extendedInfo,omitempty"` - // WorkloadType - Workload type for which registration was sent. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` - // OperationType - Re-Do Operation. Possible values include: 'OperationTypeInvalid', 'OperationTypeRegister', 'OperationTypeReregister' - OperationType OperationType `json:"operationType,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) MarshalJSON() ([]byte, error) { - avacpc.ContainerType = ContainerTypeVMAppContainer1 - objectMap := make(map[string]interface{}) - if avacpc.SourceResourceID != nil { - objectMap["sourceResourceId"] = avacpc.SourceResourceID - } - if avacpc.LastUpdatedTime != nil { - objectMap["lastUpdatedTime"] = avacpc.LastUpdatedTime - } - if avacpc.ExtendedInfo != nil { - objectMap["extendedInfo"] = avacpc.ExtendedInfo - } - if avacpc.WorkloadType != "" { - objectMap["workloadType"] = avacpc.WorkloadType - } - if avacpc.OperationType != "" { - objectMap["operationType"] = avacpc.OperationType - } - if avacpc.FriendlyName != nil { - objectMap["friendlyName"] = avacpc.FriendlyName - } - if avacpc.BackupManagementType != "" { - objectMap["backupManagementType"] = avacpc.BackupManagementType - } - if avacpc.RegistrationStatus != nil { - objectMap["registrationStatus"] = avacpc.RegistrationStatus - } - if avacpc.HealthStatus != nil { - objectMap["healthStatus"] = avacpc.HealthStatus - } - if avacpc.ContainerType != "" { - objectMap["containerType"] = avacpc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { return nil, false } -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { return nil, false } -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { return nil, false } -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { return nil, false } -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { return nil, false } -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return &avacpc, true +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return &avwshdpi, true } -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { return nil, false } -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return &avacpc, true +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return &avwshdpi, true } -// AsDpmContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsDpmContainer() (*DpmContainer, bool) { +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { return nil, false } -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { return nil, false } -// AsGenericContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsGenericContainer() (*GenericContainer, bool) { +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { return nil, false } -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { return nil, false } -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { +// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { return nil, false } -// AsMabContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &avacpc, true +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &avwshdpi, true } -// AzureVMResourceFeatureSupportRequest azureResource(IaaS VM) Specific feature support request -type AzureVMResourceFeatureSupportRequest struct { - // VMSize - Size of the resource: VM size(A/D series etc) in case of IaasVM - VMSize *string `json:"vmSize,omitempty"` - // VMSku - SKUs (Premium/Managed etc) in case of IaasVM - VMSku *string `json:"vmSku,omitempty"` - // FeatureType - Possible values include: 'FeatureTypeFeatureSupportRequest', 'FeatureTypeAzureBackupGoals', 'FeatureTypeAzureVMResourceBackup' - FeatureType FeatureType `json:"featureType,omitempty"` +// AzureVMWorkloadSQLDatabaseProtectedItem azure VM workload-specific protected item representing SQL +// Database. +type AzureVMWorkloadSQLDatabaseProtectedItem struct { + // FriendlyName - Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // ParentName - Parent name of the DB such as Instance or Availability Group. + ParentName *string `json:"parentName,omitempty"` + // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed + ParentType *string `json:"parentType,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' + LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // LastBackupErrorDetail - Error details in last backup + LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` + // ProtectedItemDataSourceID - Data ID of the protected item. + ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` + // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' + ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // KpisHealths - Health details of different KPIs + KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureVMResourceFeatureSupportRequest. -func (avrfsr AzureVMResourceFeatureSupportRequest) MarshalJSON() ([]byte, error) { - avrfsr.FeatureType = FeatureTypeAzureVMResourceBackup +// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) MarshalJSON() ([]byte, error) { + avwsdpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadSQLDatabase objectMap := make(map[string]interface{}) - if avrfsr.VMSize != nil { - objectMap["vmSize"] = avrfsr.VMSize + if avwsdpi.FriendlyName != nil { + objectMap["friendlyName"] = avwsdpi.FriendlyName } - if avrfsr.VMSku != nil { - objectMap["vmSku"] = avrfsr.VMSku + if avwsdpi.ServerName != nil { + objectMap["serverName"] = avwsdpi.ServerName } - if avrfsr.FeatureType != "" { - objectMap["featureType"] = avrfsr.FeatureType + if avwsdpi.ParentName != nil { + objectMap["parentName"] = avwsdpi.ParentName } - return json.Marshal(objectMap) -} - -// AsAzureBackupGoalFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureVMResourceFeatureSupportRequest. -func (avrfsr AzureVMResourceFeatureSupportRequest) AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) { - return nil, false -} - -// AsAzureVMResourceFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureVMResourceFeatureSupportRequest. -func (avrfsr AzureVMResourceFeatureSupportRequest) AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) { - return &avrfsr, true -} - -// AsFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureVMResourceFeatureSupportRequest. -func (avrfsr AzureVMResourceFeatureSupportRequest) AsFeatureSupportRequest() (*FeatureSupportRequest, bool) { - return nil, false -} - -// AsBasicFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureVMResourceFeatureSupportRequest. -func (avrfsr AzureVMResourceFeatureSupportRequest) AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) { - return &avrfsr, true -} - -// AzureVMResourceFeatureSupportResponse response for feature support requests for Azure IaasVm -type AzureVMResourceFeatureSupportResponse struct { - autorest.Response `json:"-"` - // SupportStatus - Support status of feature. Possible values include: 'SupportStatusInvalid', 'SupportStatusSupported', 'SupportStatusDefaultOFF', 'SupportStatusDefaultON', 'SupportStatusNotSupported' - SupportStatus SupportStatus `json:"supportStatus,omitempty"` -} - -// BasicAzureVMWorkloadItem azure VM workload-specific workload item. -type BasicAzureVMWorkloadItem interface { - AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) - AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) - AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) - AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) - AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) - AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) - AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) -} - -// AzureVMWorkloadItem azure VM workload-specific workload item. -type AzureVMWorkloadItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if workload item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DB's present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected - SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` -} - -func unmarshalBasicAzureVMWorkloadItem(body []byte) (BasicAzureVMWorkloadItem, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err + if avwsdpi.ParentType != nil { + objectMap["parentType"] = avwsdpi.ParentType } - - switch m["workloadItemType"] { - case string(WorkloadItemTypeSAPAseDatabase1): - var avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem - err := json.Unmarshal(body, &avwsadwi) - return avwsadwi, err - case string(WorkloadItemTypeSAPAseSystem1): - var avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem - err := json.Unmarshal(body, &avwsaswi) - return avwsaswi, err - case string(WorkloadItemTypeSAPHanaDatabase1): - var avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem - err := json.Unmarshal(body, &avwshdwi) - return avwshdwi, err - case string(WorkloadItemTypeSAPHanaSystem1): - var avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem - err := json.Unmarshal(body, &avwshswi) - return avwshswi, err - case string(WorkloadItemTypeSQLDataBase1): - var avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem - err := json.Unmarshal(body, &avwsdwi) - return avwsdwi, err - case string(WorkloadItemTypeSQLInstance1): - var avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem - err := json.Unmarshal(body, &avwsiwi) - return avwsiwi, err - default: - var avwi AzureVMWorkloadItem - err := json.Unmarshal(body, &avwi) - return avwi, err + if avwsdpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = avwsdpi.ProtectionStatus } -} -func unmarshalBasicAzureVMWorkloadItemArray(body []byte) ([]BasicAzureVMWorkloadItem, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err + if avwsdpi.ProtectionState != "" { + objectMap["protectionState"] = avwsdpi.ProtectionState } - - avwiArray := make([]BasicAzureVMWorkloadItem, len(rawMessages)) - - for index, rawMessage := range rawMessages { - avwi, err := unmarshalBasicAzureVMWorkloadItem(*rawMessage) - if err != nil { - return nil, err - } - avwiArray[index] = avwi + if avwsdpi.LastBackupStatus != "" { + objectMap["lastBackupStatus"] = avwsdpi.LastBackupStatus } - return avwiArray, nil -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) MarshalJSON() ([]byte, error) { - avwi.WorkloadItemType = WorkloadItemTypeAzureVMWorkloadItem - objectMap := make(map[string]interface{}) - if avwi.ParentName != nil { - objectMap["parentName"] = avwi.ParentName + if avwsdpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = avwsdpi.LastBackupTime } - if avwi.ServerName != nil { - objectMap["serverName"] = avwi.ServerName + if avwsdpi.LastBackupErrorDetail != nil { + objectMap["lastBackupErrorDetail"] = avwsdpi.LastBackupErrorDetail + } + if avwsdpi.ProtectedItemDataSourceID != nil { + objectMap["protectedItemDataSourceId"] = avwsdpi.ProtectedItemDataSourceID + } + if avwsdpi.ProtectedItemHealthStatus != "" { + objectMap["protectedItemHealthStatus"] = avwsdpi.ProtectedItemHealthStatus + } + if avwsdpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = avwsdpi.ExtendedInfo + } + if avwsdpi.KpisHealths != nil { + objectMap["kpisHealths"] = avwsdpi.KpisHealths + } + if avwsdpi.BackupManagementType != "" { + objectMap["backupManagementType"] = avwsdpi.BackupManagementType + } + if avwsdpi.WorkloadType != "" { + objectMap["workloadType"] = avwsdpi.WorkloadType + } + if avwsdpi.ContainerName != nil { + objectMap["containerName"] = avwsdpi.ContainerName + } + if avwsdpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = avwsdpi.SourceResourceID + } + if avwsdpi.PolicyID != nil { + objectMap["policyId"] = avwsdpi.PolicyID + } + if avwsdpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = avwsdpi.LastRecoveryPoint } - if avwi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwi.IsAutoProtectable + if avwsdpi.BackupSetName != nil { + objectMap["backupSetName"] = avwsdpi.BackupSetName } - if avwi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwi.Subinquireditemcount + if avwsdpi.CreateMode != "" { + objectMap["createMode"] = avwsdpi.CreateMode } - if avwi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwi.SubWorkloadItemCount + if avwsdpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = avwsdpi.DeferredDeleteTimeInUTC } - if avwi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwi.BackupManagementType + if avwsdpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = avwsdpi.IsScheduledForDeferredDelete } - if avwi.WorkloadType != nil { - objectMap["workloadType"] = avwi.WorkloadType + if avwsdpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = avwsdpi.DeferredDeleteTimeRemaining } - if avwi.FriendlyName != nil { - objectMap["friendlyName"] = avwi.FriendlyName + if avwsdpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = avwsdpi.IsDeferredDeleteScheduleUpcoming } - if avwi.ProtectionState != "" { - objectMap["protectionState"] = avwi.ProtectionState + if avwsdpi.IsRehydrate != nil { + objectMap["isRehydrate"] = avwsdpi.IsRehydrate } - if avwi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwi.WorkloadItemType + if avwsdpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = avwsdpi.ProtectedItemType } return json.Marshal(objectMap) } -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { - return &avwi, true +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false } -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwi, true +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false } -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { return nil, false } -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { return nil, false } -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { - return nil, false +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return &avwsdpi, true } -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { return nil, false } -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwi, true +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false } -// BasicAzureVMWorkloadProtectableItem azure VM workload-specific protectable item. -type BasicAzureVMWorkloadProtectableItem interface { - AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) - AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) - AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) - AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) - AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) - AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) - AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return &avwsdpi, true } -// AzureVMWorkloadProtectableItem azure VM workload-specific protectable item. -type AzureVMWorkloadProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - 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 - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false } -func unmarshalBasicAzureVMWorkloadProtectableItem(body []byte) (BasicAzureVMWorkloadProtectableItem, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} - switch m["protectableItemType"] { - case string(ProtectableItemTypeSAPAseSystem): - var avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem - err := json.Unmarshal(body, &avwsaspi) - return avwsaspi, err - case string(ProtectableItemTypeSAPHanaDatabase): - var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem - err := json.Unmarshal(body, &avwshdpi) - return avwshdpi, err - case string(ProtectableItemTypeSAPHanaSystem): - var avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem - err := json.Unmarshal(body, &avwshspi) - return avwshspi, err - case string(ProtectableItemTypeSQLAvailabilityGroupContainer): - var avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem - err := json.Unmarshal(body, &avwsagpi) - return avwsagpi, err - case string(ProtectableItemTypeSQLDataBase): - var avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem - err := json.Unmarshal(body, &avwsdpi) - return avwsdpi, err - case string(ProtectableItemTypeSQLInstance): - var avwsipi AzureVMWorkloadSQLInstanceProtectableItem - err := json.Unmarshal(body, &avwsipi) - return avwsipi, err - default: - var avwpi AzureVMWorkloadProtectableItem - err := json.Unmarshal(body, &avwpi) - return avwpi, err - } +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false } -func unmarshalBasicAzureVMWorkloadProtectableItemArray(body []byte) ([]BasicAzureVMWorkloadProtectableItem, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - avwpiArray := make([]BasicAzureVMWorkloadProtectableItem, len(rawMessages)) +// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} - for index, rawMessage := range rawMessages { - avwpi, err := unmarshalBasicAzureVMWorkloadProtectableItem(*rawMessage) - if err != nil { - return nil, err - } - avwpiArray[index] = avwpi - } - return avwpiArray, nil +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &avwsdpi, true } -// MarshalJSON is the custom marshaler for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) MarshalJSON() ([]byte, error) { - avwpi.ProtectableItemType = ProtectableItemTypeAzureVMWorkloadProtectableItem - objectMap := make(map[string]interface{}) - if avwpi.ParentName != nil { - objectMap["parentName"] = avwpi.ParentName - } - if avwpi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwpi.ParentUniqueName - } - if avwpi.ServerName != nil { - objectMap["serverName"] = avwpi.ServerName +// AzureWorkloadErrorInfo azure storage specific error information +type AzureWorkloadErrorInfo struct { + // ErrorCode - Error code. + ErrorCode *int32 `json:"errorCode,omitempty"` + // ErrorString - Localized error string. + ErrorString *string `json:"errorString,omitempty"` + // ErrorTitle - Title: Typically, the entity that the error pertains to. + ErrorTitle *string `json:"errorTitle,omitempty"` + // Recommendations - List of localized recommendations for above error code. + Recommendations *[]string `json:"recommendations,omitempty"` + // AdditionalDetails - Additional details for above error code. + AdditionalDetails *string `json:"additionalDetails,omitempty"` +} + +// AzureWorkloadJob azure storage specific job. +type AzureWorkloadJob struct { + // WorkloadType - Workload type of the job + WorkloadType *string `json:"workloadType,omitempty"` + // Duration - Time elapsed during the execution of this job. + Duration *string `json:"duration,omitempty"` + // ActionsInfo - Gets or sets the state/actions applicable on this job like cancel/retry. + ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` + // ErrorDetails - Error details on execution of this job. + ErrorDetails *[]AzureWorkloadErrorInfo `json:"errorDetails,omitempty"` + // ExtendedInfo - Additional information about the job. + ExtendedInfo *AzureWorkloadJobExtendedInfo `json:"extendedInfo,omitempty"` + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' + JobType JobType `json:"jobType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadJob. +func (awj AzureWorkloadJob) MarshalJSON() ([]byte, error) { + awj.JobType = JobTypeAzureWorkloadJob + objectMap := make(map[string]interface{}) + if awj.WorkloadType != nil { + objectMap["workloadType"] = awj.WorkloadType } - if avwpi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwpi.IsAutoProtectable + if awj.Duration != nil { + objectMap["duration"] = awj.Duration } - if avwpi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwpi.IsAutoProtected + if awj.ActionsInfo != nil { + objectMap["actionsInfo"] = awj.ActionsInfo } - if avwpi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwpi.Subinquireditemcount + if awj.ErrorDetails != nil { + objectMap["errorDetails"] = awj.ErrorDetails } - if avwpi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwpi.Subprotectableitemcount + if awj.ExtendedInfo != nil { + objectMap["extendedInfo"] = awj.ExtendedInfo } - if avwpi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwpi.Prebackupvalidation + if awj.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = awj.EntityFriendlyName } - if avwpi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwpi.BackupManagementType + if awj.BackupManagementType != "" { + objectMap["backupManagementType"] = awj.BackupManagementType } - if avwpi.WorkloadType != nil { - objectMap["workloadType"] = avwpi.WorkloadType + if awj.Operation != nil { + objectMap["operation"] = awj.Operation } - if avwpi.FriendlyName != nil { - objectMap["friendlyName"] = avwpi.FriendlyName + if awj.Status != nil { + objectMap["status"] = awj.Status } - if avwpi.ProtectionState != "" { - objectMap["protectionState"] = avwpi.ProtectionState + if awj.StartTime != nil { + objectMap["startTime"] = awj.StartTime + } + if awj.EndTime != nil { + objectMap["endTime"] = awj.EndTime + } + if awj.ActivityID != nil { + objectMap["activityId"] = awj.ActivityID } - if avwpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwpi.ProtectableItemType + if awj.JobType != "" { + objectMap["jobType"] = awj.JobType } return json.Marshal(objectMap) } -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return &avwpi, true -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwpi, true -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { +// AsAzureIaaSVMJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { +// AsAzureStorageJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsAzureStorageJob() (*AzureStorageJob, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false +// AsAzureWorkloadJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { + return &awj, true } -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { +// AsDpmJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsDpmJob() (*DpmJob, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { +// AsMabJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsMabJob() (*MabJob, bool) { return nil, false } -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { +// AsJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsJob() (*Job, bool) { return nil, false } -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return nil, false +// AsBasicJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsBasicJob() (BasicJob, bool) { + return &awj, true } -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return nil, false +// AzureWorkloadJobExtendedInfo azure VM workload-specific additional information for job. +type AzureWorkloadJobExtendedInfo struct { + // TasksList - List of tasks for this job + TasksList *[]AzureWorkloadJobTaskDetails `json:"tasksList,omitempty"` + // PropertyBag - Job properties. + PropertyBag map[string]*string `json:"propertyBag"` + // DynamicErrorMessage - Non localized error message on job execution. + DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` } -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false +// MarshalJSON is the custom marshaler for AzureWorkloadJobExtendedInfo. +func (awjei AzureWorkloadJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if awjei.TasksList != nil { + objectMap["tasksList"] = awjei.TasksList + } + if awjei.PropertyBag != nil { + objectMap["propertyBag"] = awjei.PropertyBag + } + if awjei.DynamicErrorMessage != nil { + objectMap["dynamicErrorMessage"] = awjei.DynamicErrorMessage + } + return json.Marshal(objectMap) } -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwpi, true +// AzureWorkloadJobTaskDetails azure VM workload specific job task details. +type AzureWorkloadJobTaskDetails struct { + // TaskID - The task display name. + TaskID *string `json:"taskId,omitempty"` + // Status - The status. + Status *string `json:"status,omitempty"` } -// BasicAzureVMWorkloadProtectedItem azure VM workload-specific protected item. -type BasicAzureVMWorkloadProtectedItem interface { - AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) - AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) - AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) - AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) +// BasicAzureWorkloadPointInTimeRecoveryPoint recovery point specific to PointInTime +type BasicAzureWorkloadPointInTimeRecoveryPoint interface { + AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) + AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) } -// AzureVMWorkloadProtectedItem azure VM workload-specific protected item. -type AzureVMWorkloadProtectedItem struct { - // FriendlyName - Friendly name of the DB represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // ParentName - Parent name of the DB such as Instance or Availability Group. - ParentName *string `json:"parentName,omitempty"` - // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed - ParentType *string `json:"parentType,omitempty"` - // ProtectionStatus - Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' - LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // LastBackupErrorDetail - Error details in last backup - LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` - // ProtectedItemDataSourceID - Data ID of the protected item. - ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` - // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' - ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` - // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // KpisHealths - Health details of different KPIs - KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +// AzureWorkloadPointInTimeRecoveryPoint recovery point specific to PointInTime +type AzureWorkloadPointInTimeRecoveryPoint struct { + // TimeRanges - List of log ranges + TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` + // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' + Type RestorePointType `json:"type,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` } -func unmarshalBasicAzureVMWorkloadProtectedItem(body []byte) (BasicAzureVMWorkloadProtectedItem, error) { +func unmarshalBasicAzureWorkloadPointInTimeRecoveryPoint(body []byte) (BasicAzureWorkloadPointInTimeRecoveryPoint, error) { var m map[string]interface{} err := json.Unmarshal(body, &m) if err != nil { return nil, err } - switch m["protectedItemType"] { - case string(ProtectedItemTypeAzureVMWorkloadSAPAseDatabase): - var avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem - err := json.Unmarshal(body, &avwsadpi) - return avwsadpi, err - case string(ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase): - var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem - err := json.Unmarshal(body, &avwshdpi) - return avwshdpi, err - case string(ProtectedItemTypeAzureVMWorkloadSQLDatabase): - var avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem - err := json.Unmarshal(body, &avwsdpi) - return avwsdpi, err + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): + var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awshpitrp) + return awshpitrp, err default: - var avwpi AzureVMWorkloadProtectedItem - err := json.Unmarshal(body, &avwpi) - return avwpi, err + var awpitrp AzureWorkloadPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awpitrp) + return awpitrp, err } } -func unmarshalBasicAzureVMWorkloadProtectedItemArray(body []byte) ([]BasicAzureVMWorkloadProtectedItem, error) { +func unmarshalBasicAzureWorkloadPointInTimeRecoveryPointArray(body []byte) ([]BasicAzureWorkloadPointInTimeRecoveryPoint, error) { var rawMessages []*json.RawMessage err := json.Unmarshal(body, &rawMessages) if err != nil { return nil, err } - avwpiArray := make([]BasicAzureVMWorkloadProtectedItem, len(rawMessages)) + awpitrpArray := make([]BasicAzureWorkloadPointInTimeRecoveryPoint, len(rawMessages)) for index, rawMessage := range rawMessages { - avwpi, err := unmarshalBasicAzureVMWorkloadProtectedItem(*rawMessage) + awpitrp, err := unmarshalBasicAzureWorkloadPointInTimeRecoveryPoint(*rawMessage) if err != nil { return nil, err } - avwpiArray[index] = avwpi + awpitrpArray[index] = awpitrp } - return avwpiArray, nil + return awpitrpArray, nil } -// MarshalJSON is the custom marshaler for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) MarshalJSON() ([]byte, error) { - avwpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadProtectedItem +// MarshalJSON is the custom marshaler for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { + awpitrp.ObjectType = ObjectTypeAzureWorkloadPointInTimeRecoveryPoint objectMap := make(map[string]interface{}) - if avwpi.FriendlyName != nil { - objectMap["friendlyName"] = avwpi.FriendlyName - } - if avwpi.ServerName != nil { - objectMap["serverName"] = avwpi.ServerName - } - if avwpi.ParentName != nil { - objectMap["parentName"] = avwpi.ParentName - } - if avwpi.ParentType != nil { - objectMap["parentType"] = avwpi.ParentType - } - if avwpi.ProtectionStatus != nil { - objectMap["protectionStatus"] = avwpi.ProtectionStatus - } - if avwpi.ProtectionState != "" { - objectMap["protectionState"] = avwpi.ProtectionState - } - if avwpi.LastBackupStatus != "" { - objectMap["lastBackupStatus"] = avwpi.LastBackupStatus - } - if avwpi.LastBackupTime != nil { - objectMap["lastBackupTime"] = avwpi.LastBackupTime - } - if avwpi.LastBackupErrorDetail != nil { - objectMap["lastBackupErrorDetail"] = avwpi.LastBackupErrorDetail - } - if avwpi.ProtectedItemDataSourceID != nil { - objectMap["protectedItemDataSourceId"] = avwpi.ProtectedItemDataSourceID - } - if avwpi.ProtectedItemHealthStatus != "" { - objectMap["protectedItemHealthStatus"] = avwpi.ProtectedItemHealthStatus - } - if avwpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = avwpi.ExtendedInfo - } - if avwpi.KpisHealths != nil { - objectMap["kpisHealths"] = avwpi.KpisHealths - } - if avwpi.BackupManagementType != "" { - objectMap["backupManagementType"] = avwpi.BackupManagementType - } - if avwpi.WorkloadType != "" { - objectMap["workloadType"] = avwpi.WorkloadType - } - if avwpi.ContainerName != nil { - objectMap["containerName"] = avwpi.ContainerName - } - if avwpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = avwpi.SourceResourceID - } - if avwpi.PolicyID != nil { - objectMap["policyId"] = avwpi.PolicyID - } - if avwpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = avwpi.LastRecoveryPoint - } - if avwpi.BackupSetName != nil { - objectMap["backupSetName"] = avwpi.BackupSetName - } - if avwpi.CreateMode != "" { - objectMap["createMode"] = avwpi.CreateMode - } - if avwpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = avwpi.DeferredDeleteTimeInUTC - } - if avwpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = avwpi.IsScheduledForDeferredDelete - } - if avwpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = avwpi.DeferredDeleteTimeRemaining - } - if avwpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = avwpi.IsDeferredDeleteScheduleUpcoming - } - if avwpi.IsRehydrate != nil { - objectMap["isRehydrate"] = avwpi.IsRehydrate + if awpitrp.TimeRanges != nil { + objectMap["timeRanges"] = awpitrp.TimeRanges } - if avwpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = avwpi.ProtectedItemType + if awpitrp.ObjectType != "" { + objectMap["objectType"] = awpitrp.ObjectType } return json.Marshal(objectMap) } -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { + return &awpitrp, true } -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { + return &awpitrp, true } -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { return nil, false } -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return &awpitrp, true } -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return &avwpi, true -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return &avwpi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { return nil, false } -// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { return nil, false } -// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { return nil, false } -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { return nil, false } -// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { return nil, false } -// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &avwpi, true -} - -// AzureVMWorkloadProtectedItemExtendedInfo additional information on Azure Workload for SQL specific -// backup item. -type AzureVMWorkloadProtectedItemExtendedInfo struct { - // OldestRecoveryPoint - The oldest backup copy available for this backup item. - OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` - // RecoveryPointCount - Number of backup copies available for this backup item. - RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` - // PolicyState - Indicates consistency of policy object and policy applied to this backup item. - PolicyState *string `json:"policyState,omitempty"` +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awpitrp, true } -// AzureVMWorkloadProtectionPolicy azure VM (Mercury) workload-specific backup policy. -type AzureVMWorkloadProtectionPolicy struct { - // 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', 'WorkloadTypeSAPAseDatabase' - 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 - SubProtectionPolicy *[]SubProtectionPolicy `json:"subProtectionPolicy,omitempty"` - // MakePolicyConsistent - Fix the policy inconsistency - MakePolicyConsistent *bool `json:"makePolicyConsistent,omitempty"` - // ProtectedItemsCount - Number of items associated with this policy. - ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' - BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` +// AzureWorkloadPointInTimeRestoreRequest azureWorkload SAP Hana -specific restore. Specifically for +// PointInTime/Log restore +type AzureWorkloadPointInTimeRestoreRequest struct { + // PointInTime - PointInTime value + PointInTime *date.Time `json:"pointInTime,omitempty"` + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) MarshalJSON() ([]byte, error) { - avwpp.BackupManagementType = BackupManagementTypeAzureWorkload +// MarshalJSON is the custom marshaler for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { + awpitrr.ObjectType = ObjectTypeAzureWorkloadPointInTimeRestoreRequest objectMap := make(map[string]interface{}) - if avwpp.WorkLoadType != "" { - objectMap["workLoadType"] = avwpp.WorkLoadType + if awpitrr.PointInTime != nil { + objectMap["pointInTime"] = awpitrr.PointInTime } - if avwpp.Settings != nil { - objectMap["settings"] = avwpp.Settings + if awpitrr.RecoveryType != "" { + objectMap["recoveryType"] = awpitrr.RecoveryType } - if avwpp.SubProtectionPolicy != nil { - objectMap["subProtectionPolicy"] = avwpp.SubProtectionPolicy + if awpitrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awpitrr.SourceResourceID } - if avwpp.MakePolicyConsistent != nil { - objectMap["makePolicyConsistent"] = avwpp.MakePolicyConsistent + if awpitrr.PropertyBag != nil { + objectMap["propertyBag"] = awpitrr.PropertyBag } - if avwpp.ProtectedItemsCount != nil { - objectMap["protectedItemsCount"] = avwpp.ProtectedItemsCount + if awpitrr.TargetInfo != nil { + objectMap["targetInfo"] = awpitrr.TargetInfo } - if avwpp.BackupManagementType != "" { - objectMap["backupManagementType"] = avwpp.BackupManagementType + if awpitrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awpitrr.RecoveryMode + } + if awpitrr.ObjectType != "" { + objectMap["objectType"] = awpitrr.ObjectType } return json.Marshal(objectMap) } -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { - return &avwpp, true -} - -// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { return nil, false } -// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { - return nil, false +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return &awpitrr, true } -// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { - return nil, false -} - -// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { - return nil, false -} - -// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { - return nil, false -} - -// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { return nil, false } -// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { - return &avwpp, true -} - -// AzureVMWorkloadSAPAseDatabaseProtectedItem azure VM workload-specific protected item representing SAP -// ASE Database. -type AzureVMWorkloadSAPAseDatabaseProtectedItem struct { - // FriendlyName - Friendly name of the DB represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // ParentName - Parent name of the DB such as Instance or Availability Group. - ParentName *string `json:"parentName,omitempty"` - // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed - ParentType *string `json:"parentType,omitempty"` - // ProtectionStatus - Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' - LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // LastBackupErrorDetail - Error details in last backup - LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` - // ProtectedItemDataSourceID - Data ID of the protected item. - ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` - // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' - ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` - // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // KpisHealths - Health details of different KPIs - KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) MarshalJSON() ([]byte, error) { - avwsadpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadSAPAseDatabase - objectMap := make(map[string]interface{}) - if avwsadpi.FriendlyName != nil { - objectMap["friendlyName"] = avwsadpi.FriendlyName - } - if avwsadpi.ServerName != nil { - objectMap["serverName"] = avwsadpi.ServerName - } - if avwsadpi.ParentName != nil { - objectMap["parentName"] = avwsadpi.ParentName - } - if avwsadpi.ParentType != nil { - objectMap["parentType"] = avwsadpi.ParentType - } - if avwsadpi.ProtectionStatus != nil { - objectMap["protectionStatus"] = avwsadpi.ProtectionStatus - } - if avwsadpi.ProtectionState != "" { - objectMap["protectionState"] = avwsadpi.ProtectionState - } - if avwsadpi.LastBackupStatus != "" { - objectMap["lastBackupStatus"] = avwsadpi.LastBackupStatus - } - if avwsadpi.LastBackupTime != nil { - objectMap["lastBackupTime"] = avwsadpi.LastBackupTime - } - if avwsadpi.LastBackupErrorDetail != nil { - objectMap["lastBackupErrorDetail"] = avwsadpi.LastBackupErrorDetail - } - if avwsadpi.ProtectedItemDataSourceID != nil { - objectMap["protectedItemDataSourceId"] = avwsadpi.ProtectedItemDataSourceID - } - if avwsadpi.ProtectedItemHealthStatus != "" { - objectMap["protectedItemHealthStatus"] = avwsadpi.ProtectedItemHealthStatus - } - if avwsadpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = avwsadpi.ExtendedInfo - } - if avwsadpi.KpisHealths != nil { - objectMap["kpisHealths"] = avwsadpi.KpisHealths - } - if avwsadpi.BackupManagementType != "" { - objectMap["backupManagementType"] = avwsadpi.BackupManagementType - } - if avwsadpi.WorkloadType != "" { - objectMap["workloadType"] = avwsadpi.WorkloadType - } - if avwsadpi.ContainerName != nil { - objectMap["containerName"] = avwsadpi.ContainerName - } - if avwsadpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = avwsadpi.SourceResourceID - } - if avwsadpi.PolicyID != nil { - objectMap["policyId"] = avwsadpi.PolicyID - } - if avwsadpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = avwsadpi.LastRecoveryPoint - } - if avwsadpi.BackupSetName != nil { - objectMap["backupSetName"] = avwsadpi.BackupSetName - } - if avwsadpi.CreateMode != "" { - objectMap["createMode"] = avwsadpi.CreateMode - } - if avwsadpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = avwsadpi.DeferredDeleteTimeInUTC - } - if avwsadpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = avwsadpi.IsScheduledForDeferredDelete - } - if avwsadpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = avwsadpi.DeferredDeleteTimeRemaining - } - if avwsadpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = avwsadpi.IsDeferredDeleteScheduleUpcoming - } - if avwsadpi.IsRehydrate != nil { - objectMap["isRehydrate"] = avwsadpi.IsRehydrate - } - if avwsadpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = avwsadpi.ProtectedItemType - } - return json.Marshal(objectMap) +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awpitrr, true } -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { return nil, false } -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { return nil, false } -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { return nil, false } -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { return nil, false } -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { return nil, false } -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return &avwsadpi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return &avwsadpi, true -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return nil, false +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awpitrr, true } -// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return nil, false +// BasicAzureWorkloadRecoveryPoint workload specific recovery point, specifically encapsulates full/diff recovery point +type BasicAzureWorkloadRecoveryPoint interface { + AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) + AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) + AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) + AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) + AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) } -// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return nil, false +// AzureWorkloadRecoveryPoint workload specific recovery point, specifically encapsulates full/diff recovery +// point +type AzureWorkloadRecoveryPoint struct { + // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' + Type RestorePointType `json:"type,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` } -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return nil, false -} +func unmarshalBasicAzureWorkloadRecoveryPoint(body []byte) (BasicAzureWorkloadRecoveryPoint, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } -// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return nil, false + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadPointInTimeRecoveryPoint): + var awpitrp AzureWorkloadPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awpitrp) + return awpitrp, err + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): + var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awshpitrp) + return awshpitrp, err + case string(ObjectTypeAzureWorkloadSAPHanaRecoveryPoint): + var awshrp AzureWorkloadSAPHanaRecoveryPoint + err := json.Unmarshal(body, &awshrp) + return awshrp, err + case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): + var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awspitrp) + return awspitrp, err + case string(ObjectTypeAzureWorkloadSQLRecoveryPoint): + var awsrp AzureWorkloadSQLRecoveryPoint + err := json.Unmarshal(body, &awsrp) + return awsrp, err + default: + var awrp AzureWorkloadRecoveryPoint + err := json.Unmarshal(body, &awrp) + return awrp, err + } } +func unmarshalBasicAzureWorkloadRecoveryPointArray(body []byte) ([]BasicAzureWorkloadRecoveryPoint, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } -// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &avwsadpi, true -} + awrpArray := make([]BasicAzureWorkloadRecoveryPoint, len(rawMessages)) -// AzureVMWorkloadSAPAseDatabaseWorkloadItem azure VM workload-specific workload item representing SAP ASE -// Database. -type AzureVMWorkloadSAPAseDatabaseWorkloadItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if workload item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DB's present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected - SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` + for index, rawMessage := range rawMessages { + awrp, err := unmarshalBasicAzureWorkloadRecoveryPoint(*rawMessage) + if err != nil { + return nil, err + } + awrpArray[index] = awrp + } + return awrpArray, nil } -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { - avwsadwi.WorkloadItemType = WorkloadItemTypeSAPAseDatabase1 +// MarshalJSON is the custom marshaler for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) MarshalJSON() ([]byte, error) { + awrp.ObjectType = ObjectTypeAzureWorkloadRecoveryPoint objectMap := make(map[string]interface{}) - if avwsadwi.ParentName != nil { - objectMap["parentName"] = avwsadwi.ParentName - } - if avwsadwi.ServerName != nil { - objectMap["serverName"] = avwsadwi.ServerName - } - if avwsadwi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsadwi.IsAutoProtectable - } - if avwsadwi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsadwi.Subinquireditemcount - } - if avwsadwi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwsadwi.SubWorkloadItemCount - } - if avwsadwi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsadwi.BackupManagementType - } - if avwsadwi.WorkloadType != nil { - objectMap["workloadType"] = avwsadwi.WorkloadType - } - if avwsadwi.FriendlyName != nil { - objectMap["friendlyName"] = avwsadwi.FriendlyName - } - if avwsadwi.ProtectionState != "" { - objectMap["protectionState"] = avwsadwi.ProtectionState - } - if avwsadwi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwsadwi.WorkloadItemType + if awrp.ObjectType != "" { + objectMap["objectType"] = awrp.ObjectType } return json.Marshal(objectMap) } -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { return nil, false } -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwsadwi, true +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return &awrp, true +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return &awrp, true } -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { - return &avwsadwi, true +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false } -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { return nil, false } -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { return nil, false } -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwsadwi, true +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false } -// AzureVMWorkloadSAPAseSystemProtectableItem azure VM workload-specific protectable item representing SAP -// ASE System. -type AzureVMWorkloadSAPAseSystemProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - 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 - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awrp, true } -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) MarshalJSON() ([]byte, error) { - avwsaspi.ProtectableItemType = ProtectableItemTypeSAPAseSystem - objectMap := make(map[string]interface{}) - if avwsaspi.ParentName != nil { - objectMap["parentName"] = avwsaspi.ParentName - } - if avwsaspi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwsaspi.ParentUniqueName - } - if avwsaspi.ServerName != nil { - objectMap["serverName"] = avwsaspi.ServerName - } - if avwsaspi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsaspi.IsAutoProtectable +// BasicAzureWorkloadRestoreRequest azureWorkload-specific restore. +type BasicAzureWorkloadRestoreRequest interface { + AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) + AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) + AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) + AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) + AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) + AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) + AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) + AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) +} + +// AzureWorkloadRestoreRequest azureWorkload-specific restore. +type AzureWorkloadRestoreRequest struct { + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicAzureWorkloadRestoreRequest(body []byte) (BasicAzureWorkloadRestoreRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err } - if avwsaspi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwsaspi.IsAutoProtected + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadPointInTimeRestoreRequest): + var awpitrr AzureWorkloadPointInTimeRestoreRequest + err := json.Unmarshal(body, &awpitrr) + return awpitrr, err + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): + var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest + err := json.Unmarshal(body, &awshpitrr) + return awshpitrr, err + case string(ObjectTypeAzureWorkloadSAPHanaRestoreRequest): + var awshrr AzureWorkloadSAPHanaRestoreRequest + err := json.Unmarshal(body, &awshrr) + return awshrr, err + case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): + var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest + err := json.Unmarshal(body, &awspitrr) + return awspitrr, err + case string(ObjectTypeAzureWorkloadSQLRestoreRequest): + var awsrr AzureWorkloadSQLRestoreRequest + err := json.Unmarshal(body, &awsrr) + return awsrr, err + default: + var awrr AzureWorkloadRestoreRequest + err := json.Unmarshal(body, &awrr) + return awrr, err } - if avwsaspi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsaspi.Subinquireditemcount +} +func unmarshalBasicAzureWorkloadRestoreRequestArray(body []byte) ([]BasicAzureWorkloadRestoreRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err } - if avwsaspi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwsaspi.Subprotectableitemcount + + awrrArray := make([]BasicAzureWorkloadRestoreRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awrr, err := unmarshalBasicAzureWorkloadRestoreRequest(*rawMessage) + if err != nil { + return nil, err + } + awrrArray[index] = awrr } - if avwsaspi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwsaspi.Prebackupvalidation + return awrrArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) MarshalJSON() ([]byte, error) { + awrr.ObjectType = ObjectTypeAzureWorkloadRestoreRequest + objectMap := make(map[string]interface{}) + if awrr.RecoveryType != "" { + objectMap["recoveryType"] = awrr.RecoveryType } - if avwsaspi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsaspi.BackupManagementType + if awrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awrr.SourceResourceID } - if avwsaspi.WorkloadType != nil { - objectMap["workloadType"] = avwsaspi.WorkloadType + if awrr.PropertyBag != nil { + objectMap["propertyBag"] = awrr.PropertyBag } - if avwsaspi.FriendlyName != nil { - objectMap["friendlyName"] = avwsaspi.FriendlyName + if awrr.TargetInfo != nil { + objectMap["targetInfo"] = awrr.TargetInfo } - if avwsaspi.ProtectionState != "" { - objectMap["protectionState"] = avwsaspi.ProtectionState + if awrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awrr.RecoveryMode } - if avwsaspi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwsaspi.ProtectableItemType + if awrr.ObjectType != "" { + objectMap["objectType"] = awrr.ObjectType } return json.Marshal(objectMap) } -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { return nil, false } -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return &awrr, true } -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwsaspi, true +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awrr, true } -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return &avwsaspi, true +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { return nil, false } -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { return nil, false } -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { return nil, false } -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awrr, true } -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwsaspi, true +// AzureWorkloadSAPHanaPointInTimeRecoveryPoint recovery point specific to PointInTime in SAPHana +type AzureWorkloadSAPHanaPointInTimeRecoveryPoint struct { + // TimeRanges - List of log ranges + TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` + // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' + Type RestorePointType `json:"type,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` } -// AzureVMWorkloadSAPAseSystemWorkloadItem azure VM workload-specific workload item representing SAP ASE -// System. -type AzureVMWorkloadSAPAseSystemWorkloadItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if workload item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DB's present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected - SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) MarshalJSON() ([]byte, error) { - avwsaswi.WorkloadItemType = WorkloadItemTypeSAPAseSystem1 +// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { + awshpitrp.ObjectType = ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint objectMap := make(map[string]interface{}) - if avwsaswi.ParentName != nil { - objectMap["parentName"] = avwsaswi.ParentName - } - if avwsaswi.ServerName != nil { - objectMap["serverName"] = avwsaswi.ServerName - } - if avwsaswi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsaswi.IsAutoProtectable - } - if avwsaswi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsaswi.Subinquireditemcount - } - if avwsaswi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwsaswi.SubWorkloadItemCount - } - if avwsaswi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsaswi.BackupManagementType - } - if avwsaswi.WorkloadType != nil { - objectMap["workloadType"] = avwsaswi.WorkloadType - } - if avwsaswi.FriendlyName != nil { - objectMap["friendlyName"] = avwsaswi.FriendlyName - } - if avwsaswi.ProtectionState != "" { - objectMap["protectionState"] = avwsaswi.ProtectionState + if awshpitrp.TimeRanges != nil { + objectMap["timeRanges"] = awshpitrp.TimeRanges } - if avwsaswi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwsaswi.WorkloadItemType + if awshpitrp.ObjectType != "" { + objectMap["objectType"] = awshpitrp.ObjectType } return json.Marshal(objectMap) } -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { return nil, false } -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwsaswi, true +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { + return &awshpitrp, true } -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { - return &avwsaswi, true +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return &awshpitrp, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return &awshpitrp, true +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { return nil, false } -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { return nil, false } -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwsaswi, true +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false } -// AzureVMWorkloadSAPHanaDatabaseProtectableItem azure VM workload-specific protectable item representing -// SAP HANA Database. -type AzureVMWorkloadSAPHanaDatabaseProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - 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 - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awshpitrp, true +} + +// AzureWorkloadSAPHanaPointInTimeRestoreRequest azureWorkload SAP Hana -specific restore. Specifically for +// PointInTime/Log restore +type AzureWorkloadSAPHanaPointInTimeRestoreRequest struct { + // PointInTime - PointInTime value + PointInTime *date.Time `json:"pointInTime,omitempty"` + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) MarshalJSON() ([]byte, error) { - avwshdpi.ProtectableItemType = ProtectableItemTypeSAPHanaDatabase +// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { + awshpitrr.ObjectType = ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest objectMap := make(map[string]interface{}) - if avwshdpi.ParentName != nil { - objectMap["parentName"] = avwshdpi.ParentName - } - if avwshdpi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwshdpi.ParentUniqueName - } - if avwshdpi.ServerName != nil { - objectMap["serverName"] = avwshdpi.ServerName - } - if avwshdpi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwshdpi.IsAutoProtectable - } - if avwshdpi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwshdpi.IsAutoProtected - } - if avwshdpi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwshdpi.Subinquireditemcount - } - if avwshdpi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwshdpi.Subprotectableitemcount + if awshpitrr.PointInTime != nil { + objectMap["pointInTime"] = awshpitrr.PointInTime } - if avwshdpi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwshdpi.Prebackupvalidation + if awshpitrr.RecoveryType != "" { + objectMap["recoveryType"] = awshpitrr.RecoveryType } - if avwshdpi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwshdpi.BackupManagementType + if awshpitrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awshpitrr.SourceResourceID } - if avwshdpi.WorkloadType != nil { - objectMap["workloadType"] = avwshdpi.WorkloadType + if awshpitrr.PropertyBag != nil { + objectMap["propertyBag"] = awshpitrr.PropertyBag } - if avwshdpi.FriendlyName != nil { - objectMap["friendlyName"] = avwshdpi.FriendlyName + if awshpitrr.TargetInfo != nil { + objectMap["targetInfo"] = awshpitrr.TargetInfo } - if avwshdpi.ProtectionState != "" { - objectMap["protectionState"] = avwshdpi.ProtectionState + if awshpitrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awshpitrr.RecoveryMode } - if avwshdpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwshdpi.ProtectableItemType + if awshpitrr.ObjectType != "" { + objectMap["objectType"] = awshpitrr.ObjectType } return json.Marshal(objectMap) } -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { return nil, false } -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awshpitrr, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return &awshpitrr, true +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { return nil, false } -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwshdpi, true +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return &awshpitrr, true } -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return &avwshdpi, true +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false } -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awshpitrr, true +} + +// AzureWorkloadSAPHanaRecoveryPoint sAPHana specific recoverypoint, specifically encapsulates full/diff +// recoverypoints +type AzureWorkloadSAPHanaRecoveryPoint struct { + // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' + Type RestorePointType `json:"type,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) MarshalJSON() ([]byte, error) { + awshrp.ObjectType = ObjectTypeAzureWorkloadSAPHanaRecoveryPoint + objectMap := make(map[string]interface{}) + if awshrp.ObjectType != "" { + objectMap["objectType"] = awshrp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { return nil, false } -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { return nil, false } -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { return nil, false } -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { return nil, false } -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwshdpi, true +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return &awshrp, true } -// AzureVMWorkloadSAPHanaDatabaseProtectedItem azure VM workload-specific protected item representing SAP -// HANA Database. -type AzureVMWorkloadSAPHanaDatabaseProtectedItem struct { - // FriendlyName - Friendly name of the DB represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // ParentName - Parent name of the DB such as Instance or Availability Group. - ParentName *string `json:"parentName,omitempty"` - // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed - ParentType *string `json:"parentType,omitempty"` - // ProtectionStatus - Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' - LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // LastBackupErrorDetail - Error details in last backup - LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` - // ProtectedItemDataSourceID - Data ID of the protected item. - ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` - // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' - ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` - // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // KpisHealths - Health details of different KPIs - KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) MarshalJSON() ([]byte, error) { - avwshdpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase - objectMap := make(map[string]interface{}) - if avwshdpi.FriendlyName != nil { - objectMap["friendlyName"] = avwshdpi.FriendlyName - } - if avwshdpi.ServerName != nil { - objectMap["serverName"] = avwshdpi.ServerName - } - if avwshdpi.ParentName != nil { - objectMap["parentName"] = avwshdpi.ParentName - } - if avwshdpi.ParentType != nil { - objectMap["parentType"] = avwshdpi.ParentType - } - if avwshdpi.ProtectionStatus != nil { - objectMap["protectionStatus"] = avwshdpi.ProtectionStatus - } - if avwshdpi.ProtectionState != "" { - objectMap["protectionState"] = avwshdpi.ProtectionState - } - if avwshdpi.LastBackupStatus != "" { - objectMap["lastBackupStatus"] = avwshdpi.LastBackupStatus - } - if avwshdpi.LastBackupTime != nil { - objectMap["lastBackupTime"] = avwshdpi.LastBackupTime - } - if avwshdpi.LastBackupErrorDetail != nil { - objectMap["lastBackupErrorDetail"] = avwshdpi.LastBackupErrorDetail - } - if avwshdpi.ProtectedItemDataSourceID != nil { - objectMap["protectedItemDataSourceId"] = avwshdpi.ProtectedItemDataSourceID - } - if avwshdpi.ProtectedItemHealthStatus != "" { - objectMap["protectedItemHealthStatus"] = avwshdpi.ProtectedItemHealthStatus - } - if avwshdpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = avwshdpi.ExtendedInfo - } - if avwshdpi.KpisHealths != nil { - objectMap["kpisHealths"] = avwshdpi.KpisHealths - } - if avwshdpi.BackupManagementType != "" { - objectMap["backupManagementType"] = avwshdpi.BackupManagementType - } - if avwshdpi.WorkloadType != "" { - objectMap["workloadType"] = avwshdpi.WorkloadType - } - if avwshdpi.ContainerName != nil { - objectMap["containerName"] = avwshdpi.ContainerName - } - if avwshdpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = avwshdpi.SourceResourceID - } - if avwshdpi.PolicyID != nil { - objectMap["policyId"] = avwshdpi.PolicyID - } - if avwshdpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = avwshdpi.LastRecoveryPoint - } - if avwshdpi.BackupSetName != nil { - objectMap["backupSetName"] = avwshdpi.BackupSetName - } - if avwshdpi.CreateMode != "" { - objectMap["createMode"] = avwshdpi.CreateMode - } - if avwshdpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = avwshdpi.DeferredDeleteTimeInUTC - } - if avwshdpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = avwshdpi.IsScheduledForDeferredDelete - } - if avwshdpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = avwshdpi.DeferredDeleteTimeRemaining - } - if avwshdpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = avwshdpi.IsDeferredDeleteScheduleUpcoming - } - if avwshdpi.IsRehydrate != nil { - objectMap["isRehydrate"] = avwshdpi.IsRehydrate - } - if avwshdpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = avwshdpi.ProtectedItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return &awshrp, true } -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { return nil, false } -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { return nil, false } -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { return nil, false } -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return &avwshdpi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return &avwshdpi, true -} - -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return nil, false +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awshrp, true } -// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return nil, false +// BasicAzureWorkloadSAPHanaRestoreRequest azureWorkload SAP Hana-specific restore. +type BasicAzureWorkloadSAPHanaRestoreRequest interface { + AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) + AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) } -// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return nil, false +// AzureWorkloadSAPHanaRestoreRequest azureWorkload SAP Hana-specific restore. +type AzureWorkloadSAPHanaRestoreRequest struct { + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return nil, false -} +func unmarshalBasicAzureWorkloadSAPHanaRestoreRequest(body []byte) (BasicAzureWorkloadSAPHanaRestoreRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } -// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return nil, false + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): + var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest + err := json.Unmarshal(body, &awshpitrr) + return awshpitrr, err + default: + var awshrr AzureWorkloadSAPHanaRestoreRequest + err := json.Unmarshal(body, &awshrr) + return awshrr, err + } } +func unmarshalBasicAzureWorkloadSAPHanaRestoreRequestArray(body []byte) ([]BasicAzureWorkloadSAPHanaRestoreRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } -// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &avwshdpi, true -} + awshrrArray := make([]BasicAzureWorkloadSAPHanaRestoreRequest, len(rawMessages)) -// AzureVMWorkloadSAPHanaDatabaseWorkloadItem azure VM workload-specific workload item representing SAP -// HANA Database. -type AzureVMWorkloadSAPHanaDatabaseWorkloadItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if workload item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DB's present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected - SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` + for index, rawMessage := range rawMessages { + awshrr, err := unmarshalBasicAzureWorkloadSAPHanaRestoreRequest(*rawMessage) + if err != nil { + return nil, err + } + awshrrArray[index] = awshrr + } + return awshrrArray, nil } -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { - avwshdwi.WorkloadItemType = WorkloadItemTypeSAPHanaDatabase1 +// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) MarshalJSON() ([]byte, error) { + awshrr.ObjectType = ObjectTypeAzureWorkloadSAPHanaRestoreRequest objectMap := make(map[string]interface{}) - if avwshdwi.ParentName != nil { - objectMap["parentName"] = avwshdwi.ParentName - } - if avwshdwi.ServerName != nil { - objectMap["serverName"] = avwshdwi.ServerName - } - if avwshdwi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwshdwi.IsAutoProtectable - } - if avwshdwi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwshdwi.Subinquireditemcount - } - if avwshdwi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwshdwi.SubWorkloadItemCount + if awshrr.RecoveryType != "" { + objectMap["recoveryType"] = awshrr.RecoveryType } - if avwshdwi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwshdwi.BackupManagementType + if awshrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awshrr.SourceResourceID } - if avwshdwi.WorkloadType != nil { - objectMap["workloadType"] = avwshdwi.WorkloadType + if awshrr.PropertyBag != nil { + objectMap["propertyBag"] = awshrr.PropertyBag } - if avwshdwi.FriendlyName != nil { - objectMap["friendlyName"] = avwshdwi.FriendlyName + if awshrr.TargetInfo != nil { + objectMap["targetInfo"] = awshrr.TargetInfo } - if avwshdwi.ProtectionState != "" { - objectMap["protectionState"] = avwshdwi.ProtectionState + if awshrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awshrr.RecoveryMode } - if avwshdwi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwshdwi.WorkloadItemType + if awshrr.ObjectType != "" { + objectMap["objectType"] = awshrr.ObjectType } return json.Marshal(objectMap) } -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { return nil, false } -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwshdwi, true +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return nil, false } -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awshrr, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { - return &avwshdwi, true +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return &awshrr, true } -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { - return nil, false +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return &awshrr, true } -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { return nil, false } -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { return nil, false } -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwshdwi, true +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false } -// AzureVMWorkloadSAPHanaSystemProtectableItem azure VM workload-specific protectable item representing SAP -// HANA System. -type AzureVMWorkloadSAPHanaSystemProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - 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 - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awshrr, true +} + +// AzureWorkloadSQLPointInTimeRecoveryPoint recovery point specific to PointInTime +type AzureWorkloadSQLPointInTimeRecoveryPoint struct { + // TimeRanges - List of log ranges + TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` + // ExtendedInfo - Extended Info that provides data directory details. Will be populated in two cases: + // When a specific recovery point is accessed using GetRecoveryPoint + // Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter + ExtendedInfo *AzureWorkloadSQLRecoveryPointExtendedInfo `json:"extendedInfo,omitempty"` + // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' + Type RestorePointType `json:"type,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) MarshalJSON() ([]byte, error) { - avwshspi.ProtectableItemType = ProtectableItemTypeSAPHanaSystem +// MarshalJSON is the custom marshaler for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { + awspitrp.ObjectType = ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint objectMap := make(map[string]interface{}) - if avwshspi.ParentName != nil { - objectMap["parentName"] = avwshspi.ParentName - } - if avwshspi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwshspi.ParentUniqueName - } - if avwshspi.ServerName != nil { - objectMap["serverName"] = avwshspi.ServerName - } - if avwshspi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwshspi.IsAutoProtectable - } - if avwshspi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwshspi.IsAutoProtected - } - if avwshspi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwshspi.Subinquireditemcount - } - if avwshspi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwshspi.Subprotectableitemcount - } - if avwshspi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwshspi.Prebackupvalidation - } - if avwshspi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwshspi.BackupManagementType - } - if avwshspi.WorkloadType != nil { - objectMap["workloadType"] = avwshspi.WorkloadType - } - if avwshspi.FriendlyName != nil { - objectMap["friendlyName"] = avwshspi.FriendlyName + if awspitrp.TimeRanges != nil { + objectMap["timeRanges"] = awspitrp.TimeRanges } - if avwshspi.ProtectionState != "" { - objectMap["protectionState"] = avwshspi.ProtectionState + if awspitrp.ExtendedInfo != nil { + objectMap["extendedInfo"] = awspitrp.ExtendedInfo } - if avwshspi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwshspi.ProtectableItemType + if awspitrp.ObjectType != "" { + objectMap["objectType"] = awspitrp.ObjectType } return json.Marshal(objectMap) } -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { return nil, false } -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwshspi, true +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return &awspitrp, true } -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return &avwshspi, true -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return &awspitrp, true } -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return &awspitrp, true } -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { return nil, false } -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { return nil, false } -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { return nil, false } -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwshspi, true +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awspitrp, true } -// AzureVMWorkloadSAPHanaSystemWorkloadItem azure VM workload-specific workload item representing SAP HANA -// System. -type AzureVMWorkloadSAPHanaSystemWorkloadItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if workload item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DB's present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected - SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +// AzureWorkloadSQLPointInTimeRestoreRequest azureWorkload SQL -specific restore. Specifically for +// PointInTime/Log restore +type AzureWorkloadSQLPointInTimeRestoreRequest struct { + // PointInTime - PointInTime value + PointInTime *date.Time `json:"pointInTime,omitempty"` + // ShouldUseAlternateTargetLocation - Default option set to true. If this is set to false, alternate data directory must be provided + ShouldUseAlternateTargetLocation *bool `json:"shouldUseAlternateTargetLocation,omitempty"` + // IsNonRecoverable - SQL specific property where user can chose to set no-recovery when restore operation is tried + IsNonRecoverable *bool `json:"isNonRecoverable,omitempty"` + // AlternateDirectoryPaths - Data directory details + AlternateDirectoryPaths *[]SQLDataDirectoryMapping `json:"alternateDirectoryPaths,omitempty"` + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) MarshalJSON() ([]byte, error) { - avwshswi.WorkloadItemType = WorkloadItemTypeSAPHanaSystem1 +// MarshalJSON is the custom marshaler for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { + awspitrr.ObjectType = ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest objectMap := make(map[string]interface{}) - if avwshswi.ParentName != nil { - objectMap["parentName"] = avwshswi.ParentName + if awspitrr.PointInTime != nil { + objectMap["pointInTime"] = awspitrr.PointInTime } - if avwshswi.ServerName != nil { - objectMap["serverName"] = avwshswi.ServerName + if awspitrr.ShouldUseAlternateTargetLocation != nil { + objectMap["shouldUseAlternateTargetLocation"] = awspitrr.ShouldUseAlternateTargetLocation } - if avwshswi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwshswi.IsAutoProtectable + if awspitrr.IsNonRecoverable != nil { + objectMap["isNonRecoverable"] = awspitrr.IsNonRecoverable } - if avwshswi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwshswi.Subinquireditemcount + if awspitrr.AlternateDirectoryPaths != nil { + objectMap["alternateDirectoryPaths"] = awspitrr.AlternateDirectoryPaths } - if avwshswi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwshswi.SubWorkloadItemCount + if awspitrr.RecoveryType != "" { + objectMap["recoveryType"] = awspitrr.RecoveryType } - if avwshswi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwshswi.BackupManagementType + if awspitrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awspitrr.SourceResourceID } - if avwshswi.WorkloadType != nil { - objectMap["workloadType"] = avwshswi.WorkloadType + if awspitrr.PropertyBag != nil { + objectMap["propertyBag"] = awspitrr.PropertyBag } - if avwshswi.FriendlyName != nil { - objectMap["friendlyName"] = avwshswi.FriendlyName + if awspitrr.TargetInfo != nil { + objectMap["targetInfo"] = awspitrr.TargetInfo } - if avwshswi.ProtectionState != "" { - objectMap["protectionState"] = avwshswi.ProtectionState + if awspitrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awspitrr.RecoveryMode } - if avwshswi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwshswi.WorkloadItemType + if awspitrr.ObjectType != "" { + objectMap["objectType"] = awspitrr.ObjectType } return json.Marshal(objectMap) } -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { return nil, false } -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwshswi, true +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awspitrr, true } -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { - return &avwshswi, true +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return &awspitrr, true } -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return &awspitrr, true +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { return nil, false } -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { return nil, false } -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwshswi, true +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awspitrr, true } -// AzureVMWorkloadSQLAvailabilityGroupProtectableItem azure VM workload-specific protectable item -// representing SQL Availability Group. -type AzureVMWorkloadSQLAvailabilityGroupProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - 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 - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +// BasicAzureWorkloadSQLRecoveryPoint SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint +// along with extended info +type BasicAzureWorkloadSQLRecoveryPoint interface { + AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) } -// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) MarshalJSON() ([]byte, error) { - avwsagpi.ProtectableItemType = ProtectableItemTypeSQLAvailabilityGroupContainer - objectMap := make(map[string]interface{}) - if avwsagpi.ParentName != nil { - objectMap["parentName"] = avwsagpi.ParentName - } - if avwsagpi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwsagpi.ParentUniqueName - } - if avwsagpi.ServerName != nil { - objectMap["serverName"] = avwsagpi.ServerName - } - if avwsagpi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsagpi.IsAutoProtectable - } - if avwsagpi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwsagpi.IsAutoProtected - } - if avwsagpi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsagpi.Subinquireditemcount - } - if avwsagpi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwsagpi.Subprotectableitemcount - } - if avwsagpi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwsagpi.Prebackupvalidation +// AzureWorkloadSQLRecoveryPoint SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint +// along with extended info +type AzureWorkloadSQLRecoveryPoint struct { + // ExtendedInfo - Extended Info that provides data directory details. Will be populated in two cases: + // When a specific recovery point is accessed using GetRecoveryPoint + // Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter + ExtendedInfo *AzureWorkloadSQLRecoveryPointExtendedInfo `json:"extendedInfo,omitempty"` + // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' + Type RestorePointType `json:"type,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +func unmarshalBasicAzureWorkloadSQLRecoveryPoint(body []byte) (BasicAzureWorkloadSQLRecoveryPoint, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err } - if avwsagpi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsagpi.BackupManagementType + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): + var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awspitrp) + return awspitrp, err + default: + var awsrp AzureWorkloadSQLRecoveryPoint + err := json.Unmarshal(body, &awsrp) + return awsrp, err } - if avwsagpi.WorkloadType != nil { - objectMap["workloadType"] = avwsagpi.WorkloadType +} +func unmarshalBasicAzureWorkloadSQLRecoveryPointArray(body []byte) ([]BasicAzureWorkloadSQLRecoveryPoint, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err } - if avwsagpi.FriendlyName != nil { - objectMap["friendlyName"] = avwsagpi.FriendlyName + + awsrpArray := make([]BasicAzureWorkloadSQLRecoveryPoint, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awsrp, err := unmarshalBasicAzureWorkloadSQLRecoveryPoint(*rawMessage) + if err != nil { + return nil, err + } + awsrpArray[index] = awsrp } - if avwsagpi.ProtectionState != "" { - objectMap["protectionState"] = avwsagpi.ProtectionState + return awsrpArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) MarshalJSON() ([]byte, error) { + awsrp.ObjectType = ObjectTypeAzureWorkloadSQLRecoveryPoint + objectMap := make(map[string]interface{}) + if awsrp.ExtendedInfo != nil { + objectMap["extendedInfo"] = awsrp.ExtendedInfo } - if avwsagpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwsagpi.ProtectableItemType + if awsrp.ObjectType != "" { + objectMap["objectType"] = awsrp.ObjectType } return json.Marshal(objectMap) } -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { return nil, false } -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwsagpi, true -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return &awsrp, true } -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { return nil, false } -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return &avwsagpi, true +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return &awsrp, true } -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return &awsrp, true } -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { return nil, false } -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { return nil, false } -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { return nil, false } -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwsagpi, true +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awsrp, true } -// AzureVMWorkloadSQLDatabaseProtectableItem azure VM workload-specific protectable item representing SQL -// Database. -type AzureVMWorkloadSQLDatabaseProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - 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 - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +// AzureWorkloadSQLRecoveryPointExtendedInfo extended info class details +type AzureWorkloadSQLRecoveryPointExtendedInfo struct { + // DataDirectoryTimeInUTC - READ-ONLY; UTC time at which data directory info was captured + DataDirectoryTimeInUTC *date.Time `json:"dataDirectoryTimeInUTC,omitempty"` + // DataDirectoryPaths - READ-ONLY; List of data directory paths during restore operation. + DataDirectoryPaths *[]SQLDataDirectory `json:"dataDirectoryPaths,omitempty"` } -// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) MarshalJSON() ([]byte, error) { - avwsdpi.ProtectableItemType = ProtectableItemTypeSQLDataBase +// MarshalJSON is the custom marshaler for AzureWorkloadSQLRecoveryPointExtendedInfo. +func (awsrpei AzureWorkloadSQLRecoveryPointExtendedInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if avwsdpi.ParentName != nil { - objectMap["parentName"] = avwsdpi.ParentName + return json.Marshal(objectMap) +} + +// BasicAzureWorkloadSQLRestoreRequest azureWorkload SQL -specific restore. Specifically for full/diff restore +type BasicAzureWorkloadSQLRestoreRequest interface { + AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) + AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) +} + +// AzureWorkloadSQLRestoreRequest azureWorkload SQL -specific restore. Specifically for full/diff restore +type AzureWorkloadSQLRestoreRequest struct { + // ShouldUseAlternateTargetLocation - Default option set to true. If this is set to false, alternate data directory must be provided + ShouldUseAlternateTargetLocation *bool `json:"shouldUseAlternateTargetLocation,omitempty"` + // IsNonRecoverable - SQL specific property where user can chose to set no-recovery when restore operation is tried + IsNonRecoverable *bool `json:"isNonRecoverable,omitempty"` + // AlternateDirectoryPaths - Data directory details + AlternateDirectoryPaths *[]SQLDataDirectoryMapping `json:"alternateDirectoryPaths,omitempty"` + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicAzureWorkloadSQLRestoreRequest(body []byte) (BasicAzureWorkloadSQLRestoreRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err } - if avwsdpi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwsdpi.ParentUniqueName + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): + var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest + err := json.Unmarshal(body, &awspitrr) + return awspitrr, err + default: + var awsrr AzureWorkloadSQLRestoreRequest + err := json.Unmarshal(body, &awsrr) + return awsrr, err } - if avwsdpi.ServerName != nil { - objectMap["serverName"] = avwsdpi.ServerName +} +func unmarshalBasicAzureWorkloadSQLRestoreRequestArray(body []byte) ([]BasicAzureWorkloadSQLRestoreRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err } - if avwsdpi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsdpi.IsAutoProtectable + + awsrrArray := make([]BasicAzureWorkloadSQLRestoreRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awsrr, err := unmarshalBasicAzureWorkloadSQLRestoreRequest(*rawMessage) + if err != nil { + return nil, err + } + awsrrArray[index] = awsrr } - if avwsdpi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwsdpi.IsAutoProtected + return awsrrArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) MarshalJSON() ([]byte, error) { + awsrr.ObjectType = ObjectTypeAzureWorkloadSQLRestoreRequest + objectMap := make(map[string]interface{}) + if awsrr.ShouldUseAlternateTargetLocation != nil { + objectMap["shouldUseAlternateTargetLocation"] = awsrr.ShouldUseAlternateTargetLocation } - if avwsdpi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsdpi.Subinquireditemcount + if awsrr.IsNonRecoverable != nil { + objectMap["isNonRecoverable"] = awsrr.IsNonRecoverable } - if avwsdpi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwsdpi.Subprotectableitemcount + if awsrr.AlternateDirectoryPaths != nil { + objectMap["alternateDirectoryPaths"] = awsrr.AlternateDirectoryPaths } - if avwsdpi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwsdpi.Prebackupvalidation + if awsrr.RecoveryType != "" { + objectMap["recoveryType"] = awsrr.RecoveryType } - if avwsdpi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsdpi.BackupManagementType + if awsrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awsrr.SourceResourceID } - if avwsdpi.WorkloadType != nil { - objectMap["workloadType"] = avwsdpi.WorkloadType + if awsrr.PropertyBag != nil { + objectMap["propertyBag"] = awsrr.PropertyBag } - if avwsdpi.FriendlyName != nil { - objectMap["friendlyName"] = avwsdpi.FriendlyName + if awsrr.TargetInfo != nil { + objectMap["targetInfo"] = awsrr.TargetInfo } - if avwsdpi.ProtectionState != "" { - objectMap["protectionState"] = avwsdpi.ProtectionState + if awsrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awsrr.RecoveryMode } - if avwsdpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwsdpi.ProtectableItemType + if awsrr.ObjectType != "" { + objectMap["objectType"] = awsrr.ObjectType } return json.Marshal(objectMap) } -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { return nil, false } -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awsrr, true } -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwsdpi, true +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false } -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { return nil, false } -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return &awsrr, true } -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return &avwsdpi, true +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return &awsrr, true } -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { return nil, false } -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { return nil, false } -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return nil, false +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awsrr, true } -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false +// BEKDetails BEK is bitlocker encryption key. +type BEKDetails struct { + // SecretURL - Secret is BEK. + SecretURL *string `json:"secretUrl,omitempty"` + // SecretVaultID - ID of the Key Vault where this Secret is stored. + SecretVaultID *string `json:"secretVaultId,omitempty"` + // SecretData - BEK data. + SecretData *string `json:"secretData,omitempty"` } -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwsdpi, true +// BMSRPQueryObject filters to list backup copies. +type BMSRPQueryObject struct { + // StartDate - Backup copies created after this time. + StartDate *date.Time `json:"startDate,omitempty"` + // EndDate - Backup copies created before this time. + EndDate *date.Time `json:"endDate,omitempty"` + // RestorePointQueryType - RestorePoint type. Possible values include: 'RestorePointQueryTypeInvalid', 'RestorePointQueryTypeFull', 'RestorePointQueryTypeLog', 'RestorePointQueryTypeDifferential', 'RestorePointQueryTypeFullAndDifferential', 'RestorePointQueryTypeAll' + RestorePointQueryType RestorePointQueryType `json:"restorePointQueryType,omitempty"` + // ExtendedInfo - In Get Recovery Point, it tells whether extended information about recovery point is asked. + ExtendedInfo *bool `json:"extendedInfo,omitempty"` } -// AzureVMWorkloadSQLDatabaseProtectedItem azure VM workload-specific protected item representing SQL -// Database. -type AzureVMWorkloadSQLDatabaseProtectedItem struct { - // FriendlyName - Friendly name of the DB represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // ParentName - Parent name of the DB such as Instance or Availability Group. - ParentName *string `json:"parentName,omitempty"` - // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed - ParentType *string `json:"parentType,omitempty"` - // ProtectionStatus - Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' - LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // LastBackupErrorDetail - Error details in last backup - LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` - // ProtectedItemDataSourceID - Data ID of the protected item. - ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` - // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' - ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` - // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // KpisHealths - Health details of different KPIs - KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +// DailyRetentionFormat daily retention format. +type DailyRetentionFormat struct { + // DaysOfTheMonth - List of days of the month. + DaysOfTheMonth *[]Day `json:"daysOfTheMonth,omitempty"` } -// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) MarshalJSON() ([]byte, error) { - avwsdpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadSQLDatabase +// DailyRetentionSchedule daily retention schedule. +type DailyRetentionSchedule struct { + // RetentionTimes - Retention times of retention policy. + RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` + // RetentionDuration - Retention duration of retention Policy. + RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` +} + +// Day day of the week. +type Day struct { + // Date - Date of the month + Date *int32 `json:"date,omitempty"` + // IsLast - Whether Date is last date of month + IsLast *bool `json:"isLast,omitempty"` +} + +// DiskExclusionProperties ... +type DiskExclusionProperties struct { + // DiskLunList - List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. + DiskLunList *[]int32 `json:"diskLunList,omitempty"` + // IsInclusionList - Flag to indicate whether DiskLunList is to be included/ excluded from backup. + IsInclusionList *bool `json:"isInclusionList,omitempty"` +} + +// DiskInformation disk information +type DiskInformation struct { + Lun *int32 `json:"lun,omitempty"` + Name *string `json:"name,omitempty"` +} + +// DpmErrorInfo DPM workload-specific error information. +type DpmErrorInfo struct { + // ErrorString - Localized error string. + ErrorString *string `json:"errorString,omitempty"` + // Recommendations - List of localized recommendations for above error code. + Recommendations *[]string `json:"recommendations,omitempty"` +} + +// DpmJob DPM workload-specific job object. +type DpmJob struct { + // Duration - Time elapsed for job. + Duration *string `json:"duration,omitempty"` + // DpmServerName - DPM server name managing the backup item or backup job. + DpmServerName *string `json:"dpmServerName,omitempty"` + // ContainerName - Name of cluster/server protecting current backup item, if any. + ContainerName *string `json:"containerName,omitempty"` + // ContainerType - Type of container. + ContainerType *string `json:"containerType,omitempty"` + // WorkloadType - Type of backup item. + WorkloadType *string `json:"workloadType,omitempty"` + // ActionsInfo - The state/actions applicable on this job like cancel/retry. + ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` + // ErrorDetails - The errors. + ErrorDetails *[]DpmErrorInfo `json:"errorDetails,omitempty"` + // ExtendedInfo - Additional information for this job. + ExtendedInfo *DpmJobExtendedInfo `json:"extendedInfo,omitempty"` + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' + JobType JobType `json:"jobType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DpmJob. +func (dj DpmJob) MarshalJSON() ([]byte, error) { + dj.JobType = JobTypeDpmJob objectMap := make(map[string]interface{}) - if avwsdpi.FriendlyName != nil { - objectMap["friendlyName"] = avwsdpi.FriendlyName - } - if avwsdpi.ServerName != nil { - objectMap["serverName"] = avwsdpi.ServerName - } - if avwsdpi.ParentName != nil { - objectMap["parentName"] = avwsdpi.ParentName - } - if avwsdpi.ParentType != nil { - objectMap["parentType"] = avwsdpi.ParentType - } - if avwsdpi.ProtectionStatus != nil { - objectMap["protectionStatus"] = avwsdpi.ProtectionStatus - } - if avwsdpi.ProtectionState != "" { - objectMap["protectionState"] = avwsdpi.ProtectionState - } - if avwsdpi.LastBackupStatus != "" { - objectMap["lastBackupStatus"] = avwsdpi.LastBackupStatus - } - if avwsdpi.LastBackupTime != nil { - objectMap["lastBackupTime"] = avwsdpi.LastBackupTime - } - if avwsdpi.LastBackupErrorDetail != nil { - objectMap["lastBackupErrorDetail"] = avwsdpi.LastBackupErrorDetail - } - if avwsdpi.ProtectedItemDataSourceID != nil { - objectMap["protectedItemDataSourceId"] = avwsdpi.ProtectedItemDataSourceID - } - if avwsdpi.ProtectedItemHealthStatus != "" { - objectMap["protectedItemHealthStatus"] = avwsdpi.ProtectedItemHealthStatus - } - if avwsdpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = avwsdpi.ExtendedInfo + if dj.Duration != nil { + objectMap["duration"] = dj.Duration } - if avwsdpi.KpisHealths != nil { - objectMap["kpisHealths"] = avwsdpi.KpisHealths + if dj.DpmServerName != nil { + objectMap["dpmServerName"] = dj.DpmServerName } - if avwsdpi.BackupManagementType != "" { - objectMap["backupManagementType"] = avwsdpi.BackupManagementType + if dj.ContainerName != nil { + objectMap["containerName"] = dj.ContainerName } - if avwsdpi.WorkloadType != "" { - objectMap["workloadType"] = avwsdpi.WorkloadType + if dj.ContainerType != nil { + objectMap["containerType"] = dj.ContainerType } - if avwsdpi.ContainerName != nil { - objectMap["containerName"] = avwsdpi.ContainerName + if dj.WorkloadType != nil { + objectMap["workloadType"] = dj.WorkloadType } - if avwsdpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = avwsdpi.SourceResourceID + if dj.ActionsInfo != nil { + objectMap["actionsInfo"] = dj.ActionsInfo } - if avwsdpi.PolicyID != nil { - objectMap["policyId"] = avwsdpi.PolicyID + if dj.ErrorDetails != nil { + objectMap["errorDetails"] = dj.ErrorDetails } - if avwsdpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = avwsdpi.LastRecoveryPoint + if dj.ExtendedInfo != nil { + objectMap["extendedInfo"] = dj.ExtendedInfo } - if avwsdpi.BackupSetName != nil { - objectMap["backupSetName"] = avwsdpi.BackupSetName + if dj.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = dj.EntityFriendlyName } - if avwsdpi.CreateMode != "" { - objectMap["createMode"] = avwsdpi.CreateMode + if dj.BackupManagementType != "" { + objectMap["backupManagementType"] = dj.BackupManagementType } - if avwsdpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = avwsdpi.DeferredDeleteTimeInUTC + if dj.Operation != nil { + objectMap["operation"] = dj.Operation } - if avwsdpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = avwsdpi.IsScheduledForDeferredDelete + if dj.Status != nil { + objectMap["status"] = dj.Status } - if avwsdpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = avwsdpi.DeferredDeleteTimeRemaining + if dj.StartTime != nil { + objectMap["startTime"] = dj.StartTime } - if avwsdpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = avwsdpi.IsDeferredDeleteScheduleUpcoming + if dj.EndTime != nil { + objectMap["endTime"] = dj.EndTime } - if avwsdpi.IsRehydrate != nil { - objectMap["isRehydrate"] = avwsdpi.IsRehydrate + if dj.ActivityID != nil { + objectMap["activityId"] = dj.ActivityID } - if avwsdpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = avwsdpi.ProtectedItemType + if dj.JobType != "" { + objectMap["jobType"] = dj.JobType } return json.Marshal(objectMap) } -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { +// AsAzureIaaSVMJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { return nil, false } -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { +// AsAzureStorageJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsAzureStorageJob() (*AzureStorageJob, bool) { return nil, false } -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { +// AsAzureWorkloadJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { return nil, false } -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false +// AsDpmJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsDpmJob() (*DpmJob, bool) { + return &dj, true } -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { +// AsMabJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsMabJob() (*MabJob, bool) { return nil, false } -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { +// AsJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsJob() (*Job, bool) { return nil, false } -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return &avwsdpi, true +// AsBasicJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsBasicJob() (BasicJob, bool) { + return &dj, true } -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false +// DpmJobExtendedInfo additional information on the DPM workload-specific job. +type DpmJobExtendedInfo struct { + // TasksList - List of tasks associated with this job. + TasksList *[]DpmJobTaskDetails `json:"tasksList,omitempty"` + // PropertyBag - The job properties. + PropertyBag map[string]*string `json:"propertyBag"` + // DynamicErrorMessage - Non localized error message on job execution. + DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` } -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return nil, false +// MarshalJSON is the custom marshaler for DpmJobExtendedInfo. +func (djei DpmJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if djei.TasksList != nil { + objectMap["tasksList"] = djei.TasksList + } + if djei.PropertyBag != nil { + objectMap["propertyBag"] = djei.PropertyBag + } + if djei.DynamicErrorMessage != nil { + objectMap["dynamicErrorMessage"] = djei.DynamicErrorMessage + } + return json.Marshal(objectMap) } -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return &avwsdpi, true +// DpmJobTaskDetails DPM workload-specific job task details. +type DpmJobTaskDetails struct { + // TaskID - The task display name. + TaskID *string `json:"taskId,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // Duration - Time elapsed for task. + Duration *string `json:"duration,omitempty"` + // Status - The status. + Status *string `json:"status,omitempty"` } -// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return nil, false -} - -// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return nil, false -} - -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return nil, false -} - -// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return nil, false -} - -// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &avwsdpi, true -} - -// AzureVMWorkloadSQLDatabaseWorkloadItem azure VM workload-specific workload item representing SQL -// Database. -type AzureVMWorkloadSQLDatabaseWorkloadItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if workload item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DB's present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected - SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. +// DPMProtectedItem additional information on Backup engine specific backup item. +type DPMProtectedItem struct { + // FriendlyName - Friendly name of the managed item FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` + // BackupEngineName - Backup Management server protecting this backup item + BackupEngineName *string `json:"backupEngineName,omitempty"` + // ProtectionState - Protection state of the backup engine. Possible values include: 'ProtectedItemStateInvalid', 'ProtectedItemStateIRPending', 'ProtectedItemStateProtected', 'ProtectedItemStateProtectionError', 'ProtectedItemStateProtectionStopped', 'ProtectedItemStateProtectionPaused' + ProtectionState ProtectedItemState `json:"protectionState,omitempty"` + // ExtendedInfo - Extended info of the backup item. + ExtendedInfo *DPMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { - avwsdwi.WorkloadItemType = WorkloadItemTypeSQLDataBase1 +// MarshalJSON is the custom marshaler for DPMProtectedItem. +func (dpi DPMProtectedItem) MarshalJSON() ([]byte, error) { + dpi.ProtectedItemType = ProtectedItemTypeDPMProtectedItem objectMap := make(map[string]interface{}) - if avwsdwi.ParentName != nil { - objectMap["parentName"] = avwsdwi.ParentName - } - if avwsdwi.ServerName != nil { - objectMap["serverName"] = avwsdwi.ServerName - } - if avwsdwi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsdwi.IsAutoProtectable - } - if avwsdwi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsdwi.Subinquireditemcount - } - if avwsdwi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwsdwi.SubWorkloadItemCount - } - if avwsdwi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsdwi.BackupManagementType + if dpi.FriendlyName != nil { + objectMap["friendlyName"] = dpi.FriendlyName } - if avwsdwi.WorkloadType != nil { - objectMap["workloadType"] = avwsdwi.WorkloadType + if dpi.BackupEngineName != nil { + objectMap["backupEngineName"] = dpi.BackupEngineName } - if avwsdwi.FriendlyName != nil { - objectMap["friendlyName"] = avwsdwi.FriendlyName + if dpi.ProtectionState != "" { + objectMap["protectionState"] = dpi.ProtectionState } - if avwsdwi.ProtectionState != "" { - objectMap["protectionState"] = avwsdwi.ProtectionState + if dpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = dpi.ExtendedInfo } - if avwsdwi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwsdwi.WorkloadItemType + if dpi.BackupManagementType != "" { + objectMap["backupManagementType"] = dpi.BackupManagementType } - return json.Marshal(objectMap) -} - -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwsdwi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { - return &avwsdwi, true -} - -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { - return nil, false -} - -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { - return nil, false -} - -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwsdwi, true -} - -// AzureVMWorkloadSQLInstanceProtectableItem azure VM workload-specific protectable item representing SQL -// Instance. -type AzureVMWorkloadSQLInstanceProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - 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 - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) MarshalJSON() ([]byte, error) { - avwsipi.ProtectableItemType = ProtectableItemTypeSQLInstance - objectMap := make(map[string]interface{}) - if avwsipi.ParentName != nil { - objectMap["parentName"] = avwsipi.ParentName + if dpi.WorkloadType != "" { + objectMap["workloadType"] = dpi.WorkloadType } - if avwsipi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwsipi.ParentUniqueName + if dpi.ContainerName != nil { + objectMap["containerName"] = dpi.ContainerName } - if avwsipi.ServerName != nil { - objectMap["serverName"] = avwsipi.ServerName + if dpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = dpi.SourceResourceID } - if avwsipi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsipi.IsAutoProtectable + if dpi.PolicyID != nil { + objectMap["policyId"] = dpi.PolicyID } - if avwsipi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwsipi.IsAutoProtected + if dpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = dpi.LastRecoveryPoint } - if avwsipi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsipi.Subinquireditemcount + if dpi.BackupSetName != nil { + objectMap["backupSetName"] = dpi.BackupSetName } - if avwsipi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwsipi.Subprotectableitemcount + if dpi.CreateMode != "" { + objectMap["createMode"] = dpi.CreateMode } - if avwsipi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwsipi.Prebackupvalidation + if dpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = dpi.DeferredDeleteTimeInUTC } - if avwsipi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsipi.BackupManagementType + if dpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = dpi.IsScheduledForDeferredDelete } - if avwsipi.WorkloadType != nil { - objectMap["workloadType"] = avwsipi.WorkloadType + if dpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = dpi.DeferredDeleteTimeRemaining } - if avwsipi.FriendlyName != nil { - objectMap["friendlyName"] = avwsipi.FriendlyName + if dpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = dpi.IsDeferredDeleteScheduleUpcoming } - if avwsipi.ProtectionState != "" { - objectMap["protectionState"] = avwsipi.ProtectionState + if dpi.IsRehydrate != nil { + objectMap["isRehydrate"] = dpi.IsRehydrate } - if avwsipi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwsipi.ProtectableItemType + if dpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = dpi.ProtectedItemType } return json.Marshal(objectMap) } -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { return nil, false } -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { return nil, false } -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { return nil, false } -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwsipi, true +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false } -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { return nil, false } -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { return nil, false } -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { return nil, false } -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { return nil, false } -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return &avwsipi, true +// AsDPMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return &dpi, true } -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { +// AsGenericProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { return nil, false } -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { return nil, false } -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { +// AsProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { return nil, false } -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwsipi, true +// AsBasicProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &dpi, true } -// AzureVMWorkloadSQLInstanceWorkloadItem azure VM workload-specific workload item representing SQL -// Instance. -type AzureVMWorkloadSQLInstanceWorkloadItem struct { - // DataDirectoryPaths - Data Directory Paths for default directories - DataDirectoryPaths *[]SQLDataDirectory `json:"dataDirectoryPaths,omitempty"` - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if workload item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DB's present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected - SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +// DPMProtectedItemExtendedInfo additional information of DPM Protected item. +type DPMProtectedItemExtendedInfo struct { + // ProtectableObjectLoadPath - Attribute to provide information on various DBs. + ProtectableObjectLoadPath map[string]*string `json:"protectableObjectLoadPath"` + // Protected - To check if backup item is disk protected. + Protected *bool `json:"protected,omitempty"` + // IsPresentOnCloud - To check if backup item is cloud protected. + IsPresentOnCloud *bool `json:"isPresentOnCloud,omitempty"` + // LastBackupStatus - Last backup status information on backup item. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` + // LastRefreshedAt - Last refresh time on backup item. + LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` + // OldestRecoveryPoint - Oldest cloud recovery point time. + OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` + // RecoveryPointCount - cloud recovery point count. + RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` + // OnPremiseOldestRecoveryPoint - Oldest disk recovery point time. + OnPremiseOldestRecoveryPoint *date.Time `json:"onPremiseOldestRecoveryPoint,omitempty"` + // OnPremiseLatestRecoveryPoint - latest disk recovery point time. + OnPremiseLatestRecoveryPoint *date.Time `json:"onPremiseLatestRecoveryPoint,omitempty"` + // OnPremiseRecoveryPointCount - disk recovery point count. + OnPremiseRecoveryPointCount *int32 `json:"onPremiseRecoveryPointCount,omitempty"` + // IsCollocated - To check if backup item is collocated. + IsCollocated *bool `json:"isCollocated,omitempty"` + // ProtectionGroupName - Protection group name of the backup item. + ProtectionGroupName *string `json:"protectionGroupName,omitempty"` + // DiskStorageUsedInBytes - Used Disk storage in bytes. + DiskStorageUsedInBytes *string `json:"diskStorageUsedInBytes,omitempty"` + // TotalDiskStorageSizeInBytes - total Disk storage in bytes. + TotalDiskStorageSizeInBytes *string `json:"totalDiskStorageSizeInBytes,omitempty"` } -// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) MarshalJSON() ([]byte, error) { - avwsiwi.WorkloadItemType = WorkloadItemTypeSQLInstance1 +// MarshalJSON is the custom marshaler for DPMProtectedItemExtendedInfo. +func (dpiei DPMProtectedItemExtendedInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if avwsiwi.DataDirectoryPaths != nil { - objectMap["dataDirectoryPaths"] = avwsiwi.DataDirectoryPaths + if dpiei.ProtectableObjectLoadPath != nil { + objectMap["protectableObjectLoadPath"] = dpiei.ProtectableObjectLoadPath + } + if dpiei.Protected != nil { + objectMap["protected"] = dpiei.Protected + } + if dpiei.IsPresentOnCloud != nil { + objectMap["isPresentOnCloud"] = dpiei.IsPresentOnCloud } - if avwsiwi.ParentName != nil { - objectMap["parentName"] = avwsiwi.ParentName + if dpiei.LastBackupStatus != nil { + objectMap["lastBackupStatus"] = dpiei.LastBackupStatus + } + if dpiei.LastRefreshedAt != nil { + objectMap["lastRefreshedAt"] = dpiei.LastRefreshedAt } - if avwsiwi.ServerName != nil { - objectMap["serverName"] = avwsiwi.ServerName + if dpiei.OldestRecoveryPoint != nil { + objectMap["oldestRecoveryPoint"] = dpiei.OldestRecoveryPoint } - if avwsiwi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsiwi.IsAutoProtectable + if dpiei.RecoveryPointCount != nil { + objectMap["recoveryPointCount"] = dpiei.RecoveryPointCount } - if avwsiwi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsiwi.Subinquireditemcount + if dpiei.OnPremiseOldestRecoveryPoint != nil { + objectMap["onPremiseOldestRecoveryPoint"] = dpiei.OnPremiseOldestRecoveryPoint } - if avwsiwi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwsiwi.SubWorkloadItemCount + if dpiei.OnPremiseLatestRecoveryPoint != nil { + objectMap["onPremiseLatestRecoveryPoint"] = dpiei.OnPremiseLatestRecoveryPoint } - if avwsiwi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsiwi.BackupManagementType + if dpiei.OnPremiseRecoveryPointCount != nil { + objectMap["onPremiseRecoveryPointCount"] = dpiei.OnPremiseRecoveryPointCount } - if avwsiwi.WorkloadType != nil { - objectMap["workloadType"] = avwsiwi.WorkloadType + if dpiei.IsCollocated != nil { + objectMap["isCollocated"] = dpiei.IsCollocated } - if avwsiwi.FriendlyName != nil { - objectMap["friendlyName"] = avwsiwi.FriendlyName + if dpiei.ProtectionGroupName != nil { + objectMap["protectionGroupName"] = dpiei.ProtectionGroupName } - if avwsiwi.ProtectionState != "" { - objectMap["protectionState"] = avwsiwi.ProtectionState + if dpiei.DiskStorageUsedInBytes != nil { + objectMap["diskStorageUsedInBytes"] = dpiei.DiskStorageUsedInBytes } - if avwsiwi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwsiwi.WorkloadItemType + if dpiei.TotalDiskStorageSizeInBytes != nil { + objectMap["totalDiskStorageSizeInBytes"] = dpiei.TotalDiskStorageSizeInBytes } return json.Marshal(objectMap) } -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { - return nil, false +// EncryptionDetails details needed if the VM was encrypted at the time of backup. +type EncryptionDetails struct { + // EncryptionEnabled - Identifies whether this backup copy represents an encrypted VM at the time of backup. + EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` + // KekURL - Key Url. + KekURL *string `json:"kekUrl,omitempty"` + // SecretKeyURL - Secret Url. + SecretKeyURL *string `json:"secretKeyUrl,omitempty"` + // KekVaultID - ID of Key Vault where KEK is stored. + KekVaultID *string `json:"kekVaultId,omitempty"` + // SecretKeyVaultID - ID of Key Vault where Secret is stored. + SecretKeyVaultID *string `json:"secretKeyVaultId,omitempty"` } -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwsiwi, true +// ErrorAdditionalInfo the resource management error additional info. +type ErrorAdditionalInfo struct { + // Type - READ-ONLY; The additional info type. + Type *string `json:"type,omitempty"` + // Info - READ-ONLY; The additional info. + Info interface{} `json:"info,omitempty"` } -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { - return nil, false +// MarshalJSON is the custom marshaler for ErrorAdditionalInfo. +func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) } -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { - return nil, false +// ErrorDetail error Detail class which encapsulates Code, Message and Recommendations. +type ErrorDetail struct { + // Code - READ-ONLY; Error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; Error Message related to the Code. + Message *string `json:"message,omitempty"` + // Recommendations - READ-ONLY; List of recommendation strings. + Recommendations *[]string `json:"recommendations,omitempty"` } -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { - return nil, false +// MarshalJSON is the custom marshaler for ErrorDetail. +func (ed ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) } -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { - return nil, false +// ErrorResponse common error response for all Azure Resource Manager APIs to return error details for +// failed operations. (This also follows the OData error response format.) +type ErrorResponse struct { + // Code - READ-ONLY; The error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; The error message. + Message *string `json:"message,omitempty"` + // Target - READ-ONLY; The error target. + Target *string `json:"target,omitempty"` + // Details - READ-ONLY; The error details. + Details *[]ErrorResponse `json:"details,omitempty"` + // AdditionalInfo - READ-ONLY; The error additional info. + AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` } -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { - return nil, false +// MarshalJSON is the custom marshaler for ErrorResponse. +func (er ErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ExportJobsOperationResultInfo this class is used to send blob details after exporting jobs. +type ExportJobsOperationResultInfo struct { + // BlobURL - URL of the blob into which the serialized string of list of jobs is exported. + BlobURL *string `json:"blobUrl,omitempty"` + // BlobSasKey - SAS key to access the blob. It expires in 15 mins. + BlobSasKey *string `json:"blobSasKey,omitempty"` + // ExcelFileBlobURL - URL of the blob into which the ExcelFile is uploaded. + ExcelFileBlobURL *string `json:"excelFileBlobUrl,omitempty"` + // ExcelFileBlobSasKey - SAS key to access the blob. It expires in 15 mins. + ExcelFileBlobSasKey *string `json:"excelFileBlobSasKey,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeOperationResultInfoBase', 'ObjectTypeExportJobsOperationResultInfo', 'ObjectTypeOperationResultInfo' + ObjectType ObjectType `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExportJobsOperationResultInfo. +func (ejori ExportJobsOperationResultInfo) MarshalJSON() ([]byte, error) { + ejori.ObjectType = ObjectTypeExportJobsOperationResultInfo + objectMap := make(map[string]interface{}) + if ejori.BlobURL != nil { + objectMap["blobUrl"] = ejori.BlobURL + } + if ejori.BlobSasKey != nil { + objectMap["blobSasKey"] = ejori.BlobSasKey + } + if ejori.ExcelFileBlobURL != nil { + objectMap["excelFileBlobUrl"] = ejori.ExcelFileBlobURL + } + if ejori.ExcelFileBlobSasKey != nil { + objectMap["excelFileBlobSasKey"] = ejori.ExcelFileBlobSasKey + } + if ejori.ObjectType != "" { + objectMap["objectType"] = ejori.ObjectType + } + return json.Marshal(objectMap) +} + +// AsExportJobsOperationResultInfo is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. +func (ejori ExportJobsOperationResultInfo) AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) { + return &ejori, true } -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { - return &avwsiwi, true +// AsOperationResultInfo is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. +func (ejori ExportJobsOperationResultInfo) AsOperationResultInfo() (*OperationResultInfo, bool) { + return nil, false } -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { +// AsOperationResultInfoBase is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. +func (ejori ExportJobsOperationResultInfo) AsOperationResultInfoBase() (*OperationResultInfoBase, bool) { return nil, false } -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwsiwi, true +// AsBasicOperationResultInfoBase is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. +func (ejori ExportJobsOperationResultInfo) AsBasicOperationResultInfoBase() (BasicOperationResultInfoBase, bool) { + return &ejori, true } -// BasicAzureWorkloadAutoProtectionIntent azure Recovery Services Vault specific protection intent item. -type BasicAzureWorkloadAutoProtectionIntent interface { - AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) - AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) +// ExtendedProperties extended Properties for Azure IaasVM Backup. +type ExtendedProperties struct { + // DiskExclusionProperties - Extended Properties for Disk Exclusion. + DiskExclusionProperties *DiskExclusionProperties `json:"diskExclusionProperties,omitempty"` } -// AzureWorkloadAutoProtectionIntent azure Recovery Services Vault specific protection intent item. -type AzureWorkloadAutoProtectionIntent struct { +// GenericProtectedItem base class for backup items. +type GenericProtectedItem struct { + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // PolicyState - Indicates consistency of policy object and policy applied to this backup item. + PolicyState *string `json:"policyState,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // ProtectedItemID - Data Plane Service ID of the protected item. + ProtectedItemID *int64 `json:"protectedItemId,omitempty"` + // SourceAssociations - Loosely coupled (type, value) associations (example - parent of a protected item) + SourceAssociations map[string]*string `json:"sourceAssociations"` + // FabricName - Name of this backup item's fabric. + FabricName *string `json:"fabricName,omitempty"` // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` // SourceResourceID - ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId - ItemID *string `json:"itemId,omitempty"` // PolicyID - ID of the backup policy with which this item is backed up. PolicyID *string `json:"policyId,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' - ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } -func unmarshalBasicAzureWorkloadAutoProtectionIntent(body []byte) (BasicAzureWorkloadAutoProtectionIntent, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err +// MarshalJSON is the custom marshaler for GenericProtectedItem. +func (gpi GenericProtectedItem) MarshalJSON() ([]byte, error) { + gpi.ProtectedItemType = ProtectedItemTypeGenericProtectedItem + objectMap := make(map[string]interface{}) + if gpi.FriendlyName != nil { + objectMap["friendlyName"] = gpi.FriendlyName } - - switch m["protectionIntentItemType"] { - case string(ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent): - var awsapi AzureWorkloadSQLAutoProtectionIntent - err := json.Unmarshal(body, &awsapi) - return awsapi, err - default: - var awapi AzureWorkloadAutoProtectionIntent - err := json.Unmarshal(body, &awapi) - return awapi, err + if gpi.PolicyState != nil { + objectMap["policyState"] = gpi.PolicyState } -} -func unmarshalBasicAzureWorkloadAutoProtectionIntentArray(body []byte) ([]BasicAzureWorkloadAutoProtectionIntent, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err + if gpi.ProtectionState != "" { + objectMap["protectionState"] = gpi.ProtectionState } - - awapiArray := make([]BasicAzureWorkloadAutoProtectionIntent, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awapi, err := unmarshalBasicAzureWorkloadAutoProtectionIntent(*rawMessage) - if err != nil { - return nil, err - } - awapiArray[index] = awapi + if gpi.ProtectedItemID != nil { + objectMap["protectedItemId"] = gpi.ProtectedItemID } - return awapiArray, nil -} - -// MarshalJSON is the custom marshaler for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) MarshalJSON() ([]byte, error) { - awapi.ProtectionIntentItemType = ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent - objectMap := make(map[string]interface{}) - if awapi.BackupManagementType != "" { - objectMap["backupManagementType"] = awapi.BackupManagementType + if gpi.SourceAssociations != nil { + objectMap["sourceAssociations"] = gpi.SourceAssociations + } + if gpi.FabricName != nil { + objectMap["fabricName"] = gpi.FabricName + } + if gpi.BackupManagementType != "" { + objectMap["backupManagementType"] = gpi.BackupManagementType + } + if gpi.WorkloadType != "" { + objectMap["workloadType"] = gpi.WorkloadType + } + if gpi.ContainerName != nil { + objectMap["containerName"] = gpi.ContainerName + } + if gpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = gpi.SourceResourceID + } + if gpi.PolicyID != nil { + objectMap["policyId"] = gpi.PolicyID + } + if gpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = gpi.LastRecoveryPoint + } + if gpi.BackupSetName != nil { + objectMap["backupSetName"] = gpi.BackupSetName + } + if gpi.CreateMode != "" { + objectMap["createMode"] = gpi.CreateMode + } + if gpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = gpi.DeferredDeleteTimeInUTC } - if awapi.SourceResourceID != nil { - objectMap["sourceResourceId"] = awapi.SourceResourceID + if gpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = gpi.IsScheduledForDeferredDelete } - if awapi.ItemID != nil { - objectMap["itemId"] = awapi.ItemID + if gpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = gpi.DeferredDeleteTimeRemaining } - if awapi.PolicyID != nil { - objectMap["policyId"] = awapi.PolicyID + if gpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = gpi.IsDeferredDeleteScheduleUpcoming } - if awapi.ProtectionState != "" { - objectMap["protectionState"] = awapi.ProtectionState + if gpi.IsRehydrate != nil { + objectMap["isRehydrate"] = gpi.IsRehydrate } - if awapi.ProtectionIntentItemType != "" { - objectMap["protectionIntentItemType"] = awapi.ProtectionIntentItemType + if gpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = gpi.ProtectedItemType } return json.Marshal(objectMap) } -// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { return nil, false } -// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { - return &awapi, true +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false } -// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { return nil, false } -// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { - return &awapi, true +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false } -// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { - return &awapi, true +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false } -// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { return nil, false } -// AsProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { return nil, false } -// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { - return &awapi, true +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false } -// AzureWorkloadBackupRequest azureWorkload workload-specific backup request. -type AzureWorkloadBackupRequest struct { - // BackupType - Type of backup, viz. Full, Differential, Log or CopyOnlyFull. Possible values include: 'TypeEnumInvalid', 'TypeEnumFull', 'TypeEnumDifferential', 'TypeEnumLog', 'TypeEnumCopyOnlyFull' - BackupType TypeEnum `json:"backupType,omitempty"` - // EnableCompression - Bool for Compression setting - EnableCompression *bool `json:"enableCompression,omitempty"` - // RecoveryPointExpiryTimeInUTC - Backup copy will expire after the time specified (UTC). - RecoveryPointExpiryTimeInUTC *date.Time `json:"recoveryPointExpiryTimeInUTC,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' - ObjectType ObjectTypeBasicRequest `json:"objectType,omitempty"` +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for AzureWorkloadBackupRequest. -func (awbr AzureWorkloadBackupRequest) MarshalJSON() ([]byte, error) { - awbr.ObjectType = ObjectTypeAzureWorkloadBackupRequest - objectMap := make(map[string]interface{}) - if awbr.BackupType != "" { - objectMap["backupType"] = awbr.BackupType - } - if awbr.EnableCompression != nil { - objectMap["enableCompression"] = awbr.EnableCompression - } - if awbr.RecoveryPointExpiryTimeInUTC != nil { - objectMap["recoveryPointExpiryTimeInUTC"] = awbr.RecoveryPointExpiryTimeInUTC - } - if awbr.ObjectType != "" { - objectMap["objectType"] = awbr.ObjectType - } - return json.Marshal(objectMap) +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false } -// AsAzureFileShareBackupRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. -func (awbr AzureWorkloadBackupRequest) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { return nil, false } -// AsAzureWorkloadBackupRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. -func (awbr AzureWorkloadBackupRequest) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { - return &awbr, true +// AsDPMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false } -// AsIaasVMBackupRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. -func (awbr AzureWorkloadBackupRequest) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { - return nil, false +// AsGenericProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return &gpi, true } -// AsRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. -func (awbr AzureWorkloadBackupRequest) AsRequest() (*Request, bool) { +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { return nil, false } -// AsBasicRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. -func (awbr AzureWorkloadBackupRequest) AsBasicRequest() (BasicRequest, bool) { - return &awbr, true -} - -// BasicAzureWorkloadContainer container for the workloads running inside Azure Compute or Classic Compute. -type BasicAzureWorkloadContainer interface { - AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) - AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) - AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) -} - -// AzureWorkloadContainer container for the workloads running inside Azure Compute or Classic Compute. -type AzureWorkloadContainer struct { - // SourceResourceID - ARM ID of the virtual machine represented by this Azure Workload Container - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // LastUpdatedTime - Time stamp when this container was updated. - LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` - // ExtendedInfo - Additional details of a workload container. - ExtendedInfo *AzureWorkloadContainerExtendedInfo `json:"extendedInfo,omitempty"` - // WorkloadType - Workload type for which registration was sent. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` - // OperationType - Re-Do Operation. Possible values include: 'OperationTypeInvalid', 'OperationTypeRegister', 'OperationTypeReregister' - OperationType OperationType `json:"operationType,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +// AsProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false } -func unmarshalBasicAzureWorkloadContainer(body []byte) (BasicAzureWorkloadContainer, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["containerType"] { - case string(ContainerTypeSQLAGWorkLoadContainer1): - var aswcpc AzureSQLAGWorkloadContainerProtectionContainer - err := json.Unmarshal(body, &aswcpc) - return aswcpc, err - case string(ContainerTypeVMAppContainer1): - var avacpc AzureVMAppContainerProtectionContainer - err := json.Unmarshal(body, &avacpc) - return avacpc, err - default: - var awc AzureWorkloadContainer - err := json.Unmarshal(body, &awc) - return awc, err - } +// AsBasicProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &gpi, true } -func unmarshalBasicAzureWorkloadContainerArray(body []byte) ([]BasicAzureWorkloadContainer, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - awcArray := make([]BasicAzureWorkloadContainer, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awc, err := unmarshalBasicAzureWorkloadContainer(*rawMessage) - if err != nil { - return nil, err - } - awcArray[index] = awc - } - return awcArray, nil +// GenericProtectionPolicy azure VM (Mercury) workload-specific backup policy. +type GenericProtectionPolicy struct { + // SubProtectionPolicy - List of sub-protection policies which includes schedule and retention + SubProtectionPolicy *[]SubProtectionPolicy `json:"subProtectionPolicy,omitempty"` + // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + TimeZone *string `json:"timeZone,omitempty"` + // FabricName - Name of this policy's fabric. + FabricName *string `json:"fabricName,omitempty"` + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) MarshalJSON() ([]byte, error) { - awc.ContainerType = ContainerTypeAzureWorkloadContainer +// MarshalJSON is the custom marshaler for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) MarshalJSON() ([]byte, error) { + gpp.BackupManagementType = BackupManagementTypeGenericProtectionPolicy objectMap := make(map[string]interface{}) - if awc.SourceResourceID != nil { - objectMap["sourceResourceId"] = awc.SourceResourceID - } - if awc.LastUpdatedTime != nil { - objectMap["lastUpdatedTime"] = awc.LastUpdatedTime - } - if awc.ExtendedInfo != nil { - objectMap["extendedInfo"] = awc.ExtendedInfo - } - if awc.WorkloadType != "" { - objectMap["workloadType"] = awc.WorkloadType - } - if awc.OperationType != "" { - objectMap["operationType"] = awc.OperationType - } - if awc.FriendlyName != nil { - objectMap["friendlyName"] = awc.FriendlyName + if gpp.SubProtectionPolicy != nil { + objectMap["subProtectionPolicy"] = gpp.SubProtectionPolicy } - if awc.BackupManagementType != "" { - objectMap["backupManagementType"] = awc.BackupManagementType + if gpp.TimeZone != nil { + objectMap["timeZone"] = gpp.TimeZone } - if awc.RegistrationStatus != nil { - objectMap["registrationStatus"] = awc.RegistrationStatus + if gpp.FabricName != nil { + objectMap["fabricName"] = gpp.FabricName } - if awc.HealthStatus != nil { - objectMap["healthStatus"] = awc.HealthStatus + if gpp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = gpp.ProtectedItemsCount } - if awc.ContainerType != "" { - objectMap["containerType"] = awc.ContainerType + if gpp.BackupManagementType != "" { + objectMap["backupManagementType"] = gpp.BackupManagementType } return json.Marshal(objectMap) } -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { return nil, false } -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { return nil, false } -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { return nil, false } -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { return nil, false } -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { + return &gpp, true } -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { return nil, false } -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { +// AsProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { return nil, false } -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return &awc, true +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &gpp, true } -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return &awc, true +// GenericRecoveryPoint generic backup copy. +type GenericRecoveryPoint struct { + // FriendlyName - Friendly name of the backup copy. + FriendlyName *string `json:"friendlyName,omitempty"` + // RecoveryPointType - Type of the backup copy. + RecoveryPointType *string `json:"recoveryPointType,omitempty"` + // RecoveryPointTime - Time at which this backup copy was created. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // RecoveryPointAdditionalInfo - Additional information associated with this backup copy. + RecoveryPointAdditionalInfo *string `json:"recoveryPointAdditionalInfo,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` } -// AsDpmContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false +// MarshalJSON is the custom marshaler for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) MarshalJSON() ([]byte, error) { + grp.ObjectType = ObjectTypeGenericRecoveryPoint + objectMap := make(map[string]interface{}) + if grp.FriendlyName != nil { + objectMap["friendlyName"] = grp.FriendlyName + } + if grp.RecoveryPointType != nil { + objectMap["recoveryPointType"] = grp.RecoveryPointType + } + if grp.RecoveryPointTime != nil { + objectMap["recoveryPointTime"] = grp.RecoveryPointTime + } + if grp.RecoveryPointAdditionalInfo != nil { + objectMap["recoveryPointAdditionalInfo"] = grp.RecoveryPointAdditionalInfo + } + if grp.ObjectType != "" { + objectMap["objectType"] = grp.ObjectType + } + return json.Marshal(objectMap) } -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { return nil, false } -// AsGenericContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsGenericContainer() (*GenericContainer, bool) { +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { return nil, false } -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { return nil, false } -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { return nil, false } -// AsMabContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsMabContainer() (*MabContainer, bool) { +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { return nil, false } -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsProtectionContainer() (*ProtectionContainer, bool) { +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { return nil, false } -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &awc, true +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false } -// AzureWorkloadContainerExtendedInfo extended information of the container. -type AzureWorkloadContainerExtendedInfo struct { - // HostServerName - Host Os Name in case of Stand Alone and Cluster Name in case of distributed container. - HostServerName *string `json:"hostServerName,omitempty"` - // InquiryInfo - Inquiry Status for the container. - InquiryInfo *InquiryInfo `json:"inquiryInfo,omitempty"` - // NodesList - List of the nodes in case of distributed container. - NodesList *[]DistributedNodesInfo `json:"nodesList,omitempty"` +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false } -// AzureWorkloadErrorInfo azure storage specific error information -type AzureWorkloadErrorInfo struct { - // ErrorCode - Error code. - ErrorCode *int32 `json:"errorCode,omitempty"` - // ErrorString - Localized error string. - ErrorString *string `json:"errorString,omitempty"` - // ErrorTitle - Title: Typically, the entity that the error pertains to. - ErrorTitle *string `json:"errorTitle,omitempty"` - // Recommendations - List of localized recommendations for above error code. - Recommendations *[]string `json:"recommendations,omitempty"` - // AdditionalDetails - Additional details for above error code. - AdditionalDetails *string `json:"additionalDetails,omitempty"` +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false } -// AzureWorkloadJob azure storage specific job. -type AzureWorkloadJob struct { - // WorkloadType - Workload type of the job - WorkloadType *string `json:"workloadType,omitempty"` - // Duration - Time elapsed during the execution of this job. - Duration *string `json:"duration,omitempty"` - // ActionsInfo - Gets or sets the state/actions applicable on this job like cancel/retry. - ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` - // ErrorDetails - Error details on execution of this job. - ErrorDetails *[]AzureWorkloadErrorInfo `json:"errorDetails,omitempty"` - // ExtendedInfo - Additional information about the job. - ExtendedInfo *AzureWorkloadJobExtendedInfo `json:"extendedInfo,omitempty"` - // EntityFriendlyName - Friendly name of the entity on which the current job is executing. - EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` - // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // Operation - The operation name. - Operation *string `json:"operation,omitempty"` - // Status - Job status. - Status *string `json:"status,omitempty"` - // StartTime - The start time. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time. - EndTime *date.Time `json:"endTime,omitempty"` - // ActivityID - ActivityId of job. - ActivityID *string `json:"activityId,omitempty"` - // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' - JobType JobType `json:"jobType,omitempty"` +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for AzureWorkloadJob. -func (awj AzureWorkloadJob) MarshalJSON() ([]byte, error) { - awj.JobType = JobTypeAzureWorkloadJob - objectMap := make(map[string]interface{}) - if awj.WorkloadType != nil { - objectMap["workloadType"] = awj.WorkloadType - } - if awj.Duration != nil { - objectMap["duration"] = awj.Duration - } - if awj.ActionsInfo != nil { - objectMap["actionsInfo"] = awj.ActionsInfo - } - if awj.ErrorDetails != nil { - objectMap["errorDetails"] = awj.ErrorDetails - } - if awj.ExtendedInfo != nil { - objectMap["extendedInfo"] = awj.ExtendedInfo - } - if awj.EntityFriendlyName != nil { - objectMap["entityFriendlyName"] = awj.EntityFriendlyName - } - if awj.BackupManagementType != "" { - objectMap["backupManagementType"] = awj.BackupManagementType - } - if awj.Operation != nil { - objectMap["operation"] = awj.Operation - } - if awj.Status != nil { - objectMap["status"] = awj.Status - } - if awj.StartTime != nil { - objectMap["startTime"] = awj.StartTime - } - if awj.EndTime != nil { - objectMap["endTime"] = awj.EndTime - } - if awj.ActivityID != nil { - objectMap["activityId"] = awj.ActivityID - } - if awj.JobType != "" { - objectMap["jobType"] = awj.JobType - } - return json.Marshal(objectMap) +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return &grp, true } -// AsAzureIaaSVMJob is the BasicJob implementation for AzureWorkloadJob. -func (awj AzureWorkloadJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { return nil, false } -// AsAzureStorageJob is the BasicJob implementation for AzureWorkloadJob. -func (awj AzureWorkloadJob) AsAzureStorageJob() (*AzureStorageJob, bool) { +// AsRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { return nil, false } -// AsAzureWorkloadJob is the BasicJob implementation for AzureWorkloadJob. -func (awj AzureWorkloadJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { - return &awj, true +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &grp, true } -// AsDpmJob is the BasicJob implementation for AzureWorkloadJob. -func (awj AzureWorkloadJob) AsDpmJob() (*DpmJob, bool) { - return nil, false +// GetProtectedItemQueryObject filters to list backup items. +type GetProtectedItemQueryObject struct { + // Expand - Specifies if the additional information should be provided for this item. + Expand *string `json:"expand,omitempty"` } -// AsMabJob is the BasicJob implementation for AzureWorkloadJob. -func (awj AzureWorkloadJob) AsMabJob() (*MabJob, bool) { - return nil, false -} - -// AsJob is the BasicJob implementation for AzureWorkloadJob. -func (awj AzureWorkloadJob) AsJob() (*Job, bool) { - return nil, false -} - -// AsBasicJob is the BasicJob implementation for AzureWorkloadJob. -func (awj AzureWorkloadJob) AsBasicJob() (BasicJob, bool) { - return &awj, true -} - -// AzureWorkloadJobExtendedInfo azure VM workload-specific additional information for job. -type AzureWorkloadJobExtendedInfo struct { - // TasksList - List of tasks for this job - TasksList *[]AzureWorkloadJobTaskDetails `json:"tasksList,omitempty"` - // PropertyBag - Job properties. - PropertyBag map[string]*string `json:"propertyBag"` - // DynamicErrorMessage - Non localized error message on job execution. - DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` +// IaasVMRecoveryPoint iaaS VM workload specific backup copy. +type IaasVMRecoveryPoint struct { + // RecoveryPointType - READ-ONLY; Type of the backup copy. + RecoveryPointType *string `json:"recoveryPointType,omitempty"` + // RecoveryPointTime - READ-ONLY; Time at which this backup copy was created. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // RecoveryPointAdditionalInfo - READ-ONLY; Additional information associated with this backup copy. + RecoveryPointAdditionalInfo *string `json:"recoveryPointAdditionalInfo,omitempty"` + // SourceVMStorageType - READ-ONLY; Storage type of the VM whose backup copy is created. + SourceVMStorageType *string `json:"sourceVMStorageType,omitempty"` + // IsSourceVMEncrypted - READ-ONLY; Identifies whether the VM was encrypted when the backup copy is created. + IsSourceVMEncrypted *bool `json:"isSourceVMEncrypted,omitempty"` + // KeyAndSecret - Required details for recovering an encrypted VM. Applicable only when IsSourceVMEncrypted is true. + KeyAndSecret *KeyAndSecretDetails `json:"keyAndSecret,omitempty"` + // IsInstantIlrSessionActive - Is the session to recover items from this backup copy still active. + IsInstantIlrSessionActive *bool `json:"isInstantIlrSessionActive,omitempty"` + // RecoveryPointTierDetails - Recovery point tier information. + RecoveryPointTierDetails *[]RecoveryPointTierInformation `json:"recoveryPointTierDetails,omitempty"` + // IsManagedVirtualMachine - Whether VM is with Managed Disks + IsManagedVirtualMachine *bool `json:"isManagedVirtualMachine,omitempty"` + // VirtualMachineSize - Virtual Machine Size + VirtualMachineSize *string `json:"virtualMachineSize,omitempty"` + // OriginalStorageAccountOption - Original Storage Account Option + OriginalStorageAccountOption *bool `json:"originalStorageAccountOption,omitempty"` + // OsType - OS type + OsType *string `json:"osType,omitempty"` + // RecoveryPointDiskConfiguration - Disk configuration + RecoveryPointDiskConfiguration *RecoveryPointDiskConfiguration `json:"recoveryPointDiskConfiguration,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureWorkloadJobExtendedInfo. -func (awjei AzureWorkloadJobExtendedInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) MarshalJSON() ([]byte, error) { + ivrp.ObjectType = ObjectTypeIaasVMRecoveryPoint objectMap := make(map[string]interface{}) - if awjei.TasksList != nil { - objectMap["tasksList"] = awjei.TasksList + if ivrp.KeyAndSecret != nil { + objectMap["keyAndSecret"] = ivrp.KeyAndSecret } - if awjei.PropertyBag != nil { - objectMap["propertyBag"] = awjei.PropertyBag + if ivrp.IsInstantIlrSessionActive != nil { + objectMap["isInstantIlrSessionActive"] = ivrp.IsInstantIlrSessionActive } - if awjei.DynamicErrorMessage != nil { - objectMap["dynamicErrorMessage"] = awjei.DynamicErrorMessage + if ivrp.RecoveryPointTierDetails != nil { + objectMap["recoveryPointTierDetails"] = ivrp.RecoveryPointTierDetails } - return json.Marshal(objectMap) -} - -// AzureWorkloadJobTaskDetails azure VM workload specific job task details. -type AzureWorkloadJobTaskDetails struct { - // TaskID - The task display name. - TaskID *string `json:"taskId,omitempty"` - // Status - The status. - Status *string `json:"status,omitempty"` -} - -// BasicAzureWorkloadPointInTimeRecoveryPoint recovery point specific to PointInTime -type BasicAzureWorkloadPointInTimeRecoveryPoint interface { - AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) - AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) -} - -// AzureWorkloadPointInTimeRecoveryPoint recovery point specific to PointInTime -type AzureWorkloadPointInTimeRecoveryPoint struct { - // TimeRanges - List of log ranges - TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created - RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' - Type RestorePointType `json:"type,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` -} - -func unmarshalBasicAzureWorkloadPointInTimeRecoveryPoint(body []byte) (BasicAzureWorkloadPointInTimeRecoveryPoint, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err + if ivrp.IsManagedVirtualMachine != nil { + objectMap["isManagedVirtualMachine"] = ivrp.IsManagedVirtualMachine } - - switch m["objectType"] { - case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): - var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awshpitrp) - return awshpitrp, err - default: - var awpitrp AzureWorkloadPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awpitrp) - return awpitrp, err + if ivrp.VirtualMachineSize != nil { + objectMap["virtualMachineSize"] = ivrp.VirtualMachineSize } -} -func unmarshalBasicAzureWorkloadPointInTimeRecoveryPointArray(body []byte) ([]BasicAzureWorkloadPointInTimeRecoveryPoint, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err + if ivrp.OriginalStorageAccountOption != nil { + objectMap["originalStorageAccountOption"] = ivrp.OriginalStorageAccountOption } - - awpitrpArray := make([]BasicAzureWorkloadPointInTimeRecoveryPoint, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awpitrp, err := unmarshalBasicAzureWorkloadPointInTimeRecoveryPoint(*rawMessage) - if err != nil { - return nil, err - } - awpitrpArray[index] = awpitrp + if ivrp.OsType != nil { + objectMap["osType"] = ivrp.OsType } - return awpitrpArray, nil -} - -// MarshalJSON is the custom marshaler for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { - awpitrp.ObjectType = ObjectTypeAzureWorkloadPointInTimeRecoveryPoint - objectMap := make(map[string]interface{}) - if awpitrp.TimeRanges != nil { - objectMap["timeRanges"] = awpitrp.TimeRanges + if ivrp.RecoveryPointDiskConfiguration != nil { + objectMap["recoveryPointDiskConfiguration"] = ivrp.RecoveryPointDiskConfiguration } - if awpitrp.ObjectType != "" { - objectMap["objectType"] = awpitrp.ObjectType + if ivrp.ObjectType != "" { + objectMap["objectType"] = ivrp.ObjectType } return json.Marshal(objectMap) } -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { return nil, false } -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return &awpitrp, true +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false } -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return &awpitrp, true +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false } -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { return nil, false } -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return &awpitrp, true +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return nil, false } -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { return nil, false } -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { return nil, false } -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { return nil, false } -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { return nil, false } -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return nil, false +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return &ivrp, true } -// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { +// AsRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { return nil, false } -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &awpitrp, true +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &ivrp, true } -// AzureWorkloadPointInTimeRestoreRequest azureWorkload SAP Hana -specific restore. Specifically for -// PointInTime/Log restore -type AzureWorkloadPointInTimeRestoreRequest struct { - // PointInTime - PointInTime value - PointInTime *date.Time `json:"pointInTime,omitempty"` +// IaasVMRestoreRequest iaaS VM workload-specific restore. +type IaasVMRestoreRequest struct { + // RecoveryPointID - ID of the backup copy to be recovered. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + // SourceResourceID - Fully qualified ARM ID of the VM which is being recovered. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PropertyBag - Workload specific property bag. - PropertyBag map[string]*string `json:"propertyBag"` - // TargetInfo - Details of target database - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' - RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { - awpitrr.ObjectType = ObjectTypeAzureWorkloadPointInTimeRestoreRequest - objectMap := make(map[string]interface{}) - if awpitrr.PointInTime != nil { - objectMap["pointInTime"] = awpitrr.PointInTime - } - if awpitrr.RecoveryType != "" { - objectMap["recoveryType"] = awpitrr.RecoveryType - } - if awpitrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = awpitrr.SourceResourceID - } - if awpitrr.PropertyBag != nil { - objectMap["propertyBag"] = awpitrr.PropertyBag - } - if awpitrr.TargetInfo != nil { - objectMap["targetInfo"] = awpitrr.TargetInfo - } - if awpitrr.RecoveryMode != "" { - objectMap["recoveryMode"] = awpitrr.RecoveryMode + // TargetVirtualMachineID - This is the complete ARM Id of the VM that will be created. + // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` + // TargetResourceGroupID - This is the ARM Id of the resource group that you want to create for this Virtual machine and other artifacts. + // For e.g. /subscriptions/{subId}/resourcegroups/{rg} + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // StorageAccountID - Fully qualified ARM ID of the storage account to which the VM has to be restored. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // VirtualNetworkID - This is the virtual network Id of the vnet that will be attached to the virtual machine. + // User will be validated for join action permissions in the linked access. + VirtualNetworkID *string `json:"virtualNetworkId,omitempty"` + // SubnetID - Subnet ID, is the subnet ID associated with the to be restored VM. For Classic VMs it would be + // {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager VMs it would be ARM resource ID used to represent + // the subnet. + SubnetID *string `json:"subnetId,omitempty"` + // TargetDomainNameID - Fully qualified ARM ID of the domain name to be associated to the VM being restored. This applies only to Classic + // Virtual Machines. + TargetDomainNameID *string `json:"targetDomainNameId,omitempty"` + // Region - Region in which the virtual machine is restored. + Region *string `json:"region,omitempty"` + // AffinityGroup - Affinity group associated to VM to be restored. Used only for Classic Compute Virtual Machines. + AffinityGroup *string `json:"affinityGroup,omitempty"` + // CreateNewCloudService - Should a new cloud service be created while restoring the VM. If this is false, VM will be restored to the same + // cloud service as it was at the time of backup. + CreateNewCloudService *bool `json:"createNewCloudService,omitempty"` + // OriginalStorageAccountOption - Original Storage Account Option + OriginalStorageAccountOption *bool `json:"originalStorageAccountOption,omitempty"` + // EncryptionDetails - Details needed if the VM was encrypted at the time of backup. + EncryptionDetails *EncryptionDetails `json:"encryptionDetails,omitempty"` + // RestoreDiskLunList - List of Disk LUNs for partial restore + RestoreDiskLunList *[]int32 `json:"restoreDiskLunList,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) MarshalJSON() ([]byte, error) { + ivrr.ObjectType = ObjectTypeIaasVMRestoreRequest + objectMap := make(map[string]interface{}) + if ivrr.RecoveryPointID != nil { + objectMap["recoveryPointId"] = ivrr.RecoveryPointID } - if awpitrr.ObjectType != "" { - objectMap["objectType"] = awpitrr.ObjectType + if ivrr.RecoveryType != "" { + objectMap["recoveryType"] = ivrr.RecoveryType + } + if ivrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = ivrr.SourceResourceID + } + if ivrr.TargetVirtualMachineID != nil { + objectMap["targetVirtualMachineId"] = ivrr.TargetVirtualMachineID + } + if ivrr.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = ivrr.TargetResourceGroupID + } + if ivrr.StorageAccountID != nil { + objectMap["storageAccountId"] = ivrr.StorageAccountID + } + if ivrr.VirtualNetworkID != nil { + objectMap["virtualNetworkId"] = ivrr.VirtualNetworkID + } + if ivrr.SubnetID != nil { + objectMap["subnetId"] = ivrr.SubnetID + } + if ivrr.TargetDomainNameID != nil { + objectMap["targetDomainNameId"] = ivrr.TargetDomainNameID + } + if ivrr.Region != nil { + objectMap["region"] = ivrr.Region + } + if ivrr.AffinityGroup != nil { + objectMap["affinityGroup"] = ivrr.AffinityGroup + } + if ivrr.CreateNewCloudService != nil { + objectMap["createNewCloudService"] = ivrr.CreateNewCloudService + } + if ivrr.OriginalStorageAccountOption != nil { + objectMap["originalStorageAccountOption"] = ivrr.OriginalStorageAccountOption + } + if ivrr.EncryptionDetails != nil { + objectMap["encryptionDetails"] = ivrr.EncryptionDetails + } + if ivrr.RestoreDiskLunList != nil { + objectMap["restoreDiskLunList"] = ivrr.RestoreDiskLunList + } + if ivrr.ObjectType != "" { + objectMap["objectType"] = ivrr.ObjectType } return json.Marshal(objectMap) } -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { return nil, false } -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return &awpitrr, true +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return nil, false } -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { return nil, false } -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return &awpitrr, true +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return nil, false } -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { return nil, false } -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { return nil, false } -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { return nil, false } -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { return nil, false } -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { return nil, false } -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { return nil, false } -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { - return nil, false +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return &ivrr, true } -// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { +// AsRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { return nil, false } -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &awpitrr, true +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &ivrr, true } -// BasicAzureWorkloadRecoveryPoint workload specific recovery point, specifically encapsulates full/diff recovery point -type BasicAzureWorkloadRecoveryPoint interface { - AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) - AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) - AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) - AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) - AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) - AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) - AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) - AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) +// InstantRPAdditionalDetails ... +type InstantRPAdditionalDetails struct { + AzureBackupRGNamePrefix *string `json:"azureBackupRGNamePrefix,omitempty"` + AzureBackupRGNameSuffix *string `json:"azureBackupRGNameSuffix,omitempty"` } -// AzureWorkloadRecoveryPoint workload specific recovery point, specifically encapsulates full/diff recovery -// point -type AzureWorkloadRecoveryPoint struct { - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created - RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' - Type RestorePointType `json:"type,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +// BasicJob defines workload agnostic properties for a job. +type BasicJob interface { + AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) + AsAzureStorageJob() (*AzureStorageJob, bool) + AsAzureWorkloadJob() (*AzureWorkloadJob, bool) + AsDpmJob() (*DpmJob, bool) + AsMabJob() (*MabJob, bool) + AsJob() (*Job, bool) } -func unmarshalBasicAzureWorkloadRecoveryPoint(body []byte) (BasicAzureWorkloadRecoveryPoint, error) { +// Job defines workload agnostic properties for a job. +type Job struct { + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' + JobType JobType `json:"jobType,omitempty"` +} + +func unmarshalBasicJob(body []byte) (BasicJob, error) { var m map[string]interface{} err := json.Unmarshal(body, &m) if err != nil { return nil, err } - switch m["objectType"] { - case string(ObjectTypeAzureWorkloadPointInTimeRecoveryPoint): - var awpitrp AzureWorkloadPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awpitrp) - return awpitrp, err - case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): - var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awshpitrp) - return awshpitrp, err - case string(ObjectTypeAzureWorkloadSAPHanaRecoveryPoint): - var awshrp AzureWorkloadSAPHanaRecoveryPoint - err := json.Unmarshal(body, &awshrp) - return awshrp, err - case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): - var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awspitrp) - return awspitrp, err - case string(ObjectTypeAzureWorkloadSQLRecoveryPoint): - var awsrp AzureWorkloadSQLRecoveryPoint - err := json.Unmarshal(body, &awsrp) - return awsrp, err + switch m["jobType"] { + case string(JobTypeAzureIaaSVMJob): + var aisj AzureIaaSVMJob + err := json.Unmarshal(body, &aisj) + return aisj, err + case string(JobTypeAzureStorageJob): + var asj AzureStorageJob + err := json.Unmarshal(body, &asj) + return asj, err + case string(JobTypeAzureWorkloadJob): + var awj AzureWorkloadJob + err := json.Unmarshal(body, &awj) + return awj, err + case string(JobTypeDpmJob): + var dj DpmJob + err := json.Unmarshal(body, &dj) + return dj, err + case string(JobTypeMabJob): + var mj MabJob + err := json.Unmarshal(body, &mj) + return mj, err default: - var awrp AzureWorkloadRecoveryPoint - err := json.Unmarshal(body, &awrp) - return awrp, err + var j Job + err := json.Unmarshal(body, &j) + return j, err } } -func unmarshalBasicAzureWorkloadRecoveryPointArray(body []byte) ([]BasicAzureWorkloadRecoveryPoint, error) { +func unmarshalBasicJobArray(body []byte) ([]BasicJob, error) { var rawMessages []*json.RawMessage err := json.Unmarshal(body, &rawMessages) if err != nil { return nil, err } - awrpArray := make([]BasicAzureWorkloadRecoveryPoint, len(rawMessages)) + jArray := make([]BasicJob, len(rawMessages)) for index, rawMessage := range rawMessages { - awrp, err := unmarshalBasicAzureWorkloadRecoveryPoint(*rawMessage) + j, err := unmarshalBasicJob(*rawMessage) if err != nil { return nil, err } - awrpArray[index] = awrp + jArray[index] = j } - return awrpArray, nil + return jArray, nil } -// MarshalJSON is the custom marshaler for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) MarshalJSON() ([]byte, error) { - awrp.ObjectType = ObjectTypeAzureWorkloadRecoveryPoint +// MarshalJSON is the custom marshaler for Job. +func (j Job) MarshalJSON() ([]byte, error) { + j.JobType = JobTypeJob objectMap := make(map[string]interface{}) - if awrp.ObjectType != "" { - objectMap["objectType"] = awrp.ObjectType + if j.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = j.EntityFriendlyName + } + if j.BackupManagementType != "" { + objectMap["backupManagementType"] = j.BackupManagementType + } + if j.Operation != nil { + objectMap["operation"] = j.Operation + } + if j.Status != nil { + objectMap["status"] = j.Status + } + if j.StartTime != nil { + objectMap["startTime"] = j.StartTime + } + if j.EndTime != nil { + objectMap["endTime"] = j.EndTime + } + if j.ActivityID != nil { + objectMap["activityId"] = j.ActivityID + } + if j.JobType != "" { + objectMap["jobType"] = j.JobType } return json.Marshal(objectMap) } -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { +// AsAzureIaaSVMJob is the BasicJob implementation for Job. +func (j Job) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { return nil, false } -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { +// AsAzureStorageJob is the BasicJob implementation for Job. +func (j Job) AsAzureStorageJob() (*AzureStorageJob, bool) { return nil, false } -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { +// AsAzureWorkloadJob is the BasicJob implementation for Job. +func (j Job) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { return nil, false } -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return &awrp, true -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return &awrp, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { +// AsDpmJob is the BasicJob implementation for Job. +func (j Job) AsDpmJob() (*DpmJob, bool) { return nil, false } -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { +// AsMabJob is the BasicJob implementation for Job. +func (j Job) AsMabJob() (*MabJob, bool) { return nil, false } -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return nil, false +// AsJob is the BasicJob implementation for Job. +func (j Job) AsJob() (*Job, bool) { + return &j, true } -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return nil, false +// AsBasicJob is the BasicJob implementation for Job. +func (j Job) AsBasicJob() (BasicJob, bool) { + return &j, true } -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return nil, false +// JobQueryObject filters to list the jobs. +type JobQueryObject struct { + // Status - Status of the job. Possible values include: 'JobStatusInvalid', 'JobStatusInProgress', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusCompletedWithWarnings', 'JobStatusCancelled', 'JobStatusCancelling' + Status JobStatus `json:"status,omitempty"` + // BackupManagementType - Type of backup management for the job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - Type of operation. Possible values include: 'JobOperationTypeInvalid', 'JobOperationTypeRegister', 'JobOperationTypeUnRegister', 'JobOperationTypeConfigureBackup', 'JobOperationTypeBackup', 'JobOperationTypeRestore', 'JobOperationTypeDisableBackup', 'JobOperationTypeDeleteBackupData', 'JobOperationTypeCrossRegionRestore', 'JobOperationTypeUndelete' + Operation JobOperationType `json:"operation,omitempty"` + // JobID - JobID represents the job uniquely. + JobID *string `json:"jobId,omitempty"` + // StartTime - Job has started at this time. Value is in UTC. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Job has ended at this time. Value is in UTC. + EndTime *date.Time `json:"endTime,omitempty"` } -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { - return nil, false +// JobResource defines workload agnostic properties for a job. +type JobResource struct { + autorest.Response `json:"-"` + // Properties - JobResource properties + Properties BasicJob `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` } -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return nil, false +// MarshalJSON is the custom marshaler for JobResource. +func (jr JobResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = jr.Properties + if jr.Location != nil { + objectMap["location"] = jr.Location + } + if jr.Tags != nil { + objectMap["tags"] = jr.Tags + } + if jr.ETag != nil { + objectMap["eTag"] = jr.ETag + } + return json.Marshal(objectMap) } -// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return nil, false -} +// UnmarshalJSON is the custom unmarshaler for JobResource struct. +func (jr *JobResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicJob(*v) + if err != nil { + return err + } + jr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + jr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + jr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + jr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + jr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + jr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + jr.ETag = &eTag + } + } + } -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &awrp, true + return nil } -// BasicAzureWorkloadRestoreRequest azureWorkload-specific restore. -type BasicAzureWorkloadRestoreRequest interface { - AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) - AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) - AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) - AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) - AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) - AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) - AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) - AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) +// JobResourceList list of Job resources +type JobResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]JobResource `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"` } -// AzureWorkloadRestoreRequest azureWorkload-specific restore. -type AzureWorkloadRestoreRequest struct { - // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PropertyBag - Workload specific property bag. - PropertyBag map[string]*string `json:"propertyBag"` - // TargetInfo - Details of target database - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' - RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +// JobResourceListIterator provides access to a complete listing of JobResource values. +type JobResourceListIterator struct { + i int + page JobResourceListPage } -func unmarshalBasicAzureWorkloadRestoreRequest(body []byte) (BasicAzureWorkloadRestoreRequest, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeAzureWorkloadPointInTimeRestoreRequest): - var awpitrr AzureWorkloadPointInTimeRestoreRequest - err := json.Unmarshal(body, &awpitrr) - return awpitrr, err - case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): - var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest - err := json.Unmarshal(body, &awshpitrr) - return awshpitrr, err - case string(ObjectTypeAzureWorkloadSAPHanaRestoreRequest): - var awshrr AzureWorkloadSAPHanaRestoreRequest - err := json.Unmarshal(body, &awshrr) - return awshrr, err - case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): - var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest - err := json.Unmarshal(body, &awspitrr) - return awspitrr, err - case string(ObjectTypeAzureWorkloadSQLRestoreRequest): - var awsrr AzureWorkloadSQLRestoreRequest - err := json.Unmarshal(body, &awsrr) - return awsrr, err - default: - var awrr AzureWorkloadRestoreRequest - err := json.Unmarshal(body, &awrr) - return awrr, err +// NextWithContext 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 *JobResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } -} -func unmarshalBasicAzureWorkloadRestoreRequestArray(body []byte) ([]BasicAzureWorkloadRestoreRequest, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil } - - awrrArray := make([]BasicAzureWorkloadRestoreRequest, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awrr, err := unmarshalBasicAzureWorkloadRestoreRequest(*rawMessage) - if err != nil { - return nil, err - } - awrrArray[index] = awrr + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err } - return awrrArray, nil + iter.i = 0 + return nil } -// MarshalJSON is the custom marshaler for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) MarshalJSON() ([]byte, error) { - awrr.ObjectType = ObjectTypeAzureWorkloadRestoreRequest - objectMap := make(map[string]interface{}) - if awrr.RecoveryType != "" { - objectMap["recoveryType"] = awrr.RecoveryType - } - if awrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = awrr.SourceResourceID - } - if awrr.PropertyBag != nil { - objectMap["propertyBag"] = awrr.PropertyBag - } - if awrr.TargetInfo != nil { - objectMap["targetInfo"] = awrr.TargetInfo - } - if awrr.RecoveryMode != "" { - objectMap["recoveryMode"] = awrr.RecoveryMode - } - if awrr.ObjectType != "" { - objectMap["objectType"] = awrr.ObjectType - } - return json.Marshal(objectMap) +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *JobResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) } -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return nil, false +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter JobResourceListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) } -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return nil, false +// Response returns the raw server response from the last page request. +func (iter JobResourceListIterator) Response() JobResourceList { + return iter.page.Response() } -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return &awrr, true +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter JobResourceListIterator) Value() JobResource { + if !iter.page.NotDone() { + return JobResource{} + } + return iter.page.Values()[iter.i] } -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return &awrr, true +// Creates a new instance of the JobResourceListIterator type. +func NewJobResourceListIterator(page JobResourceListPage) JobResourceListIterator { + return JobResourceListIterator{page: page} } -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return nil, false +// IsEmpty returns true if the ListResult contains no values. +func (jrl JobResourceList) IsEmpty() bool { + return jrl.Value == nil || len(*jrl.Value) == 0 } -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false +// hasNextLink returns true if the NextLink is not empty. +func (jrl JobResourceList) hasNextLink() bool { + return jrl.NextLink != nil && len(*jrl.NextLink) != 0 } -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false +// jobResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (jrl JobResourceList) jobResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !jrl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(jrl.NextLink))) } -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return nil, false +// JobResourceListPage contains a page of JobResource values. +type JobResourceListPage struct { + fn func(context.Context, JobResourceList) (JobResourceList, error) + jrl JobResourceList } -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { - return nil, false +// NextWithContext 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 *JobResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.jrl) + if err != nil { + return err + } + page.jrl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil } -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { - return nil, false +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *JobResourceListPage) Next() error { + return page.NextWithContext(context.Background()) } -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { - return nil, false +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page JobResourceListPage) NotDone() bool { + return !page.jrl.IsEmpty() } -// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return nil, false +// Response returns the raw server response from the last page request. +func (page JobResourceListPage) Response() JobResourceList { + return page.jrl } -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &awrr, true +// Values returns the slice of values for the current page or nil if there are no values. +func (page JobResourceListPage) Values() []JobResource { + if page.jrl.IsEmpty() { + return nil + } + return *page.jrl.Value } -// AzureWorkloadSAPHanaPointInTimeRecoveryPoint recovery point specific to PointInTime in SAPHana -type AzureWorkloadSAPHanaPointInTimeRecoveryPoint struct { - // TimeRanges - List of log ranges - TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created - RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' - Type RestorePointType `json:"type,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +// Creates a new instance of the JobResourceListPage type. +func NewJobResourceListPage(cur JobResourceList, getNextPage func(context.Context, JobResourceList) (JobResourceList, error)) JobResourceListPage { + return JobResourceListPage{ + fn: getNextPage, + jrl: cur, + } } -// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { - awshpitrp.ObjectType = ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint - objectMap := make(map[string]interface{}) - if awshpitrp.TimeRanges != nil { - objectMap["timeRanges"] = awshpitrp.TimeRanges - } - if awshpitrp.ObjectType != "" { - objectMap["objectType"] = awshpitrp.ObjectType - } - return json.Marshal(objectMap) +// KEKDetails KEK is encryption key for BEK. +type KEKDetails struct { + // KeyURL - Key is KEK. + KeyURL *string `json:"keyUrl,omitempty"` + // KeyVaultID - Key Vault ID where this Key is stored. + KeyVaultID *string `json:"keyVaultId,omitempty"` + // KeyBackupData - KEK data. + KeyBackupData *string `json:"keyBackupData,omitempty"` } -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false +// KeyAndSecretDetails BEK is bitlocker key. +// KEK is encryption key for BEK +// If the VM was encrypted then we will store following details : +// 1. Secret(BEK) - Url + Backup Data + vaultId. +// 2. Key(KEK) - Url + Backup Data + vaultId. +// 3. EncryptionMechanism +// BEK and KEK can potentially have different vault ids. +type KeyAndSecretDetails struct { + // KekDetails - KEK is encryption key for BEK. + KekDetails *KEKDetails `json:"kekDetails,omitempty"` + // BekDetails - BEK is bitlocker encryption key. + BekDetails *BEKDetails `json:"bekDetails,omitempty"` + // EncryptionMechanism - Encryption mechanism: None/ SinglePass/ DoublePass + EncryptionMechanism *string `json:"encryptionMechanism,omitempty"` } -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return &awshpitrp, true -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return &awshpitrp, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return &awshpitrp, true -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return nil, false +// KPIResourceHealthDetails KPI Resource Health Details +type KPIResourceHealthDetails struct { + // ResourceHealthStatus - Resource Health Status. Possible values include: 'ResourceHealthStatusHealthy', 'ResourceHealthStatusTransientDegraded', 'ResourceHealthStatusPersistentDegraded', 'ResourceHealthStatusTransientUnhealthy', 'ResourceHealthStatusPersistentUnhealthy', 'ResourceHealthStatusInvalid' + ResourceHealthStatus ResourceHealthStatus `json:"resourceHealthStatus,omitempty"` + // ResourceHealthDetails - Resource Health Status + ResourceHealthDetails *[]ResourceHealthDetails `json:"resourceHealthDetails,omitempty"` } -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return nil, false +// LogSchedulePolicy log policy schedule. +type LogSchedulePolicy struct { + // ScheduleFrequencyInMins - Frequency of the log schedule operation of this policy in minutes. + ScheduleFrequencyInMins *int32 `json:"scheduleFrequencyInMins,omitempty"` + // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' + SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` } -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return nil, false +// MarshalJSON is the custom marshaler for LogSchedulePolicy. +func (lsp LogSchedulePolicy) MarshalJSON() ([]byte, error) { + lsp.SchedulePolicyType = SchedulePolicyTypeLogSchedulePolicy + objectMap := make(map[string]interface{}) + if lsp.ScheduleFrequencyInMins != nil { + objectMap["scheduleFrequencyInMins"] = lsp.ScheduleFrequencyInMins + } + if lsp.SchedulePolicyType != "" { + objectMap["schedulePolicyType"] = lsp.SchedulePolicyType + } + return json.Marshal(objectMap) } -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return nil, false +// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. +func (lsp LogSchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { + return &lsp, true } -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { +// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. +func (lsp LogSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { return nil, false } -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { +// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. +func (lsp LogSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { return nil, false } -// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { +// AsSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. +func (lsp LogSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { return nil, false } -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &awshpitrp, true +// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. +func (lsp LogSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { + return &lsp, true } -// AzureWorkloadSAPHanaPointInTimeRestoreRequest azureWorkload SAP Hana -specific restore. Specifically for -// PointInTime/Log restore -type AzureWorkloadSAPHanaPointInTimeRestoreRequest struct { - // PointInTime - PointInTime value - PointInTime *date.Time `json:"pointInTime,omitempty"` - // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PropertyBag - Workload specific property bag. - PropertyBag map[string]*string `json:"propertyBag"` - // TargetInfo - Details of target database - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' - RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +// LongTermRetentionPolicy long term retention policy. +type LongTermRetentionPolicy struct { + // DailySchedule - Daily retention schedule of the protection policy. + DailySchedule *DailyRetentionSchedule `json:"dailySchedule,omitempty"` + // WeeklySchedule - Weekly retention schedule of the protection policy. + WeeklySchedule *WeeklyRetentionSchedule `json:"weeklySchedule,omitempty"` + // MonthlySchedule - Monthly retention schedule of the protection policy. + MonthlySchedule *MonthlyRetentionSchedule `json:"monthlySchedule,omitempty"` + // YearlySchedule - Yearly retention schedule of the protection policy. + YearlySchedule *YearlyRetentionSchedule `json:"yearlySchedule,omitempty"` + // RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy' + RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { - awshpitrr.ObjectType = ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest +// MarshalJSON is the custom marshaler for LongTermRetentionPolicy. +func (ltrp LongTermRetentionPolicy) MarshalJSON() ([]byte, error) { + ltrp.RetentionPolicyType = RetentionPolicyTypeLongTermRetentionPolicy objectMap := make(map[string]interface{}) - if awshpitrr.PointInTime != nil { - objectMap["pointInTime"] = awshpitrr.PointInTime - } - if awshpitrr.RecoveryType != "" { - objectMap["recoveryType"] = awshpitrr.RecoveryType - } - if awshpitrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = awshpitrr.SourceResourceID + if ltrp.DailySchedule != nil { + objectMap["dailySchedule"] = ltrp.DailySchedule } - if awshpitrr.PropertyBag != nil { - objectMap["propertyBag"] = awshpitrr.PropertyBag + if ltrp.WeeklySchedule != nil { + objectMap["weeklySchedule"] = ltrp.WeeklySchedule } - if awshpitrr.TargetInfo != nil { - objectMap["targetInfo"] = awshpitrr.TargetInfo + if ltrp.MonthlySchedule != nil { + objectMap["monthlySchedule"] = ltrp.MonthlySchedule } - if awshpitrr.RecoveryMode != "" { - objectMap["recoveryMode"] = awshpitrr.RecoveryMode + if ltrp.YearlySchedule != nil { + objectMap["yearlySchedule"] = ltrp.YearlySchedule } - if awshpitrr.ObjectType != "" { - objectMap["objectType"] = awshpitrr.ObjectType + if ltrp.RetentionPolicyType != "" { + objectMap["retentionPolicyType"] = ltrp.RetentionPolicyType } return json.Marshal(objectMap) } -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return nil, false +// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. +func (ltrp LongTermRetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) { + return <rp, true } -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { +// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. +func (ltrp LongTermRetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) { return nil, false } -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { +// AsRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. +func (ltrp LongTermRetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) { return nil, false } -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return &awshpitrr, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return &awshpitrr, true -} - -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false +// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. +func (ltrp LongTermRetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) { + return <rp, true } -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return &awshpitrr, true +// LongTermSchedulePolicy long term policy schedule. +type LongTermSchedulePolicy struct { + // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' + SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` } -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return nil, false +// MarshalJSON is the custom marshaler for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) MarshalJSON() ([]byte, error) { + ltsp.SchedulePolicyType = SchedulePolicyTypeLongTermSchedulePolicy + objectMap := make(map[string]interface{}) + if ltsp.SchedulePolicyType != "" { + objectMap["schedulePolicyType"] = ltsp.SchedulePolicyType + } + return json.Marshal(objectMap) } -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { +// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { return nil, false } -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { - return nil, false +// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { + return <sp, true } -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { +// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { return nil, false } -// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { +// AsSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { return nil, false } -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &awshpitrr, true +// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { + return <sp, true } -// AzureWorkloadSAPHanaRecoveryPoint sAPHana specific recoverypoint, specifically encapsulates full/diff -// recoverypoints -type AzureWorkloadSAPHanaRecoveryPoint struct { - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created - RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' - Type RestorePointType `json:"type,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +// MabErrorInfo MAB workload-specific error information. +type MabErrorInfo struct { + // ErrorString - READ-ONLY; Localized error string. + ErrorString *string `json:"errorString,omitempty"` + // Recommendations - READ-ONLY; List of localized recommendations. + Recommendations *[]string `json:"recommendations,omitempty"` } -// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) MarshalJSON() ([]byte, error) { - awshrp.ObjectType = ObjectTypeAzureWorkloadSAPHanaRecoveryPoint +// MarshalJSON is the custom marshaler for MabErrorInfo. +func (mei MabErrorInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if awshrp.ObjectType != "" { - objectMap["objectType"] = awshrp.ObjectType - } return json.Marshal(objectMap) } -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return nil, false -} +// MabFileFolderProtectedItem MAB workload-specific backup item. +type MabFileFolderProtectedItem struct { + // FriendlyName - Friendly name of this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ComputerName - Name of the computer associated with this backup item. + ComputerName *string `json:"computerName,omitempty"` + // LastBackupStatus - Status of last backup operation. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // ProtectionState - Protected, ProtectionStopped, IRPending or ProtectionError + ProtectionState *string `json:"protectionState,omitempty"` + // DeferredDeleteSyncTimeInUTC - Sync time for deferred deletion in UTC + DeferredDeleteSyncTimeInUTC *int64 `json:"deferredDeleteSyncTimeInUTC,omitempty"` + // ExtendedInfo - Additional information with this backup item. + ExtendedInfo *MabFileFolderProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return &awshrp, true +// MarshalJSON is the custom marshaler for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) MarshalJSON() ([]byte, error) { + mffpi.ProtectedItemType = ProtectedItemTypeMabFileFolderProtectedItem + objectMap := make(map[string]interface{}) + if mffpi.FriendlyName != nil { + objectMap["friendlyName"] = mffpi.FriendlyName + } + if mffpi.ComputerName != nil { + objectMap["computerName"] = mffpi.ComputerName + } + if mffpi.LastBackupStatus != nil { + objectMap["lastBackupStatus"] = mffpi.LastBackupStatus + } + if mffpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = mffpi.LastBackupTime + } + if mffpi.ProtectionState != nil { + objectMap["protectionState"] = mffpi.ProtectionState + } + if mffpi.DeferredDeleteSyncTimeInUTC != nil { + objectMap["deferredDeleteSyncTimeInUTC"] = mffpi.DeferredDeleteSyncTimeInUTC + } + if mffpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = mffpi.ExtendedInfo + } + if mffpi.BackupManagementType != "" { + objectMap["backupManagementType"] = mffpi.BackupManagementType + } + if mffpi.WorkloadType != "" { + objectMap["workloadType"] = mffpi.WorkloadType + } + if mffpi.ContainerName != nil { + objectMap["containerName"] = mffpi.ContainerName + } + if mffpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = mffpi.SourceResourceID + } + if mffpi.PolicyID != nil { + objectMap["policyId"] = mffpi.PolicyID + } + if mffpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = mffpi.LastRecoveryPoint + } + if mffpi.BackupSetName != nil { + objectMap["backupSetName"] = mffpi.BackupSetName + } + if mffpi.CreateMode != "" { + objectMap["createMode"] = mffpi.CreateMode + } + if mffpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = mffpi.DeferredDeleteTimeInUTC + } + if mffpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = mffpi.IsScheduledForDeferredDelete + } + if mffpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = mffpi.DeferredDeleteTimeRemaining + } + if mffpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = mffpi.IsDeferredDeleteScheduleUpcoming + } + if mffpi.IsRehydrate != nil { + objectMap["isRehydrate"] = mffpi.IsRehydrate + } + if mffpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = mffpi.ProtectedItemType + } + return json.Marshal(objectMap) } -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { return nil, false } -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return &awshrp, true +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false } -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { return nil, false } -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { return nil, false } -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { return nil, false } -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { return nil, false } -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { return nil, false } -// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { return nil, false } -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &awshrp, true +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false } -// BasicAzureWorkloadSAPHanaRestoreRequest azureWorkload SAP Hana-specific restore. -type BasicAzureWorkloadSAPHanaRestoreRequest interface { - AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) - AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false } -// AzureWorkloadSAPHanaRestoreRequest azureWorkload SAP Hana-specific restore. -type AzureWorkloadSAPHanaRestoreRequest struct { - // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PropertyBag - Workload specific property bag. - PropertyBag map[string]*string `json:"propertyBag"` - // TargetInfo - Details of target database - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' - RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false } -func unmarshalBasicAzureWorkloadSAPHanaRestoreRequest(body []byte) (BasicAzureWorkloadSAPHanaRestoreRequest, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): - var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest - err := json.Unmarshal(body, &awshpitrr) - return awshpitrr, err - default: - var awshrr AzureWorkloadSAPHanaRestoreRequest - err := json.Unmarshal(body, &awshrr) - return awshrr, err - } +// AsDPMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false } -func unmarshalBasicAzureWorkloadSAPHanaRestoreRequestArray(body []byte) ([]BasicAzureWorkloadSAPHanaRestoreRequest, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - awshrrArray := make([]BasicAzureWorkloadSAPHanaRestoreRequest, len(rawMessages)) - for index, rawMessage := range rawMessages { - awshrr, err := unmarshalBasicAzureWorkloadSAPHanaRestoreRequest(*rawMessage) - if err != nil { - return nil, err - } - awshrrArray[index] = awshrr - } - return awshrrArray, nil +// AsGenericProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) MarshalJSON() ([]byte, error) { - awshrr.ObjectType = ObjectTypeAzureWorkloadSAPHanaRestoreRequest - objectMap := make(map[string]interface{}) - if awshrr.RecoveryType != "" { - objectMap["recoveryType"] = awshrr.RecoveryType - } - if awshrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = awshrr.SourceResourceID - } - if awshrr.PropertyBag != nil { - objectMap["propertyBag"] = awshrr.PropertyBag - } - if awshrr.TargetInfo != nil { - objectMap["targetInfo"] = awshrr.TargetInfo - } - if awshrr.RecoveryMode != "" { - objectMap["recoveryMode"] = awshrr.RecoveryMode - } - if awshrr.ObjectType != "" { - objectMap["objectType"] = awshrr.ObjectType - } - return json.Marshal(objectMap) +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return &mffpi, true } -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { +// AsProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { return nil, false } -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return nil, false +// AsBasicProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &mffpi, true } -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return &awshrr, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return &awshrr, true -} - -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return &awshrr, true -} - -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { - return nil, false -} - -// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return nil, false -} - -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &awshrr, true +// MabFileFolderProtectedItemExtendedInfo additional information on the backed up item. +type MabFileFolderProtectedItemExtendedInfo struct { + // LastRefreshedAt - Last time when the agent data synced to service. + LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` + // OldestRecoveryPoint - The oldest backup copy available. + OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` + // RecoveryPointCount - Number of backup copies associated with the backup item. + RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` } -// AzureWorkloadSQLAutoProtectionIntent azure Workload SQL Auto Protection intent item. -type AzureWorkloadSQLAutoProtectionIntent struct { - // WorkloadItemType - Workload item type of the item for which intent is to be set. Possible values include: 'WorkloadItemTypeInvalid', 'WorkloadItemTypeSQLInstance', 'WorkloadItemTypeSQLDataBase', 'WorkloadItemTypeSAPHanaSystem', 'WorkloadItemTypeSAPHanaDatabase', 'WorkloadItemTypeSAPAseSystem', 'WorkloadItemTypeSAPAseDatabase' - WorkloadItemType WorkloadItemType `json:"workloadItemType,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' +// MabJob MAB workload-specific job. +type MabJob struct { + // Duration - Time taken by job to run. + Duration *string `json:"duration,omitempty"` + // ActionsInfo - The state/actions applicable on jobs like cancel/retry. + ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` + // MabServerName - Name of server protecting the DS. + MabServerName *string `json:"mabServerName,omitempty"` + // MabServerType - Server type of MAB container. Possible values include: 'MabServerTypeInvalid', 'MabServerTypeUnknown', 'MabServerTypeIaasVMContainer', 'MabServerTypeIaasVMServiceContainer', 'MabServerTypeDPMContainer', 'MabServerTypeAzureBackupServerContainer', 'MabServerTypeMABContainer', 'MabServerTypeCluster', 'MabServerTypeAzureSQLContainer', 'MabServerTypeWindows', 'MabServerTypeVCenter', 'MabServerTypeVMAppContainer', 'MabServerTypeSQLAGWorkLoadContainer', 'MabServerTypeStorageContainer', 'MabServerTypeGenericContainer' + MabServerType MabServerType `json:"mabServerType,omitempty"` + // WorkloadType - Workload type of backup item. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` + // ErrorDetails - The errors. + ErrorDetails *[]MabErrorInfo `json:"errorDetails,omitempty"` + // ExtendedInfo - Additional information on the job. + ExtendedInfo *MabJobExtendedInfo `json:"extendedInfo,omitempty"` + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId - ItemID *string `json:"itemId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' - ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' + JobType JobType `json:"jobType,omitempty"` } -// MarshalJSON is the custom marshaler for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) MarshalJSON() ([]byte, error) { - awsapi.ProtectionIntentItemType = ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent +// MarshalJSON is the custom marshaler for MabJob. +func (mj MabJob) MarshalJSON() ([]byte, error) { + mj.JobType = JobTypeMabJob objectMap := make(map[string]interface{}) - if awsapi.WorkloadItemType != "" { - objectMap["workloadItemType"] = awsapi.WorkloadItemType + if mj.Duration != nil { + objectMap["duration"] = mj.Duration + } + if mj.ActionsInfo != nil { + objectMap["actionsInfo"] = mj.ActionsInfo + } + if mj.MabServerName != nil { + objectMap["mabServerName"] = mj.MabServerName + } + if mj.MabServerType != "" { + objectMap["mabServerType"] = mj.MabServerType + } + if mj.WorkloadType != "" { + objectMap["workloadType"] = mj.WorkloadType + } + if mj.ErrorDetails != nil { + objectMap["errorDetails"] = mj.ErrorDetails + } + if mj.ExtendedInfo != nil { + objectMap["extendedInfo"] = mj.ExtendedInfo + } + if mj.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = mj.EntityFriendlyName + } + if mj.BackupManagementType != "" { + objectMap["backupManagementType"] = mj.BackupManagementType } - if awsapi.BackupManagementType != "" { - objectMap["backupManagementType"] = awsapi.BackupManagementType + if mj.Operation != nil { + objectMap["operation"] = mj.Operation } - if awsapi.SourceResourceID != nil { - objectMap["sourceResourceId"] = awsapi.SourceResourceID + if mj.Status != nil { + objectMap["status"] = mj.Status } - if awsapi.ItemID != nil { - objectMap["itemId"] = awsapi.ItemID + if mj.StartTime != nil { + objectMap["startTime"] = mj.StartTime } - if awsapi.PolicyID != nil { - objectMap["policyId"] = awsapi.PolicyID + if mj.EndTime != nil { + objectMap["endTime"] = mj.EndTime } - if awsapi.ProtectionState != "" { - objectMap["protectionState"] = awsapi.ProtectionState + if mj.ActivityID != nil { + objectMap["activityId"] = mj.ActivityID } - if awsapi.ProtectionIntentItemType != "" { - objectMap["protectionIntentItemType"] = awsapi.ProtectionIntentItemType + if mj.JobType != "" { + objectMap["jobType"] = mj.JobType } return json.Marshal(objectMap) } -// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { +// AsAzureIaaSVMJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { return nil, false } -// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { - return &awsapi, true -} - -// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { +// AsAzureStorageJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsAzureStorageJob() (*AzureStorageJob, bool) { return nil, false } -// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { +// AsAzureWorkloadJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { return nil, false } -// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { - return &awsapi, true +// AsDpmJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsDpmJob() (*DpmJob, bool) { + return nil, false } -// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { - return &awsapi, true +// AsMabJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsMabJob() (*MabJob, bool) { + return &mj, true } -// AsProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { +// AsJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsJob() (*Job, bool) { return nil, false } -// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { - return &awsapi, true +// AsBasicJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsBasicJob() (BasicJob, bool) { + return &mj, true } -// AzureWorkloadSQLPointInTimeRecoveryPoint recovery point specific to PointInTime -type AzureWorkloadSQLPointInTimeRecoveryPoint struct { - // TimeRanges - List of log ranges - TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` - // ExtendedInfo - Extended Info that provides data directory details. Will be populated in two cases: - // When a specific recovery point is accessed using GetRecoveryPoint - // Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter - ExtendedInfo *AzureWorkloadSQLRecoveryPointExtendedInfo `json:"extendedInfo,omitempty"` - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created - RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' - Type RestorePointType `json:"type,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +// MabJobExtendedInfo additional information for the MAB workload-specific job. +type MabJobExtendedInfo struct { + // TasksList - List of tasks for this job. + TasksList *[]MabJobTaskDetails `json:"tasksList,omitempty"` + // PropertyBag - The job properties. + PropertyBag map[string]*string `json:"propertyBag"` + // DynamicErrorMessage - Non localized error message specific to this job. + DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` } -// MarshalJSON is the custom marshaler for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { - awspitrp.ObjectType = ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint +// MarshalJSON is the custom marshaler for MabJobExtendedInfo. +func (mjei MabJobExtendedInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if awspitrp.TimeRanges != nil { - objectMap["timeRanges"] = awspitrp.TimeRanges + if mjei.TasksList != nil { + objectMap["tasksList"] = mjei.TasksList } - if awspitrp.ExtendedInfo != nil { - objectMap["extendedInfo"] = awspitrp.ExtendedInfo + if mjei.PropertyBag != nil { + objectMap["propertyBag"] = mjei.PropertyBag } - if awspitrp.ObjectType != "" { - objectMap["objectType"] = awspitrp.ObjectType + if mjei.DynamicErrorMessage != nil { + objectMap["dynamicErrorMessage"] = mjei.DynamicErrorMessage } return json.Marshal(objectMap) } -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return &awspitrp, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return &awspitrp, true -} - -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return &awspitrp, true +// MabJobTaskDetails MAB workload-specific job task details. +type MabJobTaskDetails struct { + // TaskID - The task display name. + TaskID *string `json:"taskId,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // Duration - Time elapsed for task. + Duration *string `json:"duration,omitempty"` + // Status - The status. + Status *string `json:"status,omitempty"` } -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { - return nil, false -} - -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return nil, false -} - -// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return nil, false -} - -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &awspitrp, true -} - -// AzureWorkloadSQLPointInTimeRestoreRequest azureWorkload SQL -specific restore. Specifically for -// PointInTime/Log restore -type AzureWorkloadSQLPointInTimeRestoreRequest struct { - // PointInTime - PointInTime value - PointInTime *date.Time `json:"pointInTime,omitempty"` - // ShouldUseAlternateTargetLocation - Default option set to true. If this is set to false, alternate data directory must be provided - ShouldUseAlternateTargetLocation *bool `json:"shouldUseAlternateTargetLocation,omitempty"` - // IsNonRecoverable - SQL specific property where user can chose to set no-recovery when restore operation is tried - IsNonRecoverable *bool `json:"isNonRecoverable,omitempty"` - // AlternateDirectoryPaths - Data directory details - AlternateDirectoryPaths *[]SQLDataDirectoryMapping `json:"alternateDirectoryPaths,omitempty"` - // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PropertyBag - Workload specific property bag. - PropertyBag map[string]*string `json:"propertyBag"` - // TargetInfo - Details of target database - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' - RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { - awspitrr.ObjectType = ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest - objectMap := make(map[string]interface{}) - if awspitrr.PointInTime != nil { - objectMap["pointInTime"] = awspitrr.PointInTime - } - if awspitrr.ShouldUseAlternateTargetLocation != nil { - objectMap["shouldUseAlternateTargetLocation"] = awspitrr.ShouldUseAlternateTargetLocation - } - if awspitrr.IsNonRecoverable != nil { - objectMap["isNonRecoverable"] = awspitrr.IsNonRecoverable - } - if awspitrr.AlternateDirectoryPaths != nil { - objectMap["alternateDirectoryPaths"] = awspitrr.AlternateDirectoryPaths - } - if awspitrr.RecoveryType != "" { - objectMap["recoveryType"] = awspitrr.RecoveryType - } - if awspitrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = awspitrr.SourceResourceID - } - if awspitrr.PropertyBag != nil { - objectMap["propertyBag"] = awspitrr.PropertyBag - } - if awspitrr.TargetInfo != nil { - objectMap["targetInfo"] = awspitrr.TargetInfo - } - if awspitrr.RecoveryMode != "" { - objectMap["recoveryMode"] = awspitrr.RecoveryMode - } - if awspitrr.ObjectType != "" { - objectMap["objectType"] = awspitrr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return &awspitrr, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return &awspitrr, true -} - -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { - return &awspitrr, true -} - -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { - return nil, false -} - -// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return nil, false -} - -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &awspitrr, true -} - -// BasicAzureWorkloadSQLRecoveryPoint SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint -// along with extended info -type BasicAzureWorkloadSQLRecoveryPoint interface { - AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) - AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) -} - -// AzureWorkloadSQLRecoveryPoint SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint -// along with extended info -type AzureWorkloadSQLRecoveryPoint struct { - // ExtendedInfo - Extended Info that provides data directory details. Will be populated in two cases: - // When a specific recovery point is accessed using GetRecoveryPoint - // Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter - ExtendedInfo *AzureWorkloadSQLRecoveryPointExtendedInfo `json:"extendedInfo,omitempty"` - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created - RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' - Type RestorePointType `json:"type,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` -} - -func unmarshalBasicAzureWorkloadSQLRecoveryPoint(body []byte) (BasicAzureWorkloadSQLRecoveryPoint, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): - var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awspitrp) - return awspitrp, err - default: - var awsrp AzureWorkloadSQLRecoveryPoint - err := json.Unmarshal(body, &awsrp) - return awsrp, err - } -} -func unmarshalBasicAzureWorkloadSQLRecoveryPointArray(body []byte) ([]BasicAzureWorkloadSQLRecoveryPoint, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - awsrpArray := make([]BasicAzureWorkloadSQLRecoveryPoint, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awsrp, err := unmarshalBasicAzureWorkloadSQLRecoveryPoint(*rawMessage) - if err != nil { - return nil, err - } - awsrpArray[index] = awsrp - } - return awsrpArray, nil -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) MarshalJSON() ([]byte, error) { - awsrp.ObjectType = ObjectTypeAzureWorkloadSQLRecoveryPoint - objectMap := make(map[string]interface{}) - if awsrp.ExtendedInfo != nil { - objectMap["extendedInfo"] = awsrp.ExtendedInfo - } - if awsrp.ObjectType != "" { - objectMap["objectType"] = awsrp.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return &awsrp, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return &awsrp, true -} - -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return &awsrp, true -} - -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { - return nil, false -} - -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return nil, false -} - -// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return nil, false -} - -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &awsrp, true -} - -// AzureWorkloadSQLRecoveryPointExtendedInfo extended info class details -type AzureWorkloadSQLRecoveryPointExtendedInfo struct { - // DataDirectoryTimeInUTC - READ-ONLY; UTC time at which data directory info was captured - DataDirectoryTimeInUTC *date.Time `json:"dataDirectoryTimeInUTC,omitempty"` - // DataDirectoryPaths - READ-ONLY; List of data directory paths during restore operation. - DataDirectoryPaths *[]SQLDataDirectory `json:"dataDirectoryPaths,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSQLRecoveryPointExtendedInfo. -func (awsrpei AzureWorkloadSQLRecoveryPointExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// BasicAzureWorkloadSQLRestoreRequest azureWorkload SQL -specific restore. Specifically for full/diff restore -type BasicAzureWorkloadSQLRestoreRequest interface { - AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) - AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) -} - -// AzureWorkloadSQLRestoreRequest azureWorkload SQL -specific restore. Specifically for full/diff restore -type AzureWorkloadSQLRestoreRequest struct { - // ShouldUseAlternateTargetLocation - Default option set to true. If this is set to false, alternate data directory must be provided - ShouldUseAlternateTargetLocation *bool `json:"shouldUseAlternateTargetLocation,omitempty"` - // IsNonRecoverable - SQL specific property where user can chose to set no-recovery when restore operation is tried - IsNonRecoverable *bool `json:"isNonRecoverable,omitempty"` - // AlternateDirectoryPaths - Data directory details - AlternateDirectoryPaths *[]SQLDataDirectoryMapping `json:"alternateDirectoryPaths,omitempty"` - // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PropertyBag - Workload specific property bag. - PropertyBag map[string]*string `json:"propertyBag"` - // TargetInfo - Details of target database - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' - RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` -} - -func unmarshalBasicAzureWorkloadSQLRestoreRequest(body []byte) (BasicAzureWorkloadSQLRestoreRequest, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): - var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest - err := json.Unmarshal(body, &awspitrr) - return awspitrr, err - default: - var awsrr AzureWorkloadSQLRestoreRequest - err := json.Unmarshal(body, &awsrr) - return awsrr, err - } -} -func unmarshalBasicAzureWorkloadSQLRestoreRequestArray(body []byte) ([]BasicAzureWorkloadSQLRestoreRequest, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - awsrrArray := make([]BasicAzureWorkloadSQLRestoreRequest, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awsrr, err := unmarshalBasicAzureWorkloadSQLRestoreRequest(*rawMessage) - if err != nil { - return nil, err - } - awsrrArray[index] = awsrr - } - return awsrrArray, nil -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) MarshalJSON() ([]byte, error) { - awsrr.ObjectType = ObjectTypeAzureWorkloadSQLRestoreRequest - objectMap := make(map[string]interface{}) - if awsrr.ShouldUseAlternateTargetLocation != nil { - objectMap["shouldUseAlternateTargetLocation"] = awsrr.ShouldUseAlternateTargetLocation - } - if awsrr.IsNonRecoverable != nil { - objectMap["isNonRecoverable"] = awsrr.IsNonRecoverable - } - if awsrr.AlternateDirectoryPaths != nil { - objectMap["alternateDirectoryPaths"] = awsrr.AlternateDirectoryPaths - } - if awsrr.RecoveryType != "" { - objectMap["recoveryType"] = awsrr.RecoveryType - } - if awsrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = awsrr.SourceResourceID - } - if awsrr.PropertyBag != nil { - objectMap["propertyBag"] = awsrr.PropertyBag - } - if awsrr.TargetInfo != nil { - objectMap["targetInfo"] = awsrr.TargetInfo - } - if awsrr.RecoveryMode != "" { - objectMap["recoveryMode"] = awsrr.RecoveryMode - } - if awsrr.ObjectType != "" { - objectMap["objectType"] = awsrr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return &awsrr, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { - return &awsrr, true -} - -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { - return &awsrr, true -} - -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { - return nil, false -} - -// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return nil, false -} - -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &awsrr, true -} - -// BEKDetails BEK is bitlocker encryption key. -type BEKDetails struct { - // SecretURL - Secret is BEK. - SecretURL *string `json:"secretUrl,omitempty"` - // SecretVaultID - ID of the Key Vault where this Secret is stored. - SecretVaultID *string `json:"secretVaultId,omitempty"` - // SecretData - BEK data. - SecretData *string `json:"secretData,omitempty"` -} - -// BMSBackupEngineQueryObject query parameters to fetch list of backup engines. -type BMSBackupEngineQueryObject struct { - // Expand - attribute to add extended info - Expand *string `json:"expand,omitempty"` -} - -// BMSBackupEnginesQueryObject query parameters to fetch list of backup engines. -type BMSBackupEnginesQueryObject struct { - // BackupManagementType - Backup management type for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // FriendlyName - Friendly name of the backup engine. - FriendlyName *string `json:"friendlyName,omitempty"` - // Expand - Attribute to add extended info. - Expand *string `json:"expand,omitempty"` -} - -// BMSBackupSummariesQueryObject query parameters to fetch backup summaries. -type BMSBackupSummariesQueryObject struct { - // Type - Backup management type for this container. Possible values include: 'TypeInvalid', 'TypeBackupProtectedItemCountSummary', 'TypeBackupProtectionContainerCountSummary' - Type Type `json:"type,omitempty"` -} - -// BMSContainerQueryObject the query filters that can be used with the list containers API. -type BMSContainerQueryObject struct { - // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // ContainerType - Type of container for filter. Possible values include: 'ContainerTypeInvalid', 'ContainerTypeUnknown', 'ContainerTypeIaasVMContainer', 'ContainerTypeIaasVMServiceContainer', 'ContainerTypeDPMContainer', 'ContainerTypeAzureBackupServerContainer', 'ContainerTypeMABContainer', 'ContainerTypeCluster', 'ContainerTypeAzureSQLContainer', 'ContainerTypeWindows', 'ContainerTypeVCenter', 'ContainerTypeVMAppContainer', 'ContainerTypeSQLAGWorkLoadContainer', 'ContainerTypeStorageContainer', 'ContainerTypeGenericContainer' - ContainerType ContainerType `json:"containerType,omitempty"` - // BackupEngineName - Backup engine name - BackupEngineName *string `json:"backupEngineName,omitempty"` - // FabricName - Fabric name for filter - FabricName *string `json:"fabricName,omitempty"` - // Status - Status of registration of this container with the Recovery Services Vault. - Status *string `json:"status,omitempty"` - // FriendlyName - Friendly name of this container. - FriendlyName *string `json:"friendlyName,omitempty"` -} - -// BMSContainersInquiryQueryObject the query filters that can be used with the inquire container API. -type BMSContainersInquiryQueryObject struct { - // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Workload type for this container. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` -} - -// BMSPOQueryObject filters to list items that can be backed up. -type BMSPOQueryObject struct { - // BackupManagementType - Backup management type. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Workload type. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` - // ContainerName - Full name of the container whose Protectable Objects should be returned. - ContainerName *string `json:"containerName,omitempty"` - // Status - Backup status query parameter. - Status *string `json:"status,omitempty"` - // FriendlyName - Friendly name. - FriendlyName *string `json:"friendlyName,omitempty"` -} - -// BMSRefreshContainersQueryObject the query filters that can be used with the refresh container API. -type BMSRefreshContainersQueryObject struct { - // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` -} - -// BMSRPQueryObject filters to list backup copies. -type BMSRPQueryObject struct { - // StartDate - Backup copies created after this time. - StartDate *date.Time `json:"startDate,omitempty"` - // EndDate - Backup copies created before this time. - EndDate *date.Time `json:"endDate,omitempty"` - // RestorePointQueryType - RestorePoint type. Possible values include: 'RestorePointQueryTypeInvalid', 'RestorePointQueryTypeFull', 'RestorePointQueryTypeLog', 'RestorePointQueryTypeDifferential', 'RestorePointQueryTypeFullAndDifferential', 'RestorePointQueryTypeAll' - RestorePointQueryType RestorePointQueryType `json:"restorePointQueryType,omitempty"` - // ExtendedInfo - In Get Recovery Point, it tells whether extended information about recovery point is asked. - ExtendedInfo *bool `json:"extendedInfo,omitempty"` -} - -// BMSWorkloadItemQueryObject filters to list items that can be backed up. -type BMSWorkloadItemQueryObject struct { - // BackupManagementType - Backup management type. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadItemType - Workload Item type. Possible values include: 'WorkloadItemTypeInvalid', 'WorkloadItemTypeSQLInstance', 'WorkloadItemTypeSQLDataBase', 'WorkloadItemTypeSAPHanaSystem', 'WorkloadItemTypeSAPHanaDatabase', 'WorkloadItemTypeSAPAseSystem', 'WorkloadItemTypeSAPAseDatabase' - WorkloadItemType WorkloadItemType `json:"workloadItemType,omitempty"` - // WorkloadType - Workload type. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` - // ProtectionStatus - Backup status query parameter. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionStatus ProtectionStatus `json:"protectionStatus,omitempty"` -} - -// ClientDiscoveryDisplay localized display information of an operation. -type ClientDiscoveryDisplay struct { - // Provider - Name of the provider for display purposes - Provider *string `json:"provider,omitempty"` - // Resource - ResourceType for which this Operation can be performed. - Resource *string `json:"resource,omitempty"` - // Operation - Operations Name itself. - Operation *string `json:"operation,omitempty"` - // Description - Description of the operation having details of what operation is about. - Description *string `json:"description,omitempty"` -} - -// ClientDiscoveryForLogSpecification class to represent shoebox log specification in json client -// discovery. -type ClientDiscoveryForLogSpecification struct { - // Name - Name for shoebox log specification. - Name *string `json:"name,omitempty"` - // DisplayName - Localized display name - DisplayName *string `json:"displayName,omitempty"` - // BlobDuration - blob duration of shoebox log specification - BlobDuration *string `json:"blobDuration,omitempty"` -} - -// ClientDiscoveryForProperties class to represent shoebox properties in json client discovery. -type ClientDiscoveryForProperties struct { - // ServiceSpecification - Operation properties. - ServiceSpecification *ClientDiscoveryForServiceSpecification `json:"serviceSpecification,omitempty"` -} - -// ClientDiscoveryForServiceSpecification class to represent shoebox service specification in json client -// discovery. -type ClientDiscoveryForServiceSpecification struct { - // LogSpecifications - List of log specifications of this operation. - LogSpecifications *[]ClientDiscoveryForLogSpecification `json:"logSpecifications,omitempty"` -} - -// ClientDiscoveryResponse operations List response which contains list of available APIs. -type ClientDiscoveryResponse struct { - autorest.Response `json:"-"` - // Value - List of available operations. - Value *[]ClientDiscoveryValueForSingleAPI `json:"value,omitempty"` - // NextLink - Link to the next chunk of Response. - NextLink *string `json:"nextLink,omitempty"` -} - -// ClientDiscoveryResponseIterator provides access to a complete listing of -// ClientDiscoveryValueForSingleAPI values. -type ClientDiscoveryResponseIterator struct { - i int - page ClientDiscoveryResponsePage -} - -// NextWithContext 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 *ClientDiscoveryResponseIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ClientDiscoveryResponseIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ClientDiscoveryResponseIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ClientDiscoveryResponseIterator) 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 ClientDiscoveryResponseIterator) Response() ClientDiscoveryResponse { - 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 ClientDiscoveryResponseIterator) Value() ClientDiscoveryValueForSingleAPI { - if !iter.page.NotDone() { - return ClientDiscoveryValueForSingleAPI{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ClientDiscoveryResponseIterator type. -func NewClientDiscoveryResponseIterator(page ClientDiscoveryResponsePage) ClientDiscoveryResponseIterator { - return ClientDiscoveryResponseIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (cdr ClientDiscoveryResponse) IsEmpty() bool { - return cdr.Value == nil || len(*cdr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (cdr ClientDiscoveryResponse) hasNextLink() bool { - return cdr.NextLink != nil && len(*cdr.NextLink) != 0 -} - -// clientDiscoveryResponsePreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cdr ClientDiscoveryResponse) clientDiscoveryResponsePreparer(ctx context.Context) (*http.Request, error) { - if !cdr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cdr.NextLink))) -} - -// ClientDiscoveryResponsePage contains a page of ClientDiscoveryValueForSingleAPI values. -type ClientDiscoveryResponsePage struct { - fn func(context.Context, ClientDiscoveryResponse) (ClientDiscoveryResponse, error) - cdr ClientDiscoveryResponse -} - -// NextWithContext 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 *ClientDiscoveryResponsePage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ClientDiscoveryResponsePage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.cdr) - if err != nil { - return err - } - page.cdr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *ClientDiscoveryResponsePage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ClientDiscoveryResponsePage) NotDone() bool { - return !page.cdr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ClientDiscoveryResponsePage) Response() ClientDiscoveryResponse { - return page.cdr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ClientDiscoveryResponsePage) Values() []ClientDiscoveryValueForSingleAPI { - if page.cdr.IsEmpty() { - return nil - } - return *page.cdr.Value -} - -// Creates a new instance of the ClientDiscoveryResponsePage type. -func NewClientDiscoveryResponsePage(cur ClientDiscoveryResponse, getNextPage func(context.Context, ClientDiscoveryResponse) (ClientDiscoveryResponse, error)) ClientDiscoveryResponsePage { - return ClientDiscoveryResponsePage{ - fn: getNextPage, - cdr: cur, - } -} - -// ClientDiscoveryValueForSingleAPI available operation details. -type ClientDiscoveryValueForSingleAPI struct { - // Name - Name of the Operation. - Name *string `json:"name,omitempty"` - // Display - Contains the localized display information for this particular operation - Display *ClientDiscoveryDisplay `json:"display,omitempty"` - // Origin - The intended executor of the operation;governs the display of the operation in the RBAC UX and the audit logs UX - Origin *string `json:"origin,omitempty"` - // Properties - ShoeBox properties for the given operation. - Properties *ClientDiscoveryForProperties `json:"properties,omitempty"` -} - -// ClientScriptForConnect client script details for file / folder restore. -type ClientScriptForConnect struct { - // ScriptContent - File content of the client script for file / folder restore. - ScriptContent *string `json:"scriptContent,omitempty"` - // ScriptExtension - File extension of the client script for file / folder restore - .ps1 , .sh , etc. - ScriptExtension *string `json:"scriptExtension,omitempty"` - // OsType - OS type - Windows, Linux etc. for which this file / folder restore client script works. - OsType *string `json:"osType,omitempty"` - // URL - URL of Executable from where to source the content. If this is not null then ScriptContent should not be used - URL *string `json:"url,omitempty"` - // ScriptNameSuffix - Mandatory suffix that should be added to the name of script that is given for download to user. - // If its null or empty then , ignore it. - ScriptNameSuffix *string `json:"scriptNameSuffix,omitempty"` -} - -// ContainerIdentityInfo container identity information -type ContainerIdentityInfo struct { - // UniqueName - Unique name of the container - UniqueName *string `json:"uniqueName,omitempty"` - // AadTenantID - Protection container identity - AAD Tenant - AadTenantID *string `json:"aadTenantId,omitempty"` - // ServicePrincipalClientID - Protection container identity - AAD Service Principal - ServicePrincipalClientID *string `json:"servicePrincipalClientId,omitempty"` - // Audience - Protection container identity - Audience - Audience *string `json:"audience,omitempty"` -} - -// DailyRetentionFormat daily retention format. -type DailyRetentionFormat struct { - // DaysOfTheMonth - List of days of the month. - DaysOfTheMonth *[]Day `json:"daysOfTheMonth,omitempty"` -} - -// DailyRetentionSchedule daily retention schedule. -type DailyRetentionSchedule struct { - // RetentionTimes - Retention times of retention policy. - RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` - // RetentionDuration - Retention duration of retention Policy. - RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` -} - -// Day day of the week. -type Day struct { - // Date - Date of the month - Date *int32 `json:"date,omitempty"` - // IsLast - Whether Date is last date of month - IsLast *bool `json:"isLast,omitempty"` -} - -// DiskExclusionProperties ... -type DiskExclusionProperties struct { - // DiskLunList - List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. - DiskLunList *[]int32 `json:"diskLunList,omitempty"` - // IsInclusionList - Flag to indicate whether DiskLunList is to be included/ excluded from backup. - IsInclusionList *bool `json:"isInclusionList,omitempty"` -} - -// DiskInformation disk information -type DiskInformation struct { - Lun *int32 `json:"lun,omitempty"` - Name *string `json:"name,omitempty"` -} - -// DistributedNodesInfo this is used to represent the various nodes of the distributed container. -type DistributedNodesInfo struct { - // NodeName - Name of the node under a distributed container. - NodeName *string `json:"nodeName,omitempty"` - // Status - Status of this Node. - // Failed | Succeeded - Status *string `json:"status,omitempty"` - // ErrorDetail - Error Details if the Status is non-success. - ErrorDetail *ErrorDetail `json:"errorDetail,omitempty"` -} - -// DpmBackupEngine data Protection Manager (DPM) specific backup engine. -type DpmBackupEngine struct { - // FriendlyName - Friendly name of the backup engine. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Registration status of the backup engine with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // BackupEngineState - Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} - BackupEngineState *string `json:"backupEngineState,omitempty"` - // HealthStatus - Backup status of the backup engine. - HealthStatus *string `json:"healthStatus,omitempty"` - // CanReRegister - Flag indicating if the backup engine be registered, once already registered. - CanReRegister *bool `json:"canReRegister,omitempty"` - // BackupEngineID - ID of the backup engine. - BackupEngineID *string `json:"backupEngineId,omitempty"` - // DpmVersion - Backup engine version - DpmVersion *string `json:"dpmVersion,omitempty"` - // AzureBackupAgentVersion - Backup agent version - AzureBackupAgentVersion *string `json:"azureBackupAgentVersion,omitempty"` - // IsAzureBackupAgentUpgradeAvailable - To check if backup agent upgrade available - IsAzureBackupAgentUpgradeAvailable *bool `json:"isAzureBackupAgentUpgradeAvailable,omitempty"` - // IsDpmUpgradeAvailable - To check if backup engine upgrade available - IsDpmUpgradeAvailable *bool `json:"isDpmUpgradeAvailable,omitempty"` - // ExtendedInfo - Extended info of the backupengine - ExtendedInfo *EngineExtendedInfo `json:"extendedInfo,omitempty"` - // BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine' - BackupEngineType EngineType `json:"backupEngineType,omitempty"` -} - -// MarshalJSON is the custom marshaler for DpmBackupEngine. -func (dbe DpmBackupEngine) MarshalJSON() ([]byte, error) { - dbe.BackupEngineType = BackupEngineTypeDpmBackupEngine - objectMap := make(map[string]interface{}) - if dbe.FriendlyName != nil { - objectMap["friendlyName"] = dbe.FriendlyName - } - if dbe.BackupManagementType != "" { - objectMap["backupManagementType"] = dbe.BackupManagementType - } - if dbe.RegistrationStatus != nil { - objectMap["registrationStatus"] = dbe.RegistrationStatus - } - if dbe.BackupEngineState != nil { - objectMap["backupEngineState"] = dbe.BackupEngineState - } - if dbe.HealthStatus != nil { - objectMap["healthStatus"] = dbe.HealthStatus - } - if dbe.CanReRegister != nil { - objectMap["canReRegister"] = dbe.CanReRegister - } - if dbe.BackupEngineID != nil { - objectMap["backupEngineId"] = dbe.BackupEngineID - } - if dbe.DpmVersion != nil { - objectMap["dpmVersion"] = dbe.DpmVersion - } - if dbe.AzureBackupAgentVersion != nil { - objectMap["azureBackupAgentVersion"] = dbe.AzureBackupAgentVersion - } - if dbe.IsAzureBackupAgentUpgradeAvailable != nil { - objectMap["isAzureBackupAgentUpgradeAvailable"] = dbe.IsAzureBackupAgentUpgradeAvailable - } - if dbe.IsDpmUpgradeAvailable != nil { - objectMap["isDpmUpgradeAvailable"] = dbe.IsDpmUpgradeAvailable - } - if dbe.ExtendedInfo != nil { - objectMap["extendedInfo"] = dbe.ExtendedInfo - } - if dbe.BackupEngineType != "" { - objectMap["backupEngineType"] = dbe.BackupEngineType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerEngine is the BasicEngineBase implementation for DpmBackupEngine. -func (dbe DpmBackupEngine) AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) { - return nil, false -} - -// AsDpmBackupEngine is the BasicEngineBase implementation for DpmBackupEngine. -func (dbe DpmBackupEngine) AsDpmBackupEngine() (*DpmBackupEngine, bool) { - return &dbe, true -} - -// AsEngineBase is the BasicEngineBase implementation for DpmBackupEngine. -func (dbe DpmBackupEngine) AsEngineBase() (*EngineBase, bool) { - return nil, false -} - -// AsBasicEngineBase is the BasicEngineBase implementation for DpmBackupEngine. -func (dbe DpmBackupEngine) AsBasicEngineBase() (BasicEngineBase, bool) { - return &dbe, true -} - -// BasicDpmContainer DPM workload-specific protection container. -type BasicDpmContainer interface { - AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) - AsDpmContainer() (*DpmContainer, bool) -} - -// DpmContainer DPM workload-specific protection container. -type DpmContainer struct { - // CanReRegister - Specifies whether the container is re-registrable. - CanReRegister *bool `json:"canReRegister,omitempty"` - // ContainerID - ID of container. - ContainerID *string `json:"containerId,omitempty"` - // ProtectedItemCount - Number of protected items in the BackupEngine - ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` - // DpmAgentVersion - Backup engine Agent version - DpmAgentVersion *string `json:"dpmAgentVersion,omitempty"` - // DpmServers - List of BackupEngines protecting the container - DpmServers *[]string `json:"dpmServers,omitempty"` - // UpgradeAvailable - To check if upgrade available - UpgradeAvailable *bool `json:"upgradeAvailable,omitempty"` - // ProtectionStatus - Protection status of the container. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ExtendedInfo - Extended Info of the container. - ExtendedInfo *DPMContainerExtendedInfo `json:"extendedInfo,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -func unmarshalBasicDpmContainer(body []byte) (BasicDpmContainer, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["containerType"] { - case string(ContainerTypeAzureBackupServerContainer1): - var absc AzureBackupServerContainer - err := json.Unmarshal(body, &absc) - return absc, err - default: - var dc DpmContainer - err := json.Unmarshal(body, &dc) - return dc, err - } -} -func unmarshalBasicDpmContainerArray(body []byte) ([]BasicDpmContainer, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - dcArray := make([]BasicDpmContainer, len(rawMessages)) - - for index, rawMessage := range rawMessages { - dc, err := unmarshalBasicDpmContainer(*rawMessage) - if err != nil { - return nil, err - } - dcArray[index] = dc - } - return dcArray, nil -} - -// MarshalJSON is the custom marshaler for DpmContainer. -func (dc DpmContainer) MarshalJSON() ([]byte, error) { - dc.ContainerType = ContainerTypeDPMContainer1 - objectMap := make(map[string]interface{}) - if dc.CanReRegister != nil { - objectMap["canReRegister"] = dc.CanReRegister - } - if dc.ContainerID != nil { - objectMap["containerId"] = dc.ContainerID - } - if dc.ProtectedItemCount != nil { - objectMap["protectedItemCount"] = dc.ProtectedItemCount - } - if dc.DpmAgentVersion != nil { - objectMap["dpmAgentVersion"] = dc.DpmAgentVersion - } - if dc.DpmServers != nil { - objectMap["dpmServers"] = dc.DpmServers - } - if dc.UpgradeAvailable != nil { - objectMap["upgradeAvailable"] = dc.UpgradeAvailable - } - if dc.ProtectionStatus != nil { - objectMap["protectionStatus"] = dc.ProtectionStatus - } - if dc.ExtendedInfo != nil { - objectMap["extendedInfo"] = dc.ExtendedInfo - } - if dc.FriendlyName != nil { - objectMap["friendlyName"] = dc.FriendlyName - } - if dc.BackupManagementType != "" { - objectMap["backupManagementType"] = dc.BackupManagementType - } - if dc.RegistrationStatus != nil { - objectMap["registrationStatus"] = dc.RegistrationStatus - } - if dc.HealthStatus != nil { - objectMap["healthStatus"] = dc.HealthStatus - } - if dc.ContainerType != "" { - objectMap["containerType"] = dc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsDpmContainer() (*DpmContainer, bool) { - return &dc, true -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return &dc, true -} - -// AsGenericContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false -} - -// AsMabContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &dc, true -} - -// DPMContainerExtendedInfo additional information of the DPMContainer. -type DPMContainerExtendedInfo struct { - // LastRefreshedAt - Last refresh time of the DPMContainer. - LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` -} - -// DpmErrorInfo DPM workload-specific error information. -type DpmErrorInfo struct { - // ErrorString - Localized error string. - ErrorString *string `json:"errorString,omitempty"` - // Recommendations - List of localized recommendations for above error code. - Recommendations *[]string `json:"recommendations,omitempty"` -} - -// DpmJob DPM workload-specific job object. -type DpmJob struct { - // Duration - Time elapsed for job. - Duration *string `json:"duration,omitempty"` - // DpmServerName - DPM server name managing the backup item or backup job. - DpmServerName *string `json:"dpmServerName,omitempty"` - // ContainerName - Name of cluster/server protecting current backup item, if any. - ContainerName *string `json:"containerName,omitempty"` - // ContainerType - Type of container. - ContainerType *string `json:"containerType,omitempty"` - // WorkloadType - Type of backup item. - WorkloadType *string `json:"workloadType,omitempty"` - // ActionsInfo - The state/actions applicable on this job like cancel/retry. - ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` - // ErrorDetails - The errors. - ErrorDetails *[]DpmErrorInfo `json:"errorDetails,omitempty"` - // ExtendedInfo - Additional information for this job. - ExtendedInfo *DpmJobExtendedInfo `json:"extendedInfo,omitempty"` - // EntityFriendlyName - Friendly name of the entity on which the current job is executing. - EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` - // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // Operation - The operation name. - Operation *string `json:"operation,omitempty"` - // Status - Job status. - Status *string `json:"status,omitempty"` - // StartTime - The start time. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time. - EndTime *date.Time `json:"endTime,omitempty"` - // ActivityID - ActivityId of job. - ActivityID *string `json:"activityId,omitempty"` - // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' - JobType JobType `json:"jobType,omitempty"` -} - -// MarshalJSON is the custom marshaler for DpmJob. -func (dj DpmJob) MarshalJSON() ([]byte, error) { - dj.JobType = JobTypeDpmJob - objectMap := make(map[string]interface{}) - if dj.Duration != nil { - objectMap["duration"] = dj.Duration - } - if dj.DpmServerName != nil { - objectMap["dpmServerName"] = dj.DpmServerName - } - if dj.ContainerName != nil { - objectMap["containerName"] = dj.ContainerName - } - if dj.ContainerType != nil { - objectMap["containerType"] = dj.ContainerType - } - if dj.WorkloadType != nil { - objectMap["workloadType"] = dj.WorkloadType - } - if dj.ActionsInfo != nil { - objectMap["actionsInfo"] = dj.ActionsInfo - } - if dj.ErrorDetails != nil { - objectMap["errorDetails"] = dj.ErrorDetails - } - if dj.ExtendedInfo != nil { - objectMap["extendedInfo"] = dj.ExtendedInfo - } - if dj.EntityFriendlyName != nil { - objectMap["entityFriendlyName"] = dj.EntityFriendlyName - } - if dj.BackupManagementType != "" { - objectMap["backupManagementType"] = dj.BackupManagementType - } - if dj.Operation != nil { - objectMap["operation"] = dj.Operation - } - if dj.Status != nil { - objectMap["status"] = dj.Status - } - if dj.StartTime != nil { - objectMap["startTime"] = dj.StartTime - } - if dj.EndTime != nil { - objectMap["endTime"] = dj.EndTime - } - if dj.ActivityID != nil { - objectMap["activityId"] = dj.ActivityID - } - if dj.JobType != "" { - objectMap["jobType"] = dj.JobType - } - return json.Marshal(objectMap) -} - -// AsAzureIaaSVMJob is the BasicJob implementation for DpmJob. -func (dj DpmJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { - return nil, false -} - -// AsAzureStorageJob is the BasicJob implementation for DpmJob. -func (dj DpmJob) AsAzureStorageJob() (*AzureStorageJob, bool) { - return nil, false -} - -// AsAzureWorkloadJob is the BasicJob implementation for DpmJob. -func (dj DpmJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { - return nil, false -} - -// AsDpmJob is the BasicJob implementation for DpmJob. -func (dj DpmJob) AsDpmJob() (*DpmJob, bool) { - return &dj, true -} - -// AsMabJob is the BasicJob implementation for DpmJob. -func (dj DpmJob) AsMabJob() (*MabJob, bool) { - return nil, false -} - -// AsJob is the BasicJob implementation for DpmJob. -func (dj DpmJob) AsJob() (*Job, bool) { - return nil, false -} - -// AsBasicJob is the BasicJob implementation for DpmJob. -func (dj DpmJob) AsBasicJob() (BasicJob, bool) { - return &dj, true -} - -// DpmJobExtendedInfo additional information on the DPM workload-specific job. -type DpmJobExtendedInfo struct { - // TasksList - List of tasks associated with this job. - TasksList *[]DpmJobTaskDetails `json:"tasksList,omitempty"` - // PropertyBag - The job properties. - PropertyBag map[string]*string `json:"propertyBag"` - // DynamicErrorMessage - Non localized error message on job execution. - DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` -} - -// MarshalJSON is the custom marshaler for DpmJobExtendedInfo. -func (djei DpmJobExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if djei.TasksList != nil { - objectMap["tasksList"] = djei.TasksList - } - if djei.PropertyBag != nil { - objectMap["propertyBag"] = djei.PropertyBag - } - if djei.DynamicErrorMessage != nil { - objectMap["dynamicErrorMessage"] = djei.DynamicErrorMessage - } - return json.Marshal(objectMap) -} - -// DpmJobTaskDetails DPM workload-specific job task details. -type DpmJobTaskDetails struct { - // TaskID - The task display name. - TaskID *string `json:"taskId,omitempty"` - // StartTime - The start time. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time. - EndTime *date.Time `json:"endTime,omitempty"` - // Duration - Time elapsed for task. - Duration *string `json:"duration,omitempty"` - // Status - The status. - Status *string `json:"status,omitempty"` -} - -// DPMProtectedItem additional information on Backup engine specific backup item. -type DPMProtectedItem struct { - // FriendlyName - Friendly name of the managed item - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupEngineName - Backup Management server protecting this backup item - BackupEngineName *string `json:"backupEngineName,omitempty"` - // ProtectionState - Protection state of the backup engine. Possible values include: 'ProtectedItemStateInvalid', 'ProtectedItemStateIRPending', 'ProtectedItemStateProtected', 'ProtectedItemStateProtectionError', 'ProtectedItemStateProtectionStopped', 'ProtectedItemStateProtectionPaused' - ProtectionState ProtectedItemState `json:"protectionState,omitempty"` - // ExtendedInfo - Extended info of the backup item. - ExtendedInfo *DPMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for DPMProtectedItem. -func (dpi DPMProtectedItem) MarshalJSON() ([]byte, error) { - dpi.ProtectedItemType = ProtectedItemTypeDPMProtectedItem - objectMap := make(map[string]interface{}) - if dpi.FriendlyName != nil { - objectMap["friendlyName"] = dpi.FriendlyName - } - if dpi.BackupEngineName != nil { - objectMap["backupEngineName"] = dpi.BackupEngineName - } - if dpi.ProtectionState != "" { - objectMap["protectionState"] = dpi.ProtectionState - } - if dpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = dpi.ExtendedInfo - } - if dpi.BackupManagementType != "" { - objectMap["backupManagementType"] = dpi.BackupManagementType - } - if dpi.WorkloadType != "" { - objectMap["workloadType"] = dpi.WorkloadType - } - if dpi.ContainerName != nil { - objectMap["containerName"] = dpi.ContainerName - } - if dpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = dpi.SourceResourceID - } - if dpi.PolicyID != nil { - objectMap["policyId"] = dpi.PolicyID - } - if dpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = dpi.LastRecoveryPoint - } - if dpi.BackupSetName != nil { - objectMap["backupSetName"] = dpi.BackupSetName - } - if dpi.CreateMode != "" { - objectMap["createMode"] = dpi.CreateMode - } - if dpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = dpi.DeferredDeleteTimeInUTC - } - if dpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = dpi.IsScheduledForDeferredDelete - } - if dpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = dpi.DeferredDeleteTimeRemaining - } - if dpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = dpi.IsDeferredDeleteScheduleUpcoming - } - if dpi.IsRehydrate != nil { - objectMap["isRehydrate"] = dpi.IsRehydrate - } - if dpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = dpi.ProtectedItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return nil, false -} - -// AsDPMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return &dpi, true -} - -// AsGenericProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return nil, false -} - -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return nil, false -} - -// AsProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return nil, false -} - -// AsBasicProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &dpi, true -} - -// DPMProtectedItemExtendedInfo additional information of DPM Protected item. -type DPMProtectedItemExtendedInfo struct { - // ProtectableObjectLoadPath - Attribute to provide information on various DBs. - ProtectableObjectLoadPath map[string]*string `json:"protectableObjectLoadPath"` - // Protected - To check if backup item is disk protected. - Protected *bool `json:"protected,omitempty"` - // IsPresentOnCloud - To check if backup item is cloud protected. - IsPresentOnCloud *bool `json:"isPresentOnCloud,omitempty"` - // LastBackupStatus - Last backup status information on backup item. - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - // LastRefreshedAt - Last refresh time on backup item. - LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` - // OldestRecoveryPoint - Oldest cloud recovery point time. - OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` - // RecoveryPointCount - cloud recovery point count. - RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` - // OnPremiseOldestRecoveryPoint - Oldest disk recovery point time. - OnPremiseOldestRecoveryPoint *date.Time `json:"onPremiseOldestRecoveryPoint,omitempty"` - // OnPremiseLatestRecoveryPoint - latest disk recovery point time. - OnPremiseLatestRecoveryPoint *date.Time `json:"onPremiseLatestRecoveryPoint,omitempty"` - // OnPremiseRecoveryPointCount - disk recovery point count. - OnPremiseRecoveryPointCount *int32 `json:"onPremiseRecoveryPointCount,omitempty"` - // IsCollocated - To check if backup item is collocated. - IsCollocated *bool `json:"isCollocated,omitempty"` - // ProtectionGroupName - Protection group name of the backup item. - ProtectionGroupName *string `json:"protectionGroupName,omitempty"` - // DiskStorageUsedInBytes - Used Disk storage in bytes. - DiskStorageUsedInBytes *string `json:"diskStorageUsedInBytes,omitempty"` - // TotalDiskStorageSizeInBytes - total Disk storage in bytes. - TotalDiskStorageSizeInBytes *string `json:"totalDiskStorageSizeInBytes,omitempty"` -} - -// MarshalJSON is the custom marshaler for DPMProtectedItemExtendedInfo. -func (dpiei DPMProtectedItemExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dpiei.ProtectableObjectLoadPath != nil { - objectMap["protectableObjectLoadPath"] = dpiei.ProtectableObjectLoadPath - } - if dpiei.Protected != nil { - objectMap["protected"] = dpiei.Protected - } - if dpiei.IsPresentOnCloud != nil { - objectMap["isPresentOnCloud"] = dpiei.IsPresentOnCloud - } - if dpiei.LastBackupStatus != nil { - objectMap["lastBackupStatus"] = dpiei.LastBackupStatus - } - if dpiei.LastRefreshedAt != nil { - objectMap["lastRefreshedAt"] = dpiei.LastRefreshedAt - } - if dpiei.OldestRecoveryPoint != nil { - objectMap["oldestRecoveryPoint"] = dpiei.OldestRecoveryPoint - } - if dpiei.RecoveryPointCount != nil { - objectMap["recoveryPointCount"] = dpiei.RecoveryPointCount - } - if dpiei.OnPremiseOldestRecoveryPoint != nil { - objectMap["onPremiseOldestRecoveryPoint"] = dpiei.OnPremiseOldestRecoveryPoint - } - if dpiei.OnPremiseLatestRecoveryPoint != nil { - objectMap["onPremiseLatestRecoveryPoint"] = dpiei.OnPremiseLatestRecoveryPoint - } - if dpiei.OnPremiseRecoveryPointCount != nil { - objectMap["onPremiseRecoveryPointCount"] = dpiei.OnPremiseRecoveryPointCount - } - if dpiei.IsCollocated != nil { - objectMap["isCollocated"] = dpiei.IsCollocated - } - if dpiei.ProtectionGroupName != nil { - objectMap["protectionGroupName"] = dpiei.ProtectionGroupName - } - if dpiei.DiskStorageUsedInBytes != nil { - objectMap["diskStorageUsedInBytes"] = dpiei.DiskStorageUsedInBytes - } - if dpiei.TotalDiskStorageSizeInBytes != nil { - objectMap["totalDiskStorageSizeInBytes"] = dpiei.TotalDiskStorageSizeInBytes - } - return json.Marshal(objectMap) -} - -// EncryptionDetails details needed if the VM was encrypted at the time of backup. -type EncryptionDetails struct { - // EncryptionEnabled - Identifies whether this backup copy represents an encrypted VM at the time of backup. - EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` - // KekURL - Key Url. - KekURL *string `json:"kekUrl,omitempty"` - // SecretKeyURL - Secret Url. - SecretKeyURL *string `json:"secretKeyUrl,omitempty"` - // KekVaultID - ID of Key Vault where KEK is stored. - KekVaultID *string `json:"kekVaultId,omitempty"` - // SecretKeyVaultID - ID of Key Vault where Secret is stored. - SecretKeyVaultID *string `json:"secretKeyVaultId,omitempty"` -} - -// BasicEngineBase the base backup engine class. All workload specific backup engines derive from this class. -type BasicEngineBase interface { - AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) - AsDpmBackupEngine() (*DpmBackupEngine, bool) - AsEngineBase() (*EngineBase, bool) -} - -// EngineBase the base backup engine class. All workload specific backup engines derive from this class. -type EngineBase struct { - // FriendlyName - Friendly name of the backup engine. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Registration status of the backup engine with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // BackupEngineState - Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} - BackupEngineState *string `json:"backupEngineState,omitempty"` - // HealthStatus - Backup status of the backup engine. - HealthStatus *string `json:"healthStatus,omitempty"` - // CanReRegister - Flag indicating if the backup engine be registered, once already registered. - CanReRegister *bool `json:"canReRegister,omitempty"` - // BackupEngineID - ID of the backup engine. - BackupEngineID *string `json:"backupEngineId,omitempty"` - // DpmVersion - Backup engine version - DpmVersion *string `json:"dpmVersion,omitempty"` - // AzureBackupAgentVersion - Backup agent version - AzureBackupAgentVersion *string `json:"azureBackupAgentVersion,omitempty"` - // IsAzureBackupAgentUpgradeAvailable - To check if backup agent upgrade available - IsAzureBackupAgentUpgradeAvailable *bool `json:"isAzureBackupAgentUpgradeAvailable,omitempty"` - // IsDpmUpgradeAvailable - To check if backup engine upgrade available - IsDpmUpgradeAvailable *bool `json:"isDpmUpgradeAvailable,omitempty"` - // ExtendedInfo - Extended info of the backupengine - ExtendedInfo *EngineExtendedInfo `json:"extendedInfo,omitempty"` - // BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine' - BackupEngineType EngineType `json:"backupEngineType,omitempty"` -} - -func unmarshalBasicEngineBase(body []byte) (BasicEngineBase, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["backupEngineType"] { - case string(BackupEngineTypeAzureBackupServerEngine): - var abse AzureBackupServerEngine - err := json.Unmarshal(body, &abse) - return abse, err - case string(BackupEngineTypeDpmBackupEngine): - var dbe DpmBackupEngine - err := json.Unmarshal(body, &dbe) - return dbe, err - default: - var eb EngineBase - err := json.Unmarshal(body, &eb) - return eb, err - } -} -func unmarshalBasicEngineBaseArray(body []byte) ([]BasicEngineBase, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - ebArray := make([]BasicEngineBase, len(rawMessages)) - - for index, rawMessage := range rawMessages { - eb, err := unmarshalBasicEngineBase(*rawMessage) - if err != nil { - return nil, err - } - ebArray[index] = eb - } - return ebArray, nil -} - -// MarshalJSON is the custom marshaler for EngineBase. -func (eb EngineBase) MarshalJSON() ([]byte, error) { - eb.BackupEngineType = BackupEngineTypeBackupEngineBase - objectMap := make(map[string]interface{}) - if eb.FriendlyName != nil { - objectMap["friendlyName"] = eb.FriendlyName - } - if eb.BackupManagementType != "" { - objectMap["backupManagementType"] = eb.BackupManagementType - } - if eb.RegistrationStatus != nil { - objectMap["registrationStatus"] = eb.RegistrationStatus - } - if eb.BackupEngineState != nil { - objectMap["backupEngineState"] = eb.BackupEngineState - } - if eb.HealthStatus != nil { - objectMap["healthStatus"] = eb.HealthStatus - } - if eb.CanReRegister != nil { - objectMap["canReRegister"] = eb.CanReRegister - } - if eb.BackupEngineID != nil { - objectMap["backupEngineId"] = eb.BackupEngineID - } - if eb.DpmVersion != nil { - objectMap["dpmVersion"] = eb.DpmVersion - } - if eb.AzureBackupAgentVersion != nil { - objectMap["azureBackupAgentVersion"] = eb.AzureBackupAgentVersion - } - if eb.IsAzureBackupAgentUpgradeAvailable != nil { - objectMap["isAzureBackupAgentUpgradeAvailable"] = eb.IsAzureBackupAgentUpgradeAvailable - } - if eb.IsDpmUpgradeAvailable != nil { - objectMap["isDpmUpgradeAvailable"] = eb.IsDpmUpgradeAvailable - } - if eb.ExtendedInfo != nil { - objectMap["extendedInfo"] = eb.ExtendedInfo - } - if eb.BackupEngineType != "" { - objectMap["backupEngineType"] = eb.BackupEngineType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerEngine is the BasicEngineBase implementation for EngineBase. -func (eb EngineBase) AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) { - return nil, false -} - -// AsDpmBackupEngine is the BasicEngineBase implementation for EngineBase. -func (eb EngineBase) AsDpmBackupEngine() (*DpmBackupEngine, bool) { - return nil, false -} - -// AsEngineBase is the BasicEngineBase implementation for EngineBase. -func (eb EngineBase) AsEngineBase() (*EngineBase, bool) { - return &eb, true -} - -// AsBasicEngineBase is the BasicEngineBase implementation for EngineBase. -func (eb EngineBase) AsBasicEngineBase() (BasicEngineBase, bool) { - return &eb, true -} - -// EngineBaseResource the base backup engine class. All workload specific backup engines derive from this -// class. -type EngineBaseResource struct { - autorest.Response `json:"-"` - // Properties - BackupEngineBaseResource properties - Properties BasicEngineBase `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for EngineBaseResource. -func (ebr EngineBaseResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = ebr.Properties - if ebr.Location != nil { - objectMap["location"] = ebr.Location - } - if ebr.Tags != nil { - objectMap["tags"] = ebr.Tags - } - if ebr.ETag != nil { - objectMap["eTag"] = ebr.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for EngineBaseResource struct. -func (ebr *EngineBaseResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicEngineBase(*v) - if err != nil { - return err - } - ebr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ebr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ebr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ebr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ebr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ebr.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - ebr.ETag = &eTag - } - } - } - - return nil -} - -// EngineBaseResourceList list of BackupEngineBase resources -type EngineBaseResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]EngineBaseResource `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"` -} - -// EngineBaseResourceListIterator provides access to a complete listing of EngineBaseResource values. -type EngineBaseResourceListIterator struct { - i int - page EngineBaseResourceListPage -} - -// NextWithContext 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 *EngineBaseResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EngineBaseResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *EngineBaseResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter EngineBaseResourceListIterator) 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 EngineBaseResourceListIterator) Response() EngineBaseResourceList { - 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 EngineBaseResourceListIterator) Value() EngineBaseResource { - if !iter.page.NotDone() { - return EngineBaseResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the EngineBaseResourceListIterator type. -func NewEngineBaseResourceListIterator(page EngineBaseResourceListPage) EngineBaseResourceListIterator { - return EngineBaseResourceListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ebrl EngineBaseResourceList) IsEmpty() bool { - return ebrl.Value == nil || len(*ebrl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ebrl EngineBaseResourceList) hasNextLink() bool { - return ebrl.NextLink != nil && len(*ebrl.NextLink) != 0 -} - -// engineBaseResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ebrl EngineBaseResourceList) engineBaseResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !ebrl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ebrl.NextLink))) -} - -// EngineBaseResourceListPage contains a page of EngineBaseResource values. -type EngineBaseResourceListPage struct { - fn func(context.Context, EngineBaseResourceList) (EngineBaseResourceList, error) - ebrl EngineBaseResourceList -} - -// NextWithContext 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 *EngineBaseResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EngineBaseResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ebrl) - if err != nil { - return err - } - page.ebrl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *EngineBaseResourceListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page EngineBaseResourceListPage) NotDone() bool { - return !page.ebrl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page EngineBaseResourceListPage) Response() EngineBaseResourceList { - return page.ebrl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page EngineBaseResourceListPage) Values() []EngineBaseResource { - if page.ebrl.IsEmpty() { - return nil - } - return *page.ebrl.Value -} - -// Creates a new instance of the EngineBaseResourceListPage type. -func NewEngineBaseResourceListPage(cur EngineBaseResourceList, getNextPage func(context.Context, EngineBaseResourceList) (EngineBaseResourceList, error)) EngineBaseResourceListPage { - return EngineBaseResourceListPage{ - fn: getNextPage, - ebrl: cur, - } -} - -// EngineExtendedInfo additional information on backup engine. -type EngineExtendedInfo struct { - // DatabaseName - Database name of backup engine. - DatabaseName *string `json:"databaseName,omitempty"` - // ProtectedItemsCount - Number of protected items in the backup engine. - ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // ProtectedServersCount - Number of protected servers in the backup engine. - ProtectedServersCount *int32 `json:"protectedServersCount,omitempty"` - // DiskCount - Number of disks in the backup engine. - DiskCount *int32 `json:"diskCount,omitempty"` - // UsedDiskSpace - Disk space used in the backup engine. - UsedDiskSpace *float64 `json:"usedDiskSpace,omitempty"` - // AvailableDiskSpace - Disk space currently available in the backup engine. - AvailableDiskSpace *float64 `json:"availableDiskSpace,omitempty"` - // RefreshedAt - Last refresh time in the backup engine. - RefreshedAt *date.Time `json:"refreshedAt,omitempty"` - // AzureProtectedInstances - Protected instances in the backup engine. - AzureProtectedInstances *int32 `json:"azureProtectedInstances,omitempty"` -} - -// ErrorAdditionalInfo the resource management error additional info. -type ErrorAdditionalInfo struct { - // Type - READ-ONLY; The additional info type. - Type *string `json:"type,omitempty"` - // Info - READ-ONLY; The additional info. - Info interface{} `json:"info,omitempty"` -} - -// MarshalJSON is the custom marshaler for ErrorAdditionalInfo. -func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ErrorDetail error Detail class which encapsulates Code, Message and Recommendations. -type ErrorDetail struct { - // Code - READ-ONLY; Error code. - Code *string `json:"code,omitempty"` - // Message - READ-ONLY; Error Message related to the Code. - Message *string `json:"message,omitempty"` - // Recommendations - READ-ONLY; List of recommendation strings. - Recommendations *[]string `json:"recommendations,omitempty"` -} - -// MarshalJSON is the custom marshaler for ErrorDetail. -func (ed ErrorDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ErrorResponse common error response for all Azure Resource Manager APIs to return error details for -// failed operations. (This also follows the OData error response format.) -type ErrorResponse struct { - // Code - READ-ONLY; The error code. - Code *string `json:"code,omitempty"` - // Message - READ-ONLY; The error message. - Message *string `json:"message,omitempty"` - // Target - READ-ONLY; The error target. - Target *string `json:"target,omitempty"` - // Details - READ-ONLY; The error details. - Details *[]ErrorResponse `json:"details,omitempty"` - // AdditionalInfo - READ-ONLY; The error additional info. - AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` -} - -// MarshalJSON is the custom marshaler for ErrorResponse. -func (er ErrorResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ExportJobsOperationResultInfo this class is used to send blob details after exporting jobs. -type ExportJobsOperationResultInfo struct { - // BlobURL - URL of the blob into which the serialized string of list of jobs is exported. - BlobURL *string `json:"blobUrl,omitempty"` - // BlobSasKey - SAS key to access the blob. It expires in 15 mins. - BlobSasKey *string `json:"blobSasKey,omitempty"` - // ExcelFileBlobURL - URL of the blob into which the ExcelFile is uploaded. - ExcelFileBlobURL *string `json:"excelFileBlobUrl,omitempty"` - // ExcelFileBlobSasKey - SAS key to access the blob. It expires in 15 mins. - ExcelFileBlobSasKey *string `json:"excelFileBlobSasKey,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeOperationResultInfoBase', 'ObjectTypeExportJobsOperationResultInfo', 'ObjectTypeOperationResultInfo' - ObjectType ObjectType `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExportJobsOperationResultInfo. -func (ejori ExportJobsOperationResultInfo) MarshalJSON() ([]byte, error) { - ejori.ObjectType = ObjectTypeExportJobsOperationResultInfo - objectMap := make(map[string]interface{}) - if ejori.BlobURL != nil { - objectMap["blobUrl"] = ejori.BlobURL - } - if ejori.BlobSasKey != nil { - objectMap["blobSasKey"] = ejori.BlobSasKey - } - if ejori.ExcelFileBlobURL != nil { - objectMap["excelFileBlobUrl"] = ejori.ExcelFileBlobURL - } - if ejori.ExcelFileBlobSasKey != nil { - objectMap["excelFileBlobSasKey"] = ejori.ExcelFileBlobSasKey - } - if ejori.ObjectType != "" { - objectMap["objectType"] = ejori.ObjectType - } - return json.Marshal(objectMap) -} - -// AsExportJobsOperationResultInfo is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. -func (ejori ExportJobsOperationResultInfo) AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) { - return &ejori, true -} - -// AsOperationResultInfo is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. -func (ejori ExportJobsOperationResultInfo) AsOperationResultInfo() (*OperationResultInfo, bool) { - return nil, false -} - -// AsOperationResultInfoBase is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. -func (ejori ExportJobsOperationResultInfo) AsOperationResultInfoBase() (*OperationResultInfoBase, bool) { - return nil, false -} - -// AsBasicOperationResultInfoBase is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. -func (ejori ExportJobsOperationResultInfo) AsBasicOperationResultInfoBase() (BasicOperationResultInfoBase, bool) { - return &ejori, true -} - -// ExtendedProperties extended Properties for Azure IaasVM Backup. -type ExtendedProperties struct { - // DiskExclusionProperties - Extended Properties for Disk Exclusion. - DiskExclusionProperties *DiskExclusionProperties `json:"diskExclusionProperties,omitempty"` -} - -// BasicFeatureSupportRequest base class for feature request -type BasicFeatureSupportRequest interface { - AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) - AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) - AsFeatureSupportRequest() (*FeatureSupportRequest, bool) -} - -// FeatureSupportRequest base class for feature request -type FeatureSupportRequest struct { - // FeatureType - Possible values include: 'FeatureTypeFeatureSupportRequest', 'FeatureTypeAzureBackupGoals', 'FeatureTypeAzureVMResourceBackup' - FeatureType FeatureType `json:"featureType,omitempty"` -} - -func unmarshalBasicFeatureSupportRequest(body []byte) (BasicFeatureSupportRequest, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["featureType"] { - case string(FeatureTypeAzureBackupGoals): - var abgfsr AzureBackupGoalFeatureSupportRequest - err := json.Unmarshal(body, &abgfsr) - return abgfsr, err - case string(FeatureTypeAzureVMResourceBackup): - var avrfsr AzureVMResourceFeatureSupportRequest - err := json.Unmarshal(body, &avrfsr) - return avrfsr, err - default: - var fsr FeatureSupportRequest - err := json.Unmarshal(body, &fsr) - return fsr, err - } -} -func unmarshalBasicFeatureSupportRequestArray(body []byte) ([]BasicFeatureSupportRequest, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - fsrArray := make([]BasicFeatureSupportRequest, len(rawMessages)) - - for index, rawMessage := range rawMessages { - fsr, err := unmarshalBasicFeatureSupportRequest(*rawMessage) - if err != nil { - return nil, err - } - fsrArray[index] = fsr - } - return fsrArray, nil -} - -// MarshalJSON is the custom marshaler for FeatureSupportRequest. -func (fsr FeatureSupportRequest) MarshalJSON() ([]byte, error) { - fsr.FeatureType = FeatureTypeFeatureSupportRequest - objectMap := make(map[string]interface{}) - if fsr.FeatureType != "" { - objectMap["featureType"] = fsr.FeatureType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupGoalFeatureSupportRequest is the BasicFeatureSupportRequest implementation for FeatureSupportRequest. -func (fsr FeatureSupportRequest) AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) { - return nil, false -} - -// AsAzureVMResourceFeatureSupportRequest is the BasicFeatureSupportRequest implementation for FeatureSupportRequest. -func (fsr FeatureSupportRequest) AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) { - return nil, false -} - -// AsFeatureSupportRequest is the BasicFeatureSupportRequest implementation for FeatureSupportRequest. -func (fsr FeatureSupportRequest) AsFeatureSupportRequest() (*FeatureSupportRequest, bool) { - return &fsr, true -} - -// AsBasicFeatureSupportRequest is the BasicFeatureSupportRequest implementation for FeatureSupportRequest. -func (fsr FeatureSupportRequest) AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) { - return &fsr, true -} - -// GenericContainer base class for generic container of backup items -type GenericContainer struct { - // FabricName - Name of the container's fabric - FabricName *string `json:"fabricName,omitempty"` - // ExtendedInformation - Extended information (not returned in List container API calls) - ExtendedInformation *GenericContainerExtendedInfo `json:"extendedInformation,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for GenericContainer. -func (gc GenericContainer) MarshalJSON() ([]byte, error) { - gc.ContainerType = ContainerTypeGenericContainer1 - objectMap := make(map[string]interface{}) - if gc.FabricName != nil { - objectMap["fabricName"] = gc.FabricName - } - if gc.ExtendedInformation != nil { - objectMap["extendedInformation"] = gc.ExtendedInformation - } - if gc.FriendlyName != nil { - objectMap["friendlyName"] = gc.FriendlyName - } - if gc.BackupManagementType != "" { - objectMap["backupManagementType"] = gc.BackupManagementType - } - if gc.RegistrationStatus != nil { - objectMap["registrationStatus"] = gc.RegistrationStatus - } - if gc.HealthStatus != nil { - objectMap["healthStatus"] = gc.HealthStatus - } - if gc.ContainerType != "" { - objectMap["containerType"] = gc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsGenericContainer() (*GenericContainer, bool) { - return &gc, true -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false -} - -// AsMabContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &gc, true -} - -// GenericContainerExtendedInfo container extended information -type GenericContainerExtendedInfo struct { - // RawCertData - Public key of container cert - RawCertData *string `json:"rawCertData,omitempty"` - // ContainerIdentityInfo - Container identity information - ContainerIdentityInfo *ContainerIdentityInfo `json:"containerIdentityInfo,omitempty"` - // ServiceEndpoints - Azure Backup Service Endpoints for the container - ServiceEndpoints map[string]*string `json:"serviceEndpoints"` -} - -// MarshalJSON is the custom marshaler for GenericContainerExtendedInfo. -func (gcei GenericContainerExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gcei.RawCertData != nil { - objectMap["rawCertData"] = gcei.RawCertData - } - if gcei.ContainerIdentityInfo != nil { - objectMap["containerIdentityInfo"] = gcei.ContainerIdentityInfo - } - if gcei.ServiceEndpoints != nil { - objectMap["serviceEndpoints"] = gcei.ServiceEndpoints - } - return json.Marshal(objectMap) -} - -// GenericProtectedItem base class for backup items. -type GenericProtectedItem struct { - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // PolicyState - Indicates consistency of policy object and policy applied to this backup item. - PolicyState *string `json:"policyState,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // ProtectedItemID - Data Plane Service ID of the protected item. - ProtectedItemID *int64 `json:"protectedItemId,omitempty"` - // SourceAssociations - Loosely coupled (type, value) associations (example - parent of a protected item) - SourceAssociations map[string]*string `json:"sourceAssociations"` - // FabricName - Name of this backup item's fabric. - FabricName *string `json:"fabricName,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for GenericProtectedItem. -func (gpi GenericProtectedItem) MarshalJSON() ([]byte, error) { - gpi.ProtectedItemType = ProtectedItemTypeGenericProtectedItem - objectMap := make(map[string]interface{}) - if gpi.FriendlyName != nil { - objectMap["friendlyName"] = gpi.FriendlyName - } - if gpi.PolicyState != nil { - objectMap["policyState"] = gpi.PolicyState - } - if gpi.ProtectionState != "" { - objectMap["protectionState"] = gpi.ProtectionState - } - if gpi.ProtectedItemID != nil { - objectMap["protectedItemId"] = gpi.ProtectedItemID - } - if gpi.SourceAssociations != nil { - objectMap["sourceAssociations"] = gpi.SourceAssociations - } - if gpi.FabricName != nil { - objectMap["fabricName"] = gpi.FabricName - } - if gpi.BackupManagementType != "" { - objectMap["backupManagementType"] = gpi.BackupManagementType - } - if gpi.WorkloadType != "" { - objectMap["workloadType"] = gpi.WorkloadType - } - if gpi.ContainerName != nil { - objectMap["containerName"] = gpi.ContainerName - } - if gpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = gpi.SourceResourceID - } - if gpi.PolicyID != nil { - objectMap["policyId"] = gpi.PolicyID - } - if gpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = gpi.LastRecoveryPoint - } - if gpi.BackupSetName != nil { - objectMap["backupSetName"] = gpi.BackupSetName - } - if gpi.CreateMode != "" { - objectMap["createMode"] = gpi.CreateMode - } - if gpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = gpi.DeferredDeleteTimeInUTC - } - if gpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = gpi.IsScheduledForDeferredDelete - } - if gpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = gpi.DeferredDeleteTimeRemaining - } - if gpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = gpi.IsDeferredDeleteScheduleUpcoming - } - if gpi.IsRehydrate != nil { - objectMap["isRehydrate"] = gpi.IsRehydrate - } - if gpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = gpi.ProtectedItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return nil, false -} - -// AsDPMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return nil, false -} - -// AsGenericProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return &gpi, true -} - -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return nil, false -} - -// AsProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return nil, false -} - -// AsBasicProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &gpi, true -} - -// GenericProtectionPolicy azure VM (Mercury) workload-specific backup policy. -type GenericProtectionPolicy struct { - // SubProtectionPolicy - List of sub-protection policies which includes schedule and retention - SubProtectionPolicy *[]SubProtectionPolicy `json:"subProtectionPolicy,omitempty"` - // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". - TimeZone *string `json:"timeZone,omitempty"` - // FabricName - Name of this policy's fabric. - FabricName *string `json:"fabricName,omitempty"` - // ProtectedItemsCount - Number of items associated with this policy. - ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' - BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` -} - -// MarshalJSON is the custom marshaler for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) MarshalJSON() ([]byte, error) { - gpp.BackupManagementType = BackupManagementTypeGenericProtectionPolicy - objectMap := make(map[string]interface{}) - if gpp.SubProtectionPolicy != nil { - objectMap["subProtectionPolicy"] = gpp.SubProtectionPolicy - } - if gpp.TimeZone != nil { - objectMap["timeZone"] = gpp.TimeZone - } - if gpp.FabricName != nil { - objectMap["fabricName"] = gpp.FabricName - } - if gpp.ProtectedItemsCount != nil { - objectMap["protectedItemsCount"] = gpp.ProtectedItemsCount - } - if gpp.BackupManagementType != "" { - objectMap["backupManagementType"] = gpp.BackupManagementType - } - return json.Marshal(objectMap) -} - -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { - return nil, false -} - -// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { - return nil, false -} - -// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { - return nil, false -} - -// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { - return &gpp, true -} - -// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { - return nil, false -} - -// AsProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { - return nil, false -} - -// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { - return &gpp, true -} - -// GenericRecoveryPoint generic backup copy. -type GenericRecoveryPoint struct { - // FriendlyName - Friendly name of the backup copy. - FriendlyName *string `json:"friendlyName,omitempty"` - // RecoveryPointType - Type of the backup copy. - RecoveryPointType *string `json:"recoveryPointType,omitempty"` - // RecoveryPointTime - Time at which this backup copy was created. - RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` - // RecoveryPointAdditionalInfo - Additional information associated with this backup copy. - RecoveryPointAdditionalInfo *string `json:"recoveryPointAdditionalInfo,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) MarshalJSON() ([]byte, error) { - grp.ObjectType = ObjectTypeGenericRecoveryPoint - objectMap := make(map[string]interface{}) - if grp.FriendlyName != nil { - objectMap["friendlyName"] = grp.FriendlyName - } - if grp.RecoveryPointType != nil { - objectMap["recoveryPointType"] = grp.RecoveryPointType - } - if grp.RecoveryPointTime != nil { - objectMap["recoveryPointTime"] = grp.RecoveryPointTime - } - if grp.RecoveryPointAdditionalInfo != nil { - objectMap["recoveryPointAdditionalInfo"] = grp.RecoveryPointAdditionalInfo - } - if grp.ObjectType != "" { - objectMap["objectType"] = grp.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { - return &grp, true -} - -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return nil, false -} - -// AsRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return nil, false -} - -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &grp, true -} - -// GetProtectedItemQueryObject filters to list backup items. -type GetProtectedItemQueryObject struct { - // Expand - Specifies if the additional information should be provided for this item. - Expand *string `json:"expand,omitempty"` -} - -// IaasVMBackupRequest iaaS VM workload-specific backup request. -type IaasVMBackupRequest struct { - // RecoveryPointExpiryTimeInUTC - Backup copy will expire after the time specified (UTC). - RecoveryPointExpiryTimeInUTC *date.Time `json:"recoveryPointExpiryTimeInUTC,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' - ObjectType ObjectTypeBasicRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for IaasVMBackupRequest. -func (ivbr IaasVMBackupRequest) MarshalJSON() ([]byte, error) { - ivbr.ObjectType = ObjectTypeIaasVMBackupRequest - objectMap := make(map[string]interface{}) - if ivbr.RecoveryPointExpiryTimeInUTC != nil { - objectMap["recoveryPointExpiryTimeInUTC"] = ivbr.RecoveryPointExpiryTimeInUTC - } - if ivbr.ObjectType != "" { - objectMap["objectType"] = ivbr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareBackupRequest is the BasicRequest implementation for IaasVMBackupRequest. -func (ivbr IaasVMBackupRequest) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { - return nil, false -} - -// AsAzureWorkloadBackupRequest is the BasicRequest implementation for IaasVMBackupRequest. -func (ivbr IaasVMBackupRequest) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { - return nil, false -} - -// AsIaasVMBackupRequest is the BasicRequest implementation for IaasVMBackupRequest. -func (ivbr IaasVMBackupRequest) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { - return &ivbr, true -} - -// AsRequest is the BasicRequest implementation for IaasVMBackupRequest. -func (ivbr IaasVMBackupRequest) AsRequest() (*Request, bool) { - return nil, false -} - -// AsBasicRequest is the BasicRequest implementation for IaasVMBackupRequest. -func (ivbr IaasVMBackupRequest) AsBasicRequest() (BasicRequest, bool) { - return &ivbr, true -} - -// BasicIaaSVMContainer iaaS VM workload-specific container. -type BasicIaaSVMContainer interface { - AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) - AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) - AsIaaSVMContainer() (*IaaSVMContainer, bool) -} - -// IaaSVMContainer iaaS VM workload-specific container. -type IaaSVMContainer struct { - // VirtualMachineID - Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // VirtualMachineVersion - Specifies whether the container represents a Classic or an Azure Resource Manager VM. - VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` - // ResourceGroup - Resource group name of Recovery Services Vault. - ResourceGroup *string `json:"resourceGroup,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -func unmarshalBasicIaaSVMContainer(body []byte) (BasicIaaSVMContainer, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["containerType"] { - case string(ContainerTypeMicrosoftClassicComputevirtualMachines): - var aisccvc AzureIaaSClassicComputeVMContainer - err := json.Unmarshal(body, &aisccvc) - return aisccvc, err - case string(ContainerTypeMicrosoftComputevirtualMachines): - var aiscvc AzureIaaSComputeVMContainer - err := json.Unmarshal(body, &aiscvc) - return aiscvc, err - default: - var isc IaaSVMContainer - err := json.Unmarshal(body, &isc) - return isc, err - } -} -func unmarshalBasicIaaSVMContainerArray(body []byte) ([]BasicIaaSVMContainer, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - iscArray := make([]BasicIaaSVMContainer, len(rawMessages)) - - for index, rawMessage := range rawMessages { - isc, err := unmarshalBasicIaaSVMContainer(*rawMessage) - if err != nil { - return nil, err - } - iscArray[index] = isc - } - return iscArray, nil -} - -// MarshalJSON is the custom marshaler for IaaSVMContainer. -func (isc IaaSVMContainer) MarshalJSON() ([]byte, error) { - isc.ContainerType = ContainerTypeIaaSVMContainer - objectMap := make(map[string]interface{}) - if isc.VirtualMachineID != nil { - objectMap["virtualMachineId"] = isc.VirtualMachineID - } - if isc.VirtualMachineVersion != nil { - objectMap["virtualMachineVersion"] = isc.VirtualMachineVersion - } - if isc.ResourceGroup != nil { - objectMap["resourceGroup"] = isc.ResourceGroup - } - if isc.FriendlyName != nil { - objectMap["friendlyName"] = isc.FriendlyName - } - if isc.BackupManagementType != "" { - objectMap["backupManagementType"] = isc.BackupManagementType - } - if isc.RegistrationStatus != nil { - objectMap["registrationStatus"] = isc.RegistrationStatus - } - if isc.HealthStatus != nil { - objectMap["healthStatus"] = isc.HealthStatus - } - if isc.ContainerType != "" { - objectMap["containerType"] = isc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return &isc, true -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return &isc, true -} - -// AsMabContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &isc, true -} - -// IaasVMILRRegistrationRequest restore files/folders from a backup copy of IaaS VM. -type IaasVMILRRegistrationRequest struct { - // RecoveryPointID - ID of the IaaS VM backup copy from where the files/folders have to be restored. - RecoveryPointID *string `json:"recoveryPointId,omitempty"` - // VirtualMachineID - Fully qualified ARM ID of the virtual machine whose the files / folders have to be restored. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // InitiatorName - iSCSI initiator name. - InitiatorName *string `json:"initiatorName,omitempty"` - // RenewExistingRegistration - Whether to renew existing registration with the iSCSI server. - RenewExistingRegistration *bool `json:"renewExistingRegistration,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeAzureFileShareProvisionILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest' - ObjectType ObjectTypeBasicILRRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for IaasVMILRRegistrationRequest. -func (ivrr IaasVMILRRegistrationRequest) MarshalJSON() ([]byte, error) { - ivrr.ObjectType = ObjectTypeIaasVMILRRegistrationRequest - objectMap := make(map[string]interface{}) - if ivrr.RecoveryPointID != nil { - objectMap["recoveryPointId"] = ivrr.RecoveryPointID - } - if ivrr.VirtualMachineID != nil { - objectMap["virtualMachineId"] = ivrr.VirtualMachineID - } - if ivrr.InitiatorName != nil { - objectMap["initiatorName"] = ivrr.InitiatorName - } - if ivrr.RenewExistingRegistration != nil { - objectMap["renewExistingRegistration"] = ivrr.RenewExistingRegistration - } - if ivrr.ObjectType != "" { - objectMap["objectType"] = ivrr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProvisionILRRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. -func (ivrr IaasVMILRRegistrationRequest) AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) { - return nil, false -} - -// AsIaasVMILRRegistrationRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. -func (ivrr IaasVMILRRegistrationRequest) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) { - return &ivrr, true -} - -// AsILRRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. -func (ivrr IaasVMILRRegistrationRequest) AsILRRequest() (*ILRRequest, bool) { - return nil, false -} - -// AsBasicILRRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. -func (ivrr IaasVMILRRegistrationRequest) AsBasicILRRequest() (BasicILRRequest, bool) { - return &ivrr, true -} - -// BasicIaaSVMProtectableItem iaaS VM workload-specific backup item. -type BasicIaaSVMProtectableItem interface { - AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) - AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) - AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) -} - -// IaaSVMProtectableItem iaaS VM workload-specific backup item. -type IaaSVMProtectableItem struct { - // VirtualMachineID - Fully qualified ARM ID of the virtual machine. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -func unmarshalBasicIaaSVMProtectableItem(body []byte) (BasicIaaSVMProtectableItem, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["protectableItemType"] { - case string(ProtectableItemTypeMicrosoftClassicComputevirtualMachines): - var aisccvpi AzureIaaSClassicComputeVMProtectableItem - err := json.Unmarshal(body, &aisccvpi) - return aisccvpi, err - case string(ProtectableItemTypeMicrosoftComputevirtualMachines): - var aiscvpi AzureIaaSComputeVMProtectableItem - err := json.Unmarshal(body, &aiscvpi) - return aiscvpi, err - default: - var ispi IaaSVMProtectableItem - err := json.Unmarshal(body, &ispi) - return ispi, err - } -} -func unmarshalBasicIaaSVMProtectableItemArray(body []byte) ([]BasicIaaSVMProtectableItem, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - ispiArray := make([]BasicIaaSVMProtectableItem, len(rawMessages)) - - for index, rawMessage := range rawMessages { - ispi, err := unmarshalBasicIaaSVMProtectableItem(*rawMessage) - if err != nil { - return nil, err - } - ispiArray[index] = ispi - } - return ispiArray, nil -} - -// MarshalJSON is the custom marshaler for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) MarshalJSON() ([]byte, error) { - ispi.ProtectableItemType = ProtectableItemTypeIaaSVMProtectableItem - objectMap := make(map[string]interface{}) - if ispi.VirtualMachineID != nil { - objectMap["virtualMachineId"] = ispi.VirtualMachineID - } - if ispi.BackupManagementType != nil { - objectMap["backupManagementType"] = ispi.BackupManagementType - } - if ispi.WorkloadType != nil { - objectMap["workloadType"] = ispi.WorkloadType - } - if ispi.FriendlyName != nil { - objectMap["friendlyName"] = ispi.FriendlyName - } - if ispi.ProtectionState != "" { - objectMap["protectionState"] = ispi.ProtectionState - } - if ispi.ProtectableItemType != "" { - objectMap["protectableItemType"] = ispi.ProtectableItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false -} - -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return &ispi, true -} - -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return &ispi, true -} - -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &ispi, true -} - -// IaasVMRecoveryPoint iaaS VM workload specific backup copy. -type IaasVMRecoveryPoint struct { - // RecoveryPointType - READ-ONLY; Type of the backup copy. - RecoveryPointType *string `json:"recoveryPointType,omitempty"` - // RecoveryPointTime - READ-ONLY; Time at which this backup copy was created. - RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` - // RecoveryPointAdditionalInfo - READ-ONLY; Additional information associated with this backup copy. - RecoveryPointAdditionalInfo *string `json:"recoveryPointAdditionalInfo,omitempty"` - // SourceVMStorageType - READ-ONLY; Storage type of the VM whose backup copy is created. - SourceVMStorageType *string `json:"sourceVMStorageType,omitempty"` - // IsSourceVMEncrypted - READ-ONLY; Identifies whether the VM was encrypted when the backup copy is created. - IsSourceVMEncrypted *bool `json:"isSourceVMEncrypted,omitempty"` - // KeyAndSecret - Required details for recovering an encrypted VM. Applicable only when IsSourceVMEncrypted is true. - KeyAndSecret *KeyAndSecretDetails `json:"keyAndSecret,omitempty"` - // IsInstantIlrSessionActive - Is the session to recover items from this backup copy still active. - IsInstantIlrSessionActive *bool `json:"isInstantIlrSessionActive,omitempty"` - // RecoveryPointTierDetails - Recovery point tier information. - RecoveryPointTierDetails *[]RecoveryPointTierInformation `json:"recoveryPointTierDetails,omitempty"` - // IsManagedVirtualMachine - Whether VM is with Managed Disks - IsManagedVirtualMachine *bool `json:"isManagedVirtualMachine,omitempty"` - // VirtualMachineSize - Virtual Machine Size - VirtualMachineSize *string `json:"virtualMachineSize,omitempty"` - // OriginalStorageAccountOption - Original Storage Account Option - OriginalStorageAccountOption *bool `json:"originalStorageAccountOption,omitempty"` - // OsType - OS type - OsType *string `json:"osType,omitempty"` - // RecoveryPointDiskConfiguration - Disk configuration - RecoveryPointDiskConfiguration *RecoveryPointDiskConfiguration `json:"recoveryPointDiskConfiguration,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) MarshalJSON() ([]byte, error) { - ivrp.ObjectType = ObjectTypeIaasVMRecoveryPoint - objectMap := make(map[string]interface{}) - if ivrp.KeyAndSecret != nil { - objectMap["keyAndSecret"] = ivrp.KeyAndSecret - } - if ivrp.IsInstantIlrSessionActive != nil { - objectMap["isInstantIlrSessionActive"] = ivrp.IsInstantIlrSessionActive - } - if ivrp.RecoveryPointTierDetails != nil { - objectMap["recoveryPointTierDetails"] = ivrp.RecoveryPointTierDetails - } - if ivrp.IsManagedVirtualMachine != nil { - objectMap["isManagedVirtualMachine"] = ivrp.IsManagedVirtualMachine - } - if ivrp.VirtualMachineSize != nil { - objectMap["virtualMachineSize"] = ivrp.VirtualMachineSize - } - if ivrp.OriginalStorageAccountOption != nil { - objectMap["originalStorageAccountOption"] = ivrp.OriginalStorageAccountOption - } - if ivrp.OsType != nil { - objectMap["osType"] = ivrp.OsType - } - if ivrp.RecoveryPointDiskConfiguration != nil { - objectMap["recoveryPointDiskConfiguration"] = ivrp.RecoveryPointDiskConfiguration - } - if ivrp.ObjectType != "" { - objectMap["objectType"] = ivrp.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { - return nil, false -} - -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return &ivrp, true -} - -// AsRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return nil, false -} - -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &ivrp, true -} - -// IaasVMRestoreRequest iaaS VM workload-specific restore. -type IaasVMRestoreRequest struct { - // RecoveryPointID - ID of the backup copy to be recovered. - RecoveryPointID *string `json:"recoveryPointId,omitempty"` - // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM which is being recovered. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // TargetVirtualMachineID - This is the complete ARM Id of the VM that will be created. - // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} - TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` - // TargetResourceGroupID - This is the ARM Id of the resource group that you want to create for this Virtual machine and other artifacts. - // For e.g. /subscriptions/{subId}/resourcegroups/{rg} - TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` - // StorageAccountID - Fully qualified ARM ID of the storage account to which the VM has to be restored. - StorageAccountID *string `json:"storageAccountId,omitempty"` - // VirtualNetworkID - This is the virtual network Id of the vnet that will be attached to the virtual machine. - // User will be validated for join action permissions in the linked access. - VirtualNetworkID *string `json:"virtualNetworkId,omitempty"` - // SubnetID - Subnet ID, is the subnet ID associated with the to be restored VM. For Classic VMs it would be - // {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager VMs it would be ARM resource ID used to represent - // the subnet. - SubnetID *string `json:"subnetId,omitempty"` - // TargetDomainNameID - Fully qualified ARM ID of the domain name to be associated to the VM being restored. This applies only to Classic - // Virtual Machines. - TargetDomainNameID *string `json:"targetDomainNameId,omitempty"` - // Region - Region in which the virtual machine is restored. - Region *string `json:"region,omitempty"` - // AffinityGroup - Affinity group associated to VM to be restored. Used only for Classic Compute Virtual Machines. - AffinityGroup *string `json:"affinityGroup,omitempty"` - // CreateNewCloudService - Should a new cloud service be created while restoring the VM. If this is false, VM will be restored to the same - // cloud service as it was at the time of backup. - CreateNewCloudService *bool `json:"createNewCloudService,omitempty"` - // OriginalStorageAccountOption - Original Storage Account Option - OriginalStorageAccountOption *bool `json:"originalStorageAccountOption,omitempty"` - // EncryptionDetails - Details needed if the VM was encrypted at the time of backup. - EncryptionDetails *EncryptionDetails `json:"encryptionDetails,omitempty"` - // RestoreDiskLunList - List of Disk LUNs for partial restore - RestoreDiskLunList *[]int32 `json:"restoreDiskLunList,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) MarshalJSON() ([]byte, error) { - ivrr.ObjectType = ObjectTypeIaasVMRestoreRequest - objectMap := make(map[string]interface{}) - if ivrr.RecoveryPointID != nil { - objectMap["recoveryPointId"] = ivrr.RecoveryPointID - } - if ivrr.RecoveryType != "" { - objectMap["recoveryType"] = ivrr.RecoveryType - } - if ivrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = ivrr.SourceResourceID - } - if ivrr.TargetVirtualMachineID != nil { - objectMap["targetVirtualMachineId"] = ivrr.TargetVirtualMachineID - } - if ivrr.TargetResourceGroupID != nil { - objectMap["targetResourceGroupId"] = ivrr.TargetResourceGroupID - } - if ivrr.StorageAccountID != nil { - objectMap["storageAccountId"] = ivrr.StorageAccountID - } - if ivrr.VirtualNetworkID != nil { - objectMap["virtualNetworkId"] = ivrr.VirtualNetworkID - } - if ivrr.SubnetID != nil { - objectMap["subnetId"] = ivrr.SubnetID - } - if ivrr.TargetDomainNameID != nil { - objectMap["targetDomainNameId"] = ivrr.TargetDomainNameID - } - if ivrr.Region != nil { - objectMap["region"] = ivrr.Region - } - if ivrr.AffinityGroup != nil { - objectMap["affinityGroup"] = ivrr.AffinityGroup - } - if ivrr.CreateNewCloudService != nil { - objectMap["createNewCloudService"] = ivrr.CreateNewCloudService - } - if ivrr.OriginalStorageAccountOption != nil { - objectMap["originalStorageAccountOption"] = ivrr.OriginalStorageAccountOption - } - if ivrr.EncryptionDetails != nil { - objectMap["encryptionDetails"] = ivrr.EncryptionDetails - } - if ivrr.RestoreDiskLunList != nil { - objectMap["restoreDiskLunList"] = ivrr.RestoreDiskLunList - } - if ivrr.ObjectType != "" { - objectMap["objectType"] = ivrr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { - return &ivrr, true -} - -// AsRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return nil, false -} - -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &ivrr, true -} - -// BasicILRRequest parameters to Provision ILR API. -type BasicILRRequest interface { - AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) - AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) - AsILRRequest() (*ILRRequest, bool) -} - -// ILRRequest parameters to Provision ILR API. -type ILRRequest struct { - // ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeAzureFileShareProvisionILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest' - ObjectType ObjectTypeBasicILRRequest `json:"objectType,omitempty"` -} - -func unmarshalBasicILRRequest(body []byte) (BasicILRRequest, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeAzureFileShareProvisionILRRequest): - var afspir AzureFileShareProvisionILRRequest - err := json.Unmarshal(body, &afspir) - return afspir, err - case string(ObjectTypeIaasVMILRRegistrationRequest): - var ivrr IaasVMILRRegistrationRequest - err := json.Unmarshal(body, &ivrr) - return ivrr, err - default: - var ir ILRRequest - err := json.Unmarshal(body, &ir) - return ir, err - } -} -func unmarshalBasicILRRequestArray(body []byte) ([]BasicILRRequest, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - irArray := make([]BasicILRRequest, len(rawMessages)) - - for index, rawMessage := range rawMessages { - ir, err := unmarshalBasicILRRequest(*rawMessage) - if err != nil { - return nil, err - } - irArray[index] = ir - } - return irArray, nil -} - -// MarshalJSON is the custom marshaler for ILRRequest. -func (ir ILRRequest) MarshalJSON() ([]byte, error) { - ir.ObjectType = ObjectTypeILRRequest - objectMap := make(map[string]interface{}) - if ir.ObjectType != "" { - objectMap["objectType"] = ir.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProvisionILRRequest is the BasicILRRequest implementation for ILRRequest. -func (ir ILRRequest) AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) { - return nil, false -} - -// AsIaasVMILRRegistrationRequest is the BasicILRRequest implementation for ILRRequest. -func (ir ILRRequest) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) { - return nil, false -} - -// AsILRRequest is the BasicILRRequest implementation for ILRRequest. -func (ir ILRRequest) AsILRRequest() (*ILRRequest, bool) { - return &ir, true -} - -// AsBasicILRRequest is the BasicILRRequest implementation for ILRRequest. -func (ir ILRRequest) AsBasicILRRequest() (BasicILRRequest, bool) { - return &ir, true -} - -// ILRRequestResource parameters to Provision ILR API. -type ILRRequestResource struct { - // Properties - ILRRequestResource properties - Properties BasicILRRequest `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ILRRequestResource. -func (irr ILRRequestResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = irr.Properties - if irr.Location != nil { - objectMap["location"] = irr.Location - } - if irr.Tags != nil { - objectMap["tags"] = irr.Tags - } - if irr.ETag != nil { - objectMap["eTag"] = irr.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ILRRequestResource struct. -func (irr *ILRRequestResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicILRRequest(*v) - if err != nil { - return err - } - irr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - irr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - irr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - irr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - irr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - irr.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - irr.ETag = &eTag - } - } - } - - return nil -} - -// InquiryInfo details about inquired protectable items under a given container. -type InquiryInfo struct { - // Status - Inquiry Status for this container such as - // InProgress | Failed | Succeeded - Status *string `json:"status,omitempty"` - // ErrorDetail - Error Details if the Status is non-success. - ErrorDetail *ErrorDetail `json:"errorDetail,omitempty"` - // InquiryDetails - Inquiry Details which will have workload specific details. - // For e.g. - For SQL and oracle this will contain different details. - InquiryDetails *[]WorkloadInquiryDetails `json:"inquiryDetails,omitempty"` -} - -// InquiryValidation validation for inquired protectable items under a given container. -type InquiryValidation struct { - // Status - Status for the Inquiry Validation. - Status *string `json:"status,omitempty"` - // ErrorDetail - Error Detail in case the status is non-success. - ErrorDetail *ErrorDetail `json:"errorDetail,omitempty"` - // AdditionalDetail - READ-ONLY; Error Additional Detail in case the status is non-success. - AdditionalDetail *string `json:"additionalDetail,omitempty"` -} - -// MarshalJSON is the custom marshaler for InquiryValidation. -func (iv InquiryValidation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if iv.Status != nil { - objectMap["status"] = iv.Status - } - if iv.ErrorDetail != nil { - objectMap["errorDetail"] = iv.ErrorDetail - } - return json.Marshal(objectMap) -} - -// InstantItemRecoveryTarget target details for file / folder restore. -type InstantItemRecoveryTarget struct { - // ClientScripts - List of client scripts. - ClientScripts *[]ClientScriptForConnect `json:"clientScripts,omitempty"` -} - -// InstantRPAdditionalDetails ... -type InstantRPAdditionalDetails struct { - AzureBackupRGNamePrefix *string `json:"azureBackupRGNamePrefix,omitempty"` - AzureBackupRGNameSuffix *string `json:"azureBackupRGNameSuffix,omitempty"` -} - -// BasicJob defines workload agnostic properties for a job. -type BasicJob interface { - AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) - AsAzureStorageJob() (*AzureStorageJob, bool) - AsAzureWorkloadJob() (*AzureWorkloadJob, bool) - AsDpmJob() (*DpmJob, bool) - AsMabJob() (*MabJob, bool) - AsJob() (*Job, bool) -} - -// Job defines workload agnostic properties for a job. -type Job struct { - // EntityFriendlyName - Friendly name of the entity on which the current job is executing. - EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` - // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // Operation - The operation name. - Operation *string `json:"operation,omitempty"` - // Status - Job status. - Status *string `json:"status,omitempty"` - // StartTime - The start time. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time. - EndTime *date.Time `json:"endTime,omitempty"` - // ActivityID - ActivityId of job. - ActivityID *string `json:"activityId,omitempty"` - // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' - JobType JobType `json:"jobType,omitempty"` -} - -func unmarshalBasicJob(body []byte) (BasicJob, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["jobType"] { - case string(JobTypeAzureIaaSVMJob): - var aisj AzureIaaSVMJob - err := json.Unmarshal(body, &aisj) - return aisj, err - case string(JobTypeAzureStorageJob): - var asj AzureStorageJob - err := json.Unmarshal(body, &asj) - return asj, err - case string(JobTypeAzureWorkloadJob): - var awj AzureWorkloadJob - err := json.Unmarshal(body, &awj) - return awj, err - case string(JobTypeDpmJob): - var dj DpmJob - err := json.Unmarshal(body, &dj) - return dj, err - case string(JobTypeMabJob): - var mj MabJob - err := json.Unmarshal(body, &mj) - return mj, err - default: - var j Job - err := json.Unmarshal(body, &j) - return j, err - } -} -func unmarshalBasicJobArray(body []byte) ([]BasicJob, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - jArray := make([]BasicJob, len(rawMessages)) - - for index, rawMessage := range rawMessages { - j, err := unmarshalBasicJob(*rawMessage) - if err != nil { - return nil, err - } - jArray[index] = j - } - return jArray, nil -} - -// MarshalJSON is the custom marshaler for Job. -func (j Job) MarshalJSON() ([]byte, error) { - j.JobType = JobTypeJob - objectMap := make(map[string]interface{}) - if j.EntityFriendlyName != nil { - objectMap["entityFriendlyName"] = j.EntityFriendlyName - } - if j.BackupManagementType != "" { - objectMap["backupManagementType"] = j.BackupManagementType - } - if j.Operation != nil { - objectMap["operation"] = j.Operation - } - if j.Status != nil { - objectMap["status"] = j.Status - } - if j.StartTime != nil { - objectMap["startTime"] = j.StartTime - } - if j.EndTime != nil { - objectMap["endTime"] = j.EndTime - } - if j.ActivityID != nil { - objectMap["activityId"] = j.ActivityID - } - if j.JobType != "" { - objectMap["jobType"] = j.JobType - } - return json.Marshal(objectMap) -} - -// AsAzureIaaSVMJob is the BasicJob implementation for Job. -func (j Job) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { - return nil, false -} - -// AsAzureStorageJob is the BasicJob implementation for Job. -func (j Job) AsAzureStorageJob() (*AzureStorageJob, bool) { - return nil, false -} - -// AsAzureWorkloadJob is the BasicJob implementation for Job. -func (j Job) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { - return nil, false -} - -// AsDpmJob is the BasicJob implementation for Job. -func (j Job) AsDpmJob() (*DpmJob, bool) { - return nil, false -} - -// AsMabJob is the BasicJob implementation for Job. -func (j Job) AsMabJob() (*MabJob, bool) { - return nil, false -} - -// AsJob is the BasicJob implementation for Job. -func (j Job) AsJob() (*Job, bool) { - return &j, true -} - -// AsBasicJob is the BasicJob implementation for Job. -func (j Job) AsBasicJob() (BasicJob, bool) { - return &j, true -} - -// JobQueryObject filters to list the jobs. -type JobQueryObject struct { - // Status - Status of the job. Possible values include: 'JobStatusInvalid', 'JobStatusInProgress', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusCompletedWithWarnings', 'JobStatusCancelled', 'JobStatusCancelling' - Status JobStatus `json:"status,omitempty"` - // BackupManagementType - Type of backup management for the job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // Operation - Type of operation. Possible values include: 'JobOperationTypeInvalid', 'JobOperationTypeRegister', 'JobOperationTypeUnRegister', 'JobOperationTypeConfigureBackup', 'JobOperationTypeBackup', 'JobOperationTypeRestore', 'JobOperationTypeDisableBackup', 'JobOperationTypeDeleteBackupData', 'JobOperationTypeCrossRegionRestore', 'JobOperationTypeUndelete' - Operation JobOperationType `json:"operation,omitempty"` - // JobID - JobID represents the job uniquely. - JobID *string `json:"jobId,omitempty"` - // StartTime - Job has started at this time. Value is in UTC. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - Job has ended at this time. Value is in UTC. - EndTime *date.Time `json:"endTime,omitempty"` -} - -// JobResource defines workload agnostic properties for a job. -type JobResource struct { - autorest.Response `json:"-"` - // Properties - JobResource properties - Properties BasicJob `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for JobResource. -func (jr JobResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = jr.Properties - if jr.Location != nil { - objectMap["location"] = jr.Location - } - if jr.Tags != nil { - objectMap["tags"] = jr.Tags - } - if jr.ETag != nil { - objectMap["eTag"] = jr.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for JobResource struct. -func (jr *JobResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicJob(*v) - if err != nil { - return err - } - jr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - jr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - jr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - jr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - jr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - jr.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - jr.ETag = &eTag - } - } - } - - return nil -} - -// JobResourceList list of Job resources -type JobResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]JobResource `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"` -} - -// JobResourceListIterator provides access to a complete listing of JobResource values. -type JobResourceListIterator struct { - i int - page JobResourceListPage -} - -// NextWithContext 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 *JobResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *JobResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter JobResourceListIterator) 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 JobResourceListIterator) Response() JobResourceList { - 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 JobResourceListIterator) Value() JobResource { - if !iter.page.NotDone() { - return JobResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the JobResourceListIterator type. -func NewJobResourceListIterator(page JobResourceListPage) JobResourceListIterator { - return JobResourceListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (jrl JobResourceList) IsEmpty() bool { - return jrl.Value == nil || len(*jrl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (jrl JobResourceList) hasNextLink() bool { - return jrl.NextLink != nil && len(*jrl.NextLink) != 0 -} - -// jobResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (jrl JobResourceList) jobResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !jrl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(jrl.NextLink))) -} - -// JobResourceListPage contains a page of JobResource values. -type JobResourceListPage struct { - fn func(context.Context, JobResourceList) (JobResourceList, error) - jrl JobResourceList -} - -// NextWithContext 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 *JobResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.jrl) - if err != nil { - return err - } - page.jrl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *JobResourceListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page JobResourceListPage) NotDone() bool { - return !page.jrl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page JobResourceListPage) Response() JobResourceList { - return page.jrl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page JobResourceListPage) Values() []JobResource { - if page.jrl.IsEmpty() { - return nil - } - return *page.jrl.Value -} - -// Creates a new instance of the JobResourceListPage type. -func NewJobResourceListPage(cur JobResourceList, getNextPage func(context.Context, JobResourceList) (JobResourceList, error)) JobResourceListPage { - return JobResourceListPage{ - fn: getNextPage, - jrl: cur, - } -} - -// KEKDetails KEK is encryption key for BEK. -type KEKDetails struct { - // KeyURL - Key is KEK. - KeyURL *string `json:"keyUrl,omitempty"` - // KeyVaultID - Key Vault ID where this Key is stored. - KeyVaultID *string `json:"keyVaultId,omitempty"` - // KeyBackupData - KEK data. - KeyBackupData *string `json:"keyBackupData,omitempty"` -} - -// KeyAndSecretDetails BEK is bitlocker key. -// KEK is encryption key for BEK -// If the VM was encrypted then we will store following details : -// 1. Secret(BEK) - Url + Backup Data + vaultId. -// 2. Key(KEK) - Url + Backup Data + vaultId. -// 3. EncryptionMechanism -// BEK and KEK can potentially have different vault ids. -type KeyAndSecretDetails struct { - // KekDetails - KEK is encryption key for BEK. - KekDetails *KEKDetails `json:"kekDetails,omitempty"` - // BekDetails - BEK is bitlocker encryption key. - BekDetails *BEKDetails `json:"bekDetails,omitempty"` - // EncryptionMechanism - Encryption mechanism: None/ SinglePass/ DoublePass - EncryptionMechanism *string `json:"encryptionMechanism,omitempty"` -} - -// KPIResourceHealthDetails KPI Resource Health Details -type KPIResourceHealthDetails struct { - // ResourceHealthStatus - Resource Health Status. Possible values include: 'ResourceHealthStatusHealthy', 'ResourceHealthStatusTransientDegraded', 'ResourceHealthStatusPersistentDegraded', 'ResourceHealthStatusTransientUnhealthy', 'ResourceHealthStatusPersistentUnhealthy', 'ResourceHealthStatusInvalid' - ResourceHealthStatus ResourceHealthStatus `json:"resourceHealthStatus,omitempty"` - // ResourceHealthDetails - Resource Health Status - ResourceHealthDetails *[]ResourceHealthDetails `json:"resourceHealthDetails,omitempty"` -} - -// LogSchedulePolicy log policy schedule. -type LogSchedulePolicy struct { - // ScheduleFrequencyInMins - Frequency of the log schedule operation of this policy in minutes. - ScheduleFrequencyInMins *int32 `json:"scheduleFrequencyInMins,omitempty"` - // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' - SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` -} - -// MarshalJSON is the custom marshaler for LogSchedulePolicy. -func (lsp LogSchedulePolicy) MarshalJSON() ([]byte, error) { - lsp.SchedulePolicyType = SchedulePolicyTypeLogSchedulePolicy - objectMap := make(map[string]interface{}) - if lsp.ScheduleFrequencyInMins != nil { - objectMap["scheduleFrequencyInMins"] = lsp.ScheduleFrequencyInMins - } - if lsp.SchedulePolicyType != "" { - objectMap["schedulePolicyType"] = lsp.SchedulePolicyType - } - return json.Marshal(objectMap) -} - -// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. -func (lsp LogSchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { - return &lsp, true -} - -// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. -func (lsp LogSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { - return nil, false -} - -// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. -func (lsp LogSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { - return nil, false -} - -// AsSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. -func (lsp LogSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { - return nil, false -} - -// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. -func (lsp LogSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { - return &lsp, true -} - -// LongTermRetentionPolicy long term retention policy. -type LongTermRetentionPolicy struct { - // DailySchedule - Daily retention schedule of the protection policy. - DailySchedule *DailyRetentionSchedule `json:"dailySchedule,omitempty"` - // WeeklySchedule - Weekly retention schedule of the protection policy. - WeeklySchedule *WeeklyRetentionSchedule `json:"weeklySchedule,omitempty"` - // MonthlySchedule - Monthly retention schedule of the protection policy. - MonthlySchedule *MonthlyRetentionSchedule `json:"monthlySchedule,omitempty"` - // YearlySchedule - Yearly retention schedule of the protection policy. - YearlySchedule *YearlyRetentionSchedule `json:"yearlySchedule,omitempty"` - // RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy' - RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"` -} - -// MarshalJSON is the custom marshaler for LongTermRetentionPolicy. -func (ltrp LongTermRetentionPolicy) MarshalJSON() ([]byte, error) { - ltrp.RetentionPolicyType = RetentionPolicyTypeLongTermRetentionPolicy - objectMap := make(map[string]interface{}) - if ltrp.DailySchedule != nil { - objectMap["dailySchedule"] = ltrp.DailySchedule - } - if ltrp.WeeklySchedule != nil { - objectMap["weeklySchedule"] = ltrp.WeeklySchedule - } - if ltrp.MonthlySchedule != nil { - objectMap["monthlySchedule"] = ltrp.MonthlySchedule - } - if ltrp.YearlySchedule != nil { - objectMap["yearlySchedule"] = ltrp.YearlySchedule - } - if ltrp.RetentionPolicyType != "" { - objectMap["retentionPolicyType"] = ltrp.RetentionPolicyType - } - return json.Marshal(objectMap) -} - -// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. -func (ltrp LongTermRetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) { - return <rp, true -} - -// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. -func (ltrp LongTermRetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) { - return nil, false -} - -// AsRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. -func (ltrp LongTermRetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) { - return nil, false -} - -// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. -func (ltrp LongTermRetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) { - return <rp, true -} - -// LongTermSchedulePolicy long term policy schedule. -type LongTermSchedulePolicy struct { - // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' - SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` -} - -// MarshalJSON is the custom marshaler for LongTermSchedulePolicy. -func (ltsp LongTermSchedulePolicy) MarshalJSON() ([]byte, error) { - ltsp.SchedulePolicyType = SchedulePolicyTypeLongTermSchedulePolicy - objectMap := make(map[string]interface{}) - if ltsp.SchedulePolicyType != "" { - objectMap["schedulePolicyType"] = ltsp.SchedulePolicyType - } - return json.Marshal(objectMap) -} - -// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. -func (ltsp LongTermSchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { - return nil, false -} - -// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. -func (ltsp LongTermSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { - return <sp, true -} - -// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. -func (ltsp LongTermSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { - return nil, false -} - -// AsSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. -func (ltsp LongTermSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { - return nil, false -} - -// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. -func (ltsp LongTermSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { - return <sp, true -} - -// MabContainer container with items backed up using MAB backup engine. -type MabContainer struct { - // CanReRegister - Can the container be registered one more time. - CanReRegister *bool `json:"canReRegister,omitempty"` - // ContainerID - ContainerID represents the container. - ContainerID *int64 `json:"containerId,omitempty"` - // ProtectedItemCount - Number of items backed up in this container. - ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` - // AgentVersion - Agent version of this container. - AgentVersion *string `json:"agentVersion,omitempty"` - // ExtendedInfo - Additional information for this container - ExtendedInfo *MabContainerExtendedInfo `json:"extendedInfo,omitempty"` - // MabContainerHealthDetails - Health details on this mab container. - MabContainerHealthDetails *[]MABContainerHealthDetails `json:"mabContainerHealthDetails,omitempty"` - // ContainerHealthState - Health state of mab container. - ContainerHealthState *string `json:"containerHealthState,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for MabContainer. -func (mc MabContainer) MarshalJSON() ([]byte, error) { - mc.ContainerType = ContainerTypeWindows1 - objectMap := make(map[string]interface{}) - if mc.CanReRegister != nil { - objectMap["canReRegister"] = mc.CanReRegister - } - if mc.ContainerID != nil { - objectMap["containerId"] = mc.ContainerID - } - if mc.ProtectedItemCount != nil { - objectMap["protectedItemCount"] = mc.ProtectedItemCount - } - if mc.AgentVersion != nil { - objectMap["agentVersion"] = mc.AgentVersion - } - if mc.ExtendedInfo != nil { - objectMap["extendedInfo"] = mc.ExtendedInfo - } - if mc.MabContainerHealthDetails != nil { - objectMap["mabContainerHealthDetails"] = mc.MabContainerHealthDetails - } - if mc.ContainerHealthState != nil { - objectMap["containerHealthState"] = mc.ContainerHealthState - } - if mc.FriendlyName != nil { - objectMap["friendlyName"] = mc.FriendlyName - } - if mc.BackupManagementType != "" { - objectMap["backupManagementType"] = mc.BackupManagementType - } - if mc.RegistrationStatus != nil { - objectMap["registrationStatus"] = mc.RegistrationStatus - } - if mc.HealthStatus != nil { - objectMap["healthStatus"] = mc.HealthStatus - } - if mc.ContainerType != "" { - objectMap["containerType"] = mc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false -} - -// AsMabContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsMabContainer() (*MabContainer, bool) { - return &mc, true -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &mc, true -} - -// MabContainerExtendedInfo additional information of the container. -type MabContainerExtendedInfo struct { - // LastRefreshedAt - Time stamp when this container was refreshed. - LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` - // BackupItemType - Type of backup items associated with this container. Possible values include: 'ItemTypeInvalid', 'ItemTypeVM', 'ItemTypeFileFolder', 'ItemTypeAzureSQLDb', 'ItemTypeSQLDB', 'ItemTypeExchange', 'ItemTypeSharepoint', 'ItemTypeVMwareVM', 'ItemTypeSystemState', 'ItemTypeClient', 'ItemTypeGenericDataSource', 'ItemTypeSQLDataBase', 'ItemTypeAzureFileShare', 'ItemTypeSAPHanaDatabase', 'ItemTypeSAPAseDatabase' - BackupItemType ItemType `json:"backupItemType,omitempty"` - // BackupItems - List of backup items associated with this container. - BackupItems *[]string `json:"backupItems,omitempty"` - // PolicyName - Backup policy associated with this container. - PolicyName *string `json:"policyName,omitempty"` - // LastBackupStatus - Latest backup status of this container. - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` -} - -// MABContainerHealthDetails MAB workload-specific Health Details. -type MABContainerHealthDetails struct { - // Code - Health Code - Code *int32 `json:"code,omitempty"` - // Title - Health Title - Title *string `json:"title,omitempty"` - // Message - Health Message - Message *string `json:"message,omitempty"` - // Recommendations - Health Recommended Actions - Recommendations *[]string `json:"recommendations,omitempty"` -} - -// MabErrorInfo MAB workload-specific error information. -type MabErrorInfo struct { - // ErrorString - READ-ONLY; Localized error string. - ErrorString *string `json:"errorString,omitempty"` - // Recommendations - READ-ONLY; List of localized recommendations. - Recommendations *[]string `json:"recommendations,omitempty"` -} - -// MarshalJSON is the custom marshaler for MabErrorInfo. -func (mei MabErrorInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// MabFileFolderProtectedItem MAB workload-specific backup item. -type MabFileFolderProtectedItem struct { - // FriendlyName - Friendly name of this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ComputerName - Name of the computer associated with this backup item. - ComputerName *string `json:"computerName,omitempty"` - // LastBackupStatus - Status of last backup operation. - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // ProtectionState - Protected, ProtectionStopped, IRPending or ProtectionError - ProtectionState *string `json:"protectionState,omitempty"` - // DeferredDeleteSyncTimeInUTC - Sync time for deferred deletion in UTC - DeferredDeleteSyncTimeInUTC *int64 `json:"deferredDeleteSyncTimeInUTC,omitempty"` - // ExtendedInfo - Additional information with this backup item. - ExtendedInfo *MabFileFolderProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) MarshalJSON() ([]byte, error) { - mffpi.ProtectedItemType = ProtectedItemTypeMabFileFolderProtectedItem - objectMap := make(map[string]interface{}) - if mffpi.FriendlyName != nil { - objectMap["friendlyName"] = mffpi.FriendlyName - } - if mffpi.ComputerName != nil { - objectMap["computerName"] = mffpi.ComputerName - } - if mffpi.LastBackupStatus != nil { - objectMap["lastBackupStatus"] = mffpi.LastBackupStatus - } - if mffpi.LastBackupTime != nil { - objectMap["lastBackupTime"] = mffpi.LastBackupTime - } - if mffpi.ProtectionState != nil { - objectMap["protectionState"] = mffpi.ProtectionState - } - if mffpi.DeferredDeleteSyncTimeInUTC != nil { - objectMap["deferredDeleteSyncTimeInUTC"] = mffpi.DeferredDeleteSyncTimeInUTC - } - if mffpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = mffpi.ExtendedInfo - } - if mffpi.BackupManagementType != "" { - objectMap["backupManagementType"] = mffpi.BackupManagementType - } - if mffpi.WorkloadType != "" { - objectMap["workloadType"] = mffpi.WorkloadType - } - if mffpi.ContainerName != nil { - objectMap["containerName"] = mffpi.ContainerName - } - if mffpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = mffpi.SourceResourceID - } - if mffpi.PolicyID != nil { - objectMap["policyId"] = mffpi.PolicyID - } - if mffpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = mffpi.LastRecoveryPoint - } - if mffpi.BackupSetName != nil { - objectMap["backupSetName"] = mffpi.BackupSetName - } - if mffpi.CreateMode != "" { - objectMap["createMode"] = mffpi.CreateMode - } - if mffpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = mffpi.DeferredDeleteTimeInUTC - } - if mffpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = mffpi.IsScheduledForDeferredDelete - } - if mffpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = mffpi.DeferredDeleteTimeRemaining - } - if mffpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = mffpi.IsDeferredDeleteScheduleUpcoming - } - if mffpi.IsRehydrate != nil { - objectMap["isRehydrate"] = mffpi.IsRehydrate - } - if mffpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = mffpi.ProtectedItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return nil, false -} - -// AsDPMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return nil, false -} - -// AsGenericProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return nil, false -} - -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return &mffpi, true -} - -// AsProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return nil, false -} - -// AsBasicProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &mffpi, true -} - -// MabFileFolderProtectedItemExtendedInfo additional information on the backed up item. -type MabFileFolderProtectedItemExtendedInfo struct { - // LastRefreshedAt - Last time when the agent data synced to service. - LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` - // OldestRecoveryPoint - The oldest backup copy available. - OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` - // RecoveryPointCount - Number of backup copies associated with the backup item. - RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` -} - -// MabJob MAB workload-specific job. -type MabJob struct { - // Duration - Time taken by job to run. - Duration *string `json:"duration,omitempty"` - // ActionsInfo - The state/actions applicable on jobs like cancel/retry. - ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` - // MabServerName - Name of server protecting the DS. - MabServerName *string `json:"mabServerName,omitempty"` - // MabServerType - Server type of MAB container. Possible values include: 'MabServerTypeInvalid', 'MabServerTypeUnknown', 'MabServerTypeIaasVMContainer', 'MabServerTypeIaasVMServiceContainer', 'MabServerTypeDPMContainer', 'MabServerTypeAzureBackupServerContainer', 'MabServerTypeMABContainer', 'MabServerTypeCluster', 'MabServerTypeAzureSQLContainer', 'MabServerTypeWindows', 'MabServerTypeVCenter', 'MabServerTypeVMAppContainer', 'MabServerTypeSQLAGWorkLoadContainer', 'MabServerTypeStorageContainer', 'MabServerTypeGenericContainer' - MabServerType MabServerType `json:"mabServerType,omitempty"` - // WorkloadType - Workload type of backup item. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` - // ErrorDetails - The errors. - ErrorDetails *[]MabErrorInfo `json:"errorDetails,omitempty"` - // ExtendedInfo - Additional information on the job. - ExtendedInfo *MabJobExtendedInfo `json:"extendedInfo,omitempty"` - // EntityFriendlyName - Friendly name of the entity on which the current job is executing. - EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` - // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // Operation - The operation name. - Operation *string `json:"operation,omitempty"` - // Status - Job status. - Status *string `json:"status,omitempty"` - // StartTime - The start time. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time. - EndTime *date.Time `json:"endTime,omitempty"` - // ActivityID - ActivityId of job. - ActivityID *string `json:"activityId,omitempty"` - // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' - JobType JobType `json:"jobType,omitempty"` -} - -// MarshalJSON is the custom marshaler for MabJob. -func (mj MabJob) MarshalJSON() ([]byte, error) { - mj.JobType = JobTypeMabJob - objectMap := make(map[string]interface{}) - if mj.Duration != nil { - objectMap["duration"] = mj.Duration - } - if mj.ActionsInfo != nil { - objectMap["actionsInfo"] = mj.ActionsInfo - } - if mj.MabServerName != nil { - objectMap["mabServerName"] = mj.MabServerName - } - if mj.MabServerType != "" { - objectMap["mabServerType"] = mj.MabServerType - } - if mj.WorkloadType != "" { - objectMap["workloadType"] = mj.WorkloadType - } - if mj.ErrorDetails != nil { - objectMap["errorDetails"] = mj.ErrorDetails - } - if mj.ExtendedInfo != nil { - objectMap["extendedInfo"] = mj.ExtendedInfo - } - if mj.EntityFriendlyName != nil { - objectMap["entityFriendlyName"] = mj.EntityFriendlyName - } - if mj.BackupManagementType != "" { - objectMap["backupManagementType"] = mj.BackupManagementType - } - if mj.Operation != nil { - objectMap["operation"] = mj.Operation - } - if mj.Status != nil { - objectMap["status"] = mj.Status - } - if mj.StartTime != nil { - objectMap["startTime"] = mj.StartTime - } - if mj.EndTime != nil { - objectMap["endTime"] = mj.EndTime - } - if mj.ActivityID != nil { - objectMap["activityId"] = mj.ActivityID - } - if mj.JobType != "" { - objectMap["jobType"] = mj.JobType - } - return json.Marshal(objectMap) -} - -// AsAzureIaaSVMJob is the BasicJob implementation for MabJob. -func (mj MabJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { - return nil, false -} - -// AsAzureStorageJob is the BasicJob implementation for MabJob. -func (mj MabJob) AsAzureStorageJob() (*AzureStorageJob, bool) { - return nil, false -} - -// AsAzureWorkloadJob is the BasicJob implementation for MabJob. -func (mj MabJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { - return nil, false -} - -// AsDpmJob is the BasicJob implementation for MabJob. -func (mj MabJob) AsDpmJob() (*DpmJob, bool) { - return nil, false -} - -// AsMabJob is the BasicJob implementation for MabJob. -func (mj MabJob) AsMabJob() (*MabJob, bool) { - return &mj, true -} - -// AsJob is the BasicJob implementation for MabJob. -func (mj MabJob) AsJob() (*Job, bool) { - return nil, false -} - -// AsBasicJob is the BasicJob implementation for MabJob. -func (mj MabJob) AsBasicJob() (BasicJob, bool) { - return &mj, true -} - -// MabJobExtendedInfo additional information for the MAB workload-specific job. -type MabJobExtendedInfo struct { - // TasksList - List of tasks for this job. - TasksList *[]MabJobTaskDetails `json:"tasksList,omitempty"` - // PropertyBag - The job properties. - PropertyBag map[string]*string `json:"propertyBag"` - // DynamicErrorMessage - Non localized error message specific to this job. - DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` -} - -// MarshalJSON is the custom marshaler for MabJobExtendedInfo. -func (mjei MabJobExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mjei.TasksList != nil { - objectMap["tasksList"] = mjei.TasksList - } - if mjei.PropertyBag != nil { - objectMap["propertyBag"] = mjei.PropertyBag - } - if mjei.DynamicErrorMessage != nil { - objectMap["dynamicErrorMessage"] = mjei.DynamicErrorMessage - } - return json.Marshal(objectMap) -} - -// MabJobTaskDetails MAB workload-specific job task details. -type MabJobTaskDetails struct { - // TaskID - The task display name. - TaskID *string `json:"taskId,omitempty"` - // StartTime - The start time. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time. - EndTime *date.Time `json:"endTime,omitempty"` - // Duration - Time elapsed for task. - Duration *string `json:"duration,omitempty"` - // Status - The status. - Status *string `json:"status,omitempty"` -} - -// MabProtectionPolicy mab container-specific backup policy. -type MabProtectionPolicy struct { - // SchedulePolicy - Backup schedule of backup policy. - SchedulePolicy BasicSchedulePolicy `json:"schedulePolicy,omitempty"` - // RetentionPolicy - Retention policy details. - RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` - // ProtectedItemsCount - Number of items associated with this policy. - ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' - BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` -} - -// MarshalJSON is the custom marshaler for MabProtectionPolicy. -func (mpp MabProtectionPolicy) MarshalJSON() ([]byte, error) { - mpp.BackupManagementType = BackupManagementTypeMAB - objectMap := make(map[string]interface{}) - objectMap["schedulePolicy"] = mpp.SchedulePolicy - objectMap["retentionPolicy"] = mpp.RetentionPolicy - if mpp.ProtectedItemsCount != nil { - objectMap["protectedItemsCount"] = mpp.ProtectedItemsCount - } - if mpp.BackupManagementType != "" { - objectMap["backupManagementType"] = mpp.BackupManagementType - } - return json.Marshal(objectMap) -} - -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { - return nil, false -} - -// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { - return nil, false -} - -// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { - return nil, false -} - -// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { - return nil, false -} - -// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { - return &mpp, true -} - -// AsProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { - return nil, false -} - -// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { - return &mpp, true -} - -// UnmarshalJSON is the custom unmarshaler for MabProtectionPolicy struct. -func (mpp *MabProtectionPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "schedulePolicy": - if v != nil { - schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) - if err != nil { - return err - } - mpp.SchedulePolicy = schedulePolicy - } - case "retentionPolicy": - if v != nil { - retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) - if err != nil { - return err - } - mpp.RetentionPolicy = retentionPolicy - } - case "protectedItemsCount": - if v != nil { - var protectedItemsCount int32 - err = json.Unmarshal(*v, &protectedItemsCount) - if err != nil { - return err - } - mpp.ProtectedItemsCount = &protectedItemsCount - } - case "backupManagementType": - if v != nil { - var backupManagementType ManagementTypeBasicProtectionPolicy - err = json.Unmarshal(*v, &backupManagementType) - if err != nil { - return err - } - mpp.BackupManagementType = backupManagementType - } - } - } - - return nil -} - -// ManagementUsage backup management usages of a vault. -type ManagementUsage struct { - // Unit - Unit of the usage. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond' - Unit UsagesUnit `json:"unit,omitempty"` - // QuotaPeriod - Quota period of usage. - QuotaPeriod *string `json:"quotaPeriod,omitempty"` - // NextResetTime - Next reset time of usage. - NextResetTime *date.Time `json:"nextResetTime,omitempty"` - // CurrentValue - Current value of usage. - CurrentValue *int64 `json:"currentValue,omitempty"` - // Limit - Limit of usage. - Limit *int64 `json:"limit,omitempty"` - // Name - Name of usage. - Name *NameInfo `json:"name,omitempty"` -} - -// ManagementUsageList backup management usage for vault. -type ManagementUsageList struct { - autorest.Response `json:"-"` - // Value - The list of backup management usages for the given vault. - Value *[]ManagementUsage `json:"value,omitempty"` -} - -// MonthlyRetentionSchedule monthly retention schedule. -type MonthlyRetentionSchedule struct { - // RetentionScheduleFormatType - Retention schedule format type for monthly retention policy. Possible values include: 'RetentionScheduleFormatInvalid', 'RetentionScheduleFormatDaily', 'RetentionScheduleFormatWeekly' - RetentionScheduleFormatType RetentionScheduleFormat `json:"retentionScheduleFormatType,omitempty"` - // RetentionScheduleDaily - Daily retention format for monthly retention policy. - RetentionScheduleDaily *DailyRetentionFormat `json:"retentionScheduleDaily,omitempty"` - // RetentionScheduleWeekly - Weekly retention format for monthly retention policy. - RetentionScheduleWeekly *WeeklyRetentionFormat `json:"retentionScheduleWeekly,omitempty"` - // RetentionTimes - Retention times of retention policy. - RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` - // RetentionDuration - Retention duration of retention Policy. - RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` -} - -// NameInfo the name of usage. -type NameInfo struct { - // Value - Value of usage. - Value *string `json:"value,omitempty"` - // LocalizedValue - Localized value of usage. - LocalizedValue *string `json:"localizedValue,omitempty"` -} - -// OperationResultInfo operation result info. -type OperationResultInfo struct { - // JobList - List of jobs created by this operation. - JobList *[]string `json:"jobList,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeOperationResultInfoBase', 'ObjectTypeExportJobsOperationResultInfo', 'ObjectTypeOperationResultInfo' - ObjectType ObjectType `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationResultInfo. -func (ori OperationResultInfo) MarshalJSON() ([]byte, error) { - ori.ObjectType = ObjectTypeOperationResultInfo - objectMap := make(map[string]interface{}) - if ori.JobList != nil { - objectMap["jobList"] = ori.JobList - } - if ori.ObjectType != "" { - objectMap["objectType"] = ori.ObjectType - } - return json.Marshal(objectMap) -} - -// AsExportJobsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfo. -func (ori OperationResultInfo) AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) { - return nil, false -} - -// AsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfo. -func (ori OperationResultInfo) AsOperationResultInfo() (*OperationResultInfo, bool) { - return &ori, true -} - -// AsOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfo. -func (ori OperationResultInfo) AsOperationResultInfoBase() (*OperationResultInfoBase, bool) { - return nil, false -} - -// AsBasicOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfo. -func (ori OperationResultInfo) AsBasicOperationResultInfoBase() (BasicOperationResultInfoBase, bool) { - return &ori, true -} - -// BasicOperationResultInfoBase base class for operation result info. -type BasicOperationResultInfoBase interface { - AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) - AsOperationResultInfo() (*OperationResultInfo, bool) - AsOperationResultInfoBase() (*OperationResultInfoBase, bool) -} - -// OperationResultInfoBase base class for operation result info. -type OperationResultInfoBase struct { - // ObjectType - Possible values include: 'ObjectTypeOperationResultInfoBase', 'ObjectTypeExportJobsOperationResultInfo', 'ObjectTypeOperationResultInfo' - ObjectType ObjectType `json:"objectType,omitempty"` -} - -func unmarshalBasicOperationResultInfoBase(body []byte) (BasicOperationResultInfoBase, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeExportJobsOperationResultInfo): - var ejori ExportJobsOperationResultInfo - err := json.Unmarshal(body, &ejori) - return ejori, err - case string(ObjectTypeOperationResultInfo): - var ori OperationResultInfo - err := json.Unmarshal(body, &ori) - return ori, err - default: - var orib OperationResultInfoBase - err := json.Unmarshal(body, &orib) - return orib, err - } -} -func unmarshalBasicOperationResultInfoBaseArray(body []byte) ([]BasicOperationResultInfoBase, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - oribArray := make([]BasicOperationResultInfoBase, len(rawMessages)) - - for index, rawMessage := range rawMessages { - orib, err := unmarshalBasicOperationResultInfoBase(*rawMessage) - if err != nil { - return nil, err - } - oribArray[index] = orib - } - return oribArray, nil -} - -// MarshalJSON is the custom marshaler for OperationResultInfoBase. -func (orib OperationResultInfoBase) MarshalJSON() ([]byte, error) { - orib.ObjectType = ObjectTypeOperationResultInfoBase - objectMap := make(map[string]interface{}) - if orib.ObjectType != "" { - objectMap["objectType"] = orib.ObjectType - } - return json.Marshal(objectMap) -} - -// AsExportJobsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. -func (orib OperationResultInfoBase) AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) { - return nil, false -} - -// AsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. -func (orib OperationResultInfoBase) AsOperationResultInfo() (*OperationResultInfo, bool) { - return nil, false -} - -// AsOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. -func (orib OperationResultInfoBase) AsOperationResultInfoBase() (*OperationResultInfoBase, bool) { - return &orib, true -} - -// AsBasicOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. -func (orib OperationResultInfoBase) AsBasicOperationResultInfoBase() (BasicOperationResultInfoBase, bool) { - return &orib, true -} - -// OperationResultInfoBaseResource base class for operation result info. -type OperationResultInfoBaseResource struct { - autorest.Response `json:"-"` - // Operation - OperationResultInfoBaseResource operation - Operation BasicOperationResultInfoBase `json:"operation,omitempty"` - // StatusCode - 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' - StatusCode HTTPStatusCode `json:"statusCode,omitempty"` - // Headers - HTTP headers associated with this operation. - Headers map[string][]string `json:"headers"` -} - -// MarshalJSON is the custom marshaler for OperationResultInfoBaseResource. -func (oribr OperationResultInfoBaseResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["operation"] = oribr.Operation - if oribr.StatusCode != "" { - objectMap["statusCode"] = oribr.StatusCode - } - if oribr.Headers != nil { - objectMap["headers"] = oribr.Headers - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for OperationResultInfoBaseResource struct. -func (oribr *OperationResultInfoBaseResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "operation": - if v != nil { - operation, err := unmarshalBasicOperationResultInfoBase(*v) - if err != nil { - return err - } - oribr.Operation = operation - } - case "statusCode": - if v != nil { - var statusCode HTTPStatusCode - err = json.Unmarshal(*v, &statusCode) - if err != nil { - return err - } - oribr.StatusCode = statusCode - } - case "headers": - if v != nil { - var headers map[string][]string - err = json.Unmarshal(*v, &headers) - if err != nil { - return err - } - oribr.Headers = headers - } - } - } - - return nil -} - -// OperationStatus operation status. -type OperationStatus struct { - autorest.Response `json:"-"` - // ID - ID of the operation. - ID *string `json:"id,omitempty"` - // Name - Name of the operation. - Name *string `json:"name,omitempty"` - // Status - Operation status. Possible values include: 'OperationStatusValuesInvalid', 'OperationStatusValuesInProgress', 'OperationStatusValuesSucceeded', 'OperationStatusValuesFailed', 'OperationStatusValuesCanceled' - Status OperationStatusValues `json:"status,omitempty"` - // StartTime - Operation start time. Format: ISO-8601. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - Operation end time. Format: ISO-8601. - EndTime *date.Time `json:"endTime,omitempty"` - // Error - Error information related to this operation. - Error *OperationStatusError `json:"error,omitempty"` - // Properties - Additional information associated with this operation. - Properties BasicOperationStatusExtendedInfo `json:"properties,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for OperationStatus struct. -func (osVar *OperationStatus) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - osVar.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - osVar.Name = &name - } - case "status": - if v != nil { - var status OperationStatusValues - err = json.Unmarshal(*v, &status) - if err != nil { - return err - } - osVar.Status = status - } - case "startTime": - if v != nil { - var startTime date.Time - err = json.Unmarshal(*v, &startTime) - if err != nil { - return err - } - osVar.StartTime = &startTime - } - case "endTime": - if v != nil { - var endTime date.Time - err = json.Unmarshal(*v, &endTime) - if err != nil { - return err - } - osVar.EndTime = &endTime - } - case "error": - if v != nil { - var errorVar OperationStatusError - err = json.Unmarshal(*v, &errorVar) - if err != nil { - return err - } - osVar.Error = &errorVar - } - case "properties": - if v != nil { - properties, err := unmarshalBasicOperationStatusExtendedInfo(*v) - if err != nil { - return err - } - osVar.Properties = properties - } - } - } - - return nil -} - -// OperationStatusError error information associated with operation status call. -type OperationStatusError struct { - // Code - Error code of the operation failure. - Code *string `json:"code,omitempty"` - // Message - Error message displayed if the operation failure. - Message *string `json:"message,omitempty"` -} - -// BasicOperationStatusExtendedInfo base class for additional information of operation status. -type BasicOperationStatusExtendedInfo interface { - AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) - AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) - AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) - AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) -} - -// OperationStatusExtendedInfo base class for additional information of operation status. -type OperationStatusExtendedInfo struct { - // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' - ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` -} - -func unmarshalBasicOperationStatusExtendedInfo(body []byte) (BasicOperationStatusExtendedInfo, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeOperationStatusJobExtendedInfo): - var osjei OperationStatusJobExtendedInfo - err := json.Unmarshal(body, &osjei) - return osjei, err - case string(ObjectTypeOperationStatusJobsExtendedInfo): - var osjei OperationStatusJobsExtendedInfo - err := json.Unmarshal(body, &osjei) - return osjei, err - case string(ObjectTypeOperationStatusProvisionILRExtendedInfo): - var ospiei OperationStatusProvisionILRExtendedInfo - err := json.Unmarshal(body, &ospiei) - return ospiei, err - default: - var osei OperationStatusExtendedInfo - err := json.Unmarshal(body, &osei) - return osei, err - } -} -func unmarshalBasicOperationStatusExtendedInfoArray(body []byte) ([]BasicOperationStatusExtendedInfo, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - oseiArray := make([]BasicOperationStatusExtendedInfo, len(rawMessages)) - - for index, rawMessage := range rawMessages { - osei, err := unmarshalBasicOperationStatusExtendedInfo(*rawMessage) - if err != nil { - return nil, err - } - oseiArray[index] = osei - } - return oseiArray, nil -} - -// MarshalJSON is the custom marshaler for OperationStatusExtendedInfo. -func (osei OperationStatusExtendedInfo) MarshalJSON() ([]byte, error) { - osei.ObjectType = ObjectTypeOperationStatusExtendedInfo - objectMap := make(map[string]interface{}) - if osei.ObjectType != "" { - objectMap["objectType"] = osei.ObjectType - } - return json.Marshal(objectMap) -} - -// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. -func (osei OperationStatusExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. -func (osei OperationStatusExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. -func (osei OperationStatusExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. -func (osei OperationStatusExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { - return &osei, true -} - -// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. -func (osei OperationStatusExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { - return &osei, true -} - -// OperationStatusJobExtendedInfo operation status job extended info. -type OperationStatusJobExtendedInfo struct { - // JobID - ID of the job created for this protected item. - JobID *string `json:"jobId,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' - ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationStatusJobExtendedInfo. -func (osjei OperationStatusJobExtendedInfo) MarshalJSON() ([]byte, error) { - osjei.ObjectType = ObjectTypeOperationStatusJobExtendedInfo - objectMap := make(map[string]interface{}) - if osjei.JobID != nil { - objectMap["jobId"] = osjei.JobID - } - if osjei.ObjectType != "" { - objectMap["objectType"] = osjei.ObjectType - } - return json.Marshal(objectMap) -} - -// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. -func (osjei OperationStatusJobExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { - return &osjei, true -} - -// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. -func (osjei OperationStatusJobExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. -func (osjei OperationStatusJobExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. -func (osjei OperationStatusJobExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { - return nil, false -} - -// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. -func (osjei OperationStatusJobExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { - return &osjei, true -} - -// OperationStatusJobsExtendedInfo operation status extended info for list of jobs. -type OperationStatusJobsExtendedInfo struct { - // JobIds - IDs of the jobs created for the protected item. - JobIds *[]string `json:"jobIds,omitempty"` - // FailedJobsError - Stores all the failed jobs along with the corresponding error codes. - FailedJobsError map[string]*string `json:"failedJobsError"` - // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' - ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationStatusJobsExtendedInfo. -func (osjei OperationStatusJobsExtendedInfo) MarshalJSON() ([]byte, error) { - osjei.ObjectType = ObjectTypeOperationStatusJobsExtendedInfo - objectMap := make(map[string]interface{}) - if osjei.JobIds != nil { - objectMap["jobIds"] = osjei.JobIds - } - if osjei.FailedJobsError != nil { - objectMap["failedJobsError"] = osjei.FailedJobsError - } - if osjei.ObjectType != "" { - objectMap["objectType"] = osjei.ObjectType - } - return json.Marshal(objectMap) -} - -// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. -func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. -func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { - return &osjei, true -} - -// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. -func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. -func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { - return nil, false -} - -// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. -func (osjei OperationStatusJobsExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { - return &osjei, true -} - -// OperationStatusProvisionILRExtendedInfo operation status extended info for ILR provision action. -type OperationStatusProvisionILRExtendedInfo struct { - // RecoveryTarget - Target details for file / folder restore. - RecoveryTarget *InstantItemRecoveryTarget `json:"recoveryTarget,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' - ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationStatusProvisionILRExtendedInfo. -func (ospiei OperationStatusProvisionILRExtendedInfo) MarshalJSON() ([]byte, error) { - ospiei.ObjectType = ObjectTypeOperationStatusProvisionILRExtendedInfo - objectMap := make(map[string]interface{}) - if ospiei.RecoveryTarget != nil { - objectMap["recoveryTarget"] = ospiei.RecoveryTarget - } - if ospiei.ObjectType != "" { - objectMap["objectType"] = ospiei.ObjectType - } - return json.Marshal(objectMap) -} - -// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. -func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. -func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. -func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { - return &ospiei, true -} - -// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. -func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { - return nil, false -} - -// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. -func (ospiei OperationStatusProvisionILRExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { - return &ospiei, true -} - -// OperationWorkerResponse this is the base class for operation result responses. -type OperationWorkerResponse struct { - // StatusCode - 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' - StatusCode HTTPStatusCode `json:"statusCode,omitempty"` - // Headers - HTTP headers associated with this operation. - Headers map[string][]string `json:"headers"` -} - -// MarshalJSON is the custom marshaler for OperationWorkerResponse. -func (owr OperationWorkerResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if owr.StatusCode != "" { - objectMap["statusCode"] = owr.StatusCode - } - if owr.Headers != nil { - objectMap["headers"] = owr.Headers - } - return json.Marshal(objectMap) -} - -// PointInTimeRange provides details for log ranges -type PointInTimeRange struct { - // StartTime - Start time of the time range for log recovery. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - End time of the time range for log recovery. - EndTime *date.Time `json:"endTime,omitempty"` -} - -// PreBackupValidation pre-backup validation for Azure VM Workload provider. -type PreBackupValidation struct { - // Status - Status of protectable item, i.e. InProgress,Succeeded,Failed. Possible values include: 'InquiryStatusInvalid', 'InquiryStatusSuccess', 'InquiryStatusFailed' - Status InquiryStatus `json:"status,omitempty"` - // Code - Error code of protectable item - Code *string `json:"code,omitempty"` - // Message - Message corresponding to the error code for the protectable item - Message *string `json:"message,omitempty"` -} - -// PreValidateEnableBackupRequest contract to validate if backup can be enabled on the given resource in a -// given vault and given configuration. -// It will validate followings -// 1. Vault capacity -// 2. VM is already protected -// 3. Any VM related configuration passed in properties. -type PreValidateEnableBackupRequest struct { - // ResourceType - ProtectedItem Type- VM, SqlDataBase, AzureFileShare etc. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - ResourceType DataSourceType `json:"resourceType,omitempty"` - // ResourceID - ARM Virtual Machine Id - ResourceID *string `json:"resourceId,omitempty"` - // VaultID - ARM id of the Recovery Services Vault - VaultID *string `json:"vaultId,omitempty"` - // Properties - Configuration of VM if any needs to be validated like OS type etc - Properties *string `json:"properties,omitempty"` -} - -// PreValidateEnableBackupResponse response contract for enable backup validation request -type PreValidateEnableBackupResponse struct { - autorest.Response `json:"-"` - // Status - Validation Status. Possible values include: 'ValidationStatusInvalid', 'ValidationStatusSucceeded', 'ValidationStatusFailed' - Status ValidationStatus `json:"status,omitempty"` - // ErrorCode - Response error code - ErrorCode *string `json:"errorCode,omitempty"` - // ErrorMessage - Response error message - ErrorMessage *string `json:"errorMessage,omitempty"` - // Recommendation - Recommended action for user - Recommendation *string `json:"recommendation,omitempty"` - // ContainerName - Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is required - // for portal - ContainerName *string `json:"containerName,omitempty"` - // ProtectedItemName - Specifies the product specific ds name. E.g. vm;iaasvmcontainer;rgname;vmname. This is required for portal - ProtectedItemName *string `json:"protectedItemName,omitempty"` -} - -// BasicProtectableContainer protectable Container Class. -type BasicProtectableContainer interface { - AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) - AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) - AsProtectableContainer() (*ProtectableContainer, bool) -} - -// ProtectableContainer protectable Container Class. -type ProtectableContainer struct { - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerID - Fabric Id of the container such as ARM Id. - ContainerID *string `json:"containerId,omitempty"` - // ProtectableContainerType - Possible values include: 'ProtectableContainerTypeProtectableContainer', 'ProtectableContainerTypeStorageContainer', 'ProtectableContainerTypeVMAppContainer' - ProtectableContainerType ProtectableContainerType `json:"protectableContainerType,omitempty"` -} - -func unmarshalBasicProtectableContainer(body []byte) (BasicProtectableContainer, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["protectableContainerType"] { - case string(ProtectableContainerTypeStorageContainer): - var aspc AzureStorageProtectableContainer - err := json.Unmarshal(body, &aspc) - return aspc, err - case string(ProtectableContainerTypeVMAppContainer): - var avacpc AzureVMAppContainerProtectableContainer - err := json.Unmarshal(body, &avacpc) - return avacpc, err - default: - var pc ProtectableContainer - err := json.Unmarshal(body, &pc) - return pc, err - } -} -func unmarshalBasicProtectableContainerArray(body []byte) ([]BasicProtectableContainer, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - pcArray := make([]BasicProtectableContainer, len(rawMessages)) - - for index, rawMessage := range rawMessages { - pc, err := unmarshalBasicProtectableContainer(*rawMessage) - if err != nil { - return nil, err - } - pcArray[index] = pc - } - return pcArray, nil -} - -// MarshalJSON is the custom marshaler for ProtectableContainer. -func (pc ProtectableContainer) MarshalJSON() ([]byte, error) { - pc.ProtectableContainerType = ProtectableContainerTypeProtectableContainer - objectMap := make(map[string]interface{}) - if pc.FriendlyName != nil { - objectMap["friendlyName"] = pc.FriendlyName - } - if pc.BackupManagementType != "" { - objectMap["backupManagementType"] = pc.BackupManagementType - } - if pc.HealthStatus != nil { - objectMap["healthStatus"] = pc.HealthStatus - } - if pc.ContainerID != nil { - objectMap["containerId"] = pc.ContainerID - } - if pc.ProtectableContainerType != "" { - objectMap["protectableContainerType"] = pc.ProtectableContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureStorageProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. -func (pc ProtectableContainer) AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. -func (pc ProtectableContainer) AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) { - return nil, false -} - -// AsProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. -func (pc ProtectableContainer) AsProtectableContainer() (*ProtectableContainer, bool) { - return &pc, true -} - -// AsBasicProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. -func (pc ProtectableContainer) AsBasicProtectableContainer() (BasicProtectableContainer, bool) { - return &pc, true -} - -// ProtectableContainerResource protectable Container Class. -type ProtectableContainerResource struct { - // Properties - ProtectableContainerResource properties - Properties BasicProtectableContainer `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProtectableContainerResource. -func (pcr ProtectableContainerResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = pcr.Properties - if pcr.Location != nil { - objectMap["location"] = pcr.Location - } - if pcr.Tags != nil { - objectMap["tags"] = pcr.Tags - } - if pcr.ETag != nil { - objectMap["eTag"] = pcr.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ProtectableContainerResource struct. -func (pcr *ProtectableContainerResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicProtectableContainer(*v) - if err != nil { - return err - } - pcr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pcr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pcr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pcr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - pcr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - pcr.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - pcr.ETag = &eTag - } - } - } - - return nil -} - -// ProtectableContainerResourceList list of ProtectableContainer resources -type ProtectableContainerResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]ProtectableContainerResource `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"` -} - -// ProtectableContainerResourceListIterator provides access to a complete listing of -// ProtectableContainerResource values. -type ProtectableContainerResourceListIterator struct { - i int - page ProtectableContainerResourceListPage -} - -// NextWithContext 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 *ProtectableContainerResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableContainerResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ProtectableContainerResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ProtectableContainerResourceListIterator) 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 ProtectableContainerResourceListIterator) Response() ProtectableContainerResourceList { - 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 ProtectableContainerResourceListIterator) Value() ProtectableContainerResource { - if !iter.page.NotDone() { - return ProtectableContainerResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ProtectableContainerResourceListIterator type. -func NewProtectableContainerResourceListIterator(page ProtectableContainerResourceListPage) ProtectableContainerResourceListIterator { - return ProtectableContainerResourceListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (pcrl ProtectableContainerResourceList) IsEmpty() bool { - return pcrl.Value == nil || len(*pcrl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (pcrl ProtectableContainerResourceList) hasNextLink() bool { - return pcrl.NextLink != nil && len(*pcrl.NextLink) != 0 -} - -// protectableContainerResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (pcrl ProtectableContainerResourceList) protectableContainerResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !pcrl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(pcrl.NextLink))) -} - -// ProtectableContainerResourceListPage contains a page of ProtectableContainerResource values. -type ProtectableContainerResourceListPage struct { - fn func(context.Context, ProtectableContainerResourceList) (ProtectableContainerResourceList, error) - pcrl ProtectableContainerResourceList -} - -// NextWithContext 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 *ProtectableContainerResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableContainerResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.pcrl) - if err != nil { - return err - } - page.pcrl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *ProtectableContainerResourceListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ProtectableContainerResourceListPage) NotDone() bool { - return !page.pcrl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ProtectableContainerResourceListPage) Response() ProtectableContainerResourceList { - return page.pcrl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ProtectableContainerResourceListPage) Values() []ProtectableContainerResource { - if page.pcrl.IsEmpty() { - return nil - } - return *page.pcrl.Value -} - -// Creates a new instance of the ProtectableContainerResourceListPage type. -func NewProtectableContainerResourceListPage(cur ProtectableContainerResourceList, getNextPage func(context.Context, ProtectableContainerResourceList) (ProtectableContainerResourceList, error)) ProtectableContainerResourceListPage { - return ProtectableContainerResourceListPage{ - fn: getNextPage, - pcrl: cur, - } -} - -// BasicProtectedItem base class for backup items. -type BasicProtectedItem interface { - AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) - AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) - AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) - AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) - AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) - AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) - AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) - AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) - AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) - AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) - AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) - AsDPMProtectedItem() (*DPMProtectedItem, bool) - AsGenericProtectedItem() (*GenericProtectedItem, bool) - AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) - AsProtectedItem() (*ProtectedItem, bool) -} - -// ProtectedItem base class for backup items. -type ProtectedItem struct { - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -func unmarshalBasicProtectedItem(body []byte) (BasicProtectedItem, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["protectedItemType"] { - case string(ProtectedItemTypeAzureFileShareProtectedItem): - var afpi AzureFileshareProtectedItem - err := json.Unmarshal(body, &afpi) - return afpi, err - case string(ProtectedItemTypeMicrosoftClassicComputevirtualMachines): - var aisccvpi AzureIaaSClassicComputeVMProtectedItem - err := json.Unmarshal(body, &aisccvpi) - return aisccvpi, err - case string(ProtectedItemTypeMicrosoftComputevirtualMachines): - var aiscvpi AzureIaaSComputeVMProtectedItem - err := json.Unmarshal(body, &aiscvpi) - return aiscvpi, err - case string(ProtectedItemTypeAzureIaaSVMProtectedItem): - var aispi AzureIaaSVMProtectedItem - err := json.Unmarshal(body, &aispi) - return aispi, err - case string(ProtectedItemTypeMicrosoftSqlserversdatabases): - var aspi AzureSQLProtectedItem - err := json.Unmarshal(body, &aspi) - return aspi, err - case string(ProtectedItemTypeAzureVMWorkloadProtectedItem): - var avwpi AzureVMWorkloadProtectedItem - err := json.Unmarshal(body, &avwpi) - return avwpi, err - case string(ProtectedItemTypeAzureVMWorkloadSAPAseDatabase): - var avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem - err := json.Unmarshal(body, &avwsadpi) - return avwsadpi, err - case string(ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase): - var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem - err := json.Unmarshal(body, &avwshdpi) - return avwshdpi, err - case string(ProtectedItemTypeAzureVMWorkloadSQLDatabase): - var avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem - err := json.Unmarshal(body, &avwsdpi) - return avwsdpi, err - case string(ProtectedItemTypeDPMProtectedItem): - var dpi DPMProtectedItem - err := json.Unmarshal(body, &dpi) - return dpi, err - case string(ProtectedItemTypeGenericProtectedItem): - var gpi GenericProtectedItem - err := json.Unmarshal(body, &gpi) - return gpi, err - case string(ProtectedItemTypeMabFileFolderProtectedItem): - var mffpi MabFileFolderProtectedItem - err := json.Unmarshal(body, &mffpi) - return mffpi, err - default: - var pi ProtectedItem - err := json.Unmarshal(body, &pi) - return pi, err - } -} -func unmarshalBasicProtectedItemArray(body []byte) ([]BasicProtectedItem, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - piArray := make([]BasicProtectedItem, len(rawMessages)) - - for index, rawMessage := range rawMessages { - pi, err := unmarshalBasicProtectedItem(*rawMessage) - if err != nil { - return nil, err - } - piArray[index] = pi - } - return piArray, nil -} - -// MarshalJSON is the custom marshaler for ProtectedItem. -func (pi ProtectedItem) MarshalJSON() ([]byte, error) { - pi.ProtectedItemType = ProtectedItemTypeProtectedItem - objectMap := make(map[string]interface{}) - if pi.BackupManagementType != "" { - objectMap["backupManagementType"] = pi.BackupManagementType - } - if pi.WorkloadType != "" { - objectMap["workloadType"] = pi.WorkloadType - } - if pi.ContainerName != nil { - objectMap["containerName"] = pi.ContainerName - } - if pi.SourceResourceID != nil { - objectMap["sourceResourceId"] = pi.SourceResourceID - } - if pi.PolicyID != nil { - objectMap["policyId"] = pi.PolicyID - } - if pi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = pi.LastRecoveryPoint - } - if pi.BackupSetName != nil { - objectMap["backupSetName"] = pi.BackupSetName - } - if pi.CreateMode != "" { - objectMap["createMode"] = pi.CreateMode - } - if pi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = pi.DeferredDeleteTimeInUTC - } - if pi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = pi.IsScheduledForDeferredDelete - } - if pi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = pi.DeferredDeleteTimeRemaining - } - if pi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = pi.IsDeferredDeleteScheduleUpcoming - } - if pi.IsRehydrate != nil { - objectMap["isRehydrate"] = pi.IsRehydrate - } - if pi.ProtectedItemType != "" { - objectMap["protectedItemType"] = pi.ProtectedItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return nil, false -} - -// AsDPMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return nil, false -} - -// AsGenericProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return nil, false -} - -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return nil, false -} - -// AsProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return &pi, true -} - -// AsBasicProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &pi, true -} - -// ProtectedItemQueryObject filters to list backup items. -type ProtectedItemQueryObject struct { - // HealthState - Health State for the backed up item. Possible values include: 'HealthStatePassed', 'HealthStateActionRequired', 'HealthStateActionSuggested', 'HealthStateInvalid' - HealthState HealthState `json:"healthState,omitempty"` - // 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: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - ItemType DataSourceType `json:"itemType,omitempty"` - // PolicyName - Backup policy name associated with the backup item. - PolicyName *string `json:"policyName,omitempty"` - // ContainerName - Name of the container. - ContainerName *string `json:"containerName,omitempty"` - // BackupEngineName - Backup Engine name - BackupEngineName *string `json:"backupEngineName,omitempty"` - // FriendlyName - Friendly name of protected item - FriendlyName *string `json:"friendlyName,omitempty"` - // FabricName - Name of the fabric. - FabricName *string `json:"fabricName,omitempty"` - // BackupSetName - Name of the backup set. - BackupSetName *string `json:"backupSetName,omitempty"` -} - -// ProtectedItemResource base class for backup items. -type ProtectedItemResource struct { - autorest.Response `json:"-"` - // Properties - ProtectedItemResource properties - Properties BasicProtectedItem `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProtectedItemResource. -func (pir ProtectedItemResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = pir.Properties - if pir.Location != nil { - objectMap["location"] = pir.Location - } - if pir.Tags != nil { - objectMap["tags"] = pir.Tags - } - if pir.ETag != nil { - objectMap["eTag"] = pir.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ProtectedItemResource struct. -func (pir *ProtectedItemResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicProtectedItem(*v) - if err != nil { - return err - } - pir.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pir.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pir.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pir.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - pir.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - pir.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - pir.ETag = &eTag - } - } - } - - return nil -} - -// ProtectedItemResourceList list of ProtectedItem resources -type ProtectedItemResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]ProtectedItemResource `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"` -} - -// ProtectedItemResourceListIterator provides access to a complete listing of ProtectedItemResource values. -type ProtectedItemResourceListIterator struct { - i int - page ProtectedItemResourceListPage -} - -// NextWithContext 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 *ProtectedItemResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ProtectedItemResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ProtectedItemResourceListIterator) 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 ProtectedItemResourceListIterator) Response() ProtectedItemResourceList { - 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 ProtectedItemResourceListIterator) Value() ProtectedItemResource { - if !iter.page.NotDone() { - return ProtectedItemResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ProtectedItemResourceListIterator type. -func NewProtectedItemResourceListIterator(page ProtectedItemResourceListPage) ProtectedItemResourceListIterator { - return ProtectedItemResourceListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (pirl ProtectedItemResourceList) IsEmpty() bool { - return pirl.Value == nil || len(*pirl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (pirl ProtectedItemResourceList) hasNextLink() bool { - return pirl.NextLink != nil && len(*pirl.NextLink) != 0 -} - -// protectedItemResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (pirl ProtectedItemResourceList) protectedItemResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !pirl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(pirl.NextLink))) -} - -// ProtectedItemResourceListPage contains a page of ProtectedItemResource values. -type ProtectedItemResourceListPage struct { - fn func(context.Context, ProtectedItemResourceList) (ProtectedItemResourceList, error) - pirl ProtectedItemResourceList -} - -// NextWithContext 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 *ProtectedItemResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.pirl) - if err != nil { - return err - } - page.pirl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *ProtectedItemResourceListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ProtectedItemResourceListPage) NotDone() bool { - return !page.pirl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ProtectedItemResourceListPage) Response() ProtectedItemResourceList { - return page.pirl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ProtectedItemResourceListPage) Values() []ProtectedItemResource { - if page.pirl.IsEmpty() { - return nil - } - return *page.pirl.Value -} - -// Creates a new instance of the ProtectedItemResourceListPage type. -func NewProtectedItemResourceListPage(cur ProtectedItemResourceList, getNextPage func(context.Context, ProtectedItemResourceList) (ProtectedItemResourceList, error)) ProtectedItemResourceListPage { - return ProtectedItemResourceListPage{ - fn: getNextPage, - pirl: cur, - } -} - -// BasicProtectionContainer base class for container with backup items. Containers with specific workloads are derived -// from this class. -type BasicProtectionContainer interface { - AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) - AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) - AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) - AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) - AsAzureSQLContainer() (*AzureSQLContainer, bool) - AsAzureStorageContainer() (*AzureStorageContainer, bool) - AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) - AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) - AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) - AsDpmContainer() (*DpmContainer, bool) - AsBasicDpmContainer() (BasicDpmContainer, bool) - AsGenericContainer() (*GenericContainer, bool) - AsIaaSVMContainer() (*IaaSVMContainer, bool) - AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) - AsMabContainer() (*MabContainer, bool) - AsProtectionContainer() (*ProtectionContainer, bool) -} - -// ProtectionContainer base class for container with backup items. Containers with specific workloads are -// derived from this class. -type ProtectionContainer struct { - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -func unmarshalBasicProtectionContainer(body []byte) (BasicProtectionContainer, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["containerType"] { - case string(ContainerTypeAzureBackupServerContainer1): - var absc AzureBackupServerContainer - err := json.Unmarshal(body, &absc) - return absc, err - case string(ContainerTypeMicrosoftClassicComputevirtualMachines): - var aisccvc AzureIaaSClassicComputeVMContainer - err := json.Unmarshal(body, &aisccvc) - return aisccvc, err - case string(ContainerTypeMicrosoftComputevirtualMachines): - var aiscvc AzureIaaSComputeVMContainer - err := json.Unmarshal(body, &aiscvc) - return aiscvc, err - case string(ContainerTypeSQLAGWorkLoadContainer1): - var aswcpc AzureSQLAGWorkloadContainerProtectionContainer - err := json.Unmarshal(body, &aswcpc) - return aswcpc, err - case string(ContainerTypeAzureSQLContainer1): - var asc AzureSQLContainer - err := json.Unmarshal(body, &asc) - return asc, err - case string(ContainerTypeStorageContainer1): - var asc AzureStorageContainer - err := json.Unmarshal(body, &asc) - return asc, err - case string(ContainerTypeVMAppContainer1): - var avacpc AzureVMAppContainerProtectionContainer - err := json.Unmarshal(body, &avacpc) - return avacpc, err - case string(ContainerTypeAzureWorkloadContainer): - var awc AzureWorkloadContainer - err := json.Unmarshal(body, &awc) - return awc, err - case string(ContainerTypeDPMContainer1): - var dc DpmContainer - err := json.Unmarshal(body, &dc) - return dc, err - case string(ContainerTypeGenericContainer1): - var gc GenericContainer - err := json.Unmarshal(body, &gc) - return gc, err - case string(ContainerTypeIaaSVMContainer): - var isc IaaSVMContainer - err := json.Unmarshal(body, &isc) - return isc, err - case string(ContainerTypeWindows1): - var mc MabContainer - err := json.Unmarshal(body, &mc) - return mc, err - default: - var pc ProtectionContainer - err := json.Unmarshal(body, &pc) - return pc, err - } -} -func unmarshalBasicProtectionContainerArray(body []byte) ([]BasicProtectionContainer, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - pcArray := make([]BasicProtectionContainer, len(rawMessages)) - - for index, rawMessage := range rawMessages { - pc, err := unmarshalBasicProtectionContainer(*rawMessage) - if err != nil { - return nil, err - } - pcArray[index] = pc - } - return pcArray, nil -} - -// MarshalJSON is the custom marshaler for ProtectionContainer. -func (pc ProtectionContainer) MarshalJSON() ([]byte, error) { - pc.ContainerType = ContainerTypeProtectionContainer - objectMap := make(map[string]interface{}) - if pc.FriendlyName != nil { - objectMap["friendlyName"] = pc.FriendlyName - } - if pc.BackupManagementType != "" { - objectMap["backupManagementType"] = pc.BackupManagementType - } - if pc.RegistrationStatus != nil { - objectMap["registrationStatus"] = pc.RegistrationStatus - } - if pc.HealthStatus != nil { - objectMap["healthStatus"] = pc.HealthStatus - } - if pc.ContainerType != "" { - objectMap["containerType"] = pc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false -} - -// AsMabContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return &pc, true -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &pc, true -} - -// ProtectionContainerResource base class for container with backup items. Containers with specific -// workloads are derived from this class. -type ProtectionContainerResource struct { - autorest.Response `json:"-"` - // Properties - ProtectionContainerResource properties - Properties BasicProtectionContainer `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProtectionContainerResource. -func (pcr ProtectionContainerResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = pcr.Properties - if pcr.Location != nil { - objectMap["location"] = pcr.Location - } - if pcr.Tags != nil { - objectMap["tags"] = pcr.Tags - } - if pcr.ETag != nil { - objectMap["eTag"] = pcr.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ProtectionContainerResource struct. -func (pcr *ProtectionContainerResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicProtectionContainer(*v) - if err != nil { - return err - } - pcr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pcr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pcr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pcr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - pcr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - pcr.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - pcr.ETag = &eTag - } - } - } - - return nil -} - -// ProtectionContainerResourceList list of ProtectionContainer resources -type ProtectionContainerResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]ProtectionContainerResource `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"` -} - -// ProtectionContainerResourceListIterator provides access to a complete listing of -// ProtectionContainerResource values. -type ProtectionContainerResourceListIterator struct { - i int - page ProtectionContainerResourceListPage -} - -// NextWithContext 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 *ProtectionContainerResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ProtectionContainerResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ProtectionContainerResourceListIterator) 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 ProtectionContainerResourceListIterator) Response() ProtectionContainerResourceList { - 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 ProtectionContainerResourceListIterator) Value() ProtectionContainerResource { - if !iter.page.NotDone() { - return ProtectionContainerResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ProtectionContainerResourceListIterator type. -func NewProtectionContainerResourceListIterator(page ProtectionContainerResourceListPage) ProtectionContainerResourceListIterator { - return ProtectionContainerResourceListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (pcrl ProtectionContainerResourceList) IsEmpty() bool { - return pcrl.Value == nil || len(*pcrl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (pcrl ProtectionContainerResourceList) hasNextLink() bool { - return pcrl.NextLink != nil && len(*pcrl.NextLink) != 0 -} - -// protectionContainerResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (pcrl ProtectionContainerResourceList) protectionContainerResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !pcrl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(pcrl.NextLink))) -} - -// ProtectionContainerResourceListPage contains a page of ProtectionContainerResource values. -type ProtectionContainerResourceListPage struct { - fn func(context.Context, ProtectionContainerResourceList) (ProtectionContainerResourceList, error) - pcrl ProtectionContainerResourceList -} - -// NextWithContext 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 *ProtectionContainerResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.pcrl) - if err != nil { - return err - } - page.pcrl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *ProtectionContainerResourceListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ProtectionContainerResourceListPage) NotDone() bool { - return !page.pcrl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ProtectionContainerResourceListPage) Response() ProtectionContainerResourceList { - return page.pcrl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ProtectionContainerResourceListPage) Values() []ProtectionContainerResource { - if page.pcrl.IsEmpty() { - return nil - } - return *page.pcrl.Value -} - -// Creates a new instance of the ProtectionContainerResourceListPage type. -func NewProtectionContainerResourceListPage(cur ProtectionContainerResourceList, getNextPage func(context.Context, ProtectionContainerResourceList) (ProtectionContainerResourceList, error)) ProtectionContainerResourceListPage { - return ProtectionContainerResourceListPage{ - fn: getNextPage, - pcrl: cur, - } -} - -// BasicProtectionIntent base class for backup ProtectionIntent. -type BasicProtectionIntent interface { - AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) - AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) - AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) - AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) - AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) - AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) - AsProtectionIntent() (*ProtectionIntent, bool) -} - -// ProtectionIntent base class for backup ProtectionIntent. -type ProtectionIntent struct { - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId - ItemID *string `json:"itemId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' - ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` -} - -func unmarshalBasicProtectionIntent(body []byte) (BasicProtectionIntent, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["protectionIntentItemType"] { - case string(ProtectionIntentItemTypeRecoveryServiceVaultItem): - var arsvpi AzureRecoveryServiceVaultProtectionIntent - err := json.Unmarshal(body, &arsvpi) - return arsvpi, err - case string(ProtectionIntentItemTypeAzureResourceItem): - var arpi AzureResourceProtectionIntent - err := json.Unmarshal(body, &arpi) - return arpi, err - case string(ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent): - var awapi AzureWorkloadAutoProtectionIntent - err := json.Unmarshal(body, &awapi) - return awapi, err - case string(ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent): - var awsapi AzureWorkloadSQLAutoProtectionIntent - err := json.Unmarshal(body, &awsapi) - return awsapi, err - default: - var pi ProtectionIntent - err := json.Unmarshal(body, &pi) - return pi, err - } -} -func unmarshalBasicProtectionIntentArray(body []byte) ([]BasicProtectionIntent, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - piArray := make([]BasicProtectionIntent, len(rawMessages)) - - for index, rawMessage := range rawMessages { - pi, err := unmarshalBasicProtectionIntent(*rawMessage) - if err != nil { - return nil, err - } - piArray[index] = pi - } - return piArray, nil -} - -// MarshalJSON is the custom marshaler for ProtectionIntent. -func (pi ProtectionIntent) MarshalJSON() ([]byte, error) { - pi.ProtectionIntentItemType = ProtectionIntentItemTypeProtectionIntent - objectMap := make(map[string]interface{}) - if pi.BackupManagementType != "" { - objectMap["backupManagementType"] = pi.BackupManagementType - } - if pi.SourceResourceID != nil { - objectMap["sourceResourceId"] = pi.SourceResourceID - } - if pi.ItemID != nil { - objectMap["itemId"] = pi.ItemID - } - if pi.PolicyID != nil { - objectMap["policyId"] = pi.PolicyID - } - if pi.ProtectionState != "" { - objectMap["protectionState"] = pi.ProtectionState - } - if pi.ProtectionIntentItemType != "" { - objectMap["protectionIntentItemType"] = pi.ProtectionIntentItemType - } - return json.Marshal(objectMap) -} - -// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { - return nil, false -} - -// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { - return nil, false -} - -// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { - return nil, false -} - -// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { - return nil, false -} - -// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { - return nil, false -} - -// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { - return nil, false -} - -// AsProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { - return &pi, true -} - -// AsBasicProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { - 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:"-"` - // Properties - ProtectionIntentResource properties - Properties BasicProtectionIntent `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProtectionIntentResource. -func (pir ProtectionIntentResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = pir.Properties - if pir.Location != nil { - objectMap["location"] = pir.Location - } - if pir.Tags != nil { - objectMap["tags"] = pir.Tags - } - if pir.ETag != nil { - objectMap["eTag"] = pir.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ProtectionIntentResource struct. -func (pir *ProtectionIntentResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicProtectionIntent(*v) - if err != nil { - return err - } - pir.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pir.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pir.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pir.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - pir.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - pir.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - pir.ETag = &eTag - } - } - } - - 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 -} - -// NextWithContext 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) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionIntentResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ProtectionIntentResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// 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] -} - -// Creates a new instance of the ProtectionIntentResourceListIterator type. -func NewProtectionIntentResourceListIterator(page ProtectionIntentResourceListPage) ProtectionIntentResourceListIterator { - return ProtectionIntentResourceListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (pirl ProtectionIntentResourceList) IsEmpty() bool { - return pirl.Value == nil || len(*pirl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (pirl ProtectionIntentResourceList) hasNextLink() bool { - return pirl.NextLink != nil && len(*pirl.NextLink) != 0 -} - -// protectionIntentResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (pirl ProtectionIntentResourceList) protectionIntentResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !pirl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(pirl.NextLink))) -} - -// ProtectionIntentResourceListPage contains a page of ProtectionIntentResource values. -type ProtectionIntentResourceListPage struct { - fn func(context.Context, ProtectionIntentResourceList) (ProtectionIntentResourceList, error) - pirl ProtectionIntentResourceList -} - -// NextWithContext 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) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionIntentResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.pirl) - if err != nil { - return err - } - page.pirl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *ProtectionIntentResourceListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// 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 -} - -// Creates a new instance of the ProtectionIntentResourceListPage type. -func NewProtectionIntentResourceListPage(cur ProtectionIntentResourceList, getNextPage func(context.Context, ProtectionIntentResourceList) (ProtectionIntentResourceList, error)) ProtectionIntentResourceListPage { - return ProtectionIntentResourceListPage{ - fn: getNextPage, - pirl: cur, - } -} - -// BasicProtectionPolicy base class for backup policy. Workload-specific backup policies are derived from this class. -type BasicProtectionPolicy interface { - AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) - AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) - AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) - AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) - AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) - AsMabProtectionPolicy() (*MabProtectionPolicy, bool) - AsProtectionPolicy() (*ProtectionPolicy, bool) -} - -// ProtectionPolicy base class for backup policy. Workload-specific backup policies are derived from this -// class. -type ProtectionPolicy struct { - // ProtectedItemsCount - Number of items associated with this policy. - ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' - BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` -} - -func unmarshalBasicProtectionPolicy(body []byte) (BasicProtectionPolicy, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["backupManagementType"] { - case string(BackupManagementTypeAzureWorkload): - var avwpp AzureVMWorkloadProtectionPolicy - err := json.Unmarshal(body, &avwpp) - return avwpp, err - case string(BackupManagementTypeAzureStorage): - var afspp AzureFileShareProtectionPolicy - err := json.Unmarshal(body, &afspp) - return afspp, err - case string(BackupManagementTypeAzureIaasVM): - var aispp AzureIaaSVMProtectionPolicy - err := json.Unmarshal(body, &aispp) - return aispp, err - case string(BackupManagementTypeAzureSQL): - var aspp AzureSQLProtectionPolicy - err := json.Unmarshal(body, &aspp) - return aspp, err - case string(BackupManagementTypeGenericProtectionPolicy): - var gpp GenericProtectionPolicy - err := json.Unmarshal(body, &gpp) - return gpp, err - case string(BackupManagementTypeMAB): - var mpp MabProtectionPolicy - err := json.Unmarshal(body, &mpp) - return mpp, err - default: - var pp ProtectionPolicy - err := json.Unmarshal(body, &pp) - return pp, err - } -} -func unmarshalBasicProtectionPolicyArray(body []byte) ([]BasicProtectionPolicy, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - ppArray := make([]BasicProtectionPolicy, len(rawMessages)) - - for index, rawMessage := range rawMessages { - pp, err := unmarshalBasicProtectionPolicy(*rawMessage) - if err != nil { - return nil, err - } - ppArray[index] = pp - } - return ppArray, nil +// MabProtectionPolicy mab container-specific backup policy. +type MabProtectionPolicy struct { + // SchedulePolicy - Backup schedule of backup policy. + SchedulePolicy BasicSchedulePolicy `json:"schedulePolicy,omitempty"` + // RetentionPolicy - Retention policy details. + RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` } -// MarshalJSON is the custom marshaler for ProtectionPolicy. -func (pp ProtectionPolicy) MarshalJSON() ([]byte, error) { - pp.BackupManagementType = BackupManagementTypeProtectionPolicy +// MarshalJSON is the custom marshaler for MabProtectionPolicy. +func (mpp MabProtectionPolicy) MarshalJSON() ([]byte, error) { + mpp.BackupManagementType = BackupManagementTypeMAB objectMap := make(map[string]interface{}) - if pp.ProtectedItemsCount != nil { - objectMap["protectedItemsCount"] = pp.ProtectedItemsCount + objectMap["schedulePolicy"] = mpp.SchedulePolicy + objectMap["retentionPolicy"] = mpp.RetentionPolicy + if mpp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = mpp.ProtectedItemsCount } - if pp.BackupManagementType != "" { - objectMap["backupManagementType"] = pp.BackupManagementType + if mpp.BackupManagementType != "" { + objectMap["backupManagementType"] = mpp.BackupManagementType } return json.Marshal(objectMap) } -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { - return nil, false -} - -// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { return nil, false } -// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { return nil, false } -// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { return nil, false } -// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { return nil, false } -// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { return nil, false } -// AsProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { - return &pp, true -} - -// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { - return &pp, true -} - -// ProtectionPolicyQueryObject filters the list backup policies API. -type ProtectionPolicyQueryObject struct { - // BackupManagementType - Backup management type for the backup policy. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // FabricName - Fabric name for filter - FabricName *string `json:"fabricName,omitempty"` - // WorkloadType - Workload type for the backup policy. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { + return &mpp, true } -// ProtectionPolicyResource base class for backup policy. Workload-specific backup policies are derived -// from this class. -type ProtectionPolicyResource struct { - autorest.Response `json:"-"` - // Properties - ProtectionPolicyResource properties - Properties BasicProtectionPolicy `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` +// AsProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for ProtectionPolicyResource. -func (ppr ProtectionPolicyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = ppr.Properties - if ppr.Location != nil { - objectMap["location"] = ppr.Location - } - if ppr.Tags != nil { - objectMap["tags"] = ppr.Tags - } - if ppr.ETag != nil { - objectMap["eTag"] = ppr.ETag - } - return json.Marshal(objectMap) +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &mpp, true } -// UnmarshalJSON is the custom unmarshaler for ProtectionPolicyResource struct. -func (ppr *ProtectionPolicyResource) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for MabProtectionPolicy struct. +func (mpp *MabProtectionPolicy) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -16600,67 +7283,39 @@ func (ppr *ProtectionPolicyResource) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicProtectionPolicy(*v) - if err != nil { - return err - } - ppr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ppr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ppr.Name = &name - } - case "type": + case "schedulePolicy": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) if err != nil { return err } - ppr.Type = &typeVar + mpp.SchedulePolicy = schedulePolicy } - case "location": + case "retentionPolicy": if v != nil { - var location string - err = json.Unmarshal(*v, &location) + retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) if err != nil { return err } - ppr.Location = &location + mpp.RetentionPolicy = retentionPolicy } - case "tags": + case "protectedItemsCount": if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) + var protectedItemsCount int32 + err = json.Unmarshal(*v, &protectedItemsCount) if err != nil { return err } - ppr.Tags = tags + mpp.ProtectedItemsCount = &protectedItemsCount } - case "eTag": + case "backupManagementType": if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) + var backupManagementType ManagementTypeBasicProtectionPolicy + err = json.Unmarshal(*v, &backupManagementType) if err != nil { return err } - ppr.ETag = &eTag + mpp.BackupManagementType = backupManagementType } } } @@ -16668,356 +7323,526 @@ func (ppr *ProtectionPolicyResource) UnmarshalJSON(body []byte) error { return nil } -// ProtectionPolicyResourceList list of ProtectionPolicy resources -type ProtectionPolicyResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]ProtectionPolicyResource `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"` +// MonthlyRetentionSchedule monthly retention schedule. +type MonthlyRetentionSchedule struct { + // RetentionScheduleFormatType - Retention schedule format type for monthly retention policy. Possible values include: 'RetentionScheduleFormatInvalid', 'RetentionScheduleFormatDaily', 'RetentionScheduleFormatWeekly' + RetentionScheduleFormatType RetentionScheduleFormat `json:"retentionScheduleFormatType,omitempty"` + // RetentionScheduleDaily - Daily retention format for monthly retention policy. + RetentionScheduleDaily *DailyRetentionFormat `json:"retentionScheduleDaily,omitempty"` + // RetentionScheduleWeekly - Weekly retention format for monthly retention policy. + RetentionScheduleWeekly *WeeklyRetentionFormat `json:"retentionScheduleWeekly,omitempty"` + // RetentionTimes - Retention times of retention policy. + RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` + // RetentionDuration - Retention duration of retention Policy. + RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` } -// ProtectionPolicyResourceListIterator provides access to a complete listing of ProtectionPolicyResource -// values. -type ProtectionPolicyResourceListIterator struct { - i int - page ProtectionPolicyResourceListPage +// OperationResultInfo operation result info. +type OperationResultInfo struct { + // JobList - List of jobs created by this operation. + JobList *[]string `json:"jobList,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeOperationResultInfoBase', 'ObjectTypeExportJobsOperationResultInfo', 'ObjectTypeOperationResultInfo' + ObjectType ObjectType `json:"objectType,omitempty"` } -// NextWithContext 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 *ProtectionPolicyResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionPolicyResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() +// MarshalJSON is the custom marshaler for OperationResultInfo. +func (ori OperationResultInfo) MarshalJSON() ([]byte, error) { + ori.ObjectType = ObjectTypeOperationResultInfo + objectMap := make(map[string]interface{}) + if ori.JobList != nil { + objectMap["jobList"] = ori.JobList } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil + if ori.ObjectType != "" { + objectMap["objectType"] = ori.ObjectType } - err = iter.page.NextWithContext(ctx) + return json.Marshal(objectMap) +} + +// AsExportJobsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfo. +func (ori OperationResultInfo) AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) { + return nil, false +} + +// AsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfo. +func (ori OperationResultInfo) AsOperationResultInfo() (*OperationResultInfo, bool) { + return &ori, true +} + +// AsOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfo. +func (ori OperationResultInfo) AsOperationResultInfoBase() (*OperationResultInfoBase, bool) { + return nil, false +} + +// AsBasicOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfo. +func (ori OperationResultInfo) AsBasicOperationResultInfoBase() (BasicOperationResultInfoBase, bool) { + return &ori, true +} + +// BasicOperationResultInfoBase base class for operation result info. +type BasicOperationResultInfoBase interface { + AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) + AsOperationResultInfo() (*OperationResultInfo, bool) + AsOperationResultInfoBase() (*OperationResultInfoBase, bool) +} + +// OperationResultInfoBase base class for operation result info. +type OperationResultInfoBase struct { + // ObjectType - Possible values include: 'ObjectTypeOperationResultInfoBase', 'ObjectTypeExportJobsOperationResultInfo', 'ObjectTypeOperationResultInfo' + ObjectType ObjectType `json:"objectType,omitempty"` +} + +func unmarshalBasicOperationResultInfoBase(body []byte) (BasicOperationResultInfoBase, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) if err != nil { - iter.i-- - return err + return nil, err } - iter.i = 0 - return nil -} -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ProtectionPolicyResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) + switch m["objectType"] { + case string(ObjectTypeExportJobsOperationResultInfo): + var ejori ExportJobsOperationResultInfo + err := json.Unmarshal(body, &ejori) + return ejori, err + case string(ObjectTypeOperationResultInfo): + var ori OperationResultInfo + err := json.Unmarshal(body, &ori) + return ori, err + default: + var orib OperationResultInfoBase + err := json.Unmarshal(body, &orib) + return orib, err + } } +func unmarshalBasicOperationResultInfoBaseArray(body []byte) ([]BasicOperationResultInfoBase, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ProtectionPolicyResourceListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} + oribArray := make([]BasicOperationResultInfoBase, len(rawMessages)) -// Response returns the raw server response from the last page request. -func (iter ProtectionPolicyResourceListIterator) Response() ProtectionPolicyResourceList { - return iter.page.Response() + for index, rawMessage := range rawMessages { + orib, err := unmarshalBasicOperationResultInfoBase(*rawMessage) + if err != nil { + return nil, err + } + oribArray[index] = orib + } + return oribArray, nil } -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ProtectionPolicyResourceListIterator) Value() ProtectionPolicyResource { - if !iter.page.NotDone() { - return ProtectionPolicyResource{} +// MarshalJSON is the custom marshaler for OperationResultInfoBase. +func (orib OperationResultInfoBase) MarshalJSON() ([]byte, error) { + orib.ObjectType = ObjectTypeOperationResultInfoBase + objectMap := make(map[string]interface{}) + if orib.ObjectType != "" { + objectMap["objectType"] = orib.ObjectType } - return iter.page.Values()[iter.i] + return json.Marshal(objectMap) } -// Creates a new instance of the ProtectionPolicyResourceListIterator type. -func NewProtectionPolicyResourceListIterator(page ProtectionPolicyResourceListPage) ProtectionPolicyResourceListIterator { - return ProtectionPolicyResourceListIterator{page: page} +// AsExportJobsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. +func (orib OperationResultInfoBase) AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) { + return nil, false } -// IsEmpty returns true if the ListResult contains no values. -func (pprl ProtectionPolicyResourceList) IsEmpty() bool { - return pprl.Value == nil || len(*pprl.Value) == 0 +// AsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. +func (orib OperationResultInfoBase) AsOperationResultInfo() (*OperationResultInfo, bool) { + return nil, false } -// hasNextLink returns true if the NextLink is not empty. -func (pprl ProtectionPolicyResourceList) hasNextLink() bool { - return pprl.NextLink != nil && len(*pprl.NextLink) != 0 +// AsOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. +func (orib OperationResultInfoBase) AsOperationResultInfoBase() (*OperationResultInfoBase, bool) { + return &orib, true } -// protectionPolicyResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (pprl ProtectionPolicyResourceList) protectionPolicyResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !pprl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(pprl.NextLink))) +// AsBasicOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. +func (orib OperationResultInfoBase) AsBasicOperationResultInfoBase() (BasicOperationResultInfoBase, bool) { + return &orib, true } -// ProtectionPolicyResourceListPage contains a page of ProtectionPolicyResource values. -type ProtectionPolicyResourceListPage struct { - fn func(context.Context, ProtectionPolicyResourceList) (ProtectionPolicyResourceList, error) - pprl ProtectionPolicyResourceList +// OperationResultInfoBaseResource base class for operation result info. +type OperationResultInfoBaseResource struct { + autorest.Response `json:"-"` + // Operation - OperationResultInfoBaseResource operation + Operation BasicOperationResultInfoBase `json:"operation,omitempty"` + // StatusCode - 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' + StatusCode HTTPStatusCode `json:"statusCode,omitempty"` + // Headers - HTTP headers associated with this operation. + Headers map[string][]string `json:"headers"` } -// NextWithContext 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 *ProtectionPolicyResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionPolicyResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() +// MarshalJSON is the custom marshaler for OperationResultInfoBaseResource. +func (oribr OperationResultInfoBaseResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["operation"] = oribr.Operation + if oribr.StatusCode != "" { + objectMap["statusCode"] = oribr.StatusCode } - for { - next, err := page.fn(ctx, page.pprl) - if err != nil { - return err - } - page.pprl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } + if oribr.Headers != nil { + objectMap["headers"] = oribr.Headers } - return nil + return json.Marshal(objectMap) } -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *ProtectionPolicyResourceListPage) Next() error { - return page.NextWithContext(context.Background()) -} +// UnmarshalJSON is the custom unmarshaler for OperationResultInfoBaseResource struct. +func (oribr *OperationResultInfoBaseResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "operation": + if v != nil { + operation, err := unmarshalBasicOperationResultInfoBase(*v) + if err != nil { + return err + } + oribr.Operation = operation + } + case "statusCode": + if v != nil { + var statusCode HTTPStatusCode + err = json.Unmarshal(*v, &statusCode) + if err != nil { + return err + } + oribr.StatusCode = statusCode + } + case "headers": + if v != nil { + var headers map[string][]string + err = json.Unmarshal(*v, &headers) + if err != nil { + return err + } + oribr.Headers = headers + } + } + } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ProtectionPolicyResourceListPage) NotDone() bool { - return !page.pprl.IsEmpty() + return nil } -// Response returns the raw server response from the last page request. -func (page ProtectionPolicyResourceListPage) Response() ProtectionPolicyResourceList { - return page.pprl +// OperationWorkerResponse this is the base class for operation result responses. +type OperationWorkerResponse struct { + // StatusCode - 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' + StatusCode HTTPStatusCode `json:"statusCode,omitempty"` + // Headers - HTTP headers associated with this operation. + Headers map[string][]string `json:"headers"` } -// Values returns the slice of values for the current page or nil if there are no values. -func (page ProtectionPolicyResourceListPage) Values() []ProtectionPolicyResource { - if page.pprl.IsEmpty() { - return nil +// MarshalJSON is the custom marshaler for OperationWorkerResponse. +func (owr OperationWorkerResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if owr.StatusCode != "" { + objectMap["statusCode"] = owr.StatusCode } - return *page.pprl.Value + if owr.Headers != nil { + objectMap["headers"] = owr.Headers + } + return json.Marshal(objectMap) } -// Creates a new instance of the ProtectionPolicyResourceListPage type. -func NewProtectionPolicyResourceListPage(cur ProtectionPolicyResourceList, getNextPage func(context.Context, ProtectionPolicyResourceList) (ProtectionPolicyResourceList, error)) ProtectionPolicyResourceListPage { - return ProtectionPolicyResourceListPage{ - fn: getNextPage, - pprl: cur, - } +// PointInTimeRange provides details for log ranges +type PointInTimeRange struct { + // StartTime - Start time of the time range for log recovery. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - End time of the time range for log recovery. + EndTime *date.Time `json:"endTime,omitempty"` } -// BasicRecoveryPoint base class for backup copies. Workload-specific backup copies are derived from this class. -type BasicRecoveryPoint interface { - AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) - AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) - AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) - AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) - AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) - AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) - AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) - AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) - AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) - AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) - AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) - AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) - AsRecoveryPoint() (*RecoveryPoint, bool) +// BasicProtectedItem base class for backup items. +type BasicProtectedItem interface { + AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) + AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) + AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) + AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) + AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) + AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) + AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) + AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) + AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) + AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) + AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) + AsDPMProtectedItem() (*DPMProtectedItem, bool) + AsGenericProtectedItem() (*GenericProtectedItem, bool) + AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) + AsProtectedItem() (*ProtectedItem, bool) } -// RecoveryPoint base class for backup copies. Workload-specific backup copies are derived from this class. -type RecoveryPoint struct { - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +// ProtectedItem base class for backup items. +type ProtectedItem struct { + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } -func unmarshalBasicRecoveryPoint(body []byte) (BasicRecoveryPoint, error) { +func unmarshalBasicProtectedItem(body []byte) (BasicProtectedItem, error) { var m map[string]interface{} err := json.Unmarshal(body, &m) if err != nil { return nil, err } - switch m["objectType"] { - case string(ObjectTypeAzureFileShareRecoveryPoint): - var afsrp AzureFileShareRecoveryPoint - err := json.Unmarshal(body, &afsrp) - return afsrp, err - case string(ObjectTypeAzureWorkloadPointInTimeRecoveryPoint): - var awpitrp AzureWorkloadPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awpitrp) - return awpitrp, err - case string(ObjectTypeAzureWorkloadRecoveryPoint): - var awrp AzureWorkloadRecoveryPoint - err := json.Unmarshal(body, &awrp) - return awrp, err - case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): - var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awshpitrp) - return awshpitrp, err - case string(ObjectTypeAzureWorkloadSAPHanaRecoveryPoint): - var awshrp AzureWorkloadSAPHanaRecoveryPoint - err := json.Unmarshal(body, &awshrp) - return awshrp, err - case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): - var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awspitrp) - return awspitrp, err - case string(ObjectTypeAzureWorkloadSQLRecoveryPoint): - var awsrp AzureWorkloadSQLRecoveryPoint - err := json.Unmarshal(body, &awsrp) - return awsrp, err - case string(ObjectTypeGenericRecoveryPoint): - var grp GenericRecoveryPoint - err := json.Unmarshal(body, &grp) - return grp, err - case string(ObjectTypeIaasVMRecoveryPoint): - var ivrp IaasVMRecoveryPoint - err := json.Unmarshal(body, &ivrp) - return ivrp, err + switch m["protectedItemType"] { + case string(ProtectedItemTypeAzureFileShareProtectedItem): + var afpi AzureFileshareProtectedItem + err := json.Unmarshal(body, &afpi) + return afpi, err + case string(ProtectedItemTypeMicrosoftClassicComputevirtualMachines): + var aisccvpi AzureIaaSClassicComputeVMProtectedItem + err := json.Unmarshal(body, &aisccvpi) + return aisccvpi, err + case string(ProtectedItemTypeMicrosoftComputevirtualMachines): + var aiscvpi AzureIaaSComputeVMProtectedItem + err := json.Unmarshal(body, &aiscvpi) + return aiscvpi, err + case string(ProtectedItemTypeAzureIaaSVMProtectedItem): + var aispi AzureIaaSVMProtectedItem + err := json.Unmarshal(body, &aispi) + return aispi, err + case string(ProtectedItemTypeMicrosoftSqlserversdatabases): + var aspi AzureSQLProtectedItem + err := json.Unmarshal(body, &aspi) + return aspi, err + case string(ProtectedItemTypeAzureVMWorkloadProtectedItem): + var avwpi AzureVMWorkloadProtectedItem + err := json.Unmarshal(body, &avwpi) + return avwpi, err + case string(ProtectedItemTypeAzureVMWorkloadSAPAseDatabase): + var avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem + err := json.Unmarshal(body, &avwsadpi) + return avwsadpi, err + case string(ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase): + var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem + err := json.Unmarshal(body, &avwshdpi) + return avwshdpi, err + case string(ProtectedItemTypeAzureVMWorkloadSQLDatabase): + var avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem + err := json.Unmarshal(body, &avwsdpi) + return avwsdpi, err + case string(ProtectedItemTypeDPMProtectedItem): + var dpi DPMProtectedItem + err := json.Unmarshal(body, &dpi) + return dpi, err + case string(ProtectedItemTypeGenericProtectedItem): + var gpi GenericProtectedItem + err := json.Unmarshal(body, &gpi) + return gpi, err + case string(ProtectedItemTypeMabFileFolderProtectedItem): + var mffpi MabFileFolderProtectedItem + err := json.Unmarshal(body, &mffpi) + return mffpi, err default: - var rp RecoveryPoint - err := json.Unmarshal(body, &rp) - return rp, err + var pi ProtectedItem + err := json.Unmarshal(body, &pi) + return pi, err } } -func unmarshalBasicRecoveryPointArray(body []byte) ([]BasicRecoveryPoint, error) { +func unmarshalBasicProtectedItemArray(body []byte) ([]BasicProtectedItem, error) { var rawMessages []*json.RawMessage err := json.Unmarshal(body, &rawMessages) if err != nil { return nil, err } - rpArray := make([]BasicRecoveryPoint, len(rawMessages)) + piArray := make([]BasicProtectedItem, len(rawMessages)) for index, rawMessage := range rawMessages { - rp, err := unmarshalBasicRecoveryPoint(*rawMessage) + pi, err := unmarshalBasicProtectedItem(*rawMessage) if err != nil { return nil, err } - rpArray[index] = rp + piArray[index] = pi } - return rpArray, nil + return piArray, nil } -// MarshalJSON is the custom marshaler for RecoveryPoint. -func (rp RecoveryPoint) MarshalJSON() ([]byte, error) { - rp.ObjectType = ObjectTypeRecoveryPoint +// MarshalJSON is the custom marshaler for ProtectedItem. +func (pi ProtectedItem) MarshalJSON() ([]byte, error) { + pi.ProtectedItemType = ProtectedItemTypeProtectedItem objectMap := make(map[string]interface{}) - if rp.ObjectType != "" { - objectMap["objectType"] = rp.ObjectType + if pi.BackupManagementType != "" { + objectMap["backupManagementType"] = pi.BackupManagementType + } + if pi.WorkloadType != "" { + objectMap["workloadType"] = pi.WorkloadType + } + if pi.ContainerName != nil { + objectMap["containerName"] = pi.ContainerName + } + if pi.SourceResourceID != nil { + objectMap["sourceResourceId"] = pi.SourceResourceID + } + if pi.PolicyID != nil { + objectMap["policyId"] = pi.PolicyID + } + if pi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = pi.LastRecoveryPoint + } + if pi.BackupSetName != nil { + objectMap["backupSetName"] = pi.BackupSetName + } + if pi.CreateMode != "" { + objectMap["createMode"] = pi.CreateMode + } + if pi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = pi.DeferredDeleteTimeInUTC + } + if pi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = pi.IsScheduledForDeferredDelete + } + if pi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = pi.DeferredDeleteTimeRemaining + } + if pi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = pi.IsDeferredDeleteScheduleUpcoming + } + if pi.IsRehydrate != nil { + objectMap["isRehydrate"] = pi.IsRehydrate + } + if pi.ProtectedItemType != "" { + objectMap["protectedItemType"] = pi.ProtectedItemType } return json.Marshal(objectMap) } -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { return nil, false } -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { return nil, false } -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { return nil, false } -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { return nil, false } -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { return nil, false } -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { return nil, false } -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { return nil, false } -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { return nil, false } -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { return nil, false } -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { return nil, false } -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { return nil, false } -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { +// AsDPMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { return nil, false } -// AsRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return &rp, true +// AsGenericProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false } -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &rp, true +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false } -// RecoveryPointDiskConfiguration disk configuration -type RecoveryPointDiskConfiguration struct { - // NumberOfDisksIncludedInBackup - Number of disks included in backup - NumberOfDisksIncludedInBackup *int32 `json:"numberOfDisksIncludedInBackup,omitempty"` - // NumberOfDisksAttachedToVM - Number of disks attached to the VM - NumberOfDisksAttachedToVM *int32 `json:"numberOfDisksAttachedToVm,omitempty"` - // IncludedDiskList - Information of disks included in backup - IncludedDiskList *[]DiskInformation `json:"includedDiskList,omitempty"` - // ExcludedDiskList - Information of disks excluded from backup - ExcludedDiskList *[]DiskInformation `json:"excludedDiskList,omitempty"` +// AsProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return &pi, true +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &pi, true } -// RecoveryPointResource base class for backup copies. Workload-specific backup copies are derived from -// this class. -type RecoveryPointResource struct { +// ProtectedItemQueryObject filters to list backup items. +type ProtectedItemQueryObject struct { + // HealthState - Health State for the backed up item. Possible values include: 'HealthStatePassed', 'HealthStateActionRequired', 'HealthStateActionSuggested', 'HealthStateInvalid' + HealthState HealthState `json:"healthState,omitempty"` + // 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: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + ItemType DataSourceType `json:"itemType,omitempty"` + // PolicyName - Backup policy name associated with the backup item. + PolicyName *string `json:"policyName,omitempty"` + // ContainerName - Name of the container. + ContainerName *string `json:"containerName,omitempty"` + // BackupEngineName - Backup Engine name + BackupEngineName *string `json:"backupEngineName,omitempty"` + // FriendlyName - Friendly name of protected item + FriendlyName *string `json:"friendlyName,omitempty"` + // FabricName - Name of the fabric. + FabricName *string `json:"fabricName,omitempty"` + // BackupSetName - Name of the backup set. + BackupSetName *string `json:"backupSetName,omitempty"` +} + +// ProtectedItemResource base class for backup items. +type ProtectedItemResource struct { autorest.Response `json:"-"` - // Properties - RecoveryPointResource properties - Properties BasicRecoveryPoint `json:"properties,omitempty"` + // Properties - ProtectedItemResource properties + Properties BasicProtectedItem `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id represents the complete path to the resource. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name associated with the resource. @@ -17032,24 +7857,24 @@ type RecoveryPointResource struct { ETag *string `json:"eTag,omitempty"` } -// MarshalJSON is the custom marshaler for RecoveryPointResource. -func (rpr RecoveryPointResource) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ProtectedItemResource. +func (pir ProtectedItemResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["properties"] = rpr.Properties - if rpr.Location != nil { - objectMap["location"] = rpr.Location + objectMap["properties"] = pir.Properties + if pir.Location != nil { + objectMap["location"] = pir.Location } - if rpr.Tags != nil { - objectMap["tags"] = rpr.Tags + if pir.Tags != nil { + objectMap["tags"] = pir.Tags } - if rpr.ETag != nil { - objectMap["eTag"] = rpr.ETag + if pir.ETag != nil { + objectMap["eTag"] = pir.ETag } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for RecoveryPointResource struct. -func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ProtectedItemResource struct. +func (pir *ProtectedItemResource) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -17059,11 +7884,11 @@ func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - properties, err := unmarshalBasicRecoveryPoint(*v) + properties, err := unmarshalBasicProtectedItem(*v) if err != nil { return err } - rpr.Properties = properties + pir.Properties = properties } case "id": if v != nil { @@ -17072,7 +7897,7 @@ func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rpr.ID = &ID + pir.ID = &ID } case "name": if v != nil { @@ -17081,7 +7906,7 @@ func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rpr.Name = &name + pir.Name = &name } case "type": if v != nil { @@ -17090,7 +7915,7 @@ func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rpr.Type = &typeVar + pir.Type = &typeVar } case "location": if v != nil { @@ -17099,7 +7924,7 @@ func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rpr.Location = &location + pir.Location = &location } case "tags": if v != nil { @@ -17108,7 +7933,7 @@ func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rpr.Tags = tags + pir.Tags = tags } case "eTag": if v != nil { @@ -17117,7 +7942,7 @@ func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rpr.ETag = &eTag + pir.ETag = &eTag } } } @@ -17125,26 +7950,26 @@ func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { return nil } -// RecoveryPointResourceList list of RecoveryPoint resources -type RecoveryPointResourceList struct { +// ProtectedItemResourceList list of ProtectedItem resources +type ProtectedItemResourceList struct { autorest.Response `json:"-"` // Value - List of resources. - Value *[]RecoveryPointResource `json:"value,omitempty"` + Value *[]ProtectedItemResource `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"` } -// RecoveryPointResourceListIterator provides access to a complete listing of RecoveryPointResource values. -type RecoveryPointResourceListIterator struct { +// ProtectedItemResourceListIterator provides access to a complete listing of ProtectedItemResource values. +type ProtectedItemResourceListIterator struct { i int - page RecoveryPointResourceListPage + page ProtectedItemResourceListPage } // NextWithContext 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 *RecoveryPointResourceListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *ProtectedItemResourceListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointResourceListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemResourceListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -17169,67 +7994,67 @@ func (iter *RecoveryPointResourceListIterator) NextWithContext(ctx context.Conte // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *RecoveryPointResourceListIterator) Next() error { +func (iter *ProtectedItemResourceListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RecoveryPointResourceListIterator) NotDone() bool { +func (iter ProtectedItemResourceListIterator) 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 RecoveryPointResourceListIterator) Response() RecoveryPointResourceList { +func (iter ProtectedItemResourceListIterator) Response() ProtectedItemResourceList { 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 RecoveryPointResourceListIterator) Value() RecoveryPointResource { +func (iter ProtectedItemResourceListIterator) Value() ProtectedItemResource { if !iter.page.NotDone() { - return RecoveryPointResource{} + return ProtectedItemResource{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the RecoveryPointResourceListIterator type. -func NewRecoveryPointResourceListIterator(page RecoveryPointResourceListPage) RecoveryPointResourceListIterator { - return RecoveryPointResourceListIterator{page: page} +// Creates a new instance of the ProtectedItemResourceListIterator type. +func NewProtectedItemResourceListIterator(page ProtectedItemResourceListPage) ProtectedItemResourceListIterator { + return ProtectedItemResourceListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (rprl RecoveryPointResourceList) IsEmpty() bool { - return rprl.Value == nil || len(*rprl.Value) == 0 +func (pirl ProtectedItemResourceList) IsEmpty() bool { + return pirl.Value == nil || len(*pirl.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (rprl RecoveryPointResourceList) hasNextLink() bool { - return rprl.NextLink != nil && len(*rprl.NextLink) != 0 +func (pirl ProtectedItemResourceList) hasNextLink() bool { + return pirl.NextLink != nil && len(*pirl.NextLink) != 0 } -// recoveryPointResourceListPreparer prepares a request to retrieve the next set of results. +// protectedItemResourceListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (rprl RecoveryPointResourceList) recoveryPointResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !rprl.hasNextLink() { +func (pirl ProtectedItemResourceList) protectedItemResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !pirl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(rprl.NextLink))) + autorest.WithBaseURL(to.String(pirl.NextLink))) } -// RecoveryPointResourceListPage contains a page of RecoveryPointResource values. -type RecoveryPointResourceListPage struct { - fn func(context.Context, RecoveryPointResourceList) (RecoveryPointResourceList, error) - rprl RecoveryPointResourceList +// ProtectedItemResourceListPage contains a page of ProtectedItemResource values. +type ProtectedItemResourceListPage struct { + fn func(context.Context, ProtectedItemResourceList) (ProtectedItemResourceList, error) + pirl ProtectedItemResourceList } // NextWithContext 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 *RecoveryPointResourceListPage) NextWithContext(ctx context.Context) (err error) { +func (page *ProtectedItemResourceListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointResourceListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemResourceListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -17239,11 +8064,11 @@ func (page *RecoveryPointResourceListPage) NextWithContext(ctx context.Context) }() } for { - next, err := page.fn(ctx, page.rprl) + next, err := page.fn(ctx, page.pirl) if err != nil { return err } - page.rprl = next + page.pirl = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -17254,143 +8079,182 @@ func (page *RecoveryPointResourceListPage) NextWithContext(ctx context.Context) // 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. // Deprecated: Use NextWithContext() instead. -func (page *RecoveryPointResourceListPage) Next() error { +func (page *ProtectedItemResourceListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RecoveryPointResourceListPage) NotDone() bool { - return !page.rprl.IsEmpty() +func (page ProtectedItemResourceListPage) NotDone() bool { + return !page.pirl.IsEmpty() } // Response returns the raw server response from the last page request. -func (page RecoveryPointResourceListPage) Response() RecoveryPointResourceList { - return page.rprl +func (page ProtectedItemResourceListPage) Response() ProtectedItemResourceList { + return page.pirl } // Values returns the slice of values for the current page or nil if there are no values. -func (page RecoveryPointResourceListPage) Values() []RecoveryPointResource { - if page.rprl.IsEmpty() { +func (page ProtectedItemResourceListPage) Values() []ProtectedItemResource { + if page.pirl.IsEmpty() { return nil } - return *page.rprl.Value + return *page.pirl.Value } -// Creates a new instance of the RecoveryPointResourceListPage type. -func NewRecoveryPointResourceListPage(cur RecoveryPointResourceList, getNextPage func(context.Context, RecoveryPointResourceList) (RecoveryPointResourceList, error)) RecoveryPointResourceListPage { - return RecoveryPointResourceListPage{ +// Creates a new instance of the ProtectedItemResourceListPage type. +func NewProtectedItemResourceListPage(cur ProtectedItemResourceList, getNextPage func(context.Context, ProtectedItemResourceList) (ProtectedItemResourceList, error)) ProtectedItemResourceListPage { + return ProtectedItemResourceListPage{ fn: getNextPage, - rprl: cur, + pirl: cur, } } -// RecoveryPointTierInformation recovery point tier information. -type RecoveryPointTierInformation struct { - // Type - Recovery point tier type. Possible values include: 'RecoveryPointTierTypeInvalid', 'RecoveryPointTierTypeInstantRP', 'RecoveryPointTierTypeHardenedRP' - Type RecoveryPointTierType `json:"type,omitempty"` - // Status - Recovery point tier status. Possible values include: 'RecoveryPointTierStatusInvalid', 'RecoveryPointTierStatusValid', 'RecoveryPointTierStatusDisabled', 'RecoveryPointTierStatusDeleted' - Status RecoveryPointTierStatus `json:"status,omitempty"` -} - -// BasicRequest base class for backup request. Workload-specific backup requests are derived from this class. -type BasicRequest interface { - AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) - AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) - AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) - AsRequest() (*Request, bool) +// BasicProtectionPolicy base class for backup policy. Workload-specific backup policies are derived from this class. +type BasicProtectionPolicy interface { + AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) + AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) + AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) + AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) + AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) + AsMabProtectionPolicy() (*MabProtectionPolicy, bool) + AsProtectionPolicy() (*ProtectionPolicy, bool) } -// Request base class for backup request. Workload-specific backup requests are derived from this class. -type Request struct { - // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' - ObjectType ObjectTypeBasicRequest `json:"objectType,omitempty"` +// ProtectionPolicy base class for backup policy. Workload-specific backup policies are derived from this +// class. +type ProtectionPolicy struct { + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` } -func unmarshalBasicRequest(body []byte) (BasicRequest, error) { +func unmarshalBasicProtectionPolicy(body []byte) (BasicProtectionPolicy, error) { var m map[string]interface{} err := json.Unmarshal(body, &m) if err != nil { return nil, err } - switch m["objectType"] { - case string(ObjectTypeAzureFileShareBackupRequest): - var afsbr AzureFileShareBackupRequest - err := json.Unmarshal(body, &afsbr) - return afsbr, err - case string(ObjectTypeAzureWorkloadBackupRequest): - var awbr AzureWorkloadBackupRequest - err := json.Unmarshal(body, &awbr) - return awbr, err - case string(ObjectTypeIaasVMBackupRequest): - var ivbr IaasVMBackupRequest - err := json.Unmarshal(body, &ivbr) - return ivbr, err + switch m["backupManagementType"] { + case string(BackupManagementTypeAzureWorkload): + var avwpp AzureVMWorkloadProtectionPolicy + err := json.Unmarshal(body, &avwpp) + return avwpp, err + case string(BackupManagementTypeAzureStorage): + var afspp AzureFileShareProtectionPolicy + err := json.Unmarshal(body, &afspp) + return afspp, err + case string(BackupManagementTypeAzureIaasVM): + var aispp AzureIaaSVMProtectionPolicy + err := json.Unmarshal(body, &aispp) + return aispp, err + case string(BackupManagementTypeAzureSQL): + var aspp AzureSQLProtectionPolicy + err := json.Unmarshal(body, &aspp) + return aspp, err + case string(BackupManagementTypeGenericProtectionPolicy): + var gpp GenericProtectionPolicy + err := json.Unmarshal(body, &gpp) + return gpp, err + case string(BackupManagementTypeMAB): + var mpp MabProtectionPolicy + err := json.Unmarshal(body, &mpp) + return mpp, err default: - var r Request - err := json.Unmarshal(body, &r) - return r, err + var pp ProtectionPolicy + err := json.Unmarshal(body, &pp) + return pp, err } } -func unmarshalBasicRequestArray(body []byte) ([]BasicRequest, error) { +func unmarshalBasicProtectionPolicyArray(body []byte) ([]BasicProtectionPolicy, error) { var rawMessages []*json.RawMessage err := json.Unmarshal(body, &rawMessages) if err != nil { return nil, err } - rArray := make([]BasicRequest, len(rawMessages)) + ppArray := make([]BasicProtectionPolicy, len(rawMessages)) for index, rawMessage := range rawMessages { - r, err := unmarshalBasicRequest(*rawMessage) + pp, err := unmarshalBasicProtectionPolicy(*rawMessage) if err != nil { return nil, err } - rArray[index] = r + ppArray[index] = pp } - return rArray, nil + return ppArray, nil } -// MarshalJSON is the custom marshaler for Request. -func (r Request) MarshalJSON() ([]byte, error) { - r.ObjectType = ObjectTypeBackupRequest +// MarshalJSON is the custom marshaler for ProtectionPolicy. +func (pp ProtectionPolicy) MarshalJSON() ([]byte, error) { + pp.BackupManagementType = BackupManagementTypeProtectionPolicy objectMap := make(map[string]interface{}) - if r.ObjectType != "" { - objectMap["objectType"] = r.ObjectType + if pp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = pp.ProtectedItemsCount + } + if pp.BackupManagementType != "" { + objectMap["backupManagementType"] = pp.BackupManagementType } return json.Marshal(objectMap) } -// AsAzureFileShareBackupRequest is the BasicRequest implementation for Request. -func (r Request) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return nil, false +} + +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { + return nil, false +} + +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { return nil, false } -// AsAzureWorkloadBackupRequest is the BasicRequest implementation for Request. -func (r Request) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { return nil, false } -// AsIaasVMBackupRequest is the BasicRequest implementation for Request. -func (r Request) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { return nil, false } -// AsRequest is the BasicRequest implementation for Request. -func (r Request) AsRequest() (*Request, bool) { - return &r, true +// AsProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { + return &pp, true +} + +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &pp, true } -// AsBasicRequest is the BasicRequest implementation for Request. -func (r Request) AsBasicRequest() (BasicRequest, bool) { - return &r, true +// ProtectionPolicyQueryObject filters the list backup policies API. +type ProtectionPolicyQueryObject struct { + // BackupManagementType - Backup management type for the backup policy. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // FabricName - Fabric name for filter + FabricName *string `json:"fabricName,omitempty"` + // WorkloadType - Workload type for the backup policy. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` } -// RequestResource base class for backup request. Workload-specific backup requests are derived from this -// class. -type RequestResource struct { - // Properties - BackupRequestResource properties - Properties BasicRequest `json:"properties,omitempty"` +// ProtectionPolicyResource base class for backup policy. Workload-specific backup policies are derived +// from this class. +type ProtectionPolicyResource struct { + autorest.Response `json:"-"` + // Properties - ProtectionPolicyResource properties + Properties BasicProtectionPolicy `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id represents the complete path to the resource. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name associated with the resource. @@ -17405,24 +8269,24 @@ type RequestResource struct { ETag *string `json:"eTag,omitempty"` } -// MarshalJSON is the custom marshaler for RequestResource. -func (rr RequestResource) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ProtectionPolicyResource. +func (ppr ProtectionPolicyResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["properties"] = rr.Properties - if rr.Location != nil { - objectMap["location"] = rr.Location + objectMap["properties"] = ppr.Properties + if ppr.Location != nil { + objectMap["location"] = ppr.Location } - if rr.Tags != nil { - objectMap["tags"] = rr.Tags + if ppr.Tags != nil { + objectMap["tags"] = ppr.Tags } - if rr.ETag != nil { - objectMap["eTag"] = rr.ETag + if ppr.ETag != nil { + objectMap["eTag"] = ppr.ETag } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for RequestResource struct. -func (rr *RequestResource) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ProtectionPolicyResource struct. +func (ppr *ProtectionPolicyResource) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -17432,11 +8296,11 @@ func (rr *RequestResource) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - properties, err := unmarshalBasicRequest(*v) + properties, err := unmarshalBasicProtectionPolicy(*v) if err != nil { return err } - rr.Properties = properties + ppr.Properties = properties } case "id": if v != nil { @@ -17445,7 +8309,7 @@ func (rr *RequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rr.ID = &ID + ppr.ID = &ID } case "name": if v != nil { @@ -17454,7 +8318,7 @@ func (rr *RequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rr.Name = &name + ppr.Name = &name } case "type": if v != nil { @@ -17463,7 +8327,7 @@ func (rr *RequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rr.Type = &typeVar + ppr.Type = &typeVar } case "location": if v != nil { @@ -17472,7 +8336,7 @@ func (rr *RequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rr.Location = &location + ppr.Location = &location } case "tags": if v != nil { @@ -17481,7 +8345,7 @@ func (rr *RequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rr.Tags = tags + ppr.Tags = tags } case "eTag": if v != nil { @@ -17490,7 +8354,7 @@ func (rr *RequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rr.ETag = &eTag + ppr.ETag = &eTag } } } @@ -17498,193 +8362,190 @@ func (rr *RequestResource) UnmarshalJSON(body []byte) error { return nil } -// Resource ARM Resource. -type Resource struct { - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` +// ProtectionPolicyResourceList list of ProtectionPolicy resources +type ProtectionPolicyResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]ProtectionPolicyResource `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"` } -// MarshalJSON is the custom marshaler for Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if r.Location != nil { - objectMap["location"] = r.Location +// ProtectionPolicyResourceListIterator provides access to a complete listing of ProtectionPolicyResource +// values. +type ProtectionPolicyResourceListIterator struct { + i int + page ProtectionPolicyResourceListPage +} + +// NextWithContext 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 *ProtectionPolicyResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionPolicyResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } - if r.Tags != nil { - objectMap["tags"] = r.Tags + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil } - if r.ETag != nil { - objectMap["eTag"] = r.ETag + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err } - return json.Marshal(objectMap) + iter.i = 0 + return nil } -// ResourceConfig the resource storage details. -type ResourceConfig struct { - // StorageModelType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant' - StorageModelType StorageType `json:"storageModelType,omitempty"` - // StorageType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant' - StorageType StorageType `json:"storageType,omitempty"` - // StorageTypeState - Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. Possible values include: 'StorageTypeStateInvalid', 'StorageTypeStateLocked', 'StorageTypeStateUnlocked' - StorageTypeState StorageTypeState `json:"storageTypeState,omitempty"` +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectionPolicyResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) } -// ResourceConfigResource the resource storage details. -type ResourceConfigResource struct { - autorest.Response `json:"-"` - // Properties - BackupResourceConfigResource properties - Properties *ResourceConfig `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectionPolicyResourceListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) } -// MarshalJSON is the custom marshaler for ResourceConfigResource. -func (rcr ResourceConfigResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rcr.Properties != nil { - objectMap["properties"] = rcr.Properties - } - if rcr.Location != nil { - objectMap["location"] = rcr.Location - } - if rcr.Tags != nil { - objectMap["tags"] = rcr.Tags - } - if rcr.ETag != nil { - objectMap["eTag"] = rcr.ETag +// Response returns the raw server response from the last page request. +func (iter ProtectionPolicyResourceListIterator) Response() ProtectionPolicyResourceList { + 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 ProtectionPolicyResourceListIterator) Value() ProtectionPolicyResource { + if !iter.page.NotDone() { + return ProtectionPolicyResource{} } - return json.Marshal(objectMap) + return iter.page.Values()[iter.i] } -// ResourceHealthDetails health Details for backup items. -type ResourceHealthDetails struct { - // Code - READ-ONLY; Health Code - Code *int32 `json:"code,omitempty"` - // Title - READ-ONLY; Health Title - Title *string `json:"title,omitempty"` - // Message - READ-ONLY; Health Message - Message *string `json:"message,omitempty"` - // Recommendations - READ-ONLY; Health Recommended Actions - Recommendations *[]string `json:"recommendations,omitempty"` +// Creates a new instance of the ProtectionPolicyResourceListIterator type. +func NewProtectionPolicyResourceListIterator(page ProtectionPolicyResourceListPage) ProtectionPolicyResourceListIterator { + return ProtectionPolicyResourceListIterator{page: page} } -// MarshalJSON is the custom marshaler for ResourceHealthDetails. -func (rhd ResourceHealthDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) +// IsEmpty returns true if the ListResult contains no values. +func (pprl ProtectionPolicyResourceList) IsEmpty() bool { + return pprl.Value == nil || len(*pprl.Value) == 0 } -// ResourceList base for all lists of resources. -type ResourceList struct { - // NextLink - The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. - NextLink *string `json:"nextLink,omitempty"` +// hasNextLink returns true if the NextLink is not empty. +func (pprl ProtectionPolicyResourceList) hasNextLink() bool { + return pprl.NextLink != nil && len(*pprl.NextLink) != 0 } -// ResourceVaultConfig backup resource vault config details. -type ResourceVaultConfig struct { - // StorageModelType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant' - StorageModelType StorageType `json:"storageModelType,omitempty"` - // StorageType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant' - StorageType StorageType `json:"storageType,omitempty"` - // StorageTypeState - Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. Possible values include: 'StorageTypeStateInvalid', 'StorageTypeStateLocked', 'StorageTypeStateUnlocked' - StorageTypeState StorageTypeState `json:"storageTypeState,omitempty"` - // EnhancedSecurityState - Enabled or Disabled. Possible values include: 'EnhancedSecurityStateInvalid', 'EnhancedSecurityStateEnabled', 'EnhancedSecurityStateDisabled' - EnhancedSecurityState EnhancedSecurityState `json:"enhancedSecurityState,omitempty"` - // SoftDeleteFeatureState - Soft Delete feature state. Possible values include: 'SoftDeleteFeatureStateInvalid', 'SoftDeleteFeatureStateEnabled', 'SoftDeleteFeatureStateDisabled' - SoftDeleteFeatureState SoftDeleteFeatureState `json:"softDeleteFeatureState,omitempty"` +// protectionPolicyResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pprl ProtectionPolicyResourceList) protectionPolicyResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !pprl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pprl.NextLink))) } -// ResourceVaultConfigResource backup resource vault config details. -type ResourceVaultConfigResource struct { - autorest.Response `json:"-"` - // Properties - BackupResourceVaultConfigResource properties - Properties *ResourceVaultConfig `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` +// ProtectionPolicyResourceListPage contains a page of ProtectionPolicyResource values. +type ProtectionPolicyResourceListPage struct { + fn func(context.Context, ProtectionPolicyResourceList) (ProtectionPolicyResourceList, error) + pprl ProtectionPolicyResourceList } -// MarshalJSON is the custom marshaler for ResourceVaultConfigResource. -func (rvcr ResourceVaultConfigResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rvcr.Properties != nil { - objectMap["properties"] = rvcr.Properties - } - if rvcr.Location != nil { - objectMap["location"] = rvcr.Location +// NextWithContext 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 *ProtectionPolicyResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionPolicyResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } - if rvcr.Tags != nil { - objectMap["tags"] = rvcr.Tags + for { + next, err := page.fn(ctx, page.pprl) + if err != nil { + return err + } + page.pprl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - if rvcr.ETag != nil { - objectMap["eTag"] = rvcr.ETag + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectionPolicyResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectionPolicyResourceListPage) NotDone() bool { + return !page.pprl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectionPolicyResourceListPage) Response() ProtectionPolicyResourceList { + return page.pprl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectionPolicyResourceListPage) Values() []ProtectionPolicyResource { + if page.pprl.IsEmpty() { + return nil } - return json.Marshal(objectMap) + return *page.pprl.Value } -// RestoreFileSpecs restore file specs like file path, type and target folder path info. -type RestoreFileSpecs struct { - // Path - Source File/Folder path - Path *string `json:"path,omitempty"` - // FileSpecType - Indicates what the Path variable stands for - FileSpecType *string `json:"fileSpecType,omitempty"` - // TargetFolderPath - Destination folder path in target FileShare - TargetFolderPath *string `json:"targetFolderPath,omitempty"` +// Creates a new instance of the ProtectionPolicyResourceListPage type. +func NewProtectionPolicyResourceListPage(cur ProtectionPolicyResourceList, getNextPage func(context.Context, ProtectionPolicyResourceList) (ProtectionPolicyResourceList, error)) ProtectionPolicyResourceListPage { + return ProtectionPolicyResourceListPage{ + fn: getNextPage, + pprl: cur, + } } -// BasicRestoreRequest base class for restore request. Workload-specific restore requests are derived from this class. -type BasicRestoreRequest interface { - AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) - AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) - AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) - AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) - AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) - AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) - AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) - AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) - AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) - AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) - AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) - AsRestoreRequest() (*RestoreRequest, bool) +// BasicRecoveryPoint base class for backup copies. Workload-specific backup copies are derived from this class. +type BasicRecoveryPoint interface { + AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) + AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) + AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) + AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) + AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) + AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) + AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) + AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) + AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) + AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) + AsRecoveryPoint() (*RecoveryPoint, bool) } -// RestoreRequest base class for restore request. Workload-specific restore requests are derived from this -// class. -type RestoreRequest struct { - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +// RecoveryPoint base class for backup copies. Workload-specific backup copies are derived from this class. +type RecoveryPoint struct { + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` } -func unmarshalBasicRestoreRequest(body []byte) (BasicRestoreRequest, error) { +func unmarshalBasicRecoveryPoint(body []byte) (BasicRecoveryPoint, error) { var m map[string]interface{} err := json.Unmarshal(body, &m) if err != nil { @@ -17692,143 +8553,165 @@ func unmarshalBasicRestoreRequest(body []byte) (BasicRestoreRequest, error) { } switch m["objectType"] { - case string(ObjectTypeAzureFileShareRestoreRequest): - var afsrr AzureFileShareRestoreRequest - err := json.Unmarshal(body, &afsrr) - return afsrr, err - case string(ObjectTypeAzureWorkloadPointInTimeRestoreRequest): - var awpitrr AzureWorkloadPointInTimeRestoreRequest - err := json.Unmarshal(body, &awpitrr) - return awpitrr, err - case string(ObjectTypeAzureWorkloadRestoreRequest): - var awrr AzureWorkloadRestoreRequest - err := json.Unmarshal(body, &awrr) - return awrr, err - case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): - var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest - err := json.Unmarshal(body, &awshpitrr) - return awshpitrr, err - case string(ObjectTypeAzureWorkloadSAPHanaRestoreRequest): - var awshrr AzureWorkloadSAPHanaRestoreRequest - err := json.Unmarshal(body, &awshrr) - return awshrr, err - case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): - var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest - err := json.Unmarshal(body, &awspitrr) - return awspitrr, err - case string(ObjectTypeAzureWorkloadSQLRestoreRequest): - var awsrr AzureWorkloadSQLRestoreRequest - err := json.Unmarshal(body, &awsrr) - return awsrr, err - case string(ObjectTypeIaasVMRestoreRequest): - var ivrr IaasVMRestoreRequest - err := json.Unmarshal(body, &ivrr) - return ivrr, err + case string(ObjectTypeAzureFileShareRecoveryPoint): + var afsrp AzureFileShareRecoveryPoint + err := json.Unmarshal(body, &afsrp) + return afsrp, err + case string(ObjectTypeAzureWorkloadPointInTimeRecoveryPoint): + var awpitrp AzureWorkloadPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awpitrp) + return awpitrp, err + case string(ObjectTypeAzureWorkloadRecoveryPoint): + var awrp AzureWorkloadRecoveryPoint + err := json.Unmarshal(body, &awrp) + return awrp, err + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): + var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awshpitrp) + return awshpitrp, err + case string(ObjectTypeAzureWorkloadSAPHanaRecoveryPoint): + var awshrp AzureWorkloadSAPHanaRecoveryPoint + err := json.Unmarshal(body, &awshrp) + return awshrp, err + case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): + var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awspitrp) + return awspitrp, err + case string(ObjectTypeAzureWorkloadSQLRecoveryPoint): + var awsrp AzureWorkloadSQLRecoveryPoint + err := json.Unmarshal(body, &awsrp) + return awsrp, err + case string(ObjectTypeGenericRecoveryPoint): + var grp GenericRecoveryPoint + err := json.Unmarshal(body, &grp) + return grp, err + case string(ObjectTypeIaasVMRecoveryPoint): + var ivrp IaasVMRecoveryPoint + err := json.Unmarshal(body, &ivrp) + return ivrp, err default: - var rr RestoreRequest - err := json.Unmarshal(body, &rr) - return rr, err + var rp RecoveryPoint + err := json.Unmarshal(body, &rp) + return rp, err } } -func unmarshalBasicRestoreRequestArray(body []byte) ([]BasicRestoreRequest, error) { +func unmarshalBasicRecoveryPointArray(body []byte) ([]BasicRecoveryPoint, error) { var rawMessages []*json.RawMessage err := json.Unmarshal(body, &rawMessages) if err != nil { return nil, err } - rrArray := make([]BasicRestoreRequest, len(rawMessages)) + rpArray := make([]BasicRecoveryPoint, len(rawMessages)) for index, rawMessage := range rawMessages { - rr, err := unmarshalBasicRestoreRequest(*rawMessage) + rp, err := unmarshalBasicRecoveryPoint(*rawMessage) if err != nil { return nil, err } - rrArray[index] = rr + rpArray[index] = rp } - return rrArray, nil + return rpArray, nil } -// MarshalJSON is the custom marshaler for RestoreRequest. -func (rr RestoreRequest) MarshalJSON() ([]byte, error) { - rr.ObjectType = ObjectTypeRestoreRequest +// MarshalJSON is the custom marshaler for RecoveryPoint. +func (rp RecoveryPoint) MarshalJSON() ([]byte, error) { + rp.ObjectType = ObjectTypeRecoveryPoint objectMap := make(map[string]interface{}) - if rr.ObjectType != "" { - objectMap["objectType"] = rr.ObjectType + if rp.ObjectType != "" { + objectMap["objectType"] = rp.ObjectType } return json.Marshal(objectMap) } -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { return nil, false } -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { return nil, false } -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { return nil, false } -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { return nil, false } -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { return nil, false } -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { return nil, false } -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { return nil, false } -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { return nil, false } -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { return nil, false } -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { return nil, false } -// AsRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return &rr, true +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false } -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &rr, true +// AsRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return &rp, true } -// RestoreRequestResource base class for restore request. Workload-specific restore requests are derived -// from this class. -type RestoreRequestResource struct { - // Properties - RestoreRequestResource properties - Properties BasicRestoreRequest `json:"properties,omitempty"` +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &rp, true +} + +// RecoveryPointDiskConfiguration disk configuration +type RecoveryPointDiskConfiguration struct { + // NumberOfDisksIncludedInBackup - Number of disks included in backup + NumberOfDisksIncludedInBackup *int32 `json:"numberOfDisksIncludedInBackup,omitempty"` + // NumberOfDisksAttachedToVM - Number of disks attached to the VM + NumberOfDisksAttachedToVM *int32 `json:"numberOfDisksAttachedToVm,omitempty"` + // IncludedDiskList - Information of disks included in backup + IncludedDiskList *[]DiskInformation `json:"includedDiskList,omitempty"` + // ExcludedDiskList - Information of disks excluded from backup + ExcludedDiskList *[]DiskInformation `json:"excludedDiskList,omitempty"` +} + +// RecoveryPointResource base class for backup copies. Workload-specific backup copies are derived from +// this class. +type RecoveryPointResource struct { + autorest.Response `json:"-"` + // Properties - RecoveryPointResource properties + Properties BasicRecoveryPoint `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id represents the complete path to the resource. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name associated with the resource. @@ -17843,24 +8726,24 @@ type RestoreRequestResource struct { ETag *string `json:"eTag,omitempty"` } -// MarshalJSON is the custom marshaler for RestoreRequestResource. -func (rrr RestoreRequestResource) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for RecoveryPointResource. +func (rpr RecoveryPointResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["properties"] = rrr.Properties - if rrr.Location != nil { - objectMap["location"] = rrr.Location + objectMap["properties"] = rpr.Properties + if rpr.Location != nil { + objectMap["location"] = rpr.Location } - if rrr.Tags != nil { - objectMap["tags"] = rrr.Tags + if rpr.Tags != nil { + objectMap["tags"] = rpr.Tags } - if rrr.ETag != nil { - objectMap["eTag"] = rrr.ETag + if rpr.ETag != nil { + objectMap["eTag"] = rpr.ETag } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for RestoreRequestResource struct. -func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for RecoveryPointResource struct. +func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -17870,11 +8753,11 @@ func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - properties, err := unmarshalBasicRestoreRequest(*v) + properties, err := unmarshalBasicRecoveryPoint(*v) if err != nil { return err } - rrr.Properties = properties + rpr.Properties = properties } case "id": if v != nil { @@ -17883,7 +8766,7 @@ func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rrr.ID = &ID + rpr.ID = &ID } case "name": if v != nil { @@ -17892,7 +8775,7 @@ func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rrr.Name = &name + rpr.Name = &name } case "type": if v != nil { @@ -17901,7 +8784,7 @@ func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rrr.Type = &typeVar + rpr.Type = &typeVar } case "location": if v != nil { @@ -17910,7 +8793,7 @@ func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rrr.Location = &location + rpr.Location = &location } case "tags": if v != nil { @@ -17919,7 +8802,7 @@ func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rrr.Tags = tags + rpr.Tags = tags } case "eTag": if v != nil { @@ -17928,7 +8811,7 @@ func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - rrr.ETag = &eTag + rpr.ETag = &eTag } } } @@ -17936,373 +8819,489 @@ func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { return nil } -// RetentionDuration retention duration. -type RetentionDuration struct { - // Count - Count of duration types. Retention duration is obtained by the counting the duration type Count times. - // For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks. - Count *int32 `json:"count,omitempty"` - // DurationType - Retention duration type of retention policy. Possible values include: 'RetentionDurationTypeInvalid', 'RetentionDurationTypeDays', 'RetentionDurationTypeWeeks', 'RetentionDurationTypeMonths', 'RetentionDurationTypeYears' - DurationType RetentionDurationType `json:"durationType,omitempty"` -} - -// BasicRetentionPolicy base class for retention policy. -type BasicRetentionPolicy interface { - AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) - AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) - AsRetentionPolicy() (*RetentionPolicy, bool) +// RecoveryPointResourceList list of RecoveryPoint resources +type RecoveryPointResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]RecoveryPointResource `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"` } -// RetentionPolicy base class for retention policy. -type RetentionPolicy struct { - // RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy' - RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"` +// RecoveryPointResourceListIterator provides access to a complete listing of RecoveryPointResource values. +type RecoveryPointResourceListIterator struct { + i int + page RecoveryPointResourceListPage } -func unmarshalBasicRetentionPolicy(body []byte) (BasicRetentionPolicy, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) +// NextWithContext 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 *RecoveryPointResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) if err != nil { - return nil, err + iter.i-- + return err } + iter.i = 0 + return nil +} - switch m["retentionPolicyType"] { - case string(RetentionPolicyTypeLongTermRetentionPolicy): - var ltrp LongTermRetentionPolicy - err := json.Unmarshal(body, <rp) - return ltrp, err - case string(RetentionPolicyTypeSimpleRetentionPolicy): - var srp SimpleRetentionPolicy - err := json.Unmarshal(body, &srp) - return srp, err - default: - var rp RetentionPolicy - err := json.Unmarshal(body, &rp) - return rp, err +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryPointResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryPointResourceListIterator) 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 RecoveryPointResourceListIterator) Response() RecoveryPointResourceList { + 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 RecoveryPointResourceListIterator) Value() RecoveryPointResource { + if !iter.page.NotDone() { + return RecoveryPointResource{} } + return iter.page.Values()[iter.i] } -func unmarshalBasicRetentionPolicyArray(body []byte) ([]BasicRetentionPolicy, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err + +// Creates a new instance of the RecoveryPointResourceListIterator type. +func NewRecoveryPointResourceListIterator(page RecoveryPointResourceListPage) RecoveryPointResourceListIterator { + return RecoveryPointResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rprl RecoveryPointResourceList) IsEmpty() bool { + return rprl.Value == nil || len(*rprl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rprl RecoveryPointResourceList) hasNextLink() bool { + return rprl.NextLink != nil && len(*rprl.NextLink) != 0 +} + +// recoveryPointResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rprl RecoveryPointResourceList) recoveryPointResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !rprl.hasNextLink() { + return nil, nil } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rprl.NextLink))) +} - rpArray := make([]BasicRetentionPolicy, len(rawMessages)) +// RecoveryPointResourceListPage contains a page of RecoveryPointResource values. +type RecoveryPointResourceListPage struct { + fn func(context.Context, RecoveryPointResourceList) (RecoveryPointResourceList, error) + rprl RecoveryPointResourceList +} - for index, rawMessage := range rawMessages { - rp, err := unmarshalBasicRetentionPolicy(*rawMessage) +// NextWithContext 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 *RecoveryPointResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rprl) if err != nil { - return nil, err + return err + } + page.rprl = next + if !next.hasNextLink() || !next.IsEmpty() { + break } - rpArray[index] = rp } - return rpArray, nil + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryPointResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryPointResourceListPage) NotDone() bool { + return !page.rprl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryPointResourceListPage) Response() RecoveryPointResourceList { + return page.rprl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryPointResourceListPage) Values() []RecoveryPointResource { + if page.rprl.IsEmpty() { + return nil + } + return *page.rprl.Value +} + +// Creates a new instance of the RecoveryPointResourceListPage type. +func NewRecoveryPointResourceListPage(cur RecoveryPointResourceList, getNextPage func(context.Context, RecoveryPointResourceList) (RecoveryPointResourceList, error)) RecoveryPointResourceListPage { + return RecoveryPointResourceListPage{ + fn: getNextPage, + rprl: cur, + } +} + +// RecoveryPointTierInformation recovery point tier information. +type RecoveryPointTierInformation struct { + // Type - Recovery point tier type. Possible values include: 'RecoveryPointTierTypeInvalid', 'RecoveryPointTierTypeInstantRP', 'RecoveryPointTierTypeHardenedRP' + Type RecoveryPointTierType `json:"type,omitempty"` + // Status - Recovery point tier status. Possible values include: 'RecoveryPointTierStatusInvalid', 'RecoveryPointTierStatusValid', 'RecoveryPointTierStatusDisabled', 'RecoveryPointTierStatusDeleted' + Status RecoveryPointTierStatus `json:"status,omitempty"` +} + +// Resource ARM Resource. +type Resource struct { + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + if r.ETag != nil { + objectMap["eTag"] = r.ETag + } + return json.Marshal(objectMap) +} + +// ResourceHealthDetails health Details for backup items. +type ResourceHealthDetails struct { + // Code - READ-ONLY; Health Code + Code *int32 `json:"code,omitempty"` + // Title - READ-ONLY; Health Title + Title *string `json:"title,omitempty"` + // Message - READ-ONLY; Health Message + Message *string `json:"message,omitempty"` + // Recommendations - READ-ONLY; Health Recommended Actions + Recommendations *[]string `json:"recommendations,omitempty"` } -// MarshalJSON is the custom marshaler for RetentionPolicy. -func (rp RetentionPolicy) MarshalJSON() ([]byte, error) { - rp.RetentionPolicyType = RetentionPolicyTypeRetentionPolicy +// MarshalJSON is the custom marshaler for ResourceHealthDetails. +func (rhd ResourceHealthDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if rp.RetentionPolicyType != "" { - objectMap["retentionPolicyType"] = rp.RetentionPolicyType - } return json.Marshal(objectMap) } -// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. -func (rp RetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) { - return nil, false +// ResourceList base for all lists of resources. +type ResourceList struct { + // NextLink - The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + NextLink *string `json:"nextLink,omitempty"` } -// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. -func (rp RetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) { - return nil, false +// ResourceVaultConfig backup resource vault config details. +type ResourceVaultConfig struct { + // StorageModelType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant' + StorageModelType StorageType `json:"storageModelType,omitempty"` + // StorageType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant' + StorageType StorageType `json:"storageType,omitempty"` + // StorageTypeState - Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. Possible values include: 'StorageTypeStateInvalid', 'StorageTypeStateLocked', 'StorageTypeStateUnlocked' + StorageTypeState StorageTypeState `json:"storageTypeState,omitempty"` + // EnhancedSecurityState - Enabled or Disabled. Possible values include: 'EnhancedSecurityStateInvalid', 'EnhancedSecurityStateEnabled', 'EnhancedSecurityStateDisabled' + EnhancedSecurityState EnhancedSecurityState `json:"enhancedSecurityState,omitempty"` + // SoftDeleteFeatureState - Soft Delete feature state. Possible values include: 'SoftDeleteFeatureStateInvalid', 'SoftDeleteFeatureStateEnabled', 'SoftDeleteFeatureStateDisabled' + SoftDeleteFeatureState SoftDeleteFeatureState `json:"softDeleteFeatureState,omitempty"` } -// AsRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. -func (rp RetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) { - return &rp, true +// ResourceVaultConfigResource backup resource vault config details. +type ResourceVaultConfigResource struct { + autorest.Response `json:"-"` + // Properties - BackupResourceVaultConfigResource properties + Properties *ResourceVaultConfig `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` } -// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. -func (rp RetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) { - return &rp, true +// MarshalJSON is the custom marshaler for ResourceVaultConfigResource. +func (rvcr ResourceVaultConfigResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rvcr.Properties != nil { + objectMap["properties"] = rvcr.Properties + } + if rvcr.Location != nil { + objectMap["location"] = rvcr.Location + } + if rvcr.Tags != nil { + objectMap["tags"] = rvcr.Tags + } + if rvcr.ETag != nil { + objectMap["eTag"] = rvcr.ETag + } + return json.Marshal(objectMap) } -// BasicSchedulePolicy base class for backup schedule. -type BasicSchedulePolicy interface { - AsLogSchedulePolicy() (*LogSchedulePolicy, bool) - AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) - AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) - AsSchedulePolicy() (*SchedulePolicy, bool) +// RestoreFileSpecs restore file specs like file path, type and target folder path info. +type RestoreFileSpecs struct { + // Path - Source File/Folder path + Path *string `json:"path,omitempty"` + // FileSpecType - Indicates what the Path variable stands for + FileSpecType *string `json:"fileSpecType,omitempty"` + // TargetFolderPath - Destination folder path in target FileShare + TargetFolderPath *string `json:"targetFolderPath,omitempty"` } -// SchedulePolicy base class for backup schedule. -type SchedulePolicy struct { - // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' - SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` +// BasicRestoreRequest base class for restore request. Workload-specific restore requests are derived from this class. +type BasicRestoreRequest interface { + AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) + AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) + AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) + AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) + AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) + AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) + AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) + AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) + AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) + AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) + AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) + AsRestoreRequest() (*RestoreRequest, bool) } -func unmarshalBasicSchedulePolicy(body []byte) (BasicSchedulePolicy, error) { +// RestoreRequest base class for restore request. Workload-specific restore requests are derived from this +// class. +type RestoreRequest struct { + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicRestoreRequest(body []byte) (BasicRestoreRequest, error) { var m map[string]interface{} err := json.Unmarshal(body, &m) if err != nil { return nil, err } - switch m["schedulePolicyType"] { - case string(SchedulePolicyTypeLogSchedulePolicy): - var lsp LogSchedulePolicy - err := json.Unmarshal(body, &lsp) - return lsp, err - case string(SchedulePolicyTypeLongTermSchedulePolicy): - var ltsp LongTermSchedulePolicy - err := json.Unmarshal(body, <sp) - return ltsp, err - case string(SchedulePolicyTypeSimpleSchedulePolicy): - var ssp SimpleSchedulePolicy - err := json.Unmarshal(body, &ssp) - return ssp, err + switch m["objectType"] { + case string(ObjectTypeAzureFileShareRestoreRequest): + var afsrr AzureFileShareRestoreRequest + err := json.Unmarshal(body, &afsrr) + return afsrr, err + case string(ObjectTypeAzureWorkloadPointInTimeRestoreRequest): + var awpitrr AzureWorkloadPointInTimeRestoreRequest + err := json.Unmarshal(body, &awpitrr) + return awpitrr, err + case string(ObjectTypeAzureWorkloadRestoreRequest): + var awrr AzureWorkloadRestoreRequest + err := json.Unmarshal(body, &awrr) + return awrr, err + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): + var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest + err := json.Unmarshal(body, &awshpitrr) + return awshpitrr, err + case string(ObjectTypeAzureWorkloadSAPHanaRestoreRequest): + var awshrr AzureWorkloadSAPHanaRestoreRequest + err := json.Unmarshal(body, &awshrr) + return awshrr, err + case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): + var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest + err := json.Unmarshal(body, &awspitrr) + return awspitrr, err + case string(ObjectTypeAzureWorkloadSQLRestoreRequest): + var awsrr AzureWorkloadSQLRestoreRequest + err := json.Unmarshal(body, &awsrr) + return awsrr, err + case string(ObjectTypeIaasVMRestoreRequest): + var ivrr IaasVMRestoreRequest + err := json.Unmarshal(body, &ivrr) + return ivrr, err default: - var sp SchedulePolicy - err := json.Unmarshal(body, &sp) - return sp, err + var rr RestoreRequest + err := json.Unmarshal(body, &rr) + return rr, err } } -func unmarshalBasicSchedulePolicyArray(body []byte) ([]BasicSchedulePolicy, error) { +func unmarshalBasicRestoreRequestArray(body []byte) ([]BasicRestoreRequest, error) { var rawMessages []*json.RawMessage err := json.Unmarshal(body, &rawMessages) if err != nil { return nil, err } - spArray := make([]BasicSchedulePolicy, len(rawMessages)) + rrArray := make([]BasicRestoreRequest, len(rawMessages)) for index, rawMessage := range rawMessages { - sp, err := unmarshalBasicSchedulePolicy(*rawMessage) + rr, err := unmarshalBasicRestoreRequest(*rawMessage) if err != nil { return nil, err } - spArray[index] = sp - } - return spArray, nil -} - -// MarshalJSON is the custom marshaler for SchedulePolicy. -func (sp SchedulePolicy) MarshalJSON() ([]byte, error) { - sp.SchedulePolicyType = SchedulePolicyTypeSchedulePolicy - objectMap := make(map[string]interface{}) - if sp.SchedulePolicyType != "" { - objectMap["schedulePolicyType"] = sp.SchedulePolicyType + rrArray[index] = rr } - return json.Marshal(objectMap) -} - -// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. -func (sp SchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { - return nil, false -} - -// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. -func (sp SchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { - return nil, false -} - -// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. -func (sp SchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { - return nil, false -} - -// AsSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. -func (sp SchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { - return &sp, true -} - -// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. -func (sp SchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { - return &sp, true -} - -// Settings common settings field for backup management -type Settings struct { - // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". - TimeZone *string `json:"timeZone,omitempty"` - // Issqlcompression - SQL compression flag - Issqlcompression *bool `json:"issqlcompression,omitempty"` - // IsCompression - Workload compression flag. This has been added so that 'isSqlCompression' - // will be deprecated once clients upgrade to consider this flag. - IsCompression *bool `json:"isCompression,omitempty"` -} - -// SimpleRetentionPolicy simple policy retention. -type SimpleRetentionPolicy struct { - // RetentionDuration - Retention duration of the protection policy. - RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` - // RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy' - RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"` + return rrArray, nil } -// MarshalJSON is the custom marshaler for SimpleRetentionPolicy. -func (srp SimpleRetentionPolicy) MarshalJSON() ([]byte, error) { - srp.RetentionPolicyType = RetentionPolicyTypeSimpleRetentionPolicy +// MarshalJSON is the custom marshaler for RestoreRequest. +func (rr RestoreRequest) MarshalJSON() ([]byte, error) { + rr.ObjectType = ObjectTypeRestoreRequest objectMap := make(map[string]interface{}) - if srp.RetentionDuration != nil { - objectMap["retentionDuration"] = srp.RetentionDuration - } - if srp.RetentionPolicyType != "" { - objectMap["retentionPolicyType"] = srp.RetentionPolicyType + if rr.ObjectType != "" { + objectMap["objectType"] = rr.ObjectType } return json.Marshal(objectMap) } -// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. -func (srp SimpleRetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) { - return nil, false -} - -// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. -func (srp SimpleRetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) { - return &srp, true +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false } -// AsRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. -func (srp SimpleRetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) { +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { return nil, false } -// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. -func (srp SimpleRetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) { - return &srp, true +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false } -// SimpleSchedulePolicy simple policy schedule. -type SimpleSchedulePolicy struct { - // ScheduleRunFrequency - Frequency of the schedule operation of this policy. Possible values include: 'ScheduleRunTypeInvalid', 'ScheduleRunTypeDaily', 'ScheduleRunTypeWeekly' - ScheduleRunFrequency ScheduleRunType `json:"scheduleRunFrequency,omitempty"` - // ScheduleRunDays - List of days of week this schedule has to be run. - ScheduleRunDays *[]DayOfWeek `json:"scheduleRunDays,omitempty"` - // ScheduleRunTimes - List of times of day this schedule has to be run. - ScheduleRunTimes *[]date.Time `json:"scheduleRunTimes,omitempty"` - // ScheduleWeeklyFrequency - At every number weeks this schedule has to be run. - ScheduleWeeklyFrequency *int32 `json:"scheduleWeeklyFrequency,omitempty"` - // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' - SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for SimpleSchedulePolicy. -func (ssp SimpleSchedulePolicy) MarshalJSON() ([]byte, error) { - ssp.SchedulePolicyType = SchedulePolicyTypeSimpleSchedulePolicy - objectMap := make(map[string]interface{}) - if ssp.ScheduleRunFrequency != "" { - objectMap["scheduleRunFrequency"] = ssp.ScheduleRunFrequency - } - if ssp.ScheduleRunDays != nil { - objectMap["scheduleRunDays"] = ssp.ScheduleRunDays - } - if ssp.ScheduleRunTimes != nil { - objectMap["scheduleRunTimes"] = ssp.ScheduleRunTimes - } - if ssp.ScheduleWeeklyFrequency != nil { - objectMap["scheduleWeeklyFrequency"] = ssp.ScheduleWeeklyFrequency - } - if ssp.SchedulePolicyType != "" { - objectMap["schedulePolicyType"] = ssp.SchedulePolicyType - } - return json.Marshal(objectMap) +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false } -// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. -func (ssp SimpleSchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { return nil, false } -// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. -func (ssp SimpleSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { return nil, false } -// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. -func (ssp SimpleSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { - return &ssp, true +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false } -// AsSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. -func (ssp SimpleSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { return nil, false } -// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. -func (ssp SimpleSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { - return &ssp, true +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return nil, false } -// SQLDataDirectory sQLDataDirectory info -type SQLDataDirectory struct { - // Type - Type of data directory mapping. Possible values include: 'SQLDataDirectoryTypeInvalid', 'SQLDataDirectoryTypeData', 'SQLDataDirectoryTypeLog' - Type SQLDataDirectoryType `json:"type,omitempty"` - // Path - File path - Path *string `json:"path,omitempty"` - // LogicalName - Logical name of the file - LogicalName *string `json:"logicalName,omitempty"` +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false } -// SQLDataDirectoryMapping encapsulates information regarding data directory -type SQLDataDirectoryMapping struct { - // MappingType - Type of data directory mapping. Possible values include: 'SQLDataDirectoryTypeInvalid', 'SQLDataDirectoryTypeData', 'SQLDataDirectoryTypeLog' - MappingType SQLDataDirectoryType `json:"mappingType,omitempty"` - // SourceLogicalName - Restore source logical name path - SourceLogicalName *string `json:"sourceLogicalName,omitempty"` - // SourcePath - Restore source path - SourcePath *string `json:"sourcePath,omitempty"` - // TargetPath - Target path - TargetPath *string `json:"targetPath,omitempty"` +// AsRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return &rr, true } -// StatusRequest backupStatus request. -type StatusRequest struct { - // ResourceType - Container Type - VM, SQLPaaS, DPM, AzureFileShare. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - ResourceType DataSourceType `json:"resourceType,omitempty"` - // ResourceID - Entire ARM resource id of the resource - ResourceID *string `json:"resourceId,omitempty"` - // PoLogicalName - Protectable Item Logical Name - PoLogicalName *string `json:"poLogicalName,omitempty"` +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &rr, true } -// StatusResponse backupStatus response. -type StatusResponse struct { - autorest.Response `json:"-"` - // ProtectionStatus - Specifies whether the container is registered or not. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionStatus ProtectionStatus `json:"protectionStatus,omitempty"` - // VaultID - Specifies the arm resource id of the vault - VaultID *string `json:"vaultId,omitempty"` - // FabricName - Specifies the fabric name - Azure or AD. Possible values include: 'FabricNameInvalid', 'FabricNameAzure' - FabricName FabricName `json:"fabricName,omitempty"` - // ContainerName - Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;csname;vmname. - ContainerName *string `json:"containerName,omitempty"` - // ProtectedItemName - Specifies the product specific ds name. E.g. vm;iaasvmcontainer;csname;vmname. - ProtectedItemName *string `json:"protectedItemName,omitempty"` - // ErrorCode - ErrorCode in case of intent failed - ErrorCode *string `json:"errorCode,omitempty"` - // ErrorMessage - ErrorMessage in case of intent failed. - ErrorMessage *string `json:"errorMessage,omitempty"` - // PolicyName - Specifies the policy name which is used for protection - PolicyName *string `json:"policyName,omitempty"` - // RegistrationStatus - Container registration status - RegistrationStatus *string `json:"registrationStatus,omitempty"` +// RestoreRequestResource base class for restore request. Workload-specific restore requests are derived +// from this class. +type RestoreRequestResource struct { + // Properties - RestoreRequestResource properties + Properties BasicRestoreRequest `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` } -// SubProtectionPolicy sub-protection policy which includes schedule and retention -type SubProtectionPolicy struct { - // 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. - RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` +// MarshalJSON is the custom marshaler for RestoreRequestResource. +func (rrr RestoreRequestResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = rrr.Properties + if rrr.Location != nil { + objectMap["location"] = rrr.Location + } + if rrr.Tags != nil { + objectMap["tags"] = rrr.Tags + } + if rrr.ETag != nil { + objectMap["eTag"] = rrr.ETag + } + return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for SubProtectionPolicy struct. -func (spp *SubProtectionPolicy) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for RestoreRequestResource struct. +func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -18310,30 +9309,67 @@ func (spp *SubProtectionPolicy) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "policyType": + case "properties": if v != nil { - var policyType PolicyType - err = json.Unmarshal(*v, &policyType) + properties, err := unmarshalBasicRestoreRequest(*v) if err != nil { return err } - spp.PolicyType = policyType + rrr.Properties = properties } - case "schedulePolicy": + case "id": if v != nil { - schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) + var ID string + err = json.Unmarshal(*v, &ID) if err != nil { return err } - spp.SchedulePolicy = schedulePolicy + rrr.ID = &ID } - case "retentionPolicy": + case "name": if v != nil { - retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - spp.RetentionPolicy = retentionPolicy + rrr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rrr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rrr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rrr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + rrr.ETag = &eTag } } } @@ -18341,304 +9377,340 @@ func (spp *SubProtectionPolicy) UnmarshalJSON(body []byte) error { return nil } -// TargetAFSRestoreInfo target Azure File Share Info. -type TargetAFSRestoreInfo struct { - // Name - File share name - Name *string `json:"name,omitempty"` - // TargetResourceID - Target file share resource ARM ID - TargetResourceID *string `json:"targetResourceId,omitempty"` +// RetentionDuration retention duration. +type RetentionDuration struct { + // Count - Count of duration types. Retention duration is obtained by the counting the duration type Count times. + // For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks. + Count *int32 `json:"count,omitempty"` + // DurationType - Retention duration type of retention policy. Possible values include: 'RetentionDurationTypeInvalid', 'RetentionDurationTypeDays', 'RetentionDurationTypeWeeks', 'RetentionDurationTypeMonths', 'RetentionDurationTypeYears' + DurationType RetentionDurationType `json:"durationType,omitempty"` } -// TargetRestoreInfo details about target workload during restore operation. -type TargetRestoreInfo struct { - // OverwriteOption - Can Overwrite if Target DataBase already exists. Possible values include: 'OverwriteOptionsInvalid', 'OverwriteOptionsFailOnConflict', 'OverwriteOptionsOverwrite' - OverwriteOption OverwriteOptions `json:"overwriteOption,omitempty"` - // ContainerID - Resource Id name of the container in which Target DataBase resides - ContainerID *string `json:"containerId,omitempty"` - // DatabaseName - Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana - DatabaseName *string `json:"databaseName,omitempty"` - // TargetDirectoryForFileRestore - Target directory location for restore as files. - TargetDirectoryForFileRestore *string `json:"targetDirectoryForFileRestore,omitempty"` +// BasicRetentionPolicy base class for retention policy. +type BasicRetentionPolicy interface { + AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) + AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) + AsRetentionPolicy() (*RetentionPolicy, bool) +} + +// RetentionPolicy base class for retention policy. +type RetentionPolicy struct { + // RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy' + RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"` +} + +func unmarshalBasicRetentionPolicy(body []byte) (BasicRetentionPolicy, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["retentionPolicyType"] { + case string(RetentionPolicyTypeLongTermRetentionPolicy): + var ltrp LongTermRetentionPolicy + err := json.Unmarshal(body, <rp) + return ltrp, err + case string(RetentionPolicyTypeSimpleRetentionPolicy): + var srp SimpleRetentionPolicy + err := json.Unmarshal(body, &srp) + return srp, err + default: + var rp RetentionPolicy + err := json.Unmarshal(body, &rp) + return rp, err + } } +func unmarshalBasicRetentionPolicyArray(body []byte) ([]BasicRetentionPolicy, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } -// TokenInformation the token information details. -type TokenInformation struct { - autorest.Response `json:"-"` - // Token - Token value. - Token *string `json:"token,omitempty"` - // ExpiryTimeInUtcTicks - Expiry time of token. - ExpiryTimeInUtcTicks *int64 `json:"expiryTimeInUtcTicks,omitempty"` - // SecurityPIN - Security PIN - SecurityPIN *string `json:"securityPIN,omitempty"` -} + rpArray := make([]BasicRetentionPolicy, len(rawMessages)) -// ValidateIaasVMRestoreOperationRequest azureRestoreValidation request. -type ValidateIaasVMRestoreOperationRequest struct { - // RestoreRequest - Sets restore request to be validated - RestoreRequest BasicRestoreRequest `json:"restoreRequest,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeValidateOperationRequest', 'ObjectTypeValidateIaasVMRestoreOperationRequest', 'ObjectTypeValidateRestoreOperationRequest' - ObjectType ObjectTypeBasicValidateOperationRequest `json:"objectType,omitempty"` + for index, rawMessage := range rawMessages { + rp, err := unmarshalBasicRetentionPolicy(*rawMessage) + if err != nil { + return nil, err + } + rpArray[index] = rp + } + return rpArray, nil } -// MarshalJSON is the custom marshaler for ValidateIaasVMRestoreOperationRequest. -func (vivror ValidateIaasVMRestoreOperationRequest) MarshalJSON() ([]byte, error) { - vivror.ObjectType = ObjectTypeValidateIaasVMRestoreOperationRequest +// MarshalJSON is the custom marshaler for RetentionPolicy. +func (rp RetentionPolicy) MarshalJSON() ([]byte, error) { + rp.RetentionPolicyType = RetentionPolicyTypeRetentionPolicy objectMap := make(map[string]interface{}) - objectMap["restoreRequest"] = vivror.RestoreRequest - if vivror.ObjectType != "" { - objectMap["objectType"] = vivror.ObjectType + if rp.RetentionPolicyType != "" { + objectMap["retentionPolicyType"] = rp.RetentionPolicyType } return json.Marshal(objectMap) } -// AsValidateIaasVMRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. -func (vivror ValidateIaasVMRestoreOperationRequest) AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) { - return &vivror, true -} - -// AsValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. -func (vivror ValidateIaasVMRestoreOperationRequest) AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) { +// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. +func (rp RetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) { return nil, false } -// AsBasicValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. -func (vivror ValidateIaasVMRestoreOperationRequest) AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) { - return &vivror, true -} - -// AsValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. -func (vivror ValidateIaasVMRestoreOperationRequest) AsValidateOperationRequest() (*ValidateOperationRequest, bool) { +// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. +func (rp RetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) { return nil, false } -// AsBasicValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. -func (vivror ValidateIaasVMRestoreOperationRequest) AsBasicValidateOperationRequest() (BasicValidateOperationRequest, bool) { - return &vivror, true +// AsRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. +func (rp RetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) { + return &rp, true } -// UnmarshalJSON is the custom unmarshaler for ValidateIaasVMRestoreOperationRequest struct. -func (vivror *ValidateIaasVMRestoreOperationRequest) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "restoreRequest": - if v != nil { - restoreRequest, err := unmarshalBasicRestoreRequest(*v) - if err != nil { - return err - } - vivror.RestoreRequest = restoreRequest - } - case "objectType": - if v != nil { - var objectType ObjectTypeBasicValidateOperationRequest - err = json.Unmarshal(*v, &objectType) - if err != nil { - return err - } - vivror.ObjectType = objectType - } - } - } - - return nil +// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. +func (rp RetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) { + return &rp, true } -// BasicValidateOperationRequest base class for validate operation request. -type BasicValidateOperationRequest interface { - AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) - AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) - AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) - AsValidateOperationRequest() (*ValidateOperationRequest, bool) +// BasicSchedulePolicy base class for backup schedule. +type BasicSchedulePolicy interface { + AsLogSchedulePolicy() (*LogSchedulePolicy, bool) + AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) + AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) + AsSchedulePolicy() (*SchedulePolicy, bool) } -// ValidateOperationRequest base class for validate operation request. -type ValidateOperationRequest struct { - // ObjectType - Possible values include: 'ObjectTypeValidateOperationRequest', 'ObjectTypeValidateIaasVMRestoreOperationRequest', 'ObjectTypeValidateRestoreOperationRequest' - ObjectType ObjectTypeBasicValidateOperationRequest `json:"objectType,omitempty"` +// SchedulePolicy base class for backup schedule. +type SchedulePolicy struct { + // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' + SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` } -func unmarshalBasicValidateOperationRequest(body []byte) (BasicValidateOperationRequest, error) { +func unmarshalBasicSchedulePolicy(body []byte) (BasicSchedulePolicy, error) { var m map[string]interface{} err := json.Unmarshal(body, &m) if err != nil { return nil, err } - switch m["objectType"] { - case string(ObjectTypeValidateIaasVMRestoreOperationRequest): - var vivror ValidateIaasVMRestoreOperationRequest - err := json.Unmarshal(body, &vivror) - return vivror, err - case string(ObjectTypeValidateRestoreOperationRequest): - var vror ValidateRestoreOperationRequest - err := json.Unmarshal(body, &vror) - return vror, err + switch m["schedulePolicyType"] { + case string(SchedulePolicyTypeLogSchedulePolicy): + var lsp LogSchedulePolicy + err := json.Unmarshal(body, &lsp) + return lsp, err + case string(SchedulePolicyTypeLongTermSchedulePolicy): + var ltsp LongTermSchedulePolicy + err := json.Unmarshal(body, <sp) + return ltsp, err + case string(SchedulePolicyTypeSimpleSchedulePolicy): + var ssp SimpleSchedulePolicy + err := json.Unmarshal(body, &ssp) + return ssp, err default: - var vor ValidateOperationRequest - err := json.Unmarshal(body, &vor) - return vor, err + var sp SchedulePolicy + err := json.Unmarshal(body, &sp) + return sp, err } } -func unmarshalBasicValidateOperationRequestArray(body []byte) ([]BasicValidateOperationRequest, error) { +func unmarshalBasicSchedulePolicyArray(body []byte) ([]BasicSchedulePolicy, error) { var rawMessages []*json.RawMessage err := json.Unmarshal(body, &rawMessages) if err != nil { return nil, err } - vorArray := make([]BasicValidateOperationRequest, len(rawMessages)) + spArray := make([]BasicSchedulePolicy, len(rawMessages)) for index, rawMessage := range rawMessages { - vor, err := unmarshalBasicValidateOperationRequest(*rawMessage) + sp, err := unmarshalBasicSchedulePolicy(*rawMessage) if err != nil { return nil, err } - vorArray[index] = vor + spArray[index] = sp } - return vorArray, nil + return spArray, nil } -// MarshalJSON is the custom marshaler for ValidateOperationRequest. -func (vor ValidateOperationRequest) MarshalJSON() ([]byte, error) { - vor.ObjectType = ObjectTypeValidateOperationRequest +// MarshalJSON is the custom marshaler for SchedulePolicy. +func (sp SchedulePolicy) MarshalJSON() ([]byte, error) { + sp.SchedulePolicyType = SchedulePolicyTypeSchedulePolicy objectMap := make(map[string]interface{}) - if vor.ObjectType != "" { - objectMap["objectType"] = vor.ObjectType + if sp.SchedulePolicyType != "" { + objectMap["schedulePolicyType"] = sp.SchedulePolicyType } return json.Marshal(objectMap) } -// AsValidateIaasVMRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. -func (vor ValidateOperationRequest) AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) { +// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. +func (sp SchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { return nil, false } -// AsValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. -func (vor ValidateOperationRequest) AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) { +// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. +func (sp SchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { return nil, false } -// AsBasicValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. -func (vor ValidateOperationRequest) AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) { +// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. +func (sp SchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { return nil, false } -// AsValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. -func (vor ValidateOperationRequest) AsValidateOperationRequest() (*ValidateOperationRequest, bool) { - return &vor, true +// AsSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. +func (sp SchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { + return &sp, true } -// AsBasicValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. -func (vor ValidateOperationRequest) AsBasicValidateOperationRequest() (BasicValidateOperationRequest, bool) { - return &vor, true +// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. +func (sp SchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { + return &sp, true } -// ValidateOperationResponse base class for validate operation response. -type ValidateOperationResponse struct { - // ValidationResults - Gets the validation result - ValidationResults *[]ErrorDetail `json:"validationResults,omitempty"` +// Settings common settings field for backup management +type Settings struct { + // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + TimeZone *string `json:"timeZone,omitempty"` + // Issqlcompression - SQL compression flag + Issqlcompression *bool `json:"issqlcompression,omitempty"` + // IsCompression - Workload compression flag. This has been added so that 'isSqlCompression' + // will be deprecated once clients upgrade to consider this flag. + IsCompression *bool `json:"isCompression,omitempty"` } -// ValidateOperationsResponse ... -type ValidateOperationsResponse struct { - autorest.Response `json:"-"` - ValidateOperationResponse *ValidateOperationResponse `json:"validateOperationResponse,omitempty"` +// SimpleRetentionPolicy simple policy retention. +type SimpleRetentionPolicy struct { + // RetentionDuration - Retention duration of the protection policy. + RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` + // RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy' + RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"` } -// BasicValidateRestoreOperationRequest azureRestoreValidation request. -type BasicValidateRestoreOperationRequest interface { - AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) - AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) +// MarshalJSON is the custom marshaler for SimpleRetentionPolicy. +func (srp SimpleRetentionPolicy) MarshalJSON() ([]byte, error) { + srp.RetentionPolicyType = RetentionPolicyTypeSimpleRetentionPolicy + objectMap := make(map[string]interface{}) + if srp.RetentionDuration != nil { + objectMap["retentionDuration"] = srp.RetentionDuration + } + if srp.RetentionPolicyType != "" { + objectMap["retentionPolicyType"] = srp.RetentionPolicyType + } + return json.Marshal(objectMap) } -// ValidateRestoreOperationRequest azureRestoreValidation request. -type ValidateRestoreOperationRequest struct { - // RestoreRequest - Sets restore request to be validated - RestoreRequest BasicRestoreRequest `json:"restoreRequest,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeValidateOperationRequest', 'ObjectTypeValidateIaasVMRestoreOperationRequest', 'ObjectTypeValidateRestoreOperationRequest' - ObjectType ObjectTypeBasicValidateOperationRequest `json:"objectType,omitempty"` +// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. +func (srp SimpleRetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) { + return nil, false } -func unmarshalBasicValidateRestoreOperationRequest(body []byte) (BasicValidateRestoreOperationRequest, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } +// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. +func (srp SimpleRetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) { + return &srp, true +} - switch m["objectType"] { - case string(ObjectTypeValidateIaasVMRestoreOperationRequest): - var vivror ValidateIaasVMRestoreOperationRequest - err := json.Unmarshal(body, &vivror) - return vivror, err - default: - var vror ValidateRestoreOperationRequest - err := json.Unmarshal(body, &vror) - return vror, err - } +// AsRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. +func (srp SimpleRetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) { + return nil, false } -func unmarshalBasicValidateRestoreOperationRequestArray(body []byte) ([]BasicValidateRestoreOperationRequest, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - vrorArray := make([]BasicValidateRestoreOperationRequest, len(rawMessages)) +// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. +func (srp SimpleRetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) { + return &srp, true +} - for index, rawMessage := range rawMessages { - vror, err := unmarshalBasicValidateRestoreOperationRequest(*rawMessage) - if err != nil { - return nil, err - } - vrorArray[index] = vror - } - return vrorArray, nil +// SimpleSchedulePolicy simple policy schedule. +type SimpleSchedulePolicy struct { + // ScheduleRunFrequency - Frequency of the schedule operation of this policy. Possible values include: 'ScheduleRunTypeInvalid', 'ScheduleRunTypeDaily', 'ScheduleRunTypeWeekly' + ScheduleRunFrequency ScheduleRunType `json:"scheduleRunFrequency,omitempty"` + // ScheduleRunDays - List of days of week this schedule has to be run. + ScheduleRunDays *[]DayOfWeek `json:"scheduleRunDays,omitempty"` + // ScheduleRunTimes - List of times of day this schedule has to be run. + ScheduleRunTimes *[]date.Time `json:"scheduleRunTimes,omitempty"` + // ScheduleWeeklyFrequency - At every number weeks this schedule has to be run. + ScheduleWeeklyFrequency *int32 `json:"scheduleWeeklyFrequency,omitempty"` + // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' + SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` } -// MarshalJSON is the custom marshaler for ValidateRestoreOperationRequest. -func (vror ValidateRestoreOperationRequest) MarshalJSON() ([]byte, error) { - vror.ObjectType = ObjectTypeValidateRestoreOperationRequest +// MarshalJSON is the custom marshaler for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) MarshalJSON() ([]byte, error) { + ssp.SchedulePolicyType = SchedulePolicyTypeSimpleSchedulePolicy objectMap := make(map[string]interface{}) - objectMap["restoreRequest"] = vror.RestoreRequest - if vror.ObjectType != "" { - objectMap["objectType"] = vror.ObjectType + if ssp.ScheduleRunFrequency != "" { + objectMap["scheduleRunFrequency"] = ssp.ScheduleRunFrequency + } + if ssp.ScheduleRunDays != nil { + objectMap["scheduleRunDays"] = ssp.ScheduleRunDays + } + if ssp.ScheduleRunTimes != nil { + objectMap["scheduleRunTimes"] = ssp.ScheduleRunTimes + } + if ssp.ScheduleWeeklyFrequency != nil { + objectMap["scheduleWeeklyFrequency"] = ssp.ScheduleWeeklyFrequency + } + if ssp.SchedulePolicyType != "" { + objectMap["schedulePolicyType"] = ssp.SchedulePolicyType } return json.Marshal(objectMap) } -// AsValidateIaasVMRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. -func (vror ValidateRestoreOperationRequest) AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) { +// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { return nil, false } -// AsValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. -func (vror ValidateRestoreOperationRequest) AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) { - return &vror, true +// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { + return nil, false } -// AsBasicValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. -func (vror ValidateRestoreOperationRequest) AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) { - return &vror, true +// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { + return &ssp, true } -// AsValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. -func (vror ValidateRestoreOperationRequest) AsValidateOperationRequest() (*ValidateOperationRequest, bool) { +// AsSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { return nil, false } -// AsBasicValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. -func (vror ValidateRestoreOperationRequest) AsBasicValidateOperationRequest() (BasicValidateOperationRequest, bool) { - return &vror, true +// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { + return &ssp, true } -// UnmarshalJSON is the custom unmarshaler for ValidateRestoreOperationRequest struct. -func (vror *ValidateRestoreOperationRequest) UnmarshalJSON(body []byte) error { +// SQLDataDirectory sQLDataDirectory info +type SQLDataDirectory struct { + // Type - Type of data directory mapping. Possible values include: 'SQLDataDirectoryTypeInvalid', 'SQLDataDirectoryTypeData', 'SQLDataDirectoryTypeLog' + Type SQLDataDirectoryType `json:"type,omitempty"` + // Path - File path + Path *string `json:"path,omitempty"` + // LogicalName - Logical name of the file + LogicalName *string `json:"logicalName,omitempty"` +} + +// SQLDataDirectoryMapping encapsulates information regarding data directory +type SQLDataDirectoryMapping struct { + // MappingType - Type of data directory mapping. Possible values include: 'SQLDataDirectoryTypeInvalid', 'SQLDataDirectoryTypeData', 'SQLDataDirectoryTypeLog' + MappingType SQLDataDirectoryType `json:"mappingType,omitempty"` + // SourceLogicalName - Restore source logical name path + SourceLogicalName *string `json:"sourceLogicalName,omitempty"` + // SourcePath - Restore source path + SourcePath *string `json:"sourcePath,omitempty"` + // TargetPath - Target path + TargetPath *string `json:"targetPath,omitempty"` +} + +// SubProtectionPolicy sub-protection policy which includes schedule and retention +type SubProtectionPolicy struct { + // 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. + RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SubProtectionPolicy struct. +func (spp *SubProtectionPolicy) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -18646,22 +9718,30 @@ func (vror *ValidateRestoreOperationRequest) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "restoreRequest": + case "policyType": if v != nil { - restoreRequest, err := unmarshalBasicRestoreRequest(*v) + var policyType PolicyType + err = json.Unmarshal(*v, &policyType) if err != nil { return err } - vror.RestoreRequest = restoreRequest + spp.PolicyType = policyType } - case "objectType": + case "schedulePolicy": if v != nil { - var objectType ObjectTypeBasicValidateOperationRequest - err = json.Unmarshal(*v, &objectType) + schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) if err != nil { return err } - vror.ObjectType = objectType + spp.SchedulePolicy = schedulePolicy + } + case "retentionPolicy": + if v != nil { + retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) + if err != nil { + return err + } + spp.RetentionPolicy = retentionPolicy } } } @@ -18669,231 +9749,72 @@ func (vror *ValidateRestoreOperationRequest) UnmarshalJSON(body []byte) error { return nil } -// WeeklyRetentionFormat weekly retention format. -type WeeklyRetentionFormat struct { - // DaysOfTheWeek - List of days of the week. - DaysOfTheWeek *[]DayOfWeek `json:"daysOfTheWeek,omitempty"` - // WeeksOfTheMonth - List of weeks of month. - WeeksOfTheMonth *[]WeekOfMonth `json:"weeksOfTheMonth,omitempty"` -} - -// WeeklyRetentionSchedule weekly retention schedule. -type WeeklyRetentionSchedule struct { - // DaysOfTheWeek - List of days of week for weekly retention policy. - DaysOfTheWeek *[]DayOfWeek `json:"daysOfTheWeek,omitempty"` - // RetentionTimes - Retention times of retention policy. - RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` - // RetentionDuration - Retention duration of retention Policy. - RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` -} - -// WorkloadInquiryDetails details of an inquired protectable item. -type WorkloadInquiryDetails struct { - // Type - Type of the Workload such as SQL, Oracle etc. - Type *string `json:"type,omitempty"` - // ItemCount - Contains the protectable item Count inside this Container. - ItemCount *int64 `json:"itemCount,omitempty"` - // InquiryValidation - Inquiry validation such as permissions and other backup validations. - InquiryValidation *InquiryValidation `json:"inquiryValidation,omitempty"` -} - -// BasicWorkloadItem base class for backup item. Workload-specific backup items are derived from this class. -type BasicWorkloadItem interface { - AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) - AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) - AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) - AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) - AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) - AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) - AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) - AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) - AsWorkloadItem() (*WorkloadItem, bool) -} - -// WorkloadItem base class for backup item. Workload-specific backup items are derived from this class. -type WorkloadItem struct { - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +// TargetAFSRestoreInfo target Azure File Share Info. +type TargetAFSRestoreInfo struct { + // Name - File share name + Name *string `json:"name,omitempty"` + // TargetResourceID - Target file share resource ARM ID + TargetResourceID *string `json:"targetResourceId,omitempty"` } -func unmarshalBasicWorkloadItem(body []byte) (BasicWorkloadItem, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["workloadItemType"] { - case string(WorkloadItemTypeAzureVMWorkloadItem): - var avwi AzureVMWorkloadItem - err := json.Unmarshal(body, &avwi) - return avwi, err - case string(WorkloadItemTypeSAPAseDatabase1): - var avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem - err := json.Unmarshal(body, &avwsadwi) - return avwsadwi, err - case string(WorkloadItemTypeSAPAseSystem1): - var avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem - err := json.Unmarshal(body, &avwsaswi) - return avwsaswi, err - case string(WorkloadItemTypeSAPHanaDatabase1): - var avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem - err := json.Unmarshal(body, &avwshdwi) - return avwshdwi, err - case string(WorkloadItemTypeSAPHanaSystem1): - var avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem - err := json.Unmarshal(body, &avwshswi) - return avwshswi, err - case string(WorkloadItemTypeSQLDataBase1): - var avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem - err := json.Unmarshal(body, &avwsdwi) - return avwsdwi, err - case string(WorkloadItemTypeSQLInstance1): - var avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem - err := json.Unmarshal(body, &avwsiwi) - return avwsiwi, err - default: - var wi WorkloadItem - err := json.Unmarshal(body, &wi) - return wi, err - } +// TargetRestoreInfo details about target workload during restore operation. +type TargetRestoreInfo struct { + // OverwriteOption - Can Overwrite if Target DataBase already exists. Possible values include: 'OverwriteOptionsInvalid', 'OverwriteOptionsFailOnConflict', 'OverwriteOptionsOverwrite' + OverwriteOption OverwriteOptions `json:"overwriteOption,omitempty"` + // ContainerID - Resource Id name of the container in which Target DataBase resides + ContainerID *string `json:"containerId,omitempty"` + // DatabaseName - Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana + DatabaseName *string `json:"databaseName,omitempty"` + // TargetDirectoryForFileRestore - Target directory location for restore as files. + TargetDirectoryForFileRestore *string `json:"targetDirectoryForFileRestore,omitempty"` } -func unmarshalBasicWorkloadItemArray(body []byte) ([]BasicWorkloadItem, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - wiArray := make([]BasicWorkloadItem, len(rawMessages)) - for index, rawMessage := range rawMessages { - wi, err := unmarshalBasicWorkloadItem(*rawMessage) - if err != nil { - return nil, err - } - wiArray[index] = wi - } - return wiArray, nil +// ValidateIaasVMRestoreOperationRequest azureRestoreValidation request. +type ValidateIaasVMRestoreOperationRequest struct { + // RestoreRequest - Sets restore request to be validated + RestoreRequest BasicRestoreRequest `json:"restoreRequest,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeValidateOperationRequest', 'ObjectTypeValidateIaasVMRestoreOperationRequest', 'ObjectTypeValidateRestoreOperationRequest' + ObjectType ObjectTypeBasicValidateOperationRequest `json:"objectType,omitempty"` } -// MarshalJSON is the custom marshaler for WorkloadItem. -func (wi WorkloadItem) MarshalJSON() ([]byte, error) { - wi.WorkloadItemType = WorkloadItemTypeWorkloadItem +// MarshalJSON is the custom marshaler for ValidateIaasVMRestoreOperationRequest. +func (vivror ValidateIaasVMRestoreOperationRequest) MarshalJSON() ([]byte, error) { + vivror.ObjectType = ObjectTypeValidateIaasVMRestoreOperationRequest objectMap := make(map[string]interface{}) - if wi.BackupManagementType != nil { - objectMap["backupManagementType"] = wi.BackupManagementType - } - if wi.WorkloadType != nil { - objectMap["workloadType"] = wi.WorkloadType - } - if wi.FriendlyName != nil { - objectMap["friendlyName"] = wi.FriendlyName - } - if wi.ProtectionState != "" { - objectMap["protectionState"] = wi.ProtectionState - } - if wi.WorkloadItemType != "" { - objectMap["workloadItemType"] = wi.WorkloadItemType + objectMap["restoreRequest"] = vivror.RestoreRequest + if vivror.ObjectType != "" { + objectMap["objectType"] = vivror.ObjectType } return json.Marshal(objectMap) } -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { - return nil, false +// AsValidateIaasVMRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. +func (vivror ValidateIaasVMRestoreOperationRequest) AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) { + return &vivror, true } -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { +// AsValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. +func (vivror ValidateIaasVMRestoreOperationRequest) AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) { return nil, false } -// AsWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { - return &wi, true -} - -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &wi, true +// AsBasicValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. +func (vivror ValidateIaasVMRestoreOperationRequest) AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) { + return &vivror, true } - -// WorkloadItemResource base class for backup item. Workload-specific backup items are derived from this -// class. -type WorkloadItemResource struct { - // Properties - WorkloadItemResource properties - Properties BasicWorkloadItem `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` + +// AsValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. +func (vivror ValidateIaasVMRestoreOperationRequest) AsValidateOperationRequest() (*ValidateOperationRequest, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for WorkloadItemResource. -func (wir WorkloadItemResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = wir.Properties - if wir.Location != nil { - objectMap["location"] = wir.Location - } - if wir.Tags != nil { - objectMap["tags"] = wir.Tags - } - if wir.ETag != nil { - objectMap["eTag"] = wir.ETag - } - return json.Marshal(objectMap) +// AsBasicValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. +func (vivror ValidateIaasVMRestoreOperationRequest) AsBasicValidateOperationRequest() (BasicValidateOperationRequest, bool) { + return &vivror, true } -// UnmarshalJSON is the custom unmarshaler for WorkloadItemResource struct. -func (wir *WorkloadItemResource) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ValidateIaasVMRestoreOperationRequest struct. +func (vivror *ValidateIaasVMRestoreOperationRequest) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -18901,67 +9822,22 @@ func (wir *WorkloadItemResource) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicWorkloadItem(*v) - if err != nil { - return err - } - wir.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - wir.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - wir.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - wir.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - wir.Location = &location - } - case "tags": + case "restoreRequest": if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) + restoreRequest, err := unmarshalBasicRestoreRequest(*v) if err != nil { return err } - wir.Tags = tags + vivror.RestoreRequest = restoreRequest } - case "eTag": + case "objectType": if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) + var objectType ObjectTypeBasicValidateOperationRequest + err = json.Unmarshal(*v, &objectType) if err != nil { return err } - wir.ETag = &eTag + vivror.ObjectType = objectType } } } @@ -18969,409 +9845,197 @@ func (wir *WorkloadItemResource) UnmarshalJSON(body []byte) error { return nil } -// WorkloadItemResourceList list of WorkloadItem resources -type WorkloadItemResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]WorkloadItemResource `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"` +// BasicValidateOperationRequest base class for validate operation request. +type BasicValidateOperationRequest interface { + AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) + AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) + AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) + AsValidateOperationRequest() (*ValidateOperationRequest, bool) } -// WorkloadItemResourceListIterator provides access to a complete listing of WorkloadItemResource values. -type WorkloadItemResourceListIterator struct { - i int - page WorkloadItemResourceListPage +// ValidateOperationRequest base class for validate operation request. +type ValidateOperationRequest struct { + // ObjectType - Possible values include: 'ObjectTypeValidateOperationRequest', 'ObjectTypeValidateIaasVMRestoreOperationRequest', 'ObjectTypeValidateRestoreOperationRequest' + ObjectType ObjectTypeBasicValidateOperationRequest `json:"objectType,omitempty"` } -// NextWithContext 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 *WorkloadItemResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadItemResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) +func unmarshalBasicValidateOperationRequest(body []byte) (BasicValidateOperationRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) if err != nil { - iter.i-- - return err + return nil, err } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *WorkloadItemResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter WorkloadItemResourceListIterator) 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 WorkloadItemResourceListIterator) Response() WorkloadItemResourceList { - 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 WorkloadItemResourceListIterator) Value() WorkloadItemResource { - if !iter.page.NotDone() { - return WorkloadItemResource{} + switch m["objectType"] { + case string(ObjectTypeValidateIaasVMRestoreOperationRequest): + var vivror ValidateIaasVMRestoreOperationRequest + err := json.Unmarshal(body, &vivror) + return vivror, err + case string(ObjectTypeValidateRestoreOperationRequest): + var vror ValidateRestoreOperationRequest + err := json.Unmarshal(body, &vror) + return vror, err + default: + var vor ValidateOperationRequest + err := json.Unmarshal(body, &vor) + return vor, err } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the WorkloadItemResourceListIterator type. -func NewWorkloadItemResourceListIterator(page WorkloadItemResourceListPage) WorkloadItemResourceListIterator { - return WorkloadItemResourceListIterator{page: page} } +func unmarshalBasicValidateOperationRequestArray(body []byte) ([]BasicValidateOperationRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } -// IsEmpty returns true if the ListResult contains no values. -func (wirl WorkloadItemResourceList) IsEmpty() bool { - return wirl.Value == nil || len(*wirl.Value) == 0 -} + vorArray := make([]BasicValidateOperationRequest, len(rawMessages)) -// hasNextLink returns true if the NextLink is not empty. -func (wirl WorkloadItemResourceList) hasNextLink() bool { - return wirl.NextLink != nil && len(*wirl.NextLink) != 0 + for index, rawMessage := range rawMessages { + vor, err := unmarshalBasicValidateOperationRequest(*rawMessage) + if err != nil { + return nil, err + } + vorArray[index] = vor + } + return vorArray, nil } -// workloadItemResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (wirl WorkloadItemResourceList) workloadItemResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !wirl.hasNextLink() { - return nil, nil +// MarshalJSON is the custom marshaler for ValidateOperationRequest. +func (vor ValidateOperationRequest) MarshalJSON() ([]byte, error) { + vor.ObjectType = ObjectTypeValidateOperationRequest + objectMap := make(map[string]interface{}) + if vor.ObjectType != "" { + objectMap["objectType"] = vor.ObjectType } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(wirl.NextLink))) + return json.Marshal(objectMap) } -// WorkloadItemResourceListPage contains a page of WorkloadItemResource values. -type WorkloadItemResourceListPage struct { - fn func(context.Context, WorkloadItemResourceList) (WorkloadItemResourceList, error) - wirl WorkloadItemResourceList +// AsValidateIaasVMRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. +func (vor ValidateOperationRequest) AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) { + return nil, false } -// NextWithContext 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 *WorkloadItemResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadItemResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.wirl) - if err != nil { - return err - } - page.wirl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil +// AsValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. +func (vor ValidateOperationRequest) AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) { + return nil, false } -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *WorkloadItemResourceListPage) Next() error { - return page.NextWithContext(context.Background()) +// AsBasicValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. +func (vor ValidateOperationRequest) AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) { + return nil, false } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page WorkloadItemResourceListPage) NotDone() bool { - return !page.wirl.IsEmpty() +// AsValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. +func (vor ValidateOperationRequest) AsValidateOperationRequest() (*ValidateOperationRequest, bool) { + return &vor, true } -// Response returns the raw server response from the last page request. -func (page WorkloadItemResourceListPage) Response() WorkloadItemResourceList { - return page.wirl +// AsBasicValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. +func (vor ValidateOperationRequest) AsBasicValidateOperationRequest() (BasicValidateOperationRequest, bool) { + return &vor, true } -// Values returns the slice of values for the current page or nil if there are no values. -func (page WorkloadItemResourceListPage) Values() []WorkloadItemResource { - if page.wirl.IsEmpty() { - return nil - } - return *page.wirl.Value +// ValidateOperationResponse base class for validate operation response. +type ValidateOperationResponse struct { + // ValidationResults - Gets the validation result + ValidationResults *[]ErrorDetail `json:"validationResults,omitempty"` } -// Creates a new instance of the WorkloadItemResourceListPage type. -func NewWorkloadItemResourceListPage(cur WorkloadItemResourceList, getNextPage func(context.Context, WorkloadItemResourceList) (WorkloadItemResourceList, error)) WorkloadItemResourceListPage { - return WorkloadItemResourceListPage{ - fn: getNextPage, - wirl: cur, - } +// ValidateOperationsResponse ... +type ValidateOperationsResponse struct { + autorest.Response `json:"-"` + ValidateOperationResponse *ValidateOperationResponse `json:"validateOperationResponse,omitempty"` } -// BasicWorkloadProtectableItem base class for backup item. Workload-specific backup items are derived from this class. -type BasicWorkloadProtectableItem interface { - AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) - AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) - AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) - AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) - AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) - AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) - AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) - AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) - AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) - AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) - AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) - AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) - AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) - AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +// BasicValidateRestoreOperationRequest azureRestoreValidation request. +type BasicValidateRestoreOperationRequest interface { + AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) + AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) } -// WorkloadProtectableItem base class for backup item. Workload-specific backup items are derived from this -// class. -type WorkloadProtectableItem struct { - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +// ValidateRestoreOperationRequest azureRestoreValidation request. +type ValidateRestoreOperationRequest struct { + // RestoreRequest - Sets restore request to be validated + RestoreRequest BasicRestoreRequest `json:"restoreRequest,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeValidateOperationRequest', 'ObjectTypeValidateIaasVMRestoreOperationRequest', 'ObjectTypeValidateRestoreOperationRequest' + ObjectType ObjectTypeBasicValidateOperationRequest `json:"objectType,omitempty"` } -func unmarshalBasicWorkloadProtectableItem(body []byte) (BasicWorkloadProtectableItem, error) { +func unmarshalBasicValidateRestoreOperationRequest(body []byte) (BasicValidateRestoreOperationRequest, error) { var m map[string]interface{} err := json.Unmarshal(body, &m) if err != nil { return nil, err } - switch m["protectableItemType"] { - case string(ProtectableItemTypeAzureFileShare): - var afspi AzureFileShareProtectableItem - err := json.Unmarshal(body, &afspi) - return afspi, err - case string(ProtectableItemTypeMicrosoftClassicComputevirtualMachines): - var aisccvpi AzureIaaSClassicComputeVMProtectableItem - err := json.Unmarshal(body, &aisccvpi) - return aisccvpi, err - case string(ProtectableItemTypeMicrosoftComputevirtualMachines): - var aiscvpi AzureIaaSComputeVMProtectableItem - err := json.Unmarshal(body, &aiscvpi) - return aiscvpi, err - case string(ProtectableItemTypeAzureVMWorkloadProtectableItem): - var avwpi AzureVMWorkloadProtectableItem - err := json.Unmarshal(body, &avwpi) - return avwpi, err - case string(ProtectableItemTypeSAPAseSystem): - var avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem - err := json.Unmarshal(body, &avwsaspi) - return avwsaspi, err - case string(ProtectableItemTypeSAPHanaDatabase): - var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem - err := json.Unmarshal(body, &avwshdpi) - return avwshdpi, err - case string(ProtectableItemTypeSAPHanaSystem): - var avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem - err := json.Unmarshal(body, &avwshspi) - return avwshspi, err - case string(ProtectableItemTypeSQLAvailabilityGroupContainer): - var avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem - err := json.Unmarshal(body, &avwsagpi) - return avwsagpi, err - case string(ProtectableItemTypeSQLDataBase): - var avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem - err := json.Unmarshal(body, &avwsdpi) - return avwsdpi, err - case string(ProtectableItemTypeSQLInstance): - var avwsipi AzureVMWorkloadSQLInstanceProtectableItem - err := json.Unmarshal(body, &avwsipi) - return avwsipi, err - case string(ProtectableItemTypeIaaSVMProtectableItem): - var ispi IaaSVMProtectableItem - err := json.Unmarshal(body, &ispi) - return ispi, err + switch m["objectType"] { + case string(ObjectTypeValidateIaasVMRestoreOperationRequest): + var vivror ValidateIaasVMRestoreOperationRequest + err := json.Unmarshal(body, &vivror) + return vivror, err default: - var wpi WorkloadProtectableItem - err := json.Unmarshal(body, &wpi) - return wpi, err + var vror ValidateRestoreOperationRequest + err := json.Unmarshal(body, &vror) + return vror, err } } -func unmarshalBasicWorkloadProtectableItemArray(body []byte) ([]BasicWorkloadProtectableItem, error) { +func unmarshalBasicValidateRestoreOperationRequestArray(body []byte) ([]BasicValidateRestoreOperationRequest, error) { var rawMessages []*json.RawMessage err := json.Unmarshal(body, &rawMessages) if err != nil { return nil, err } - wpiArray := make([]BasicWorkloadProtectableItem, len(rawMessages)) + vrorArray := make([]BasicValidateRestoreOperationRequest, len(rawMessages)) for index, rawMessage := range rawMessages { - wpi, err := unmarshalBasicWorkloadProtectableItem(*rawMessage) + vror, err := unmarshalBasicValidateRestoreOperationRequest(*rawMessage) if err != nil { return nil, err } - wpiArray[index] = wpi + vrorArray[index] = vror } - return wpiArray, nil + return vrorArray, nil } -// MarshalJSON is the custom marshaler for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) MarshalJSON() ([]byte, error) { - wpi.ProtectableItemType = ProtectableItemTypeWorkloadProtectableItem +// MarshalJSON is the custom marshaler for ValidateRestoreOperationRequest. +func (vror ValidateRestoreOperationRequest) MarshalJSON() ([]byte, error) { + vror.ObjectType = ObjectTypeValidateRestoreOperationRequest objectMap := make(map[string]interface{}) - if wpi.BackupManagementType != nil { - objectMap["backupManagementType"] = wpi.BackupManagementType - } - if wpi.WorkloadType != nil { - objectMap["workloadType"] = wpi.WorkloadType - } - if wpi.FriendlyName != nil { - objectMap["friendlyName"] = wpi.FriendlyName - } - if wpi.ProtectionState != "" { - objectMap["protectionState"] = wpi.ProtectionState - } - if wpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = wpi.ProtectableItemType + objectMap["restoreRequest"] = vror.RestoreRequest + if vror.ObjectType != "" { + objectMap["objectType"] = vror.ObjectType } return json.Marshal(objectMap) } -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { +// AsValidateIaasVMRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. +func (vror ValidateRestoreOperationRequest) AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) { return nil, false } -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false +// AsValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. +func (vror ValidateRestoreOperationRequest) AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) { + return &vror, true } -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return nil, false +// AsBasicValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. +func (vror ValidateRestoreOperationRequest) AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) { + return &vror, true } -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { +// AsValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. +func (vror ValidateRestoreOperationRequest) AsValidateOperationRequest() (*ValidateOperationRequest, bool) { return nil, false } -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return &wpi, true -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &wpi, true -} - -// WorkloadProtectableItemResource base class for backup item. Workload-specific backup items are derived -// from this class. -type WorkloadProtectableItemResource struct { - // Properties - WorkloadProtectableItemResource properties - Properties BasicWorkloadProtectableItem `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for WorkloadProtectableItemResource. -func (wpir WorkloadProtectableItemResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = wpir.Properties - if wpir.Location != nil { - objectMap["location"] = wpir.Location - } - if wpir.Tags != nil { - objectMap["tags"] = wpir.Tags - } - if wpir.ETag != nil { - objectMap["eTag"] = wpir.ETag - } - return json.Marshal(objectMap) +// AsBasicValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. +func (vror ValidateRestoreOperationRequest) AsBasicValidateOperationRequest() (BasicValidateOperationRequest, bool) { + return &vror, true } -// UnmarshalJSON is the custom unmarshaler for WorkloadProtectableItemResource struct. -func (wpir *WorkloadProtectableItemResource) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ValidateRestoreOperationRequest struct. +func (vror *ValidateRestoreOperationRequest) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -19379,67 +10043,22 @@ func (wpir *WorkloadProtectableItemResource) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicWorkloadProtectableItem(*v) - if err != nil { - return err - } - wpir.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - wpir.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - wpir.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - wpir.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - wpir.Location = &location - } - case "tags": + case "restoreRequest": if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) + restoreRequest, err := unmarshalBasicRestoreRequest(*v) if err != nil { return err } - wpir.Tags = tags + vror.RestoreRequest = restoreRequest } - case "eTag": + case "objectType": if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) + var objectType ObjectTypeBasicValidateOperationRequest + err = json.Unmarshal(*v, &objectType) if err != nil { return err } - wpir.ETag = &eTag + vror.ObjectType = objectType } } } @@ -19447,164 +10066,22 @@ func (wpir *WorkloadProtectableItemResource) UnmarshalJSON(body []byte) error { return nil } -// WorkloadProtectableItemResourceList list of WorkloadProtectableItem resources -type WorkloadProtectableItemResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]WorkloadProtectableItemResource `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"` -} - -// WorkloadProtectableItemResourceListIterator provides access to a complete listing of -// WorkloadProtectableItemResource values. -type WorkloadProtectableItemResourceListIterator struct { - i int - page WorkloadProtectableItemResourceListPage -} - -// NextWithContext 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 *WorkloadProtectableItemResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadProtectableItemResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *WorkloadProtectableItemResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter WorkloadProtectableItemResourceListIterator) 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 WorkloadProtectableItemResourceListIterator) Response() WorkloadProtectableItemResourceList { - 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 WorkloadProtectableItemResourceListIterator) Value() WorkloadProtectableItemResource { - if !iter.page.NotDone() { - return WorkloadProtectableItemResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the WorkloadProtectableItemResourceListIterator type. -func NewWorkloadProtectableItemResourceListIterator(page WorkloadProtectableItemResourceListPage) WorkloadProtectableItemResourceListIterator { - return WorkloadProtectableItemResourceListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (wpirl WorkloadProtectableItemResourceList) IsEmpty() bool { - return wpirl.Value == nil || len(*wpirl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (wpirl WorkloadProtectableItemResourceList) hasNextLink() bool { - return wpirl.NextLink != nil && len(*wpirl.NextLink) != 0 -} - -// workloadProtectableItemResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (wpirl WorkloadProtectableItemResourceList) workloadProtectableItemResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !wpirl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(wpirl.NextLink))) -} - -// WorkloadProtectableItemResourceListPage contains a page of WorkloadProtectableItemResource values. -type WorkloadProtectableItemResourceListPage struct { - fn func(context.Context, WorkloadProtectableItemResourceList) (WorkloadProtectableItemResourceList, error) - wpirl WorkloadProtectableItemResourceList -} - -// NextWithContext 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 *WorkloadProtectableItemResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadProtectableItemResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.wpirl) - if err != nil { - return err - } - page.wpirl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *WorkloadProtectableItemResourceListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page WorkloadProtectableItemResourceListPage) NotDone() bool { - return !page.wpirl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page WorkloadProtectableItemResourceListPage) Response() WorkloadProtectableItemResourceList { - return page.wpirl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page WorkloadProtectableItemResourceListPage) Values() []WorkloadProtectableItemResource { - if page.wpirl.IsEmpty() { - return nil - } - return *page.wpirl.Value +// WeeklyRetentionFormat weekly retention format. +type WeeklyRetentionFormat struct { + // DaysOfTheWeek - List of days of the week. + DaysOfTheWeek *[]DayOfWeek `json:"daysOfTheWeek,omitempty"` + // WeeksOfTheMonth - List of weeks of month. + WeeksOfTheMonth *[]WeekOfMonth `json:"weeksOfTheMonth,omitempty"` } -// Creates a new instance of the WorkloadProtectableItemResourceListPage type. -func NewWorkloadProtectableItemResourceListPage(cur WorkloadProtectableItemResourceList, getNextPage func(context.Context, WorkloadProtectableItemResourceList) (WorkloadProtectableItemResourceList, error)) WorkloadProtectableItemResourceListPage { - return WorkloadProtectableItemResourceListPage{ - fn: getNextPage, - wpirl: cur, - } +// WeeklyRetentionSchedule weekly retention schedule. +type WeeklyRetentionSchedule struct { + // DaysOfTheWeek - List of days of week for weekly retention policy. + DaysOfTheWeek *[]DayOfWeek `json:"daysOfTheWeek,omitempty"` + // RetentionTimes - Retention times of retention policy. + RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` + // RetentionDuration - Retention duration of retention Policy. + RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` } // YearlyRetentionSchedule yearly retention schedule. diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/protectioncontainerrefreshoperationresults.go b/services/recoveryservices/mgmt/2019-06-15/backup/protectioncontainerrefreshoperationresults.go deleted file mode 100644 index 5b491864b588..000000000000 --- a/services/recoveryservices/mgmt/2019-06-15/backup/protectioncontainerrefreshoperationresults.go +++ /dev/null @@ -1,112 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ProtectionContainerRefreshOperationResultsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type ProtectionContainerRefreshOperationResultsClient struct { - BaseClient -} - -// NewProtectionContainerRefreshOperationResultsClient creates an instance of the -// ProtectionContainerRefreshOperationResultsClient client. -func NewProtectionContainerRefreshOperationResultsClient(subscriptionID string) ProtectionContainerRefreshOperationResultsClient { - return NewProtectionContainerRefreshOperationResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewProtectionContainerRefreshOperationResultsClientWithBaseURI creates an instance of the -// ProtectionContainerRefreshOperationResultsClient client using a custom endpoint. Use this when interacting with an -// Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewProtectionContainerRefreshOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) ProtectionContainerRefreshOperationResultsClient { - return ProtectionContainerRefreshOperationResultsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get provides the result of the refresh operation triggered by the BeginRefresh operation. -// 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 container. -// operationID - operation ID associated with the operation whose result needs to be fetched. -func (client ProtectionContainerRefreshOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, operationID string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerRefreshOperationResultsClient.Get") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, fabricName, operationID) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionContainerRefreshOperationResultsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "backup.ProtectionContainerRefreshOperationResultsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionContainerRefreshOperationResultsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ProtectionContainerRefreshOperationResultsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, operationID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "fabricName": autorest.Encode("path", fabricName), - "operationId": autorest.Encode("path", operationID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-12-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}/operationResults/{operationId}", 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 ProtectionContainerRefreshOperationResultsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ProtectionContainerRefreshOperationResultsClient) GetResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/protectioncontainers.go b/services/recoveryservices/mgmt/2019-06-15/backup/protectioncontainers.go deleted file mode 100644 index d12c30289ff6..000000000000 --- a/services/recoveryservices/mgmt/2019-06-15/backup/protectioncontainers.go +++ /dev/null @@ -1,444 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ProtectionContainersClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type ProtectionContainersClient struct { - BaseClient -} - -// NewProtectionContainersClient creates an instance of the ProtectionContainersClient client. -func NewProtectionContainersClient(subscriptionID string) ProtectionContainersClient { - return NewProtectionContainersClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewProtectionContainersClientWithBaseURI creates an instance of the ProtectionContainersClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewProtectionContainersClientWithBaseURI(baseURI string, subscriptionID string) ProtectionContainersClient { - return ProtectionContainersClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets details of the specific container registered to your 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. -// fabricName - name of the fabric where the container belongs. -// containerName - name of the container whose details need to be fetched. -func (client ProtectionContainersClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string) (result ProtectionContainerResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainersClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "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.ProtectionContainersClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ProtectionContainersClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "containerName": autorest.Encode("path", containerName), - "fabricName": autorest.Encode("path", fabricName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-12-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}/protectionContainers/{containerName}", 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 ProtectionContainersClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ProtectionContainersClient) GetResponder(resp *http.Response) (result ProtectionContainerResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// 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. -// fabricName - fabric Name associated with the container. -// containerName - name of the container in which inquiry needs to be triggered. -// filter - oData filter options. -func (client ProtectionContainersClient) Inquire(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, filter string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainersClient.Inquire") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.InquirePreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Inquire", nil, "Failure preparing request") - return - } - - resp, err := client.InquireSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Inquire", resp, "Failure sending request") - return - } - - result, err = client.InquireResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Inquire", resp, "Failure responding to request") - return - } - - return -} - -// InquirePreparer prepares the Inquire request. -func (client ProtectionContainersClient) InquirePreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "containerName": autorest.Encode("path", containerName), - "fabricName": autorest.Encode("path", fabricName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/inquire", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// InquireSender sends the Inquire request. The method will close the -// http.Response Body if it receives an error. -func (client ProtectionContainersClient) InquireSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// InquireResponder handles the response to the Inquire request. The method always -// closes the http.Response Body. -func (client ProtectionContainersClient) InquireResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Refresh discovers all the containers in the subscription that can be backed up to Recovery Services Vault. This is -// an -// asynchronous operation. To know the status of the operation, call GetRefreshOperationResult 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 the container. -// filter - oData filter options. -func (client ProtectionContainersClient) Refresh(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, filter string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainersClient.Refresh") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RefreshPreparer(ctx, vaultName, resourceGroupName, fabricName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Refresh", nil, "Failure preparing request") - return - } - - resp, err := client.RefreshSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Refresh", resp, "Failure sending request") - return - } - - result, err = client.RefreshResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Refresh", resp, "Failure responding to request") - return - } - - return -} - -// RefreshPreparer prepares the Refresh request. -func (client ProtectionContainersClient) RefreshPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "fabricName": autorest.Encode("path", fabricName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/refreshContainers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RefreshSender sends the Refresh request. The method will close the -// http.Response Body if it receives an error. -func (client ProtectionContainersClient) RefreshSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// RefreshResponder handles the response to the Refresh request. The method always -// closes the http.Response Body. -func (client ProtectionContainersClient) RefreshResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Register registers the container with Recovery Services vault. -// This is an asynchronous operation. To track the operation status, use location header to call get latest status of -// the operation. -// 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 container. -// containerName - name of the container to be registered. -// parameters - request body for operation -func (client ProtectionContainersClient) Register(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, parameters ProtectionContainerResource) (result ProtectionContainerResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainersClient.Register") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RegisterPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Register", nil, "Failure preparing request") - return - } - - resp, err := client.RegisterSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Register", resp, "Failure sending request") - return - } - - result, err = client.RegisterResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Register", resp, "Failure responding to request") - return - } - - return -} - -// RegisterPreparer prepares the Register request. -func (client ProtectionContainersClient) RegisterPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, parameters ProtectionContainerResource) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "containerName": autorest.Encode("path", containerName), - "fabricName": autorest.Encode("path", fabricName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RegisterSender sends the Register request. The method will close the -// http.Response Body if it receives an error. -func (client ProtectionContainersClient) RegisterSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// RegisterResponder handles the response to the Register request. The method always -// closes the http.Response Body. -func (client ProtectionContainersClient) RegisterResponder(resp *http.Response) (result ProtectionContainerResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Unregister unregisters the given container from your Recovery Services Vault. This is an asynchronous operation. To -// determine -// whether the backend service has finished processing the request, call Get Container Operation Result 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 - name of the fabric where the container belongs. -// containerName - name of the container which needs to be unregistered from the Recovery Services Vault. -func (client ProtectionContainersClient) Unregister(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainersClient.Unregister") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UnregisterPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Unregister", nil, "Failure preparing request") - return - } - - resp, err := client.UnregisterSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Unregister", resp, "Failure sending request") - return - } - - result, err = client.UnregisterResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionContainersClient", "Unregister", resp, "Failure responding to request") - return - } - - return -} - -// UnregisterPreparer prepares the Unregister request. -func (client ProtectionContainersClient) UnregisterPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "containerName": autorest.Encode("path", containerName), - "fabricName": autorest.Encode("path", fabricName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-12-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}/protectionContainers/{containerName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UnregisterSender sends the Unregister request. The method will close the -// http.Response Body if it receives an error. -func (client ProtectionContainersClient) UnregisterSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UnregisterResponder handles the response to the Unregister request. The method always -// closes the http.Response Body. -func (client ProtectionContainersClient) UnregisterResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/protectionintent.go b/services/recoveryservices/mgmt/2019-06-15/backup/protectionintent.go deleted file mode 100644 index 0327017ed0bb..000000000000 --- a/services/recoveryservices/mgmt/2019-06-15/backup/protectionintent.go +++ /dev/null @@ -1,353 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ProtectionIntentClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type ProtectionIntentClient struct { - BaseClient -} - -// NewProtectionIntentClient creates an instance of the ProtectionIntentClient client. -func NewProtectionIntentClient(subscriptionID string) ProtectionIntentClient { - return NewProtectionIntentClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewProtectionIntentClientWithBaseURI creates an instance of the ProtectionIntentClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewProtectionIntentClientWithBaseURI(baseURI string, subscriptionID string) ProtectionIntentClient { - return ProtectionIntentClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create Intent for Enabling backup of an item. This is a synchronous operation. -// 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 backup item. -// intentObjectName - intent object name. -// parameters - resource backed up item -func (client ProtectionIntentClient) CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string, parameters ProtectionIntentResource) (result ProtectionIntentResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionIntentClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, vaultName, resourceGroupName, fabricName, intentObjectName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionIntentClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.ProtectionIntentClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionIntentClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ProtectionIntentClient) CreateOrUpdatePreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string, parameters ProtectionIntentResource) (*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.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ProtectionIntentClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ProtectionIntentClient) CreateOrUpdateResponder(resp *http.Response) (result ProtectionIntentResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionIntentClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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 - } - - 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 client.Send(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, - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionIntentClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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 - } - - 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 client.Send(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, - 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 -// parameters - enable backup validation request on Virtual Machine -func (client ProtectionIntentClient) Validate(ctx context.Context, azureRegion string, parameters PreValidateEnableBackupRequest) (result PreValidateEnableBackupResponse, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionIntentClient.Validate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ValidatePreparer(ctx, azureRegion, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionIntentClient", "Validate", nil, "Failure preparing request") - return - } - - resp, err := client.ValidateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.ProtectionIntentClient", "Validate", resp, "Failure sending request") - return - } - - result, err = client.ValidateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionIntentClient", "Validate", resp, "Failure responding to request") - return - } - - return -} - -// ValidatePreparer prepares the Validate request. -func (client ProtectionIntentClient) ValidatePreparer(ctx context.Context, azureRegion string, parameters PreValidateEnableBackupRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "azureRegion": autorest.Encode("path", azureRegion), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupPreValidateProtection", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ValidateSender sends the Validate request. The method will close the -// http.Response Body if it receives an error. -func (client ProtectionIntentClient) ValidateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ValidateResponder handles the response to the Validate request. The method always -// closes the http.Response Body. -func (client ProtectionIntentClient) ValidateResponder(resp *http.Response) (result PreValidateEnableBackupResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/protectionpolicies.go b/services/recoveryservices/mgmt/2019-06-15/backup/protectionpolicies.go index df90a3956237..06ff709c59a9 100644 --- a/services/recoveryservices/mgmt/2019-06-15/backup/protectionpolicies.go +++ b/services/recoveryservices/mgmt/2019-06-15/backup/protectionpolicies.go @@ -114,85 +114,6 @@ func (client ProtectionPoliciesClient) CreateOrUpdateResponder(resp *http.Respon return } -// Delete deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status -// of the -// operation can be fetched using GetPolicyOperationResult API. -// Parameters: -// vaultName - the name of the recovery services vault. -// resourceGroupName - the name of the resource group where the recovery services vault is present. -// policyName - backup policy to be deleted. -func (client ProtectionPoliciesClient) Delete(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionPoliciesClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, vaultName, resourceGroupName, policyName) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ProtectionPoliciesClient) DeletePreparer(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "policyName": autorest.Encode("path", policyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-12-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}/backupPolicies/{policyName}", 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 ProtectionPoliciesClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ProtectionPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - // Get provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous // operation. Status of the operation can be fetched using GetPolicyOperationResult API. // Parameters: diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/resourcestorageconfigs.go b/services/recoveryservices/mgmt/2019-06-15/backup/resourcestorageconfigs.go deleted file mode 100644 index e763809902c3..000000000000 --- a/services/recoveryservices/mgmt/2019-06-15/backup/resourcestorageconfigs.go +++ /dev/null @@ -1,265 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ResourceStorageConfigsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type ResourceStorageConfigsClient struct { - BaseClient -} - -// NewResourceStorageConfigsClient creates an instance of the ResourceStorageConfigsClient client. -func NewResourceStorageConfigsClient(subscriptionID string) ResourceStorageConfigsClient { - return NewResourceStorageConfigsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewResourceStorageConfigsClientWithBaseURI creates an instance of the ResourceStorageConfigsClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewResourceStorageConfigsClientWithBaseURI(baseURI string, subscriptionID string) ResourceStorageConfigsClient { - return ResourceStorageConfigsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get fetches resource storage config. -// Parameters: -// vaultName - the name of the recovery services vault. -// resourceGroupName - the name of the resource group where the recovery services vault is present. -func (client ResourceStorageConfigsClient) Get(ctx context.Context, vaultName string, resourceGroupName string) (result ResourceConfigResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceStorageConfigsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, vaultName, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "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.ResourceStorageConfigsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ResourceStorageConfigsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName 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 = "2016-12-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}/backupstorageconfig/vaultstorageconfig", 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 ResourceStorageConfigsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ResourceStorageConfigsClient) GetResponder(resp *http.Response) (result ResourceConfigResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Patch updates vault storage model type. -// Parameters: -// vaultName - the name of the recovery services vault. -// resourceGroupName - the name of the resource group where the recovery services vault is present. -// parameters - vault storage config request -func (client ResourceStorageConfigsClient) Patch(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceConfigResource) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceStorageConfigsClient.Patch") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PatchPreparer(ctx, vaultName, resourceGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Patch", nil, "Failure preparing request") - return - } - - resp, err := client.PatchSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Patch", resp, "Failure sending request") - return - } - - result, err = client.PatchResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Patch", resp, "Failure responding to request") - return - } - - return -} - -// PatchPreparer prepares the Patch request. -func (client ResourceStorageConfigsClient) PatchPreparer(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceConfigResource) (*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 = "2016-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PatchSender sends the Patch request. The method will close the -// http.Response Body if it receives an error. -func (client ResourceStorageConfigsClient) PatchSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// PatchResponder handles the response to the Patch request. The method always -// closes the http.Response Body. -func (client ResourceStorageConfigsClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update updates vault storage model type. -// Parameters: -// vaultName - the name of the recovery services vault. -// resourceGroupName - the name of the resource group where the recovery services vault is present. -// parameters - vault storage config request -func (client ResourceStorageConfigsClient) Update(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceConfigResource) (result ResourceConfigResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceStorageConfigsClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, vaultName, resourceGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ResourceStorageConfigsClient) UpdatePreparer(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceConfigResource) (*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 = "2016-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client ResourceStorageConfigsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client ResourceStorageConfigsClient) UpdateResponder(resp *http.Response) (result ResourceConfigResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/status.go b/services/recoveryservices/mgmt/2019-06-15/backup/status.go deleted file mode 100644 index 4e62c544253c..000000000000 --- a/services/recoveryservices/mgmt/2019-06-15/backup/status.go +++ /dev/null @@ -1,108 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// StatusClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type StatusClient struct { - BaseClient -} - -// NewStatusClient creates an instance of the StatusClient client. -func NewStatusClient(subscriptionID string) StatusClient { - return NewStatusClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewStatusClientWithBaseURI creates an instance of the StatusClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewStatusClientWithBaseURI(baseURI string, subscriptionID string) StatusClient { - return StatusClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get sends the get request. -// Parameters: -// azureRegion - azure region to hit Api -// parameters - container Backup Status Request -func (client StatusClient) Get(ctx context.Context, azureRegion string, parameters StatusRequest) (result StatusResponse, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/StatusClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, azureRegion, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.StatusClient", "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.StatusClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.StatusClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client StatusClient) GetPreparer(ctx context.Context, azureRegion string, parameters StatusRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "azureRegion": autorest.Encode("path", azureRegion), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupStatus", pathParameters), - autorest.WithJSON(parameters), - 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 StatusClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client StatusClient) GetResponder(resp *http.Response) (result StatusResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/usagesummaries.go b/services/recoveryservices/mgmt/2019-06-15/backup/usagesummaries.go deleted file mode 100644 index 1c70d7b13444..000000000000 --- a/services/recoveryservices/mgmt/2019-06-15/backup/usagesummaries.go +++ /dev/null @@ -1,115 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// UsageSummariesClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type UsageSummariesClient struct { - BaseClient -} - -// NewUsageSummariesClient creates an instance of the UsageSummariesClient client. -func NewUsageSummariesClient(subscriptionID string) UsageSummariesClient { - return NewUsageSummariesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewUsageSummariesClientWithBaseURI creates an instance of the UsageSummariesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewUsageSummariesClientWithBaseURI(baseURI string, subscriptionID string) UsageSummariesClient { - return UsageSummariesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List fetches the backup management usage summaries of the 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 UsageSummariesClient) List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result ManagementUsageList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsageSummariesClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, vaultName, resourceGroupName, filter, skipToken) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.UsageSummariesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.UsageSummariesClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.UsageSummariesClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client UsageSummariesClient) 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}/backupUsageSummaries", 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 UsageSummariesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client UsageSummariesClient) ListResponder(resp *http.Response) (result ManagementUsageList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/workloaditems.go b/services/recoveryservices/mgmt/2019-06-15/backup/workloaditems.go deleted file mode 100644 index 8f400e70af4e..000000000000 --- a/services/recoveryservices/mgmt/2019-06-15/backup/workloaditems.go +++ /dev/null @@ -1,163 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// WorkloadItemsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type WorkloadItemsClient struct { - BaseClient -} - -// NewWorkloadItemsClient creates an instance of the WorkloadItemsClient client. -func NewWorkloadItemsClient(subscriptionID string) WorkloadItemsClient { - return NewWorkloadItemsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWorkloadItemsClientWithBaseURI creates an instance of the WorkloadItemsClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewWorkloadItemsClientWithBaseURI(baseURI string, subscriptionID string) WorkloadItemsClient { - return WorkloadItemsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List provides a pageable list of workload item of a specific container according to the query filter and the -// pagination -// parameters. -// 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 container. -// containerName - name of the container. -// filter - oData filter options. -// skipToken - skipToken Filter. -func (client WorkloadItemsClient) List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, filter string, skipToken string) (result WorkloadItemResourceListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadItemsClient.List") - defer func() { - sc := -1 - if result.wirl.Response.Response != nil { - sc = result.wirl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, filter, skipToken) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.WorkloadItemsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.wirl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.WorkloadItemsClient", "List", resp, "Failure sending request") - return - } - - result.wirl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.WorkloadItemsClient", "List", resp, "Failure responding to request") - return - } - if result.wirl.hasNextLink() && result.wirl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client WorkloadItemsClient) ListPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, filter string, skipToken string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "containerName": autorest.Encode("path", containerName), - "fabricName": autorest.Encode("path", fabricName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-12-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}/backupFabrics/{fabricName}/protectionContainers/{containerName}/items", 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 WorkloadItemsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client WorkloadItemsClient) ListResponder(resp *http.Response) (result WorkloadItemResourceList, err error) { - err = autorest.Respond( - resp, - 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 WorkloadItemsClient) listNextResults(ctx context.Context, lastResults WorkloadItemResourceList) (result WorkloadItemResourceList, err error) { - req, err := lastResults.workloadItemResourceListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "backup.WorkloadItemsClient", "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.WorkloadItemsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.WorkloadItemsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client WorkloadItemsClient) ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, filter string, skipToken string) (result WorkloadItemResourceListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadItemsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, vaultName, resourceGroupName, fabricName, containerName, filter, skipToken) - return -} diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/CHANGELOG.md b/services/recoveryservices/mgmt/2020-02-02/backup/CHANGELOG.md index 52911e4cc5e4..fb4e72f0a8c7 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/CHANGELOG.md +++ b/services/recoveryservices/mgmt/2020-02-02/backup/CHANGELOG.md @@ -1,2 +1,2711 @@ -# Change History +# Unreleased +## Breaking Changes + +### Removed Constants + +1. AzureFileShareType.XSMB +1. AzureFileShareType.XSync +1. ContainerType.ContainerTypeAzureBackupServerContainer +1. ContainerType.ContainerTypeAzureSQLContainer +1. ContainerType.ContainerTypeCluster +1. ContainerType.ContainerTypeDPMContainer +1. ContainerType.ContainerTypeGenericContainer +1. ContainerType.ContainerTypeIaasVMContainer +1. ContainerType.ContainerTypeIaasVMServiceContainer +1. ContainerType.ContainerTypeInvalid +1. ContainerType.ContainerTypeMABContainer +1. ContainerType.ContainerTypeSQLAGWorkLoadContainer +1. ContainerType.ContainerTypeStorageContainer +1. ContainerType.ContainerTypeUnknown +1. ContainerType.ContainerTypeVCenter +1. ContainerType.ContainerTypeVMAppContainer +1. ContainerType.ContainerTypeWindows +1. ContainerTypeBasicProtectionContainer.ContainerTypeAzureBackupServerContainer1 +1. ContainerTypeBasicProtectionContainer.ContainerTypeAzureSQLContainer1 +1. ContainerTypeBasicProtectionContainer.ContainerTypeAzureWorkloadContainer +1. ContainerTypeBasicProtectionContainer.ContainerTypeDPMContainer1 +1. ContainerTypeBasicProtectionContainer.ContainerTypeGenericContainer1 +1. ContainerTypeBasicProtectionContainer.ContainerTypeIaaSVMContainer +1. ContainerTypeBasicProtectionContainer.ContainerTypeMicrosoftClassicComputevirtualMachines +1. ContainerTypeBasicProtectionContainer.ContainerTypeMicrosoftComputevirtualMachines +1. ContainerTypeBasicProtectionContainer.ContainerTypeProtectionContainer +1. ContainerTypeBasicProtectionContainer.ContainerTypeSQLAGWorkLoadContainer1 +1. ContainerTypeBasicProtectionContainer.ContainerTypeStorageContainer1 +1. ContainerTypeBasicProtectionContainer.ContainerTypeVMAppContainer1 +1. ContainerTypeBasicProtectionContainer.ContainerTypeWindows1 +1. CopyOptions.CopyOptionsCreateCopy +1. CopyOptions.CopyOptionsFailOnConflict +1. CopyOptions.CopyOptionsInvalid +1. CopyOptions.CopyOptionsOverwrite +1. CopyOptions.CopyOptionsSkip +1. CreateMode.CreateModeDefault +1. CreateMode.CreateModeInvalid +1. CreateMode.CreateModeRecover +1. DataSourceType.DataSourceTypeAzureFileShare +1. DataSourceType.DataSourceTypeAzureSQLDb +1. DataSourceType.DataSourceTypeClient +1. DataSourceType.DataSourceTypeExchange +1. DataSourceType.DataSourceTypeFileFolder +1. DataSourceType.DataSourceTypeGenericDataSource +1. DataSourceType.DataSourceTypeInvalid +1. DataSourceType.DataSourceTypeSAPAseDatabase +1. DataSourceType.DataSourceTypeSAPHanaDatabase +1. DataSourceType.DataSourceTypeSQLDB +1. DataSourceType.DataSourceTypeSQLDataBase +1. DataSourceType.DataSourceTypeSharepoint +1. DataSourceType.DataSourceTypeSystemState +1. DataSourceType.DataSourceTypeVM +1. DataSourceType.DataSourceTypeVMwareVM +1. DayOfWeek.Friday +1. DayOfWeek.Monday +1. DayOfWeek.Saturday +1. DayOfWeek.Sunday +1. DayOfWeek.Thursday +1. DayOfWeek.Tuesday +1. DayOfWeek.Wednesday +1. EngineType.BackupEngineTypeAzureBackupServerEngine +1. EngineType.BackupEngineTypeBackupEngineBase +1. EngineType.BackupEngineTypeDpmBackupEngine +1. EnhancedSecurityState.EnhancedSecurityStateDisabled +1. EnhancedSecurityState.EnhancedSecurityStateEnabled +1. EnhancedSecurityState.EnhancedSecurityStateInvalid +1. FabricName.FabricNameAzure +1. FabricName.FabricNameInvalid +1. FeatureType.FeatureTypeAzureBackupGoals +1. FeatureType.FeatureTypeAzureVMResourceBackup +1. FeatureType.FeatureTypeFeatureSupportRequest +1. HTTPStatusCode.Accepted +1. HTTPStatusCode.Ambiguous +1. HTTPStatusCode.BadGateway +1. HTTPStatusCode.BadRequest +1. HTTPStatusCode.Conflict +1. HTTPStatusCode.Continue +1. HTTPStatusCode.Created +1. HTTPStatusCode.ExpectationFailed +1. HTTPStatusCode.Forbidden +1. HTTPStatusCode.Found +1. HTTPStatusCode.GatewayTimeout +1. HTTPStatusCode.Gone +1. HTTPStatusCode.HTTPVersionNotSupported +1. HTTPStatusCode.InternalServerError +1. HTTPStatusCode.LengthRequired +1. HTTPStatusCode.MethodNotAllowed +1. HTTPStatusCode.Moved +1. HTTPStatusCode.MovedPermanently +1. HTTPStatusCode.MultipleChoices +1. HTTPStatusCode.NoContent +1. HTTPStatusCode.NonAuthoritativeInformation +1. HTTPStatusCode.NotAcceptable +1. HTTPStatusCode.NotFound +1. HTTPStatusCode.NotImplemented +1. HTTPStatusCode.NotModified +1. HTTPStatusCode.OK +1. HTTPStatusCode.PartialContent +1. HTTPStatusCode.PaymentRequired +1. HTTPStatusCode.PreconditionFailed +1. HTTPStatusCode.ProxyAuthenticationRequired +1. HTTPStatusCode.Redirect +1. HTTPStatusCode.RedirectKeepVerb +1. HTTPStatusCode.RedirectMethod +1. HTTPStatusCode.RequestEntityTooLarge +1. HTTPStatusCode.RequestTimeout +1. HTTPStatusCode.RequestURITooLong +1. HTTPStatusCode.RequestedRangeNotSatisfiable +1. HTTPStatusCode.ResetContent +1. HTTPStatusCode.SeeOther +1. HTTPStatusCode.ServiceUnavailable +1. HTTPStatusCode.SwitchingProtocols +1. HTTPStatusCode.TemporaryRedirect +1. HTTPStatusCode.Unauthorized +1. HTTPStatusCode.UnsupportedMediaType +1. HTTPStatusCode.Unused +1. HTTPStatusCode.UpgradeRequired +1. HTTPStatusCode.UseProxy +1. HealthState.HealthStateActionRequired +1. HealthState.HealthStateActionSuggested +1. HealthState.HealthStateInvalid +1. HealthState.HealthStatePassed +1. HealthStatus.HealthStatusActionRequired +1. HealthStatus.HealthStatusActionSuggested +1. HealthStatus.HealthStatusInvalid +1. HealthStatus.HealthStatusPassed +1. InquiryStatus.InquiryStatusFailed +1. InquiryStatus.InquiryStatusInvalid +1. InquiryStatus.InquiryStatusSuccess +1. IntentItemType.IntentItemTypeInvalid +1. IntentItemType.IntentItemTypeSQLAvailabilityGroupContainer +1. IntentItemType.IntentItemTypeSQLInstance +1. ItemType.ItemTypeAzureFileShare +1. ItemType.ItemTypeAzureSQLDb +1. ItemType.ItemTypeClient +1. ItemType.ItemTypeExchange +1. ItemType.ItemTypeFileFolder +1. ItemType.ItemTypeGenericDataSource +1. ItemType.ItemTypeInvalid +1. ItemType.ItemTypeSAPAseDatabase +1. ItemType.ItemTypeSAPHanaDatabase +1. ItemType.ItemTypeSQLDB +1. ItemType.ItemTypeSQLDataBase +1. ItemType.ItemTypeSharepoint +1. ItemType.ItemTypeSystemState +1. ItemType.ItemTypeVM +1. ItemType.ItemTypeVMwareVM +1. JobOperationType.JobOperationTypeBackup +1. JobOperationType.JobOperationTypeConfigureBackup +1. JobOperationType.JobOperationTypeCrossRegionRestore +1. JobOperationType.JobOperationTypeDeleteBackupData +1. JobOperationType.JobOperationTypeDisableBackup +1. JobOperationType.JobOperationTypeInvalid +1. JobOperationType.JobOperationTypeRegister +1. JobOperationType.JobOperationTypeRestore +1. JobOperationType.JobOperationTypeUnRegister +1. JobOperationType.JobOperationTypeUndelete +1. JobStatus.JobStatusCancelled +1. JobStatus.JobStatusCancelling +1. JobStatus.JobStatusCompleted +1. JobStatus.JobStatusCompletedWithWarnings +1. JobStatus.JobStatusFailed +1. JobStatus.JobStatusInProgress +1. JobStatus.JobStatusInvalid +1. JobSupportedAction.JobSupportedActionCancellable +1. JobSupportedAction.JobSupportedActionInvalid +1. JobSupportedAction.JobSupportedActionRetriable +1. JobType.JobTypeAzureIaaSVMJob +1. JobType.JobTypeAzureStorageJob +1. JobType.JobTypeAzureWorkloadJob +1. JobType.JobTypeDpmJob +1. JobType.JobTypeJob +1. JobType.JobTypeMabJob +1. LastBackupStatus.LastBackupStatusHealthy +1. LastBackupStatus.LastBackupStatusIRPending +1. LastBackupStatus.LastBackupStatusInvalid +1. LastBackupStatus.LastBackupStatusUnhealthy +1. MabServerType.MabServerTypeAzureBackupServerContainer +1. MabServerType.MabServerTypeAzureSQLContainer +1. MabServerType.MabServerTypeCluster +1. MabServerType.MabServerTypeDPMContainer +1. MabServerType.MabServerTypeGenericContainer +1. MabServerType.MabServerTypeIaasVMContainer +1. MabServerType.MabServerTypeIaasVMServiceContainer +1. MabServerType.MabServerTypeInvalid +1. MabServerType.MabServerTypeMABContainer +1. MabServerType.MabServerTypeSQLAGWorkLoadContainer +1. MabServerType.MabServerTypeStorageContainer +1. MabServerType.MabServerTypeUnknown +1. MabServerType.MabServerTypeVCenter +1. MabServerType.MabServerTypeVMAppContainer +1. MabServerType.MabServerTypeWindows +1. ManagementType.ManagementTypeAzureBackupServer +1. ManagementType.ManagementTypeAzureIaasVM +1. ManagementType.ManagementTypeAzureSQL +1. ManagementType.ManagementTypeAzureStorage +1. ManagementType.ManagementTypeAzureWorkload +1. ManagementType.ManagementTypeDPM +1. ManagementType.ManagementTypeDefaultBackup +1. ManagementType.ManagementTypeInvalid +1. ManagementType.ManagementTypeMAB +1. ManagementTypeBasicProtectionPolicy.BackupManagementTypeAzureIaasVM +1. ManagementTypeBasicProtectionPolicy.BackupManagementTypeAzureSQL +1. ManagementTypeBasicProtectionPolicy.BackupManagementTypeAzureStorage +1. ManagementTypeBasicProtectionPolicy.BackupManagementTypeAzureWorkload +1. ManagementTypeBasicProtectionPolicy.BackupManagementTypeGenericProtectionPolicy +1. ManagementTypeBasicProtectionPolicy.BackupManagementTypeMAB +1. ManagementTypeBasicProtectionPolicy.BackupManagementTypeProtectionPolicy +1. MonthOfYear.MonthOfYearApril +1. MonthOfYear.MonthOfYearAugust +1. MonthOfYear.MonthOfYearDecember +1. MonthOfYear.MonthOfYearFebruary +1. MonthOfYear.MonthOfYearInvalid +1. MonthOfYear.MonthOfYearJanuary +1. MonthOfYear.MonthOfYearJuly +1. MonthOfYear.MonthOfYearJune +1. MonthOfYear.MonthOfYearMarch +1. MonthOfYear.MonthOfYearMay +1. MonthOfYear.MonthOfYearNovember +1. MonthOfYear.MonthOfYearOctober +1. MonthOfYear.MonthOfYearSeptember +1. ObjectType.ObjectTypeOperationStatusExtendedInfo +1. ObjectType.ObjectTypeOperationStatusJobExtendedInfo +1. ObjectType.ObjectTypeOperationStatusJobsExtendedInfo +1. ObjectType.ObjectTypeOperationStatusProvisionILRExtendedInfo +1. ObjectTypeBasicILRRequest.ObjectTypeAzureFileShareProvisionILRRequest +1. ObjectTypeBasicILRRequest.ObjectTypeILRRequest +1. ObjectTypeBasicILRRequest.ObjectTypeIaasVMILRRegistrationRequest +1. ObjectTypeBasicOperationResultInfoBase.ObjectTypeExportJobsOperationResultInfo +1. ObjectTypeBasicOperationResultInfoBase.ObjectTypeOperationResultInfo +1. ObjectTypeBasicOperationResultInfoBase.ObjectTypeOperationResultInfoBase +1. ObjectTypeBasicRecoveryPoint.ObjectTypeAzureFileShareRecoveryPoint +1. ObjectTypeBasicRecoveryPoint.ObjectTypeAzureWorkloadPointInTimeRecoveryPoint +1. ObjectTypeBasicRecoveryPoint.ObjectTypeAzureWorkloadRecoveryPoint +1. ObjectTypeBasicRecoveryPoint.ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint +1. ObjectTypeBasicRecoveryPoint.ObjectTypeAzureWorkloadSAPHanaRecoveryPoint +1. ObjectTypeBasicRecoveryPoint.ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint +1. ObjectTypeBasicRecoveryPoint.ObjectTypeAzureWorkloadSQLRecoveryPoint +1. ObjectTypeBasicRecoveryPoint.ObjectTypeGenericRecoveryPoint +1. ObjectTypeBasicRecoveryPoint.ObjectTypeIaasVMRecoveryPoint +1. ObjectTypeBasicRecoveryPoint.ObjectTypeRecoveryPoint +1. ObjectTypeBasicRequest.ObjectTypeAzureFileShareBackupRequest +1. ObjectTypeBasicRequest.ObjectTypeAzureWorkloadBackupRequest +1. ObjectTypeBasicRequest.ObjectTypeBackupRequest +1. ObjectTypeBasicRequest.ObjectTypeIaasVMBackupRequest +1. ObjectTypeBasicRestoreRequest.ObjectTypeAzureFileShareRestoreRequest +1. ObjectTypeBasicRestoreRequest.ObjectTypeAzureWorkloadPointInTimeRestoreRequest +1. ObjectTypeBasicRestoreRequest.ObjectTypeAzureWorkloadRestoreRequest +1. ObjectTypeBasicRestoreRequest.ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest +1. ObjectTypeBasicRestoreRequest.ObjectTypeAzureWorkloadSAPHanaRestoreRequest +1. ObjectTypeBasicRestoreRequest.ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest +1. ObjectTypeBasicRestoreRequest.ObjectTypeAzureWorkloadSQLRestoreRequest +1. ObjectTypeBasicRestoreRequest.ObjectTypeIaasVMRestoreRequest +1. ObjectTypeBasicRestoreRequest.ObjectTypeRestoreRequest +1. ObjectTypeBasicValidateOperationRequest.ObjectTypeValidateIaasVMRestoreOperationRequest +1. ObjectTypeBasicValidateOperationRequest.ObjectTypeValidateOperationRequest +1. ObjectTypeBasicValidateOperationRequest.ObjectTypeValidateRestoreOperationRequest +1. OperationStatusValues.OperationStatusValuesCanceled +1. OperationStatusValues.OperationStatusValuesFailed +1. OperationStatusValues.OperationStatusValuesInProgress +1. OperationStatusValues.OperationStatusValuesInvalid +1. OperationStatusValues.OperationStatusValuesSucceeded +1. OperationType.OperationTypeInvalid +1. OperationType.OperationTypeRegister +1. OperationType.OperationTypeReregister +1. OverwriteOptions.OverwriteOptionsFailOnConflict +1. OverwriteOptions.OverwriteOptionsInvalid +1. OverwriteOptions.OverwriteOptionsOverwrite +1. PolicyType.PolicyTypeCopyOnlyFull +1. PolicyType.PolicyTypeDifferential +1. PolicyType.PolicyTypeFull +1. PolicyType.PolicyTypeInvalid +1. PolicyType.PolicyTypeLog +1. ProtectableContainerType.ProtectableContainerTypeProtectableContainer +1. ProtectableContainerType.ProtectableContainerTypeStorageContainer +1. ProtectableContainerType.ProtectableContainerTypeVMAppContainer +1. ProtectableItemType.ProtectableItemTypeAzureFileShare +1. ProtectableItemType.ProtectableItemTypeAzureVMWorkloadProtectableItem +1. ProtectableItemType.ProtectableItemTypeIaaSVMProtectableItem +1. ProtectableItemType.ProtectableItemTypeMicrosoftClassicComputevirtualMachines +1. ProtectableItemType.ProtectableItemTypeMicrosoftComputevirtualMachines +1. ProtectableItemType.ProtectableItemTypeSAPAseSystem +1. ProtectableItemType.ProtectableItemTypeSAPHanaDatabase +1. ProtectableItemType.ProtectableItemTypeSAPHanaSystem +1. ProtectableItemType.ProtectableItemTypeSQLAvailabilityGroupContainer +1. ProtectableItemType.ProtectableItemTypeSQLDataBase +1. ProtectableItemType.ProtectableItemTypeSQLInstance +1. ProtectableItemType.ProtectableItemTypeWorkloadProtectableItem +1. ProtectedItemHealthStatus.ProtectedItemHealthStatusHealthy +1. ProtectedItemHealthStatus.ProtectedItemHealthStatusIRPending +1. ProtectedItemHealthStatus.ProtectedItemHealthStatusInvalid +1. ProtectedItemHealthStatus.ProtectedItemHealthStatusNotReachable +1. ProtectedItemHealthStatus.ProtectedItemHealthStatusUnhealthy +1. ProtectedItemState.ProtectedItemStateIRPending +1. ProtectedItemState.ProtectedItemStateInvalid +1. ProtectedItemState.ProtectedItemStateProtected +1. ProtectedItemState.ProtectedItemStateProtectionError +1. ProtectedItemState.ProtectedItemStateProtectionPaused +1. ProtectedItemState.ProtectedItemStateProtectionStopped +1. ProtectedItemType.ProtectedItemTypeAzureFileShareProtectedItem +1. ProtectedItemType.ProtectedItemTypeAzureIaaSVMProtectedItem +1. ProtectedItemType.ProtectedItemTypeAzureVMWorkloadProtectedItem +1. ProtectedItemType.ProtectedItemTypeAzureVMWorkloadSAPAseDatabase +1. ProtectedItemType.ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase +1. ProtectedItemType.ProtectedItemTypeAzureVMWorkloadSQLDatabase +1. ProtectedItemType.ProtectedItemTypeDPMProtectedItem +1. ProtectedItemType.ProtectedItemTypeGenericProtectedItem +1. ProtectedItemType.ProtectedItemTypeMabFileFolderProtectedItem +1. ProtectedItemType.ProtectedItemTypeMicrosoftClassicComputevirtualMachines +1. ProtectedItemType.ProtectedItemTypeMicrosoftComputevirtualMachines +1. ProtectedItemType.ProtectedItemTypeMicrosoftSqlserversdatabases +1. ProtectedItemType.ProtectedItemTypeProtectedItem +1. ProtectionIntentItemType.ProtectionIntentItemTypeAzureResourceItem +1. ProtectionIntentItemType.ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent +1. ProtectionIntentItemType.ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent +1. ProtectionIntentItemType.ProtectionIntentItemTypeProtectionIntent +1. ProtectionIntentItemType.ProtectionIntentItemTypeRecoveryServiceVaultItem +1. ProtectionState.ProtectionStateIRPending +1. ProtectionState.ProtectionStateInvalid +1. ProtectionState.ProtectionStateProtected +1. ProtectionState.ProtectionStateProtectionError +1. ProtectionState.ProtectionStateProtectionPaused +1. ProtectionState.ProtectionStateProtectionStopped +1. ProtectionStatus.ProtectionStatusInvalid +1. ProtectionStatus.ProtectionStatusNotProtected +1. ProtectionStatus.ProtectionStatusProtected +1. ProtectionStatus.ProtectionStatusProtecting +1. ProtectionStatus.ProtectionStatusProtectionFailed +1. RecoveryMode.RecoveryModeFileRecovery +1. RecoveryMode.RecoveryModeInvalid +1. RecoveryMode.RecoveryModeWorkloadRecovery +1. RecoveryPointTierStatus.RecoveryPointTierStatusDeleted +1. RecoveryPointTierStatus.RecoveryPointTierStatusDisabled +1. RecoveryPointTierStatus.RecoveryPointTierStatusInvalid +1. RecoveryPointTierStatus.RecoveryPointTierStatusValid +1. RecoveryPointTierType.RecoveryPointTierTypeHardenedRP +1. RecoveryPointTierType.RecoveryPointTierTypeInstantRP +1. RecoveryPointTierType.RecoveryPointTierTypeInvalid +1. RecoveryType.RecoveryTypeAlternateLocation +1. RecoveryType.RecoveryTypeInvalid +1. RecoveryType.RecoveryTypeOffline +1. RecoveryType.RecoveryTypeOriginalLocation +1. RecoveryType.RecoveryTypeRestoreDisks +1. ResourceHealthStatus.ResourceHealthStatusHealthy +1. ResourceHealthStatus.ResourceHealthStatusInvalid +1. ResourceHealthStatus.ResourceHealthStatusPersistentDegraded +1. ResourceHealthStatus.ResourceHealthStatusPersistentUnhealthy +1. ResourceHealthStatus.ResourceHealthStatusTransientDegraded +1. ResourceHealthStatus.ResourceHealthStatusTransientUnhealthy +1. RestorePointQueryType.RestorePointQueryTypeAll +1. RestorePointQueryType.RestorePointQueryTypeDifferential +1. RestorePointQueryType.RestorePointQueryTypeFull +1. RestorePointQueryType.RestorePointQueryTypeFullAndDifferential +1. RestorePointQueryType.RestorePointQueryTypeInvalid +1. RestorePointQueryType.RestorePointQueryTypeLog +1. RestorePointType.RestorePointTypeDifferential +1. RestorePointType.RestorePointTypeFull +1. RestorePointType.RestorePointTypeInvalid +1. RestorePointType.RestorePointTypeLog +1. RestoreRequestType.RestoreRequestTypeFullShareRestore +1. RestoreRequestType.RestoreRequestTypeInvalid +1. RestoreRequestType.RestoreRequestTypeItemLevelRestore +1. RetentionDurationType.RetentionDurationTypeDays +1. RetentionDurationType.RetentionDurationTypeInvalid +1. RetentionDurationType.RetentionDurationTypeMonths +1. RetentionDurationType.RetentionDurationTypeWeeks +1. RetentionDurationType.RetentionDurationTypeYears +1. RetentionPolicyType.RetentionPolicyTypeLongTermRetentionPolicy +1. RetentionPolicyType.RetentionPolicyTypeRetentionPolicy +1. RetentionPolicyType.RetentionPolicyTypeSimpleRetentionPolicy +1. RetentionScheduleFormat.RetentionScheduleFormatDaily +1. RetentionScheduleFormat.RetentionScheduleFormatInvalid +1. RetentionScheduleFormat.RetentionScheduleFormatWeekly +1. SQLDataDirectoryType.SQLDataDirectoryTypeData +1. SQLDataDirectoryType.SQLDataDirectoryTypeInvalid +1. SQLDataDirectoryType.SQLDataDirectoryTypeLog +1. SchedulePolicyType.SchedulePolicyTypeLogSchedulePolicy +1. SchedulePolicyType.SchedulePolicyTypeLongTermSchedulePolicy +1. SchedulePolicyType.SchedulePolicyTypeSchedulePolicy +1. SchedulePolicyType.SchedulePolicyTypeSimpleSchedulePolicy +1. ScheduleRunType.ScheduleRunTypeDaily +1. ScheduleRunType.ScheduleRunTypeInvalid +1. ScheduleRunType.ScheduleRunTypeWeekly +1. SoftDeleteFeatureState.SoftDeleteFeatureStateDisabled +1. SoftDeleteFeatureState.SoftDeleteFeatureStateEnabled +1. SoftDeleteFeatureState.SoftDeleteFeatureStateInvalid +1. StorageType.StorageTypeGeoRedundant +1. StorageType.StorageTypeInvalid +1. StorageType.StorageTypeLocallyRedundant +1. StorageTypeState.StorageTypeStateInvalid +1. StorageTypeState.StorageTypeStateLocked +1. StorageTypeState.StorageTypeStateUnlocked +1. SupportStatus.SupportStatusDefaultOFF +1. SupportStatus.SupportStatusDefaultON +1. SupportStatus.SupportStatusInvalid +1. SupportStatus.SupportStatusNotSupported +1. SupportStatus.SupportStatusSupported +1. Type.TypeBackupProtectedItemCountSummary +1. Type.TypeBackupProtectionContainerCountSummary +1. Type.TypeInvalid +1. TypeEnum.TypeEnumCopyOnlyFull +1. TypeEnum.TypeEnumDifferential +1. TypeEnum.TypeEnumFull +1. TypeEnum.TypeEnumInvalid +1. TypeEnum.TypeEnumLog +1. UsagesUnit.Bytes +1. UsagesUnit.BytesPerSecond +1. UsagesUnit.Count +1. UsagesUnit.CountPerSecond +1. UsagesUnit.Percent +1. UsagesUnit.Seconds +1. ValidationStatus.ValidationStatusFailed +1. ValidationStatus.ValidationStatusInvalid +1. ValidationStatus.ValidationStatusSucceeded +1. WeekOfMonth.WeekOfMonthFirst +1. WeekOfMonth.WeekOfMonthFourth +1. WeekOfMonth.WeekOfMonthInvalid +1. WeekOfMonth.WeekOfMonthLast +1. WeekOfMonth.WeekOfMonthSecond +1. WeekOfMonth.WeekOfMonthThird +1. WorkloadItemType.WorkloadItemTypeInvalid +1. WorkloadItemType.WorkloadItemTypeSAPAseDatabase +1. WorkloadItemType.WorkloadItemTypeSAPAseSystem +1. WorkloadItemType.WorkloadItemTypeSAPHanaDatabase +1. WorkloadItemType.WorkloadItemTypeSAPHanaSystem +1. WorkloadItemType.WorkloadItemTypeSQLDataBase +1. WorkloadItemType.WorkloadItemTypeSQLInstance +1. WorkloadItemTypeBasicWorkloadItem.WorkloadItemTypeAzureVMWorkloadItem +1. WorkloadItemTypeBasicWorkloadItem.WorkloadItemTypeSAPAseDatabase1 +1. WorkloadItemTypeBasicWorkloadItem.WorkloadItemTypeSAPAseSystem1 +1. WorkloadItemTypeBasicWorkloadItem.WorkloadItemTypeSAPHanaDatabase1 +1. WorkloadItemTypeBasicWorkloadItem.WorkloadItemTypeSAPHanaSystem1 +1. WorkloadItemTypeBasicWorkloadItem.WorkloadItemTypeSQLDataBase1 +1. WorkloadItemTypeBasicWorkloadItem.WorkloadItemTypeSQLInstance1 +1. WorkloadItemTypeBasicWorkloadItem.WorkloadItemTypeWorkloadItem +1. WorkloadType.WorkloadTypeAzureFileShare +1. WorkloadType.WorkloadTypeAzureSQLDb +1. WorkloadType.WorkloadTypeClient +1. WorkloadType.WorkloadTypeExchange +1. WorkloadType.WorkloadTypeFileFolder +1. WorkloadType.WorkloadTypeGenericDataSource +1. WorkloadType.WorkloadTypeInvalid +1. WorkloadType.WorkloadTypeSAPAseDatabase +1. WorkloadType.WorkloadTypeSAPHanaDatabase +1. WorkloadType.WorkloadTypeSQLDB +1. WorkloadType.WorkloadTypeSQLDataBase +1. WorkloadType.WorkloadTypeSharepoint +1. WorkloadType.WorkloadTypeSystemState +1. WorkloadType.WorkloadTypeVM +1. WorkloadType.WorkloadTypeVMwareVM + +### Removed Funcs + +1. *AzureFileShareProtectionPolicy.UnmarshalJSON([]byte) error +1. *AzureIaaSVMProtectionPolicy.UnmarshalJSON([]byte) error +1. *AzureSQLProtectionPolicy.UnmarshalJSON([]byte) error +1. *ClientDiscoveryResponseIterator.Next() error +1. *ClientDiscoveryResponseIterator.NextWithContext(context.Context) error +1. *ClientDiscoveryResponsePage.Next() error +1. *ClientDiscoveryResponsePage.NextWithContext(context.Context) error +1. *EngineBaseResource.UnmarshalJSON([]byte) error +1. *EngineBaseResourceListIterator.Next() error +1. *EngineBaseResourceListIterator.NextWithContext(context.Context) error +1. *EngineBaseResourceListPage.Next() error +1. *EngineBaseResourceListPage.NextWithContext(context.Context) error +1. *ILRRequestResource.UnmarshalJSON([]byte) error +1. *JobResource.UnmarshalJSON([]byte) error +1. *JobResourceListIterator.Next() error +1. *JobResourceListIterator.NextWithContext(context.Context) error +1. *JobResourceListPage.Next() error +1. *JobResourceListPage.NextWithContext(context.Context) error +1. *MabProtectionPolicy.UnmarshalJSON([]byte) error +1. *OperationResultInfoBaseResource.UnmarshalJSON([]byte) error +1. *OperationStatus.UnmarshalJSON([]byte) error +1. *ProtectableContainerResource.UnmarshalJSON([]byte) error +1. *ProtectableContainerResourceListIterator.Next() error +1. *ProtectableContainerResourceListIterator.NextWithContext(context.Context) error +1. *ProtectableContainerResourceListPage.Next() error +1. *ProtectableContainerResourceListPage.NextWithContext(context.Context) error +1. *ProtectedItemResource.UnmarshalJSON([]byte) error +1. *ProtectedItemResourceListIterator.Next() error +1. *ProtectedItemResourceListIterator.NextWithContext(context.Context) error +1. *ProtectedItemResourceListPage.Next() error +1. *ProtectedItemResourceListPage.NextWithContext(context.Context) error +1. *ProtectionContainerResource.UnmarshalJSON([]byte) error +1. *ProtectionContainerResourceListIterator.Next() error +1. *ProtectionContainerResourceListIterator.NextWithContext(context.Context) error +1. *ProtectionContainerResourceListPage.Next() error +1. *ProtectionContainerResourceListPage.NextWithContext(context.Context) error +1. *ProtectionIntentResource.UnmarshalJSON([]byte) error +1. *ProtectionIntentResourceListIterator.Next() error +1. *ProtectionIntentResourceListIterator.NextWithContext(context.Context) error +1. *ProtectionIntentResourceListPage.Next() error +1. *ProtectionIntentResourceListPage.NextWithContext(context.Context) error +1. *ProtectionPolicyResource.UnmarshalJSON([]byte) error +1. *ProtectionPolicyResourceListIterator.Next() error +1. *ProtectionPolicyResourceListIterator.NextWithContext(context.Context) error +1. *ProtectionPolicyResourceListPage.Next() error +1. *ProtectionPolicyResourceListPage.NextWithContext(context.Context) error +1. *RecoveryPointResource.UnmarshalJSON([]byte) error +1. *RecoveryPointResourceListIterator.Next() error +1. *RecoveryPointResourceListIterator.NextWithContext(context.Context) error +1. *RecoveryPointResourceListPage.Next() error +1. *RecoveryPointResourceListPage.NextWithContext(context.Context) error +1. *RequestResource.UnmarshalJSON([]byte) error +1. *RestoreRequestResource.UnmarshalJSON([]byte) error +1. *SubProtectionPolicy.UnmarshalJSON([]byte) error +1. *ValidateIaasVMRestoreOperationRequest.UnmarshalJSON([]byte) error +1. *ValidateRestoreOperationRequest.UnmarshalJSON([]byte) error +1. *WorkloadItemResource.UnmarshalJSON([]byte) error +1. *WorkloadItemResourceListIterator.Next() error +1. *WorkloadItemResourceListIterator.NextWithContext(context.Context) error +1. *WorkloadItemResourceListPage.Next() error +1. *WorkloadItemResourceListPage.NextWithContext(context.Context) error +1. *WorkloadProtectableItemResource.UnmarshalJSON([]byte) error +1. *WorkloadProtectableItemResourceListIterator.Next() error +1. *WorkloadProtectableItemResourceListIterator.NextWithContext(context.Context) error +1. *WorkloadProtectableItemResourceListPage.Next() error +1. *WorkloadProtectableItemResourceListPage.NextWithContext(context.Context) error +1. AzureBackupGoalFeatureSupportRequest.AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) +1. AzureBackupGoalFeatureSupportRequest.AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) +1. AzureBackupGoalFeatureSupportRequest.AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) +1. AzureBackupGoalFeatureSupportRequest.AsFeatureSupportRequest() (*FeatureSupportRequest, bool) +1. AzureBackupGoalFeatureSupportRequest.MarshalJSON() ([]byte, error) +1. AzureBackupServerContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. AzureBackupServerContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. AzureBackupServerContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. AzureBackupServerContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. AzureBackupServerContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. AzureBackupServerContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. AzureBackupServerContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. AzureBackupServerContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. AzureBackupServerContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. AzureBackupServerContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. AzureBackupServerContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. AzureBackupServerContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. AzureBackupServerContainer.AsDpmContainer() (*DpmContainer, bool) +1. AzureBackupServerContainer.AsGenericContainer() (*GenericContainer, bool) +1. AzureBackupServerContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. AzureBackupServerContainer.AsMabContainer() (*MabContainer, bool) +1. AzureBackupServerContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. AzureBackupServerContainer.MarshalJSON() ([]byte, error) +1. AzureBackupServerEngine.AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) +1. AzureBackupServerEngine.AsBasicEngineBase() (BasicEngineBase, bool) +1. AzureBackupServerEngine.AsDpmBackupEngine() (*DpmBackupEngine, bool) +1. AzureBackupServerEngine.AsEngineBase() (*EngineBase, bool) +1. AzureBackupServerEngine.MarshalJSON() ([]byte, error) +1. AzureFileShareBackupRequest.AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) +1. AzureFileShareBackupRequest.AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) +1. AzureFileShareBackupRequest.AsBasicRequest() (BasicRequest, bool) +1. AzureFileShareBackupRequest.AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) +1. AzureFileShareBackupRequest.AsRequest() (*Request, bool) +1. AzureFileShareBackupRequest.MarshalJSON() ([]byte, error) +1. AzureFileShareProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureFileShareProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureFileShareProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureFileShareProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureFileShareProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureFileShareProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureFileShareProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureFileShareProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureFileShareProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureFileShareProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureFileShareProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureFileShareProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureFileShareProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureFileShareProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureFileShareProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureFileShareProtectableItem.MarshalJSON() ([]byte, error) +1. AzureFileShareProtectionPolicy.AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) +1. AzureFileShareProtectionPolicy.AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) +1. AzureFileShareProtectionPolicy.AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) +1. AzureFileShareProtectionPolicy.AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) +1. AzureFileShareProtectionPolicy.AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) +1. AzureFileShareProtectionPolicy.AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) +1. AzureFileShareProtectionPolicy.AsMabProtectionPolicy() (*MabProtectionPolicy, bool) +1. AzureFileShareProtectionPolicy.AsProtectionPolicy() (*ProtectionPolicy, bool) +1. AzureFileShareProtectionPolicy.MarshalJSON() ([]byte, error) +1. AzureFileShareProvisionILRRequest.AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) +1. AzureFileShareProvisionILRRequest.AsBasicILRRequest() (BasicILRRequest, bool) +1. AzureFileShareProvisionILRRequest.AsILRRequest() (*ILRRequest, bool) +1. AzureFileShareProvisionILRRequest.AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) +1. AzureFileShareProvisionILRRequest.MarshalJSON() ([]byte, error) +1. AzureFileShareRecoveryPoint.AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) +1. AzureFileShareRecoveryPoint.AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) +1. AzureFileShareRecoveryPoint.AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) +1. AzureFileShareRecoveryPoint.AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) +1. AzureFileShareRecoveryPoint.AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) +1. AzureFileShareRecoveryPoint.AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) +1. AzureFileShareRecoveryPoint.AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) +1. AzureFileShareRecoveryPoint.AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) +1. AzureFileShareRecoveryPoint.AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) +1. AzureFileShareRecoveryPoint.AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) +1. AzureFileShareRecoveryPoint.AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) +1. AzureFileShareRecoveryPoint.AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) +1. AzureFileShareRecoveryPoint.AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) +1. AzureFileShareRecoveryPoint.AsRecoveryPoint() (*RecoveryPoint, bool) +1. AzureFileShareRecoveryPoint.MarshalJSON() ([]byte, error) +1. AzureFileShareRestoreRequest.AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) +1. AzureFileShareRestoreRequest.AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) +1. AzureFileShareRestoreRequest.AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) +1. AzureFileShareRestoreRequest.AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) +1. AzureFileShareRestoreRequest.AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) +1. AzureFileShareRestoreRequest.AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) +1. AzureFileShareRestoreRequest.AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) +1. AzureFileShareRestoreRequest.AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) +1. AzureFileShareRestoreRequest.AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) +1. AzureFileShareRestoreRequest.AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) +1. AzureFileShareRestoreRequest.AsBasicRestoreRequest() (BasicRestoreRequest, bool) +1. AzureFileShareRestoreRequest.AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) +1. AzureFileShareRestoreRequest.AsRestoreRequest() (*RestoreRequest, bool) +1. AzureFileShareRestoreRequest.MarshalJSON() ([]byte, error) +1. AzureFileshareProtectedItem.AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) +1. AzureFileshareProtectedItem.AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) +1. AzureFileshareProtectedItem.AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) +1. AzureFileshareProtectedItem.AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) +1. AzureFileshareProtectedItem.AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) +1. AzureFileshareProtectedItem.AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) +1. AzureFileshareProtectedItem.AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) +1. AzureFileshareProtectedItem.AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) +1. AzureFileshareProtectedItem.AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) +1. AzureFileshareProtectedItem.AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) +1. AzureFileshareProtectedItem.AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) +1. AzureFileshareProtectedItem.AsBasicProtectedItem() (BasicProtectedItem, bool) +1. AzureFileshareProtectedItem.AsDPMProtectedItem() (*DPMProtectedItem, bool) +1. AzureFileshareProtectedItem.AsGenericProtectedItem() (*GenericProtectedItem, bool) +1. AzureFileshareProtectedItem.AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) +1. AzureFileshareProtectedItem.AsProtectedItem() (*ProtectedItem, bool) +1. AzureFileshareProtectedItem.MarshalJSON() ([]byte, error) +1. AzureFileshareProtectedItemExtendedInfo.MarshalJSON() ([]byte, error) +1. AzureIaaSClassicComputeVMContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsDpmContainer() (*DpmContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsGenericContainer() (*GenericContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsMabContainer() (*MabContainer, bool) +1. AzureIaaSClassicComputeVMContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. AzureIaaSClassicComputeVMContainer.MarshalJSON() ([]byte, error) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureIaaSClassicComputeVMProtectableItem.MarshalJSON() ([]byte, error) +1. AzureIaaSClassicComputeVMProtectedItem.AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) +1. AzureIaaSClassicComputeVMProtectedItem.AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) +1. AzureIaaSClassicComputeVMProtectedItem.AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) +1. AzureIaaSClassicComputeVMProtectedItem.AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) +1. AzureIaaSClassicComputeVMProtectedItem.AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) +1. AzureIaaSClassicComputeVMProtectedItem.AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) +1. AzureIaaSClassicComputeVMProtectedItem.AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) +1. AzureIaaSClassicComputeVMProtectedItem.AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) +1. AzureIaaSClassicComputeVMProtectedItem.AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) +1. AzureIaaSClassicComputeVMProtectedItem.AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) +1. AzureIaaSClassicComputeVMProtectedItem.AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) +1. AzureIaaSClassicComputeVMProtectedItem.AsBasicProtectedItem() (BasicProtectedItem, bool) +1. AzureIaaSClassicComputeVMProtectedItem.AsDPMProtectedItem() (*DPMProtectedItem, bool) +1. AzureIaaSClassicComputeVMProtectedItem.AsGenericProtectedItem() (*GenericProtectedItem, bool) +1. AzureIaaSClassicComputeVMProtectedItem.AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) +1. AzureIaaSClassicComputeVMProtectedItem.AsProtectedItem() (*ProtectedItem, bool) +1. AzureIaaSClassicComputeVMProtectedItem.MarshalJSON() ([]byte, error) +1. AzureIaaSComputeVMContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. AzureIaaSComputeVMContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. AzureIaaSComputeVMContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. AzureIaaSComputeVMContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. AzureIaaSComputeVMContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. AzureIaaSComputeVMContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. AzureIaaSComputeVMContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. AzureIaaSComputeVMContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. AzureIaaSComputeVMContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. AzureIaaSComputeVMContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. AzureIaaSComputeVMContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. AzureIaaSComputeVMContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. AzureIaaSComputeVMContainer.AsDpmContainer() (*DpmContainer, bool) +1. AzureIaaSComputeVMContainer.AsGenericContainer() (*GenericContainer, bool) +1. AzureIaaSComputeVMContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. AzureIaaSComputeVMContainer.AsMabContainer() (*MabContainer, bool) +1. AzureIaaSComputeVMContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. AzureIaaSComputeVMContainer.MarshalJSON() ([]byte, error) +1. AzureIaaSComputeVMProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureIaaSComputeVMProtectableItem.MarshalJSON() ([]byte, error) +1. AzureIaaSComputeVMProtectedItem.AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) +1. AzureIaaSComputeVMProtectedItem.AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) +1. AzureIaaSComputeVMProtectedItem.AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) +1. AzureIaaSComputeVMProtectedItem.AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) +1. AzureIaaSComputeVMProtectedItem.AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) +1. AzureIaaSComputeVMProtectedItem.AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) +1. AzureIaaSComputeVMProtectedItem.AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) +1. AzureIaaSComputeVMProtectedItem.AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) +1. AzureIaaSComputeVMProtectedItem.AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) +1. AzureIaaSComputeVMProtectedItem.AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) +1. AzureIaaSComputeVMProtectedItem.AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) +1. AzureIaaSComputeVMProtectedItem.AsBasicProtectedItem() (BasicProtectedItem, bool) +1. AzureIaaSComputeVMProtectedItem.AsDPMProtectedItem() (*DPMProtectedItem, bool) +1. AzureIaaSComputeVMProtectedItem.AsGenericProtectedItem() (*GenericProtectedItem, bool) +1. AzureIaaSComputeVMProtectedItem.AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) +1. AzureIaaSComputeVMProtectedItem.AsProtectedItem() (*ProtectedItem, bool) +1. AzureIaaSComputeVMProtectedItem.MarshalJSON() ([]byte, error) +1. AzureIaaSVMErrorInfo.MarshalJSON() ([]byte, error) +1. AzureIaaSVMHealthDetails.MarshalJSON() ([]byte, error) +1. AzureIaaSVMJob.AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) +1. AzureIaaSVMJob.AsAzureStorageJob() (*AzureStorageJob, bool) +1. AzureIaaSVMJob.AsAzureWorkloadJob() (*AzureWorkloadJob, bool) +1. AzureIaaSVMJob.AsBasicJob() (BasicJob, bool) +1. AzureIaaSVMJob.AsDpmJob() (*DpmJob, bool) +1. AzureIaaSVMJob.AsJob() (*Job, bool) +1. AzureIaaSVMJob.AsMabJob() (*MabJob, bool) +1. AzureIaaSVMJob.MarshalJSON() ([]byte, error) +1. AzureIaaSVMJobExtendedInfo.MarshalJSON() ([]byte, error) +1. AzureIaaSVMProtectedItem.AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) +1. AzureIaaSVMProtectedItem.AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) +1. AzureIaaSVMProtectedItem.AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) +1. AzureIaaSVMProtectedItem.AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) +1. AzureIaaSVMProtectedItem.AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) +1. AzureIaaSVMProtectedItem.AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) +1. AzureIaaSVMProtectedItem.AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) +1. AzureIaaSVMProtectedItem.AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) +1. AzureIaaSVMProtectedItem.AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) +1. AzureIaaSVMProtectedItem.AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) +1. AzureIaaSVMProtectedItem.AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) +1. AzureIaaSVMProtectedItem.AsBasicProtectedItem() (BasicProtectedItem, bool) +1. AzureIaaSVMProtectedItem.AsDPMProtectedItem() (*DPMProtectedItem, bool) +1. AzureIaaSVMProtectedItem.AsGenericProtectedItem() (*GenericProtectedItem, bool) +1. AzureIaaSVMProtectedItem.AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) +1. AzureIaaSVMProtectedItem.AsProtectedItem() (*ProtectedItem, bool) +1. AzureIaaSVMProtectedItem.MarshalJSON() ([]byte, error) +1. AzureIaaSVMProtectionPolicy.AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) +1. AzureIaaSVMProtectionPolicy.AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) +1. AzureIaaSVMProtectionPolicy.AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) +1. AzureIaaSVMProtectionPolicy.AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) +1. AzureIaaSVMProtectionPolicy.AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) +1. AzureIaaSVMProtectionPolicy.AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) +1. AzureIaaSVMProtectionPolicy.AsMabProtectionPolicy() (*MabProtectionPolicy, bool) +1. AzureIaaSVMProtectionPolicy.AsProtectionPolicy() (*ProtectionPolicy, bool) +1. AzureIaaSVMProtectionPolicy.MarshalJSON() ([]byte, error) +1. AzureRecoveryServiceVaultProtectionIntent.AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsBasicProtectionIntent() (BasicProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsProtectionIntent() (*ProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.MarshalJSON() ([]byte, error) +1. AzureResourceProtectionIntent.AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsBasicProtectionIntent() (BasicProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsProtectionIntent() (*ProtectionIntent, bool) +1. AzureResourceProtectionIntent.MarshalJSON() ([]byte, error) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsDpmContainer() (*DpmContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsGenericContainer() (*GenericContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsMabContainer() (*MabContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. AzureSQLAGWorkloadContainerProtectionContainer.MarshalJSON() ([]byte, error) +1. AzureSQLContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. AzureSQLContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. AzureSQLContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. AzureSQLContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. AzureSQLContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. AzureSQLContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. AzureSQLContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. AzureSQLContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. AzureSQLContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. AzureSQLContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. AzureSQLContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. AzureSQLContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. AzureSQLContainer.AsDpmContainer() (*DpmContainer, bool) +1. AzureSQLContainer.AsGenericContainer() (*GenericContainer, bool) +1. AzureSQLContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. AzureSQLContainer.AsMabContainer() (*MabContainer, bool) +1. AzureSQLContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. AzureSQLContainer.MarshalJSON() ([]byte, error) +1. AzureSQLProtectedItem.AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) +1. AzureSQLProtectedItem.AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) +1. AzureSQLProtectedItem.AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) +1. AzureSQLProtectedItem.AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) +1. AzureSQLProtectedItem.AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) +1. AzureSQLProtectedItem.AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) +1. AzureSQLProtectedItem.AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) +1. AzureSQLProtectedItem.AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) +1. AzureSQLProtectedItem.AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) +1. AzureSQLProtectedItem.AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) +1. AzureSQLProtectedItem.AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) +1. AzureSQLProtectedItem.AsBasicProtectedItem() (BasicProtectedItem, bool) +1. AzureSQLProtectedItem.AsDPMProtectedItem() (*DPMProtectedItem, bool) +1. AzureSQLProtectedItem.AsGenericProtectedItem() (*GenericProtectedItem, bool) +1. AzureSQLProtectedItem.AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) +1. AzureSQLProtectedItem.AsProtectedItem() (*ProtectedItem, bool) +1. AzureSQLProtectedItem.MarshalJSON() ([]byte, error) +1. AzureSQLProtectionPolicy.AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) +1. AzureSQLProtectionPolicy.AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) +1. AzureSQLProtectionPolicy.AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) +1. AzureSQLProtectionPolicy.AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) +1. AzureSQLProtectionPolicy.AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) +1. AzureSQLProtectionPolicy.AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) +1. AzureSQLProtectionPolicy.AsMabProtectionPolicy() (*MabProtectionPolicy, bool) +1. AzureSQLProtectionPolicy.AsProtectionPolicy() (*ProtectionPolicy, bool) +1. AzureSQLProtectionPolicy.MarshalJSON() ([]byte, error) +1. AzureStorageContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. AzureStorageContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. AzureStorageContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. AzureStorageContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. AzureStorageContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. AzureStorageContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. AzureStorageContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. AzureStorageContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. AzureStorageContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. AzureStorageContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. AzureStorageContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. AzureStorageContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. AzureStorageContainer.AsDpmContainer() (*DpmContainer, bool) +1. AzureStorageContainer.AsGenericContainer() (*GenericContainer, bool) +1. AzureStorageContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. AzureStorageContainer.AsMabContainer() (*MabContainer, bool) +1. AzureStorageContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. AzureStorageContainer.MarshalJSON() ([]byte, error) +1. AzureStorageJob.AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) +1. AzureStorageJob.AsAzureStorageJob() (*AzureStorageJob, bool) +1. AzureStorageJob.AsAzureWorkloadJob() (*AzureWorkloadJob, bool) +1. AzureStorageJob.AsBasicJob() (BasicJob, bool) +1. AzureStorageJob.AsDpmJob() (*DpmJob, bool) +1. AzureStorageJob.AsJob() (*Job, bool) +1. AzureStorageJob.AsMabJob() (*MabJob, bool) +1. AzureStorageJob.MarshalJSON() ([]byte, error) +1. AzureStorageJobExtendedInfo.MarshalJSON() ([]byte, error) +1. AzureStorageProtectableContainer.AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) +1. AzureStorageProtectableContainer.AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) +1. AzureStorageProtectableContainer.AsBasicProtectableContainer() (BasicProtectableContainer, bool) +1. AzureStorageProtectableContainer.AsProtectableContainer() (*ProtectableContainer, bool) +1. AzureStorageProtectableContainer.MarshalJSON() ([]byte, error) +1. AzureVMAppContainerProtectableContainer.AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) +1. AzureVMAppContainerProtectableContainer.AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) +1. AzureVMAppContainerProtectableContainer.AsBasicProtectableContainer() (BasicProtectableContainer, bool) +1. AzureVMAppContainerProtectableContainer.AsProtectableContainer() (*ProtectableContainer, bool) +1. AzureVMAppContainerProtectableContainer.MarshalJSON() ([]byte, error) +1. AzureVMAppContainerProtectionContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsDpmContainer() (*DpmContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsGenericContainer() (*GenericContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsMabContainer() (*MabContainer, bool) +1. AzureVMAppContainerProtectionContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. AzureVMAppContainerProtectionContainer.MarshalJSON() ([]byte, error) +1. AzureVMResourceFeatureSupportRequest.AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) +1. AzureVMResourceFeatureSupportRequest.AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) +1. AzureVMResourceFeatureSupportRequest.AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) +1. AzureVMResourceFeatureSupportRequest.AsFeatureSupportRequest() (*FeatureSupportRequest, bool) +1. AzureVMResourceFeatureSupportRequest.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadItem.AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +1. AzureVMWorkloadItem.AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) +1. AzureVMWorkloadItem.AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) +1. AzureVMWorkloadItem.AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) +1. AzureVMWorkloadItem.AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) +1. AzureVMWorkloadItem.AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) +1. AzureVMWorkloadItem.AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) +1. AzureVMWorkloadItem.AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) +1. AzureVMWorkloadItem.AsBasicWorkloadItem() (BasicWorkloadItem, bool) +1. AzureVMWorkloadItem.AsWorkloadItem() (*WorkloadItem, bool) +1. AzureVMWorkloadItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureVMWorkloadProtectableItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadProtectedItem.AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) +1. AzureVMWorkloadProtectedItem.AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) +1. AzureVMWorkloadProtectedItem.AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) +1. AzureVMWorkloadProtectedItem.AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) +1. AzureVMWorkloadProtectedItem.AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) +1. AzureVMWorkloadProtectedItem.AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) +1. AzureVMWorkloadProtectedItem.AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) +1. AzureVMWorkloadProtectedItem.AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) +1. AzureVMWorkloadProtectedItem.AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) +1. AzureVMWorkloadProtectedItem.AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) +1. AzureVMWorkloadProtectedItem.AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) +1. AzureVMWorkloadProtectedItem.AsBasicProtectedItem() (BasicProtectedItem, bool) +1. AzureVMWorkloadProtectedItem.AsDPMProtectedItem() (*DPMProtectedItem, bool) +1. AzureVMWorkloadProtectedItem.AsGenericProtectedItem() (*GenericProtectedItem, bool) +1. AzureVMWorkloadProtectedItem.AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) +1. AzureVMWorkloadProtectedItem.AsProtectedItem() (*ProtectedItem, bool) +1. AzureVMWorkloadProtectedItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadProtectionPolicy.AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) +1. AzureVMWorkloadProtectionPolicy.AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) +1. AzureVMWorkloadProtectionPolicy.AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) +1. AzureVMWorkloadProtectionPolicy.AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) +1. AzureVMWorkloadProtectionPolicy.AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) +1. AzureVMWorkloadProtectionPolicy.AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) +1. AzureVMWorkloadProtectionPolicy.AsMabProtectionPolicy() (*MabProtectionPolicy, bool) +1. AzureVMWorkloadProtectionPolicy.AsProtectionPolicy() (*ProtectionPolicy, bool) +1. AzureVMWorkloadProtectionPolicy.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSAPAseDatabaseProtectedItem.AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) +1. AzureVMWorkloadSAPAseDatabaseProtectedItem.AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) +1. AzureVMWorkloadSAPAseDatabaseProtectedItem.AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) +1. AzureVMWorkloadSAPAseDatabaseProtectedItem.AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) +1. AzureVMWorkloadSAPAseDatabaseProtectedItem.AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) +1. AzureVMWorkloadSAPAseDatabaseProtectedItem.AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) +1. AzureVMWorkloadSAPAseDatabaseProtectedItem.AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) +1. AzureVMWorkloadSAPAseDatabaseProtectedItem.AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) +1. AzureVMWorkloadSAPAseDatabaseProtectedItem.AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) +1. AzureVMWorkloadSAPAseDatabaseProtectedItem.AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) +1. AzureVMWorkloadSAPAseDatabaseProtectedItem.AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) +1. AzureVMWorkloadSAPAseDatabaseProtectedItem.AsBasicProtectedItem() (BasicProtectedItem, bool) +1. AzureVMWorkloadSAPAseDatabaseProtectedItem.AsDPMProtectedItem() (*DPMProtectedItem, bool) +1. AzureVMWorkloadSAPAseDatabaseProtectedItem.AsGenericProtectedItem() (*GenericProtectedItem, bool) +1. AzureVMWorkloadSAPAseDatabaseProtectedItem.AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) +1. AzureVMWorkloadSAPAseDatabaseProtectedItem.AsProtectedItem() (*ProtectedItem, bool) +1. AzureVMWorkloadSAPAseDatabaseProtectedItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsBasicWorkloadItem() (BasicWorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.AsWorkloadItem() (*WorkloadItem, bool) +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPAseSystemProtectableItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsBasicWorkloadItem() (BasicWorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.AsWorkloadItem() (*WorkloadItem, bool) +1. AzureVMWorkloadSAPAseSystemWorkloadItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSAPHanaDatabaseProtectedItem.AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectedItem.AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectedItem.AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectedItem.AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectedItem.AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectedItem.AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectedItem.AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectedItem.AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectedItem.AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectedItem.AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectedItem.AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectedItem.AsBasicProtectedItem() (BasicProtectedItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectedItem.AsDPMProtectedItem() (*DPMProtectedItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectedItem.AsGenericProtectedItem() (*GenericProtectedItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectedItem.AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectedItem.AsProtectedItem() (*ProtectedItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseProtectedItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsBasicWorkloadItem() (BasicWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.AsWorkloadItem() (*WorkloadItem, bool) +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureVMWorkloadSAPHanaSystemProtectableItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsBasicWorkloadItem() (BasicWorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.AsWorkloadItem() (*WorkloadItem, bool) +1. AzureVMWorkloadSAPHanaSystemWorkloadItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectableItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSQLDatabaseProtectedItem.AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectedItem.AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectedItem.AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectedItem.AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectedItem.AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectedItem.AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectedItem.AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectedItem.AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectedItem.AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectedItem.AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectedItem.AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectedItem.AsBasicProtectedItem() (BasicProtectedItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectedItem.AsDPMProtectedItem() (*DPMProtectedItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectedItem.AsGenericProtectedItem() (*GenericProtectedItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectedItem.AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectedItem.AsProtectedItem() (*ProtectedItem, bool) +1. AzureVMWorkloadSQLDatabaseProtectedItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsBasicWorkloadItem() (BasicWorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.AsWorkloadItem() (*WorkloadItem, bool) +1. AzureVMWorkloadSQLDatabaseWorkloadItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. AzureVMWorkloadSQLInstanceProtectableItem.MarshalJSON() ([]byte, error) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsBasicWorkloadItem() (BasicWorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.AsWorkloadItem() (*WorkloadItem, bool) +1. AzureVMWorkloadSQLInstanceWorkloadItem.MarshalJSON() ([]byte, error) +1. AzureWorkloadAutoProtectionIntent.AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsBasicProtectionIntent() (BasicProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsProtectionIntent() (*ProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.MarshalJSON() ([]byte, error) +1. AzureWorkloadBackupRequest.AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) +1. AzureWorkloadBackupRequest.AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) +1. AzureWorkloadBackupRequest.AsBasicRequest() (BasicRequest, bool) +1. AzureWorkloadBackupRequest.AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) +1. AzureWorkloadBackupRequest.AsRequest() (*Request, bool) +1. AzureWorkloadBackupRequest.MarshalJSON() ([]byte, error) +1. AzureWorkloadContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. AzureWorkloadContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. AzureWorkloadContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. AzureWorkloadContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. AzureWorkloadContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. AzureWorkloadContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. AzureWorkloadContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. AzureWorkloadContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. AzureWorkloadContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. AzureWorkloadContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. AzureWorkloadContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. AzureWorkloadContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. AzureWorkloadContainer.AsDpmContainer() (*DpmContainer, bool) +1. AzureWorkloadContainer.AsGenericContainer() (*GenericContainer, bool) +1. AzureWorkloadContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. AzureWorkloadContainer.AsMabContainer() (*MabContainer, bool) +1. AzureWorkloadContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. AzureWorkloadContainer.MarshalJSON() ([]byte, error) +1. AzureWorkloadJob.AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) +1. AzureWorkloadJob.AsAzureStorageJob() (*AzureStorageJob, bool) +1. AzureWorkloadJob.AsAzureWorkloadJob() (*AzureWorkloadJob, bool) +1. AzureWorkloadJob.AsBasicJob() (BasicJob, bool) +1. AzureWorkloadJob.AsDpmJob() (*DpmJob, bool) +1. AzureWorkloadJob.AsJob() (*Job, bool) +1. AzureWorkloadJob.AsMabJob() (*MabJob, bool) +1. AzureWorkloadJob.MarshalJSON() ([]byte, error) +1. AzureWorkloadJobExtendedInfo.MarshalJSON() ([]byte, error) +1. AzureWorkloadPointInTimeRecoveryPoint.AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) +1. AzureWorkloadPointInTimeRecoveryPoint.AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) +1. AzureWorkloadPointInTimeRecoveryPoint.AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) +1. AzureWorkloadPointInTimeRecoveryPoint.AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) +1. AzureWorkloadPointInTimeRecoveryPoint.AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) +1. AzureWorkloadPointInTimeRecoveryPoint.AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) +1. AzureWorkloadPointInTimeRecoveryPoint.AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) +1. AzureWorkloadPointInTimeRecoveryPoint.AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) +1. AzureWorkloadPointInTimeRecoveryPoint.AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) +1. AzureWorkloadPointInTimeRecoveryPoint.AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) +1. AzureWorkloadPointInTimeRecoveryPoint.AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) +1. AzureWorkloadPointInTimeRecoveryPoint.AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) +1. AzureWorkloadPointInTimeRecoveryPoint.AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) +1. AzureWorkloadPointInTimeRecoveryPoint.AsRecoveryPoint() (*RecoveryPoint, bool) +1. AzureWorkloadPointInTimeRecoveryPoint.MarshalJSON() ([]byte, error) +1. AzureWorkloadPointInTimeRestoreRequest.AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) +1. AzureWorkloadPointInTimeRestoreRequest.AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) +1. AzureWorkloadPointInTimeRestoreRequest.AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) +1. AzureWorkloadPointInTimeRestoreRequest.AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) +1. AzureWorkloadPointInTimeRestoreRequest.AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) +1. AzureWorkloadPointInTimeRestoreRequest.AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) +1. AzureWorkloadPointInTimeRestoreRequest.AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) +1. AzureWorkloadPointInTimeRestoreRequest.AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) +1. AzureWorkloadPointInTimeRestoreRequest.AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) +1. AzureWorkloadPointInTimeRestoreRequest.AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) +1. AzureWorkloadPointInTimeRestoreRequest.AsBasicRestoreRequest() (BasicRestoreRequest, bool) +1. AzureWorkloadPointInTimeRestoreRequest.AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) +1. AzureWorkloadPointInTimeRestoreRequest.AsRestoreRequest() (*RestoreRequest, bool) +1. AzureWorkloadPointInTimeRestoreRequest.MarshalJSON() ([]byte, error) +1. AzureWorkloadRecoveryPoint.AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) +1. AzureWorkloadRecoveryPoint.AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) +1. AzureWorkloadRecoveryPoint.AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) +1. AzureWorkloadRecoveryPoint.AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) +1. AzureWorkloadRecoveryPoint.AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) +1. AzureWorkloadRecoveryPoint.AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) +1. AzureWorkloadRecoveryPoint.AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) +1. AzureWorkloadRecoveryPoint.AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) +1. AzureWorkloadRecoveryPoint.AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) +1. AzureWorkloadRecoveryPoint.AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) +1. AzureWorkloadRecoveryPoint.AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) +1. AzureWorkloadRecoveryPoint.AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) +1. AzureWorkloadRecoveryPoint.AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) +1. AzureWorkloadRecoveryPoint.AsRecoveryPoint() (*RecoveryPoint, bool) +1. AzureWorkloadRecoveryPoint.MarshalJSON() ([]byte, error) +1. AzureWorkloadRestoreRequest.AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) +1. AzureWorkloadRestoreRequest.AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) +1. AzureWorkloadRestoreRequest.AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) +1. AzureWorkloadRestoreRequest.AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) +1. AzureWorkloadRestoreRequest.AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) +1. AzureWorkloadRestoreRequest.AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) +1. AzureWorkloadRestoreRequest.AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) +1. AzureWorkloadRestoreRequest.AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) +1. AzureWorkloadRestoreRequest.AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) +1. AzureWorkloadRestoreRequest.AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) +1. AzureWorkloadRestoreRequest.AsBasicRestoreRequest() (BasicRestoreRequest, bool) +1. AzureWorkloadRestoreRequest.AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) +1. AzureWorkloadRestoreRequest.AsRestoreRequest() (*RestoreRequest, bool) +1. AzureWorkloadRestoreRequest.MarshalJSON() ([]byte, error) +1. AzureWorkloadSAPHanaPointInTimeRecoveryPoint.AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) +1. AzureWorkloadSAPHanaPointInTimeRecoveryPoint.AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) +1. AzureWorkloadSAPHanaPointInTimeRecoveryPoint.AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) +1. AzureWorkloadSAPHanaPointInTimeRecoveryPoint.AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) +1. AzureWorkloadSAPHanaPointInTimeRecoveryPoint.AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) +1. AzureWorkloadSAPHanaPointInTimeRecoveryPoint.AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) +1. AzureWorkloadSAPHanaPointInTimeRecoveryPoint.AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) +1. AzureWorkloadSAPHanaPointInTimeRecoveryPoint.AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) +1. AzureWorkloadSAPHanaPointInTimeRecoveryPoint.AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) +1. AzureWorkloadSAPHanaPointInTimeRecoveryPoint.AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) +1. AzureWorkloadSAPHanaPointInTimeRecoveryPoint.AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) +1. AzureWorkloadSAPHanaPointInTimeRecoveryPoint.AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) +1. AzureWorkloadSAPHanaPointInTimeRecoveryPoint.AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) +1. AzureWorkloadSAPHanaPointInTimeRecoveryPoint.AsRecoveryPoint() (*RecoveryPoint, bool) +1. AzureWorkloadSAPHanaPointInTimeRecoveryPoint.MarshalJSON() ([]byte, error) +1. AzureWorkloadSAPHanaPointInTimeRestoreRequest.AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) +1. AzureWorkloadSAPHanaPointInTimeRestoreRequest.AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) +1. AzureWorkloadSAPHanaPointInTimeRestoreRequest.AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) +1. AzureWorkloadSAPHanaPointInTimeRestoreRequest.AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) +1. AzureWorkloadSAPHanaPointInTimeRestoreRequest.AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) +1. AzureWorkloadSAPHanaPointInTimeRestoreRequest.AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) +1. AzureWorkloadSAPHanaPointInTimeRestoreRequest.AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) +1. AzureWorkloadSAPHanaPointInTimeRestoreRequest.AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) +1. AzureWorkloadSAPHanaPointInTimeRestoreRequest.AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) +1. AzureWorkloadSAPHanaPointInTimeRestoreRequest.AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) +1. AzureWorkloadSAPHanaPointInTimeRestoreRequest.AsBasicRestoreRequest() (BasicRestoreRequest, bool) +1. AzureWorkloadSAPHanaPointInTimeRestoreRequest.AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) +1. AzureWorkloadSAPHanaPointInTimeRestoreRequest.AsRestoreRequest() (*RestoreRequest, bool) +1. AzureWorkloadSAPHanaPointInTimeRestoreRequest.MarshalJSON() ([]byte, error) +1. AzureWorkloadSAPHanaRecoveryPoint.AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) +1. AzureWorkloadSAPHanaRecoveryPoint.AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) +1. AzureWorkloadSAPHanaRecoveryPoint.AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) +1. AzureWorkloadSAPHanaRecoveryPoint.AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) +1. AzureWorkloadSAPHanaRecoveryPoint.AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) +1. AzureWorkloadSAPHanaRecoveryPoint.AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) +1. AzureWorkloadSAPHanaRecoveryPoint.AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) +1. AzureWorkloadSAPHanaRecoveryPoint.AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) +1. AzureWorkloadSAPHanaRecoveryPoint.AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) +1. AzureWorkloadSAPHanaRecoveryPoint.AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) +1. AzureWorkloadSAPHanaRecoveryPoint.AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) +1. AzureWorkloadSAPHanaRecoveryPoint.AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) +1. AzureWorkloadSAPHanaRecoveryPoint.AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) +1. AzureWorkloadSAPHanaRecoveryPoint.AsRecoveryPoint() (*RecoveryPoint, bool) +1. AzureWorkloadSAPHanaRecoveryPoint.MarshalJSON() ([]byte, error) +1. AzureWorkloadSAPHanaRestoreRequest.AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) +1. AzureWorkloadSAPHanaRestoreRequest.AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) +1. AzureWorkloadSAPHanaRestoreRequest.AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) +1. AzureWorkloadSAPHanaRestoreRequest.AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) +1. AzureWorkloadSAPHanaRestoreRequest.AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) +1. AzureWorkloadSAPHanaRestoreRequest.AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) +1. AzureWorkloadSAPHanaRestoreRequest.AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) +1. AzureWorkloadSAPHanaRestoreRequest.AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) +1. AzureWorkloadSAPHanaRestoreRequest.AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) +1. AzureWorkloadSAPHanaRestoreRequest.AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) +1. AzureWorkloadSAPHanaRestoreRequest.AsBasicRestoreRequest() (BasicRestoreRequest, bool) +1. AzureWorkloadSAPHanaRestoreRequest.AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) +1. AzureWorkloadSAPHanaRestoreRequest.AsRestoreRequest() (*RestoreRequest, bool) +1. AzureWorkloadSAPHanaRestoreRequest.MarshalJSON() ([]byte, error) +1. AzureWorkloadSQLAutoProtectionIntent.AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsBasicProtectionIntent() (BasicProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsProtectionIntent() (*ProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.MarshalJSON() ([]byte, error) +1. AzureWorkloadSQLPointInTimeRecoveryPoint.AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) +1. AzureWorkloadSQLPointInTimeRecoveryPoint.AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) +1. AzureWorkloadSQLPointInTimeRecoveryPoint.AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) +1. AzureWorkloadSQLPointInTimeRecoveryPoint.AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) +1. AzureWorkloadSQLPointInTimeRecoveryPoint.AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) +1. AzureWorkloadSQLPointInTimeRecoveryPoint.AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) +1. AzureWorkloadSQLPointInTimeRecoveryPoint.AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) +1. AzureWorkloadSQLPointInTimeRecoveryPoint.AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) +1. AzureWorkloadSQLPointInTimeRecoveryPoint.AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) +1. AzureWorkloadSQLPointInTimeRecoveryPoint.AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) +1. AzureWorkloadSQLPointInTimeRecoveryPoint.AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) +1. AzureWorkloadSQLPointInTimeRecoveryPoint.AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) +1. AzureWorkloadSQLPointInTimeRecoveryPoint.AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) +1. AzureWorkloadSQLPointInTimeRecoveryPoint.AsRecoveryPoint() (*RecoveryPoint, bool) +1. AzureWorkloadSQLPointInTimeRecoveryPoint.MarshalJSON() ([]byte, error) +1. AzureWorkloadSQLPointInTimeRestoreRequest.AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) +1. AzureWorkloadSQLPointInTimeRestoreRequest.AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) +1. AzureWorkloadSQLPointInTimeRestoreRequest.AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) +1. AzureWorkloadSQLPointInTimeRestoreRequest.AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) +1. AzureWorkloadSQLPointInTimeRestoreRequest.AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) +1. AzureWorkloadSQLPointInTimeRestoreRequest.AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) +1. AzureWorkloadSQLPointInTimeRestoreRequest.AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) +1. AzureWorkloadSQLPointInTimeRestoreRequest.AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) +1. AzureWorkloadSQLPointInTimeRestoreRequest.AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) +1. AzureWorkloadSQLPointInTimeRestoreRequest.AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) +1. AzureWorkloadSQLPointInTimeRestoreRequest.AsBasicRestoreRequest() (BasicRestoreRequest, bool) +1. AzureWorkloadSQLPointInTimeRestoreRequest.AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) +1. AzureWorkloadSQLPointInTimeRestoreRequest.AsRestoreRequest() (*RestoreRequest, bool) +1. AzureWorkloadSQLPointInTimeRestoreRequest.MarshalJSON() ([]byte, error) +1. AzureWorkloadSQLRecoveryPoint.AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) +1. AzureWorkloadSQLRecoveryPoint.AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) +1. AzureWorkloadSQLRecoveryPoint.AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) +1. AzureWorkloadSQLRecoveryPoint.AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) +1. AzureWorkloadSQLRecoveryPoint.AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) +1. AzureWorkloadSQLRecoveryPoint.AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) +1. AzureWorkloadSQLRecoveryPoint.AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) +1. AzureWorkloadSQLRecoveryPoint.AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) +1. AzureWorkloadSQLRecoveryPoint.AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) +1. AzureWorkloadSQLRecoveryPoint.AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) +1. AzureWorkloadSQLRecoveryPoint.AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) +1. AzureWorkloadSQLRecoveryPoint.AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) +1. AzureWorkloadSQLRecoveryPoint.AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) +1. AzureWorkloadSQLRecoveryPoint.AsRecoveryPoint() (*RecoveryPoint, bool) +1. AzureWorkloadSQLRecoveryPoint.MarshalJSON() ([]byte, error) +1. AzureWorkloadSQLRecoveryPointExtendedInfo.MarshalJSON() ([]byte, error) +1. AzureWorkloadSQLRestoreRequest.AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) +1. AzureWorkloadSQLRestoreRequest.AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) +1. AzureWorkloadSQLRestoreRequest.AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) +1. AzureWorkloadSQLRestoreRequest.AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) +1. AzureWorkloadSQLRestoreRequest.AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) +1. AzureWorkloadSQLRestoreRequest.AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) +1. AzureWorkloadSQLRestoreRequest.AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) +1. AzureWorkloadSQLRestoreRequest.AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) +1. AzureWorkloadSQLRestoreRequest.AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) +1. AzureWorkloadSQLRestoreRequest.AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) +1. AzureWorkloadSQLRestoreRequest.AsBasicRestoreRequest() (BasicRestoreRequest, bool) +1. AzureWorkloadSQLRestoreRequest.AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) +1. AzureWorkloadSQLRestoreRequest.AsRestoreRequest() (*RestoreRequest, bool) +1. AzureWorkloadSQLRestoreRequest.MarshalJSON() ([]byte, error) +1. BackupsClient.Trigger(context.Context, string, string, string, string, string, RequestResource) (autorest.Response, error) +1. BackupsClient.TriggerPreparer(context.Context, string, string, string, string, string, RequestResource) (*http.Request, error) +1. BackupsClient.TriggerResponder(*http.Response) (autorest.Response, error) +1. BackupsClient.TriggerSender(*http.Request) (*http.Response, error) +1. ClientDiscoveryResponse.IsEmpty() bool +1. ClientDiscoveryResponseIterator.NotDone() bool +1. ClientDiscoveryResponseIterator.Response() ClientDiscoveryResponse +1. ClientDiscoveryResponseIterator.Value() ClientDiscoveryValueForSingleAPI +1. ClientDiscoveryResponsePage.NotDone() bool +1. ClientDiscoveryResponsePage.Response() ClientDiscoveryResponse +1. ClientDiscoveryResponsePage.Values() []ClientDiscoveryValueForSingleAPI +1. DPMProtectedItem.AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) +1. DPMProtectedItem.AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) +1. DPMProtectedItem.AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) +1. DPMProtectedItem.AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) +1. DPMProtectedItem.AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) +1. DPMProtectedItem.AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) +1. DPMProtectedItem.AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) +1. DPMProtectedItem.AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) +1. DPMProtectedItem.AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) +1. DPMProtectedItem.AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) +1. DPMProtectedItem.AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) +1. DPMProtectedItem.AsBasicProtectedItem() (BasicProtectedItem, bool) +1. DPMProtectedItem.AsDPMProtectedItem() (*DPMProtectedItem, bool) +1. DPMProtectedItem.AsGenericProtectedItem() (*GenericProtectedItem, bool) +1. DPMProtectedItem.AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) +1. DPMProtectedItem.AsProtectedItem() (*ProtectedItem, bool) +1. DPMProtectedItem.MarshalJSON() ([]byte, error) +1. DPMProtectedItemExtendedInfo.MarshalJSON() ([]byte, error) +1. DpmBackupEngine.AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) +1. DpmBackupEngine.AsBasicEngineBase() (BasicEngineBase, bool) +1. DpmBackupEngine.AsDpmBackupEngine() (*DpmBackupEngine, bool) +1. DpmBackupEngine.AsEngineBase() (*EngineBase, bool) +1. DpmBackupEngine.MarshalJSON() ([]byte, error) +1. DpmContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. DpmContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. DpmContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. DpmContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. DpmContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. DpmContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. DpmContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. DpmContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. DpmContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. DpmContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. DpmContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. DpmContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. DpmContainer.AsDpmContainer() (*DpmContainer, bool) +1. DpmContainer.AsGenericContainer() (*GenericContainer, bool) +1. DpmContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. DpmContainer.AsMabContainer() (*MabContainer, bool) +1. DpmContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. DpmContainer.MarshalJSON() ([]byte, error) +1. DpmJob.AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) +1. DpmJob.AsAzureStorageJob() (*AzureStorageJob, bool) +1. DpmJob.AsAzureWorkloadJob() (*AzureWorkloadJob, bool) +1. DpmJob.AsBasicJob() (BasicJob, bool) +1. DpmJob.AsDpmJob() (*DpmJob, bool) +1. DpmJob.AsJob() (*Job, bool) +1. DpmJob.AsMabJob() (*MabJob, bool) +1. DpmJob.MarshalJSON() ([]byte, error) +1. DpmJobExtendedInfo.MarshalJSON() ([]byte, error) +1. EngineBase.AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) +1. EngineBase.AsBasicEngineBase() (BasicEngineBase, bool) +1. EngineBase.AsDpmBackupEngine() (*DpmBackupEngine, bool) +1. EngineBase.AsEngineBase() (*EngineBase, bool) +1. EngineBase.MarshalJSON() ([]byte, error) +1. EngineBaseResource.MarshalJSON() ([]byte, error) +1. EngineBaseResourceList.IsEmpty() bool +1. EngineBaseResourceListIterator.NotDone() bool +1. EngineBaseResourceListIterator.Response() EngineBaseResourceList +1. EngineBaseResourceListIterator.Value() EngineBaseResource +1. EngineBaseResourceListPage.NotDone() bool +1. EngineBaseResourceListPage.Response() EngineBaseResourceList +1. EngineBaseResourceListPage.Values() []EngineBaseResource +1. EnginesClient.Get(context.Context, string, string, string, string, string) (EngineBaseResource, error) +1. EnginesClient.GetPreparer(context.Context, string, string, string, string, string) (*http.Request, error) +1. EnginesClient.GetResponder(*http.Response) (EngineBaseResource, error) +1. EnginesClient.GetSender(*http.Request) (*http.Response, error) +1. EnginesClient.List(context.Context, string, string, string, string) (EngineBaseResourceListPage, error) +1. EnginesClient.ListComplete(context.Context, string, string, string, string) (EngineBaseResourceListIterator, error) +1. EnginesClient.ListPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. EnginesClient.ListResponder(*http.Response) (EngineBaseResourceList, error) +1. EnginesClient.ListSender(*http.Request) (*http.Response, error) +1. ErrorDetail.MarshalJSON() ([]byte, error) +1. ExportJobsOperationResultInfo.AsBasicOperationResultInfoBase() (BasicOperationResultInfoBase, bool) +1. ExportJobsOperationResultInfo.AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) +1. ExportJobsOperationResultInfo.AsOperationResultInfo() (*OperationResultInfo, bool) +1. ExportJobsOperationResultInfo.AsOperationResultInfoBase() (*OperationResultInfoBase, bool) +1. ExportJobsOperationResultInfo.MarshalJSON() ([]byte, error) +1. ExportJobsOperationResultsClient.Get(context.Context, string, string, string) (OperationResultInfoBaseResource, error) +1. ExportJobsOperationResultsClient.GetPreparer(context.Context, string, string, string) (*http.Request, error) +1. ExportJobsOperationResultsClient.GetResponder(*http.Response) (OperationResultInfoBaseResource, error) +1. ExportJobsOperationResultsClient.GetSender(*http.Request) (*http.Response, error) +1. FeatureSupportClient.Validate(context.Context, string, BasicFeatureSupportRequest) (AzureVMResourceFeatureSupportResponse, error) +1. FeatureSupportClient.ValidatePreparer(context.Context, string, BasicFeatureSupportRequest) (*http.Request, error) +1. FeatureSupportClient.ValidateResponder(*http.Response) (AzureVMResourceFeatureSupportResponse, error) +1. FeatureSupportClient.ValidateSender(*http.Request) (*http.Response, error) +1. FeatureSupportRequest.AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) +1. FeatureSupportRequest.AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) +1. FeatureSupportRequest.AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) +1. FeatureSupportRequest.AsFeatureSupportRequest() (*FeatureSupportRequest, bool) +1. FeatureSupportRequest.MarshalJSON() ([]byte, error) +1. GenericContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. GenericContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. GenericContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. GenericContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. GenericContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. GenericContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. GenericContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. GenericContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. GenericContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. GenericContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. GenericContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. GenericContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. GenericContainer.AsDpmContainer() (*DpmContainer, bool) +1. GenericContainer.AsGenericContainer() (*GenericContainer, bool) +1. GenericContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. GenericContainer.AsMabContainer() (*MabContainer, bool) +1. GenericContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. GenericContainer.MarshalJSON() ([]byte, error) +1. GenericContainerExtendedInfo.MarshalJSON() ([]byte, error) +1. GenericProtectedItem.AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) +1. GenericProtectedItem.AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) +1. GenericProtectedItem.AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) +1. GenericProtectedItem.AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) +1. GenericProtectedItem.AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) +1. GenericProtectedItem.AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) +1. GenericProtectedItem.AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) +1. GenericProtectedItem.AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) +1. GenericProtectedItem.AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) +1. GenericProtectedItem.AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) +1. GenericProtectedItem.AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) +1. GenericProtectedItem.AsBasicProtectedItem() (BasicProtectedItem, bool) +1. GenericProtectedItem.AsDPMProtectedItem() (*DPMProtectedItem, bool) +1. GenericProtectedItem.AsGenericProtectedItem() (*GenericProtectedItem, bool) +1. GenericProtectedItem.AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) +1. GenericProtectedItem.AsProtectedItem() (*ProtectedItem, bool) +1. GenericProtectedItem.MarshalJSON() ([]byte, error) +1. GenericProtectionPolicy.AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) +1. GenericProtectionPolicy.AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) +1. GenericProtectionPolicy.AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) +1. GenericProtectionPolicy.AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) +1. GenericProtectionPolicy.AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) +1. GenericProtectionPolicy.AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) +1. GenericProtectionPolicy.AsMabProtectionPolicy() (*MabProtectionPolicy, bool) +1. GenericProtectionPolicy.AsProtectionPolicy() (*ProtectionPolicy, bool) +1. GenericProtectionPolicy.MarshalJSON() ([]byte, error) +1. GenericRecoveryPoint.AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) +1. GenericRecoveryPoint.AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) +1. GenericRecoveryPoint.AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) +1. GenericRecoveryPoint.AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) +1. GenericRecoveryPoint.AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) +1. GenericRecoveryPoint.AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) +1. GenericRecoveryPoint.AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) +1. GenericRecoveryPoint.AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) +1. GenericRecoveryPoint.AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) +1. GenericRecoveryPoint.AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) +1. GenericRecoveryPoint.AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) +1. GenericRecoveryPoint.AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) +1. GenericRecoveryPoint.AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) +1. GenericRecoveryPoint.AsRecoveryPoint() (*RecoveryPoint, bool) +1. GenericRecoveryPoint.MarshalJSON() ([]byte, error) +1. ILRRequest.AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) +1. ILRRequest.AsBasicILRRequest() (BasicILRRequest, bool) +1. ILRRequest.AsILRRequest() (*ILRRequest, bool) +1. ILRRequest.AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) +1. ILRRequest.MarshalJSON() ([]byte, error) +1. ILRRequestResource.MarshalJSON() ([]byte, error) +1. IaaSVMContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. IaaSVMContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. IaaSVMContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. IaaSVMContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. IaaSVMContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. IaaSVMContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. IaaSVMContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. IaaSVMContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. IaaSVMContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. IaaSVMContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. IaaSVMContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. IaaSVMContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. IaaSVMContainer.AsDpmContainer() (*DpmContainer, bool) +1. IaaSVMContainer.AsGenericContainer() (*GenericContainer, bool) +1. IaaSVMContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. IaaSVMContainer.AsMabContainer() (*MabContainer, bool) +1. IaaSVMContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. IaaSVMContainer.MarshalJSON() ([]byte, error) +1. IaaSVMProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. IaaSVMProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. IaaSVMProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. IaaSVMProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. IaaSVMProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. IaaSVMProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. IaaSVMProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. IaaSVMProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. IaaSVMProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. IaaSVMProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. IaaSVMProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. IaaSVMProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. IaaSVMProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. IaaSVMProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. IaaSVMProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. IaaSVMProtectableItem.MarshalJSON() ([]byte, error) +1. IaasVMBackupRequest.AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) +1. IaasVMBackupRequest.AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) +1. IaasVMBackupRequest.AsBasicRequest() (BasicRequest, bool) +1. IaasVMBackupRequest.AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) +1. IaasVMBackupRequest.AsRequest() (*Request, bool) +1. IaasVMBackupRequest.MarshalJSON() ([]byte, error) +1. IaasVMILRRegistrationRequest.AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) +1. IaasVMILRRegistrationRequest.AsBasicILRRequest() (BasicILRRequest, bool) +1. IaasVMILRRegistrationRequest.AsILRRequest() (*ILRRequest, bool) +1. IaasVMILRRegistrationRequest.AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) +1. IaasVMILRRegistrationRequest.MarshalJSON() ([]byte, error) +1. IaasVMRecoveryPoint.AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) +1. IaasVMRecoveryPoint.AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) +1. IaasVMRecoveryPoint.AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) +1. IaasVMRecoveryPoint.AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) +1. IaasVMRecoveryPoint.AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) +1. IaasVMRecoveryPoint.AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) +1. IaasVMRecoveryPoint.AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) +1. IaasVMRecoveryPoint.AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) +1. IaasVMRecoveryPoint.AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) +1. IaasVMRecoveryPoint.AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) +1. IaasVMRecoveryPoint.AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) +1. IaasVMRecoveryPoint.AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) +1. IaasVMRecoveryPoint.AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) +1. IaasVMRecoveryPoint.AsRecoveryPoint() (*RecoveryPoint, bool) +1. IaasVMRecoveryPoint.MarshalJSON() ([]byte, error) +1. IaasVMRestoreRequest.AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) +1. IaasVMRestoreRequest.AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) +1. IaasVMRestoreRequest.AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) +1. IaasVMRestoreRequest.AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) +1. IaasVMRestoreRequest.AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) +1. IaasVMRestoreRequest.AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) +1. IaasVMRestoreRequest.AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) +1. IaasVMRestoreRequest.AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) +1. IaasVMRestoreRequest.AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) +1. IaasVMRestoreRequest.AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) +1. IaasVMRestoreRequest.AsBasicRestoreRequest() (BasicRestoreRequest, bool) +1. IaasVMRestoreRequest.AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) +1. IaasVMRestoreRequest.AsRestoreRequest() (*RestoreRequest, bool) +1. IaasVMRestoreRequest.MarshalJSON() ([]byte, error) +1. InquiryValidation.MarshalJSON() ([]byte, error) +1. ItemLevelRecoveryConnectionsClient.Provision(context.Context, string, string, string, string, string, string, ILRRequestResource) (autorest.Response, error) +1. ItemLevelRecoveryConnectionsClient.ProvisionPreparer(context.Context, string, string, string, string, string, string, ILRRequestResource) (*http.Request, error) +1. ItemLevelRecoveryConnectionsClient.ProvisionResponder(*http.Response) (autorest.Response, error) +1. ItemLevelRecoveryConnectionsClient.ProvisionSender(*http.Request) (*http.Response, error) +1. ItemLevelRecoveryConnectionsClient.Revoke(context.Context, string, string, string, string, string, string) (autorest.Response, error) +1. ItemLevelRecoveryConnectionsClient.RevokePreparer(context.Context, string, string, string, string, string, string) (*http.Request, error) +1. ItemLevelRecoveryConnectionsClient.RevokeResponder(*http.Response) (autorest.Response, error) +1. ItemLevelRecoveryConnectionsClient.RevokeSender(*http.Request) (*http.Response, error) +1. Job.AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) +1. Job.AsAzureStorageJob() (*AzureStorageJob, bool) +1. Job.AsAzureWorkloadJob() (*AzureWorkloadJob, bool) +1. Job.AsBasicJob() (BasicJob, bool) +1. Job.AsDpmJob() (*DpmJob, bool) +1. Job.AsJob() (*Job, bool) +1. Job.AsMabJob() (*MabJob, bool) +1. Job.MarshalJSON() ([]byte, error) +1. JobCancellationsClient.Trigger(context.Context, string, string, string) (autorest.Response, error) +1. JobCancellationsClient.TriggerPreparer(context.Context, string, string, string) (*http.Request, error) +1. JobCancellationsClient.TriggerResponder(*http.Response) (autorest.Response, error) +1. JobCancellationsClient.TriggerSender(*http.Request) (*http.Response, error) +1. JobDetailsClient.Get(context.Context, string, string, string) (JobResource, error) +1. JobDetailsClient.GetPreparer(context.Context, string, string, string) (*http.Request, error) +1. JobDetailsClient.GetResponder(*http.Response) (JobResource, error) +1. JobDetailsClient.GetSender(*http.Request) (*http.Response, error) +1. JobOperationResultsClient.Get(context.Context, string, string, string, string) (autorest.Response, error) +1. JobOperationResultsClient.GetPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. JobOperationResultsClient.GetResponder(*http.Response) (autorest.Response, error) +1. JobOperationResultsClient.GetSender(*http.Request) (*http.Response, error) +1. JobResource.MarshalJSON() ([]byte, error) +1. JobResourceList.IsEmpty() bool +1. JobResourceListIterator.NotDone() bool +1. JobResourceListIterator.Response() JobResourceList +1. JobResourceListIterator.Value() JobResource +1. JobResourceListPage.NotDone() bool +1. JobResourceListPage.Response() JobResourceList +1. JobResourceListPage.Values() []JobResource +1. JobsClient.List(context.Context, string, string, string, string) (JobResourceListPage, error) +1. JobsClient.ListComplete(context.Context, string, string, string, string) (JobResourceListIterator, error) +1. JobsClient.ListPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. JobsClient.ListResponder(*http.Response) (JobResourceList, error) +1. JobsClient.ListSender(*http.Request) (*http.Response, error) +1. JobsGroupClient.Export(context.Context, string, string, string) (autorest.Response, error) +1. JobsGroupClient.ExportPreparer(context.Context, string, string, string) (*http.Request, error) +1. JobsGroupClient.ExportResponder(*http.Response) (autorest.Response, error) +1. JobsGroupClient.ExportSender(*http.Request) (*http.Response, error) +1. LogSchedulePolicy.AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) +1. LogSchedulePolicy.AsLogSchedulePolicy() (*LogSchedulePolicy, bool) +1. LogSchedulePolicy.AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) +1. LogSchedulePolicy.AsSchedulePolicy() (*SchedulePolicy, bool) +1. LogSchedulePolicy.AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) +1. LogSchedulePolicy.MarshalJSON() ([]byte, error) +1. LongTermRetentionPolicy.AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) +1. LongTermRetentionPolicy.AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) +1. LongTermRetentionPolicy.AsRetentionPolicy() (*RetentionPolicy, bool) +1. LongTermRetentionPolicy.AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) +1. LongTermRetentionPolicy.MarshalJSON() ([]byte, error) +1. LongTermSchedulePolicy.AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) +1. LongTermSchedulePolicy.AsLogSchedulePolicy() (*LogSchedulePolicy, bool) +1. LongTermSchedulePolicy.AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) +1. LongTermSchedulePolicy.AsSchedulePolicy() (*SchedulePolicy, bool) +1. LongTermSchedulePolicy.AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) +1. LongTermSchedulePolicy.MarshalJSON() ([]byte, error) +1. MabContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. MabContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. MabContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. MabContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. MabContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. MabContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. MabContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. MabContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. MabContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. MabContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. MabContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. MabContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. MabContainer.AsDpmContainer() (*DpmContainer, bool) +1. MabContainer.AsGenericContainer() (*GenericContainer, bool) +1. MabContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. MabContainer.AsMabContainer() (*MabContainer, bool) +1. MabContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. MabContainer.MarshalJSON() ([]byte, error) +1. MabErrorInfo.MarshalJSON() ([]byte, error) +1. MabFileFolderProtectedItem.AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) +1. MabFileFolderProtectedItem.AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) +1. MabFileFolderProtectedItem.AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) +1. MabFileFolderProtectedItem.AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) +1. MabFileFolderProtectedItem.AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) +1. MabFileFolderProtectedItem.AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) +1. MabFileFolderProtectedItem.AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) +1. MabFileFolderProtectedItem.AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) +1. MabFileFolderProtectedItem.AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) +1. MabFileFolderProtectedItem.AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) +1. MabFileFolderProtectedItem.AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) +1. MabFileFolderProtectedItem.AsBasicProtectedItem() (BasicProtectedItem, bool) +1. MabFileFolderProtectedItem.AsDPMProtectedItem() (*DPMProtectedItem, bool) +1. MabFileFolderProtectedItem.AsGenericProtectedItem() (*GenericProtectedItem, bool) +1. MabFileFolderProtectedItem.AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) +1. MabFileFolderProtectedItem.AsProtectedItem() (*ProtectedItem, bool) +1. MabFileFolderProtectedItem.MarshalJSON() ([]byte, error) +1. MabJob.AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) +1. MabJob.AsAzureStorageJob() (*AzureStorageJob, bool) +1. MabJob.AsAzureWorkloadJob() (*AzureWorkloadJob, bool) +1. MabJob.AsBasicJob() (BasicJob, bool) +1. MabJob.AsDpmJob() (*DpmJob, bool) +1. MabJob.AsJob() (*Job, bool) +1. MabJob.AsMabJob() (*MabJob, bool) +1. MabJob.MarshalJSON() ([]byte, error) +1. MabJobExtendedInfo.MarshalJSON() ([]byte, error) +1. MabProtectionPolicy.AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) +1. MabProtectionPolicy.AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) +1. MabProtectionPolicy.AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) +1. MabProtectionPolicy.AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) +1. MabProtectionPolicy.AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) +1. MabProtectionPolicy.AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) +1. MabProtectionPolicy.AsMabProtectionPolicy() (*MabProtectionPolicy, bool) +1. MabProtectionPolicy.AsProtectionPolicy() (*ProtectionPolicy, bool) +1. MabProtectionPolicy.MarshalJSON() ([]byte, error) +1. NewBackupsClient(string) BackupsClient +1. NewBackupsClientWithBaseURI(string, string) BackupsClient +1. NewClientDiscoveryResponseIterator(ClientDiscoveryResponsePage) ClientDiscoveryResponseIterator +1. NewClientDiscoveryResponsePage(ClientDiscoveryResponse, func(context.Context, ClientDiscoveryResponse) (ClientDiscoveryResponse, error)) ClientDiscoveryResponsePage +1. NewEngineBaseResourceListIterator(EngineBaseResourceListPage) EngineBaseResourceListIterator +1. NewEngineBaseResourceListPage(EngineBaseResourceList, func(context.Context, EngineBaseResourceList) (EngineBaseResourceList, error)) EngineBaseResourceListPage +1. NewEnginesClient(string) EnginesClient +1. NewEnginesClientWithBaseURI(string, string) EnginesClient +1. NewExportJobsOperationResultsClient(string) ExportJobsOperationResultsClient +1. NewExportJobsOperationResultsClientWithBaseURI(string, string) ExportJobsOperationResultsClient +1. NewFeatureSupportClient(string) FeatureSupportClient +1. NewFeatureSupportClientWithBaseURI(string, string) FeatureSupportClient +1. NewItemLevelRecoveryConnectionsClient(string) ItemLevelRecoveryConnectionsClient +1. NewItemLevelRecoveryConnectionsClientWithBaseURI(string, string) ItemLevelRecoveryConnectionsClient +1. NewJobCancellationsClient(string) JobCancellationsClient +1. NewJobCancellationsClientWithBaseURI(string, string) JobCancellationsClient +1. NewJobDetailsClient(string) JobDetailsClient +1. NewJobDetailsClientWithBaseURI(string, string) JobDetailsClient +1. NewJobOperationResultsClient(string) JobOperationResultsClient +1. NewJobOperationResultsClientWithBaseURI(string, string) JobOperationResultsClient +1. NewJobResourceListIterator(JobResourceListPage) JobResourceListIterator +1. NewJobResourceListPage(JobResourceList, func(context.Context, JobResourceList) (JobResourceList, error)) JobResourceListPage +1. NewJobsClient(string) JobsClient +1. NewJobsClientWithBaseURI(string, string) JobsClient +1. NewJobsGroupClient(string) JobsGroupClient +1. NewJobsGroupClientWithBaseURI(string, string) JobsGroupClient +1. NewOperationClient(string) OperationClient +1. NewOperationClientWithBaseURI(string, string) OperationClient +1. NewOperationResultsClient(string) OperationResultsClient +1. NewOperationResultsClientWithBaseURI(string, string) OperationResultsClient +1. NewOperationStatusesClient(string) OperationStatusesClient +1. NewOperationStatusesClientWithBaseURI(string, string) OperationStatusesClient +1. NewOperationsClient(string) OperationsClient +1. NewOperationsClientWithBaseURI(string, string) OperationsClient +1. NewPoliciesClient(string) PoliciesClient +1. NewPoliciesClientWithBaseURI(string, string) PoliciesClient +1. NewProtectableContainerResourceListIterator(ProtectableContainerResourceListPage) ProtectableContainerResourceListIterator +1. NewProtectableContainerResourceListPage(ProtectableContainerResourceList, func(context.Context, ProtectableContainerResourceList) (ProtectableContainerResourceList, error)) ProtectableContainerResourceListPage +1. NewProtectableContainersClient(string) ProtectableContainersClient +1. NewProtectableContainersClientWithBaseURI(string, string) ProtectableContainersClient +1. NewProtectableItemsClient(string) ProtectableItemsClient +1. NewProtectableItemsClientWithBaseURI(string, string) ProtectableItemsClient +1. NewProtectedItemOperationResultsClient(string) ProtectedItemOperationResultsClient +1. NewProtectedItemOperationResultsClientWithBaseURI(string, string) ProtectedItemOperationResultsClient +1. NewProtectedItemOperationStatusesClient(string) ProtectedItemOperationStatusesClient +1. NewProtectedItemOperationStatusesClientWithBaseURI(string, string) ProtectedItemOperationStatusesClient +1. NewProtectedItemResourceListIterator(ProtectedItemResourceListPage) ProtectedItemResourceListIterator +1. NewProtectedItemResourceListPage(ProtectedItemResourceList, func(context.Context, ProtectedItemResourceList) (ProtectedItemResourceList, error)) ProtectedItemResourceListPage +1. NewProtectedItemsClient(string) ProtectedItemsClient +1. NewProtectedItemsClientWithBaseURI(string, string) ProtectedItemsClient +1. NewProtectedItemsGroupClient(string) ProtectedItemsGroupClient +1. NewProtectedItemsGroupClientWithBaseURI(string, string) ProtectedItemsGroupClient +1. NewProtectionContainerOperationResultsClient(string) ProtectionContainerOperationResultsClient +1. NewProtectionContainerOperationResultsClientWithBaseURI(string, string) ProtectionContainerOperationResultsClient +1. NewProtectionContainerRefreshOperationResultsClient(string) ProtectionContainerRefreshOperationResultsClient +1. NewProtectionContainerRefreshOperationResultsClientWithBaseURI(string, string) ProtectionContainerRefreshOperationResultsClient +1. NewProtectionContainerResourceListIterator(ProtectionContainerResourceListPage) ProtectionContainerResourceListIterator +1. NewProtectionContainerResourceListPage(ProtectionContainerResourceList, func(context.Context, ProtectionContainerResourceList) (ProtectionContainerResourceList, error)) ProtectionContainerResourceListPage +1. NewProtectionContainersClient(string) ProtectionContainersClient +1. NewProtectionContainersClientWithBaseURI(string, string) ProtectionContainersClient +1. NewProtectionContainersGroupClient(string) ProtectionContainersGroupClient +1. NewProtectionContainersGroupClientWithBaseURI(string, string) ProtectionContainersGroupClient +1. NewProtectionIntentClient(string) ProtectionIntentClient +1. NewProtectionIntentClientWithBaseURI(string, string) ProtectionIntentClient +1. NewProtectionIntentGroupClient(string) ProtectionIntentGroupClient +1. NewProtectionIntentGroupClientWithBaseURI(string, string) ProtectionIntentGroupClient +1. NewProtectionIntentResourceListIterator(ProtectionIntentResourceListPage) ProtectionIntentResourceListIterator +1. NewProtectionIntentResourceListPage(ProtectionIntentResourceList, func(context.Context, ProtectionIntentResourceList) (ProtectionIntentResourceList, error)) ProtectionIntentResourceListPage +1. NewProtectionPoliciesClient(string) ProtectionPoliciesClient +1. NewProtectionPoliciesClientWithBaseURI(string, string) ProtectionPoliciesClient +1. NewProtectionPolicyOperationResultsClient(string) ProtectionPolicyOperationResultsClient +1. NewProtectionPolicyOperationResultsClientWithBaseURI(string, string) ProtectionPolicyOperationResultsClient +1. NewProtectionPolicyOperationStatusesClient(string) ProtectionPolicyOperationStatusesClient +1. NewProtectionPolicyOperationStatusesClientWithBaseURI(string, string) ProtectionPolicyOperationStatusesClient +1. NewProtectionPolicyResourceListIterator(ProtectionPolicyResourceListPage) ProtectionPolicyResourceListIterator +1. NewProtectionPolicyResourceListPage(ProtectionPolicyResourceList, func(context.Context, ProtectionPolicyResourceList) (ProtectionPolicyResourceList, error)) ProtectionPolicyResourceListPage +1. NewRecoveryPointResourceListIterator(RecoveryPointResourceListPage) RecoveryPointResourceListIterator +1. NewRecoveryPointResourceListPage(RecoveryPointResourceList, func(context.Context, RecoveryPointResourceList) (RecoveryPointResourceList, error)) RecoveryPointResourceListPage +1. NewRecoveryPointsClient(string) RecoveryPointsClient +1. NewRecoveryPointsClientWithBaseURI(string, string) RecoveryPointsClient +1. NewResourceStorageConfigsClient(string) ResourceStorageConfigsClient +1. NewResourceStorageConfigsClientWithBaseURI(string, string) ResourceStorageConfigsClient +1. NewResourceVaultConfigsClient(string) ResourceVaultConfigsClient +1. NewResourceVaultConfigsClientWithBaseURI(string, string) ResourceVaultConfigsClient +1. NewRestoresClient(string) RestoresClient +1. NewRestoresClientWithBaseURI(string, string) RestoresClient +1. NewSecurityPINsClient(string) SecurityPINsClient +1. NewSecurityPINsClientWithBaseURI(string, string) SecurityPINsClient +1. NewStatusClient(string) StatusClient +1. NewStatusClientWithBaseURI(string, string) StatusClient +1. NewUsageSummariesClient(string) UsageSummariesClient +1. NewUsageSummariesClientWithBaseURI(string, string) UsageSummariesClient +1. NewWorkloadItemResourceListIterator(WorkloadItemResourceListPage) WorkloadItemResourceListIterator +1. NewWorkloadItemResourceListPage(WorkloadItemResourceList, func(context.Context, WorkloadItemResourceList) (WorkloadItemResourceList, error)) WorkloadItemResourceListPage +1. NewWorkloadItemsClient(string) WorkloadItemsClient +1. NewWorkloadItemsClientWithBaseURI(string, string) WorkloadItemsClient +1. NewWorkloadProtectableItemResourceListIterator(WorkloadProtectableItemResourceListPage) WorkloadProtectableItemResourceListIterator +1. NewWorkloadProtectableItemResourceListPage(WorkloadProtectableItemResourceList, func(context.Context, WorkloadProtectableItemResourceList) (WorkloadProtectableItemResourceList, error)) WorkloadProtectableItemResourceListPage +1. OperationClient.Validate(context.Context, string, string, BasicValidateOperationRequest) (ValidateOperationsResponse, error) +1. OperationClient.ValidatePreparer(context.Context, string, string, BasicValidateOperationRequest) (*http.Request, error) +1. OperationClient.ValidateResponder(*http.Response) (ValidateOperationsResponse, error) +1. OperationClient.ValidateSender(*http.Request) (*http.Response, error) +1. OperationResultInfo.AsBasicOperationResultInfoBase() (BasicOperationResultInfoBase, bool) +1. OperationResultInfo.AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) +1. OperationResultInfo.AsOperationResultInfo() (*OperationResultInfo, bool) +1. OperationResultInfo.AsOperationResultInfoBase() (*OperationResultInfoBase, bool) +1. OperationResultInfo.MarshalJSON() ([]byte, error) +1. OperationResultInfoBase.AsBasicOperationResultInfoBase() (BasicOperationResultInfoBase, bool) +1. OperationResultInfoBase.AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) +1. OperationResultInfoBase.AsOperationResultInfo() (*OperationResultInfo, bool) +1. OperationResultInfoBase.AsOperationResultInfoBase() (*OperationResultInfoBase, bool) +1. OperationResultInfoBase.MarshalJSON() ([]byte, error) +1. OperationResultInfoBaseResource.MarshalJSON() ([]byte, error) +1. OperationResultsClient.Get(context.Context, string, string, string) (autorest.Response, error) +1. OperationResultsClient.GetPreparer(context.Context, string, string, string) (*http.Request, error) +1. OperationResultsClient.GetResponder(*http.Response) (autorest.Response, error) +1. OperationResultsClient.GetSender(*http.Request) (*http.Response, error) +1. OperationStatusExtendedInfo.AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) +1. OperationStatusExtendedInfo.AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) +1. OperationStatusExtendedInfo.AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) +1. OperationStatusExtendedInfo.AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) +1. OperationStatusExtendedInfo.AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) +1. OperationStatusExtendedInfo.MarshalJSON() ([]byte, error) +1. OperationStatusJobExtendedInfo.AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) +1. OperationStatusJobExtendedInfo.AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) +1. OperationStatusJobExtendedInfo.AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) +1. OperationStatusJobExtendedInfo.AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) +1. OperationStatusJobExtendedInfo.AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) +1. OperationStatusJobExtendedInfo.MarshalJSON() ([]byte, error) +1. OperationStatusJobsExtendedInfo.AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) +1. OperationStatusJobsExtendedInfo.AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) +1. OperationStatusJobsExtendedInfo.AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) +1. OperationStatusJobsExtendedInfo.AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) +1. OperationStatusJobsExtendedInfo.AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) +1. OperationStatusJobsExtendedInfo.MarshalJSON() ([]byte, error) +1. OperationStatusProvisionILRExtendedInfo.AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) +1. OperationStatusProvisionILRExtendedInfo.AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) +1. OperationStatusProvisionILRExtendedInfo.AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) +1. OperationStatusProvisionILRExtendedInfo.AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) +1. OperationStatusProvisionILRExtendedInfo.AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) +1. OperationStatusProvisionILRExtendedInfo.MarshalJSON() ([]byte, error) +1. OperationStatusesClient.Get(context.Context, string, string, string) (OperationStatus, error) +1. OperationStatusesClient.GetPreparer(context.Context, string, string, string) (*http.Request, error) +1. OperationStatusesClient.GetResponder(*http.Response) (OperationStatus, error) +1. OperationStatusesClient.GetSender(*http.Request) (*http.Response, error) +1. OperationWorkerResponse.MarshalJSON() ([]byte, error) +1. OperationsClient.List(context.Context) (ClientDiscoveryResponsePage, error) +1. OperationsClient.ListComplete(context.Context) (ClientDiscoveryResponseIterator, error) +1. OperationsClient.ListPreparer(context.Context) (*http.Request, error) +1. OperationsClient.ListResponder(*http.Response) (ClientDiscoveryResponse, error) +1. OperationsClient.ListSender(*http.Request) (*http.Response, error) +1. PoliciesClient.List(context.Context, string, string, string) (ProtectionPolicyResourceListPage, error) +1. PoliciesClient.ListComplete(context.Context, string, string, string) (ProtectionPolicyResourceListIterator, error) +1. PoliciesClient.ListPreparer(context.Context, string, string, string) (*http.Request, error) +1. PoliciesClient.ListResponder(*http.Response) (ProtectionPolicyResourceList, error) +1. PoliciesClient.ListSender(*http.Request) (*http.Response, error) +1. PossibleAzureFileShareTypeValues() []AzureFileShareType +1. PossibleContainerTypeBasicProtectionContainerValues() []ContainerTypeBasicProtectionContainer +1. PossibleContainerTypeValues() []ContainerType +1. PossibleCopyOptionsValues() []CopyOptions +1. PossibleCreateModeValues() []CreateMode +1. PossibleDataSourceTypeValues() []DataSourceType +1. PossibleDayOfWeekValues() []DayOfWeek +1. PossibleEngineTypeValues() []EngineType +1. PossibleEnhancedSecurityStateValues() []EnhancedSecurityState +1. PossibleFabricNameValues() []FabricName +1. PossibleFeatureTypeValues() []FeatureType +1. PossibleHTTPStatusCodeValues() []HTTPStatusCode +1. PossibleHealthStateValues() []HealthState +1. PossibleHealthStatusValues() []HealthStatus +1. PossibleInquiryStatusValues() []InquiryStatus +1. PossibleIntentItemTypeValues() []IntentItemType +1. PossibleItemTypeValues() []ItemType +1. PossibleJobOperationTypeValues() []JobOperationType +1. PossibleJobStatusValues() []JobStatus +1. PossibleJobSupportedActionValues() []JobSupportedAction +1. PossibleJobTypeValues() []JobType +1. PossibleLastBackupStatusValues() []LastBackupStatus +1. PossibleMabServerTypeValues() []MabServerType +1. PossibleManagementTypeBasicProtectionPolicyValues() []ManagementTypeBasicProtectionPolicy +1. PossibleManagementTypeValues() []ManagementType +1. PossibleMonthOfYearValues() []MonthOfYear +1. PossibleObjectTypeBasicILRRequestValues() []ObjectTypeBasicILRRequest +1. PossibleObjectTypeBasicOperationResultInfoBaseValues() []ObjectTypeBasicOperationResultInfoBase +1. PossibleObjectTypeBasicRecoveryPointValues() []ObjectTypeBasicRecoveryPoint +1. PossibleObjectTypeBasicRequestValues() []ObjectTypeBasicRequest +1. PossibleObjectTypeBasicRestoreRequestValues() []ObjectTypeBasicRestoreRequest +1. PossibleObjectTypeBasicValidateOperationRequestValues() []ObjectTypeBasicValidateOperationRequest +1. PossibleObjectTypeValues() []ObjectType +1. PossibleOperationTypeValues() []OperationType +1. PossibleOverwriteOptionsValues() []OverwriteOptions +1. PossiblePolicyTypeValues() []PolicyType +1. PossibleProtectableContainerTypeValues() []ProtectableContainerType +1. PossibleProtectableItemTypeValues() []ProtectableItemType +1. PossibleProtectedItemHealthStatusValues() []ProtectedItemHealthStatus +1. PossibleProtectedItemStateValues() []ProtectedItemState +1. PossibleProtectedItemTypeValues() []ProtectedItemType +1. PossibleProtectionIntentItemTypeValues() []ProtectionIntentItemType +1. PossibleProtectionStateValues() []ProtectionState +1. PossibleProtectionStatusValues() []ProtectionStatus +1. PossibleRecoveryModeValues() []RecoveryMode +1. PossibleRecoveryPointTierStatusValues() []RecoveryPointTierStatus +1. PossibleRecoveryPointTierTypeValues() []RecoveryPointTierType +1. PossibleRecoveryTypeValues() []RecoveryType +1. PossibleResourceHealthStatusValues() []ResourceHealthStatus +1. PossibleRestorePointQueryTypeValues() []RestorePointQueryType +1. PossibleRestorePointTypeValues() []RestorePointType +1. PossibleRestoreRequestTypeValues() []RestoreRequestType +1. PossibleRetentionDurationTypeValues() []RetentionDurationType +1. PossibleRetentionPolicyTypeValues() []RetentionPolicyType +1. PossibleRetentionScheduleFormatValues() []RetentionScheduleFormat +1. PossibleSQLDataDirectoryTypeValues() []SQLDataDirectoryType +1. PossibleSchedulePolicyTypeValues() []SchedulePolicyType +1. PossibleScheduleRunTypeValues() []ScheduleRunType +1. PossibleSoftDeleteFeatureStateValues() []SoftDeleteFeatureState +1. PossibleStorageTypeStateValues() []StorageTypeState +1. PossibleStorageTypeValues() []StorageType +1. PossibleSupportStatusValues() []SupportStatus +1. PossibleTypeEnumValues() []TypeEnum +1. PossibleTypeValues() []Type +1. PossibleUsagesUnitValues() []UsagesUnit +1. PossibleValidationStatusValues() []ValidationStatus +1. PossibleWeekOfMonthValues() []WeekOfMonth +1. PossibleWorkloadItemTypeBasicWorkloadItemValues() []WorkloadItemTypeBasicWorkloadItem +1. PossibleWorkloadItemTypeValues() []WorkloadItemType +1. PossibleWorkloadTypeValues() []WorkloadType +1. ProtectableContainer.AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) +1. ProtectableContainer.AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) +1. ProtectableContainer.AsBasicProtectableContainer() (BasicProtectableContainer, bool) +1. ProtectableContainer.AsProtectableContainer() (*ProtectableContainer, bool) +1. ProtectableContainer.MarshalJSON() ([]byte, error) +1. ProtectableContainerResource.MarshalJSON() ([]byte, error) +1. ProtectableContainerResourceList.IsEmpty() bool +1. ProtectableContainerResourceListIterator.NotDone() bool +1. ProtectableContainerResourceListIterator.Response() ProtectableContainerResourceList +1. ProtectableContainerResourceListIterator.Value() ProtectableContainerResource +1. ProtectableContainerResourceListPage.NotDone() bool +1. ProtectableContainerResourceListPage.Response() ProtectableContainerResourceList +1. ProtectableContainerResourceListPage.Values() []ProtectableContainerResource +1. ProtectableContainersClient.List(context.Context, string, string, string, string) (ProtectableContainerResourceListPage, error) +1. ProtectableContainersClient.ListComplete(context.Context, string, string, string, string) (ProtectableContainerResourceListIterator, error) +1. ProtectableContainersClient.ListPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectableContainersClient.ListResponder(*http.Response) (ProtectableContainerResourceList, error) +1. ProtectableContainersClient.ListSender(*http.Request) (*http.Response, error) +1. ProtectableItemsClient.List(context.Context, string, string, string, string) (WorkloadProtectableItemResourceListPage, error) +1. ProtectableItemsClient.ListComplete(context.Context, string, string, string, string) (WorkloadProtectableItemResourceListIterator, error) +1. ProtectableItemsClient.ListPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectableItemsClient.ListResponder(*http.Response) (WorkloadProtectableItemResourceList, error) +1. ProtectableItemsClient.ListSender(*http.Request) (*http.Response, error) +1. ProtectedItem.AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) +1. ProtectedItem.AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) +1. ProtectedItem.AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) +1. ProtectedItem.AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) +1. ProtectedItem.AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) +1. ProtectedItem.AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) +1. ProtectedItem.AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) +1. ProtectedItem.AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) +1. ProtectedItem.AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) +1. ProtectedItem.AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) +1. ProtectedItem.AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) +1. ProtectedItem.AsBasicProtectedItem() (BasicProtectedItem, bool) +1. ProtectedItem.AsDPMProtectedItem() (*DPMProtectedItem, bool) +1. ProtectedItem.AsGenericProtectedItem() (*GenericProtectedItem, bool) +1. ProtectedItem.AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) +1. ProtectedItem.AsProtectedItem() (*ProtectedItem, bool) +1. ProtectedItem.MarshalJSON() ([]byte, error) +1. ProtectedItemOperationResultsClient.Get(context.Context, string, string, string, string, string, string) (ProtectedItemResource, error) +1. ProtectedItemOperationResultsClient.GetPreparer(context.Context, string, string, string, string, string, string) (*http.Request, error) +1. ProtectedItemOperationResultsClient.GetResponder(*http.Response) (ProtectedItemResource, error) +1. ProtectedItemOperationResultsClient.GetSender(*http.Request) (*http.Response, error) +1. ProtectedItemOperationStatusesClient.Get(context.Context, string, string, string, string, string, string) (OperationStatus, error) +1. ProtectedItemOperationStatusesClient.GetPreparer(context.Context, string, string, string, string, string, string) (*http.Request, error) +1. ProtectedItemOperationStatusesClient.GetResponder(*http.Response) (OperationStatus, error) +1. ProtectedItemOperationStatusesClient.GetSender(*http.Request) (*http.Response, error) +1. ProtectedItemResource.MarshalJSON() ([]byte, error) +1. ProtectedItemResourceList.IsEmpty() bool +1. ProtectedItemResourceListIterator.NotDone() bool +1. ProtectedItemResourceListIterator.Response() ProtectedItemResourceList +1. ProtectedItemResourceListIterator.Value() ProtectedItemResource +1. ProtectedItemResourceListPage.NotDone() bool +1. ProtectedItemResourceListPage.Response() ProtectedItemResourceList +1. ProtectedItemResourceListPage.Values() []ProtectedItemResource +1. ProtectedItemsClient.CreateOrUpdate(context.Context, string, string, string, string, string, ProtectedItemResource) (ProtectedItemResource, error) +1. ProtectedItemsClient.CreateOrUpdatePreparer(context.Context, string, string, string, string, string, ProtectedItemResource) (*http.Request, error) +1. ProtectedItemsClient.CreateOrUpdateResponder(*http.Response) (ProtectedItemResource, error) +1. ProtectedItemsClient.CreateOrUpdateSender(*http.Request) (*http.Response, error) +1. ProtectedItemsClient.Delete(context.Context, string, string, string, string, string) (autorest.Response, error) +1. ProtectedItemsClient.DeletePreparer(context.Context, string, string, string, string, string) (*http.Request, error) +1. ProtectedItemsClient.DeleteResponder(*http.Response) (autorest.Response, error) +1. ProtectedItemsClient.DeleteSender(*http.Request) (*http.Response, error) +1. ProtectedItemsClient.Get(context.Context, string, string, string, string, string, string) (ProtectedItemResource, error) +1. ProtectedItemsClient.GetPreparer(context.Context, string, string, string, string, string, string) (*http.Request, error) +1. ProtectedItemsClient.GetResponder(*http.Response) (ProtectedItemResource, error) +1. ProtectedItemsClient.GetSender(*http.Request) (*http.Response, error) +1. ProtectedItemsGroupClient.List(context.Context, string, string, string, string) (ProtectedItemResourceListPage, error) +1. ProtectedItemsGroupClient.ListComplete(context.Context, string, string, string, string) (ProtectedItemResourceListIterator, error) +1. ProtectedItemsGroupClient.ListPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectedItemsGroupClient.ListResponder(*http.Response) (ProtectedItemResourceList, error) +1. ProtectedItemsGroupClient.ListSender(*http.Request) (*http.Response, error) +1. ProtectionContainer.AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) +1. ProtectionContainer.AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) +1. ProtectionContainer.AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) +1. ProtectionContainer.AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) +1. ProtectionContainer.AsAzureSQLContainer() (*AzureSQLContainer, bool) +1. ProtectionContainer.AsAzureStorageContainer() (*AzureStorageContainer, bool) +1. ProtectionContainer.AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) +1. ProtectionContainer.AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +1. ProtectionContainer.AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) +1. ProtectionContainer.AsBasicDpmContainer() (BasicDpmContainer, bool) +1. ProtectionContainer.AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) +1. ProtectionContainer.AsBasicProtectionContainer() (BasicProtectionContainer, bool) +1. ProtectionContainer.AsDpmContainer() (*DpmContainer, bool) +1. ProtectionContainer.AsGenericContainer() (*GenericContainer, bool) +1. ProtectionContainer.AsIaaSVMContainer() (*IaaSVMContainer, bool) +1. ProtectionContainer.AsMabContainer() (*MabContainer, bool) +1. ProtectionContainer.AsProtectionContainer() (*ProtectionContainer, bool) +1. ProtectionContainer.MarshalJSON() ([]byte, error) +1. ProtectionContainerOperationResultsClient.Get(context.Context, string, string, string, string, string) (ProtectionContainerResource, error) +1. ProtectionContainerOperationResultsClient.GetPreparer(context.Context, string, string, string, string, string) (*http.Request, error) +1. ProtectionContainerOperationResultsClient.GetResponder(*http.Response) (ProtectionContainerResource, error) +1. ProtectionContainerOperationResultsClient.GetSender(*http.Request) (*http.Response, error) +1. ProtectionContainerRefreshOperationResultsClient.Get(context.Context, string, string, string, string) (autorest.Response, error) +1. ProtectionContainerRefreshOperationResultsClient.GetPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionContainerRefreshOperationResultsClient.GetResponder(*http.Response) (autorest.Response, error) +1. ProtectionContainerRefreshOperationResultsClient.GetSender(*http.Request) (*http.Response, error) +1. ProtectionContainerResource.MarshalJSON() ([]byte, error) +1. ProtectionContainerResourceList.IsEmpty() bool +1. ProtectionContainerResourceListIterator.NotDone() bool +1. ProtectionContainerResourceListIterator.Response() ProtectionContainerResourceList +1. ProtectionContainerResourceListIterator.Value() ProtectionContainerResource +1. ProtectionContainerResourceListPage.NotDone() bool +1. ProtectionContainerResourceListPage.Response() ProtectionContainerResourceList +1. ProtectionContainerResourceListPage.Values() []ProtectionContainerResource +1. ProtectionContainersClient.Get(context.Context, string, string, string, string) (ProtectionContainerResource, error) +1. ProtectionContainersClient.GetPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionContainersClient.GetResponder(*http.Response) (ProtectionContainerResource, error) +1. ProtectionContainersClient.GetSender(*http.Request) (*http.Response, error) +1. ProtectionContainersClient.Inquire(context.Context, string, string, string, string, string) (autorest.Response, error) +1. ProtectionContainersClient.InquirePreparer(context.Context, string, string, string, string, string) (*http.Request, error) +1. ProtectionContainersClient.InquireResponder(*http.Response) (autorest.Response, error) +1. ProtectionContainersClient.InquireSender(*http.Request) (*http.Response, error) +1. ProtectionContainersClient.Refresh(context.Context, string, string, string, string) (autorest.Response, error) +1. ProtectionContainersClient.RefreshPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionContainersClient.RefreshResponder(*http.Response) (autorest.Response, error) +1. ProtectionContainersClient.RefreshSender(*http.Request) (*http.Response, error) +1. ProtectionContainersClient.Register(context.Context, string, string, string, string, ProtectionContainerResource) (ProtectionContainerResource, error) +1. ProtectionContainersClient.RegisterPreparer(context.Context, string, string, string, string, ProtectionContainerResource) (*http.Request, error) +1. ProtectionContainersClient.RegisterResponder(*http.Response) (ProtectionContainerResource, error) +1. ProtectionContainersClient.RegisterSender(*http.Request) (*http.Response, error) +1. ProtectionContainersClient.Unregister(context.Context, string, string, string, string) (autorest.Response, error) +1. ProtectionContainersClient.UnregisterPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionContainersClient.UnregisterResponder(*http.Response) (autorest.Response, error) +1. ProtectionContainersClient.UnregisterSender(*http.Request) (*http.Response, error) +1. ProtectionContainersGroupClient.List(context.Context, string, string, string) (ProtectionContainerResourceListPage, error) +1. ProtectionContainersGroupClient.ListComplete(context.Context, string, string, string) (ProtectionContainerResourceListIterator, error) +1. ProtectionContainersGroupClient.ListPreparer(context.Context, string, string, string) (*http.Request, error) +1. ProtectionContainersGroupClient.ListResponder(*http.Response) (ProtectionContainerResourceList, error) +1. ProtectionContainersGroupClient.ListSender(*http.Request) (*http.Response, error) +1. ProtectionIntent.AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) +1. ProtectionIntent.AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) +1. ProtectionIntent.AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) +1. ProtectionIntent.AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) +1. ProtectionIntent.AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) +1. ProtectionIntent.AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) +1. ProtectionIntent.AsBasicProtectionIntent() (BasicProtectionIntent, bool) +1. ProtectionIntent.AsProtectionIntent() (*ProtectionIntent, bool) +1. ProtectionIntent.MarshalJSON() ([]byte, error) +1. ProtectionIntentClient.CreateOrUpdate(context.Context, string, string, string, string, ProtectionIntentResource) (ProtectionIntentResource, error) +1. ProtectionIntentClient.CreateOrUpdatePreparer(context.Context, string, string, string, string, ProtectionIntentResource) (*http.Request, error) +1. ProtectionIntentClient.CreateOrUpdateResponder(*http.Response) (ProtectionIntentResource, error) +1. ProtectionIntentClient.CreateOrUpdateSender(*http.Request) (*http.Response, error) +1. ProtectionIntentClient.Delete(context.Context, string, string, string, string) (autorest.Response, error) +1. ProtectionIntentClient.DeletePreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionIntentClient.DeleteResponder(*http.Response) (autorest.Response, error) +1. ProtectionIntentClient.DeleteSender(*http.Request) (*http.Response, error) +1. ProtectionIntentClient.Get(context.Context, string, string, string, string) (ProtectionIntentResource, error) +1. ProtectionIntentClient.GetPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionIntentClient.GetResponder(*http.Response) (ProtectionIntentResource, error) +1. ProtectionIntentClient.GetSender(*http.Request) (*http.Response, error) +1. ProtectionIntentClient.Validate(context.Context, string, PreValidateEnableBackupRequest) (PreValidateEnableBackupResponse, error) +1. ProtectionIntentClient.ValidatePreparer(context.Context, string, PreValidateEnableBackupRequest) (*http.Request, error) +1. ProtectionIntentClient.ValidateResponder(*http.Response) (PreValidateEnableBackupResponse, error) +1. ProtectionIntentClient.ValidateSender(*http.Request) (*http.Response, error) +1. ProtectionIntentGroupClient.List(context.Context, string, string, string, string) (ProtectionIntentResourceListPage, error) +1. ProtectionIntentGroupClient.ListComplete(context.Context, string, string, string, string) (ProtectionIntentResourceListIterator, error) +1. ProtectionIntentGroupClient.ListPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionIntentGroupClient.ListResponder(*http.Response) (ProtectionIntentResourceList, error) +1. ProtectionIntentGroupClient.ListSender(*http.Request) (*http.Response, error) +1. ProtectionIntentResource.MarshalJSON() ([]byte, error) +1. ProtectionIntentResourceList.IsEmpty() bool +1. ProtectionIntentResourceListIterator.NotDone() bool +1. ProtectionIntentResourceListIterator.Response() ProtectionIntentResourceList +1. ProtectionIntentResourceListIterator.Value() ProtectionIntentResource +1. ProtectionIntentResourceListPage.NotDone() bool +1. ProtectionIntentResourceListPage.Response() ProtectionIntentResourceList +1. ProtectionIntentResourceListPage.Values() []ProtectionIntentResource +1. ProtectionPoliciesClient.CreateOrUpdate(context.Context, string, string, string, ProtectionPolicyResource) (ProtectionPolicyResource, error) +1. ProtectionPoliciesClient.CreateOrUpdatePreparer(context.Context, string, string, string, ProtectionPolicyResource) (*http.Request, error) +1. ProtectionPoliciesClient.CreateOrUpdateResponder(*http.Response) (ProtectionPolicyResource, error) +1. ProtectionPoliciesClient.CreateOrUpdateSender(*http.Request) (*http.Response, error) +1. ProtectionPoliciesClient.Delete(context.Context, string, string, string) (autorest.Response, error) +1. ProtectionPoliciesClient.DeletePreparer(context.Context, string, string, string) (*http.Request, error) +1. ProtectionPoliciesClient.DeleteResponder(*http.Response) (autorest.Response, error) +1. ProtectionPoliciesClient.DeleteSender(*http.Request) (*http.Response, error) +1. ProtectionPoliciesClient.Get(context.Context, string, string, string) (ProtectionPolicyResource, error) +1. ProtectionPoliciesClient.GetPreparer(context.Context, string, string, string) (*http.Request, error) +1. ProtectionPoliciesClient.GetResponder(*http.Response) (ProtectionPolicyResource, error) +1. ProtectionPoliciesClient.GetSender(*http.Request) (*http.Response, error) +1. ProtectionPolicy.AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) +1. ProtectionPolicy.AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) +1. ProtectionPolicy.AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) +1. ProtectionPolicy.AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) +1. ProtectionPolicy.AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) +1. ProtectionPolicy.AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) +1. ProtectionPolicy.AsMabProtectionPolicy() (*MabProtectionPolicy, bool) +1. ProtectionPolicy.AsProtectionPolicy() (*ProtectionPolicy, bool) +1. ProtectionPolicy.MarshalJSON() ([]byte, error) +1. ProtectionPolicyOperationResultsClient.Get(context.Context, string, string, string, string) (ProtectionPolicyResource, error) +1. ProtectionPolicyOperationResultsClient.GetPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionPolicyOperationResultsClient.GetResponder(*http.Response) (ProtectionPolicyResource, error) +1. ProtectionPolicyOperationResultsClient.GetSender(*http.Request) (*http.Response, error) +1. ProtectionPolicyOperationStatusesClient.Get(context.Context, string, string, string, string) (OperationStatus, error) +1. ProtectionPolicyOperationStatusesClient.GetPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionPolicyOperationStatusesClient.GetResponder(*http.Response) (OperationStatus, error) +1. ProtectionPolicyOperationStatusesClient.GetSender(*http.Request) (*http.Response, error) +1. ProtectionPolicyResource.MarshalJSON() ([]byte, error) +1. ProtectionPolicyResourceList.IsEmpty() bool +1. ProtectionPolicyResourceListIterator.NotDone() bool +1. ProtectionPolicyResourceListIterator.Response() ProtectionPolicyResourceList +1. ProtectionPolicyResourceListIterator.Value() ProtectionPolicyResource +1. ProtectionPolicyResourceListPage.NotDone() bool +1. ProtectionPolicyResourceListPage.Response() ProtectionPolicyResourceList +1. ProtectionPolicyResourceListPage.Values() []ProtectionPolicyResource +1. RecoveryPoint.AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) +1. RecoveryPoint.AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) +1. RecoveryPoint.AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) +1. RecoveryPoint.AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) +1. RecoveryPoint.AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) +1. RecoveryPoint.AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) +1. RecoveryPoint.AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) +1. RecoveryPoint.AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) +1. RecoveryPoint.AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) +1. RecoveryPoint.AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) +1. RecoveryPoint.AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) +1. RecoveryPoint.AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) +1. RecoveryPoint.AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) +1. RecoveryPoint.AsRecoveryPoint() (*RecoveryPoint, bool) +1. RecoveryPoint.MarshalJSON() ([]byte, error) +1. RecoveryPointResource.MarshalJSON() ([]byte, error) +1. RecoveryPointResourceList.IsEmpty() bool +1. RecoveryPointResourceListIterator.NotDone() bool +1. RecoveryPointResourceListIterator.Response() RecoveryPointResourceList +1. RecoveryPointResourceListIterator.Value() RecoveryPointResource +1. RecoveryPointResourceListPage.NotDone() bool +1. RecoveryPointResourceListPage.Response() RecoveryPointResourceList +1. RecoveryPointResourceListPage.Values() []RecoveryPointResource +1. RecoveryPointsClient.Get(context.Context, string, string, string, string, string, string) (RecoveryPointResource, error) +1. RecoveryPointsClient.GetPreparer(context.Context, string, string, string, string, string, string) (*http.Request, error) +1. RecoveryPointsClient.GetResponder(*http.Response) (RecoveryPointResource, error) +1. RecoveryPointsClient.GetSender(*http.Request) (*http.Response, error) +1. RecoveryPointsClient.List(context.Context, string, string, string, string, string, string) (RecoveryPointResourceListPage, error) +1. RecoveryPointsClient.ListComplete(context.Context, string, string, string, string, string, string) (RecoveryPointResourceListIterator, error) +1. RecoveryPointsClient.ListPreparer(context.Context, string, string, string, string, string, string) (*http.Request, error) +1. RecoveryPointsClient.ListResponder(*http.Response) (RecoveryPointResourceList, error) +1. RecoveryPointsClient.ListSender(*http.Request) (*http.Response, error) +1. Request.AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) +1. Request.AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) +1. Request.AsBasicRequest() (BasicRequest, bool) +1. Request.AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) +1. Request.AsRequest() (*Request, bool) +1. Request.MarshalJSON() ([]byte, error) +1. RequestResource.MarshalJSON() ([]byte, error) +1. ResourceConfigResource.MarshalJSON() ([]byte, error) +1. ResourceHealthDetails.MarshalJSON() ([]byte, error) +1. ResourceStorageConfigsClient.Get(context.Context, string, string) (ResourceConfigResource, error) +1. ResourceStorageConfigsClient.GetPreparer(context.Context, string, string) (*http.Request, error) +1. ResourceStorageConfigsClient.GetResponder(*http.Response) (ResourceConfigResource, error) +1. ResourceStorageConfigsClient.GetSender(*http.Request) (*http.Response, error) +1. ResourceStorageConfigsClient.Patch(context.Context, string, string, ResourceConfigResource) (autorest.Response, error) +1. ResourceStorageConfigsClient.PatchPreparer(context.Context, string, string, ResourceConfigResource) (*http.Request, error) +1. ResourceStorageConfigsClient.PatchResponder(*http.Response) (autorest.Response, error) +1. ResourceStorageConfigsClient.PatchSender(*http.Request) (*http.Response, error) +1. ResourceStorageConfigsClient.Update(context.Context, string, string, ResourceConfigResource) (ResourceConfigResource, error) +1. ResourceStorageConfigsClient.UpdatePreparer(context.Context, string, string, ResourceConfigResource) (*http.Request, error) +1. ResourceStorageConfigsClient.UpdateResponder(*http.Response) (ResourceConfigResource, error) +1. ResourceStorageConfigsClient.UpdateSender(*http.Request) (*http.Response, error) +1. ResourceVaultConfigResource.MarshalJSON() ([]byte, error) +1. ResourceVaultConfigsClient.Get(context.Context, string, string) (ResourceVaultConfigResource, error) +1. ResourceVaultConfigsClient.GetPreparer(context.Context, string, string) (*http.Request, error) +1. ResourceVaultConfigsClient.GetResponder(*http.Response) (ResourceVaultConfigResource, error) +1. ResourceVaultConfigsClient.GetSender(*http.Request) (*http.Response, error) +1. ResourceVaultConfigsClient.Put(context.Context, string, string, ResourceVaultConfigResource) (ResourceVaultConfigResource, error) +1. ResourceVaultConfigsClient.PutPreparer(context.Context, string, string, ResourceVaultConfigResource) (*http.Request, error) +1. ResourceVaultConfigsClient.PutResponder(*http.Response) (ResourceVaultConfigResource, error) +1. ResourceVaultConfigsClient.PutSender(*http.Request) (*http.Response, error) +1. ResourceVaultConfigsClient.Update(context.Context, string, string, ResourceVaultConfigResource) (ResourceVaultConfigResource, error) +1. ResourceVaultConfigsClient.UpdatePreparer(context.Context, string, string, ResourceVaultConfigResource) (*http.Request, error) +1. ResourceVaultConfigsClient.UpdateResponder(*http.Response) (ResourceVaultConfigResource, error) +1. ResourceVaultConfigsClient.UpdateSender(*http.Request) (*http.Response, error) +1. RestoreRequest.AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) +1. RestoreRequest.AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) +1. RestoreRequest.AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) +1. RestoreRequest.AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) +1. RestoreRequest.AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) +1. RestoreRequest.AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) +1. RestoreRequest.AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) +1. RestoreRequest.AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) +1. RestoreRequest.AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) +1. RestoreRequest.AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) +1. RestoreRequest.AsBasicRestoreRequest() (BasicRestoreRequest, bool) +1. RestoreRequest.AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) +1. RestoreRequest.AsRestoreRequest() (*RestoreRequest, bool) +1. RestoreRequest.MarshalJSON() ([]byte, error) +1. RestoreRequestResource.MarshalJSON() ([]byte, error) +1. RestoresClient.Trigger(context.Context, string, string, string, string, string, string, RestoreRequestResource) (autorest.Response, error) +1. RestoresClient.TriggerPreparer(context.Context, string, string, string, string, string, string, RestoreRequestResource) (*http.Request, error) +1. RestoresClient.TriggerResponder(*http.Response) (autorest.Response, error) +1. RestoresClient.TriggerSender(*http.Request) (*http.Response, error) +1. RetentionPolicy.AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) +1. RetentionPolicy.AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) +1. RetentionPolicy.AsRetentionPolicy() (*RetentionPolicy, bool) +1. RetentionPolicy.AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) +1. RetentionPolicy.MarshalJSON() ([]byte, error) +1. SchedulePolicy.AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) +1. SchedulePolicy.AsLogSchedulePolicy() (*LogSchedulePolicy, bool) +1. SchedulePolicy.AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) +1. SchedulePolicy.AsSchedulePolicy() (*SchedulePolicy, bool) +1. SchedulePolicy.AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) +1. SchedulePolicy.MarshalJSON() ([]byte, error) +1. SecurityPINsClient.Get(context.Context, string, string) (TokenInformation, error) +1. SecurityPINsClient.GetPreparer(context.Context, string, string) (*http.Request, error) +1. SecurityPINsClient.GetResponder(*http.Response) (TokenInformation, error) +1. SecurityPINsClient.GetSender(*http.Request) (*http.Response, error) +1. SimpleRetentionPolicy.AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) +1. SimpleRetentionPolicy.AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) +1. SimpleRetentionPolicy.AsRetentionPolicy() (*RetentionPolicy, bool) +1. SimpleRetentionPolicy.AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) +1. SimpleRetentionPolicy.MarshalJSON() ([]byte, error) +1. SimpleSchedulePolicy.AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) +1. SimpleSchedulePolicy.AsLogSchedulePolicy() (*LogSchedulePolicy, bool) +1. SimpleSchedulePolicy.AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) +1. SimpleSchedulePolicy.AsSchedulePolicy() (*SchedulePolicy, bool) +1. SimpleSchedulePolicy.AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) +1. SimpleSchedulePolicy.MarshalJSON() ([]byte, error) +1. StatusClient.Get(context.Context, string, StatusRequest) (StatusResponse, error) +1. StatusClient.GetPreparer(context.Context, string, StatusRequest) (*http.Request, error) +1. StatusClient.GetResponder(*http.Response) (StatusResponse, error) +1. StatusClient.GetSender(*http.Request) (*http.Response, error) +1. UsageSummariesClient.List(context.Context, string, string, string, string) (ManagementUsageList, error) +1. UsageSummariesClient.ListPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. UsageSummariesClient.ListResponder(*http.Response) (ManagementUsageList, error) +1. UsageSummariesClient.ListSender(*http.Request) (*http.Response, error) +1. ValidateIaasVMRestoreOperationRequest.AsBasicValidateOperationRequest() (BasicValidateOperationRequest, bool) +1. ValidateIaasVMRestoreOperationRequest.AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) +1. ValidateIaasVMRestoreOperationRequest.AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) +1. ValidateIaasVMRestoreOperationRequest.AsValidateOperationRequest() (*ValidateOperationRequest, bool) +1. ValidateIaasVMRestoreOperationRequest.AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) +1. ValidateIaasVMRestoreOperationRequest.MarshalJSON() ([]byte, error) +1. ValidateOperationRequest.AsBasicValidateOperationRequest() (BasicValidateOperationRequest, bool) +1. ValidateOperationRequest.AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) +1. ValidateOperationRequest.AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) +1. ValidateOperationRequest.AsValidateOperationRequest() (*ValidateOperationRequest, bool) +1. ValidateOperationRequest.AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) +1. ValidateOperationRequest.MarshalJSON() ([]byte, error) +1. ValidateRestoreOperationRequest.AsBasicValidateOperationRequest() (BasicValidateOperationRequest, bool) +1. ValidateRestoreOperationRequest.AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) +1. ValidateRestoreOperationRequest.AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) +1. ValidateRestoreOperationRequest.AsValidateOperationRequest() (*ValidateOperationRequest, bool) +1. ValidateRestoreOperationRequest.AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) +1. ValidateRestoreOperationRequest.MarshalJSON() ([]byte, error) +1. WorkloadItem.AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +1. WorkloadItem.AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) +1. WorkloadItem.AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) +1. WorkloadItem.AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) +1. WorkloadItem.AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) +1. WorkloadItem.AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) +1. WorkloadItem.AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) +1. WorkloadItem.AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) +1. WorkloadItem.AsBasicWorkloadItem() (BasicWorkloadItem, bool) +1. WorkloadItem.AsWorkloadItem() (*WorkloadItem, bool) +1. WorkloadItem.MarshalJSON() ([]byte, error) +1. WorkloadItemResource.MarshalJSON() ([]byte, error) +1. WorkloadItemResourceList.IsEmpty() bool +1. WorkloadItemResourceListIterator.NotDone() bool +1. WorkloadItemResourceListIterator.Response() WorkloadItemResourceList +1. WorkloadItemResourceListIterator.Value() WorkloadItemResource +1. WorkloadItemResourceListPage.NotDone() bool +1. WorkloadItemResourceListPage.Response() WorkloadItemResourceList +1. WorkloadItemResourceListPage.Values() []WorkloadItemResource +1. WorkloadItemsClient.List(context.Context, string, string, string, string, string, string) (WorkloadItemResourceListPage, error) +1. WorkloadItemsClient.ListComplete(context.Context, string, string, string, string, string, string) (WorkloadItemResourceListIterator, error) +1. WorkloadItemsClient.ListPreparer(context.Context, string, string, string, string, string, string) (*http.Request, error) +1. WorkloadItemsClient.ListResponder(*http.Response) (WorkloadItemResourceList, error) +1. WorkloadItemsClient.ListSender(*http.Request) (*http.Response, error) +1. WorkloadProtectableItem.AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) +1. WorkloadProtectableItem.AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) +1. WorkloadProtectableItem.AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) +1. WorkloadProtectableItem.AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +1. WorkloadProtectableItem.AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) +1. WorkloadProtectableItem.AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) +1. WorkloadProtectableItem.AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) +1. WorkloadProtectableItem.AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) +1. WorkloadProtectableItem.AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) +1. WorkloadProtectableItem.AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) +1. WorkloadProtectableItem.AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) +1. WorkloadProtectableItem.AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) +1. WorkloadProtectableItem.AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) +1. WorkloadProtectableItem.AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +1. WorkloadProtectableItem.AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +1. WorkloadProtectableItem.MarshalJSON() ([]byte, error) +1. WorkloadProtectableItemResource.MarshalJSON() ([]byte, error) +1. WorkloadProtectableItemResourceList.IsEmpty() bool +1. WorkloadProtectableItemResourceListIterator.NotDone() bool +1. WorkloadProtectableItemResourceListIterator.Response() WorkloadProtectableItemResourceList +1. WorkloadProtectableItemResourceListIterator.Value() WorkloadProtectableItemResource +1. WorkloadProtectableItemResourceListPage.NotDone() bool +1. WorkloadProtectableItemResourceListPage.Response() WorkloadProtectableItemResourceList +1. WorkloadProtectableItemResourceListPage.Values() []WorkloadProtectableItemResource + +### Struct Changes + +#### Removed Structs + +1. AzureBackupGoalFeatureSupportRequest +1. AzureBackupServerContainer +1. AzureBackupServerEngine +1. AzureFileShareBackupRequest +1. AzureFileShareProtectableItem +1. AzureFileShareProtectionPolicy +1. AzureFileShareProvisionILRRequest +1. AzureFileShareRecoveryPoint +1. AzureFileShareRestoreRequest +1. AzureFileshareProtectedItem +1. AzureFileshareProtectedItemExtendedInfo +1. AzureIaaSClassicComputeVMContainer +1. AzureIaaSClassicComputeVMProtectableItem +1. AzureIaaSClassicComputeVMProtectedItem +1. AzureIaaSComputeVMContainer +1. AzureIaaSComputeVMProtectableItem +1. AzureIaaSComputeVMProtectedItem +1. AzureIaaSVMErrorInfo +1. AzureIaaSVMHealthDetails +1. AzureIaaSVMJob +1. AzureIaaSVMJobExtendedInfo +1. AzureIaaSVMJobTaskDetails +1. AzureIaaSVMProtectedItem +1. AzureIaaSVMProtectedItemExtendedInfo +1. AzureIaaSVMProtectionPolicy +1. AzureRecoveryServiceVaultProtectionIntent +1. AzureResourceProtectionIntent +1. AzureSQLAGWorkloadContainerProtectionContainer +1. AzureSQLContainer +1. AzureSQLProtectedItem +1. AzureSQLProtectedItemExtendedInfo +1. AzureSQLProtectionPolicy +1. AzureStorageContainer +1. AzureStorageErrorInfo +1. AzureStorageJob +1. AzureStorageJobExtendedInfo +1. AzureStorageJobTaskDetails +1. AzureStorageProtectableContainer +1. AzureVMAppContainerProtectableContainer +1. AzureVMAppContainerProtectionContainer +1. AzureVMResourceFeatureSupportRequest +1. AzureVMResourceFeatureSupportResponse +1. AzureVMWorkloadItem +1. AzureVMWorkloadProtectableItem +1. AzureVMWorkloadProtectedItem +1. AzureVMWorkloadProtectedItemExtendedInfo +1. AzureVMWorkloadProtectionPolicy +1. AzureVMWorkloadSAPAseDatabaseProtectedItem +1. AzureVMWorkloadSAPAseDatabaseWorkloadItem +1. AzureVMWorkloadSAPAseSystemProtectableItem +1. AzureVMWorkloadSAPAseSystemWorkloadItem +1. AzureVMWorkloadSAPHanaDatabaseProtectableItem +1. AzureVMWorkloadSAPHanaDatabaseProtectedItem +1. AzureVMWorkloadSAPHanaDatabaseWorkloadItem +1. AzureVMWorkloadSAPHanaSystemProtectableItem +1. AzureVMWorkloadSAPHanaSystemWorkloadItem +1. AzureVMWorkloadSQLAvailabilityGroupProtectableItem +1. AzureVMWorkloadSQLDatabaseProtectableItem +1. AzureVMWorkloadSQLDatabaseProtectedItem +1. AzureVMWorkloadSQLDatabaseWorkloadItem +1. AzureVMWorkloadSQLInstanceProtectableItem +1. AzureVMWorkloadSQLInstanceWorkloadItem +1. AzureWorkloadAutoProtectionIntent +1. AzureWorkloadBackupRequest +1. AzureWorkloadContainer +1. AzureWorkloadContainerExtendedInfo +1. AzureWorkloadErrorInfo +1. AzureWorkloadJob +1. AzureWorkloadJobExtendedInfo +1. AzureWorkloadJobTaskDetails +1. AzureWorkloadPointInTimeRecoveryPoint +1. AzureWorkloadPointInTimeRestoreRequest +1. AzureWorkloadRecoveryPoint +1. AzureWorkloadRestoreRequest +1. AzureWorkloadSAPHanaPointInTimeRecoveryPoint +1. AzureWorkloadSAPHanaPointInTimeRestoreRequest +1. AzureWorkloadSAPHanaRecoveryPoint +1. AzureWorkloadSAPHanaRestoreRequest +1. AzureWorkloadSQLAutoProtectionIntent +1. AzureWorkloadSQLPointInTimeRecoveryPoint +1. AzureWorkloadSQLPointInTimeRestoreRequest +1. AzureWorkloadSQLRecoveryPoint +1. AzureWorkloadSQLRecoveryPointExtendedInfo +1. AzureWorkloadSQLRestoreRequest +1. BEKDetails +1. BMSBackupEngineQueryObject +1. BMSBackupEnginesQueryObject +1. BMSBackupSummariesQueryObject +1. BMSContainerQueryObject +1. BMSContainersInquiryQueryObject +1. BMSPOQueryObject +1. BMSRPQueryObject +1. BMSRefreshContainersQueryObject +1. BMSWorkloadItemQueryObject +1. BackupsClient +1. ClientDiscoveryDisplay +1. ClientDiscoveryForLogSpecification +1. ClientDiscoveryForProperties +1. ClientDiscoveryForServiceSpecification +1. ClientDiscoveryResponse +1. ClientDiscoveryResponseIterator +1. ClientDiscoveryResponsePage +1. ClientDiscoveryValueForSingleAPI +1. ClientScriptForConnect +1. ContainerIdentityInfo +1. DPMContainerExtendedInfo +1. DPMProtectedItem +1. DPMProtectedItemExtendedInfo +1. DailyRetentionFormat +1. DailyRetentionSchedule +1. Day +1. DiskExclusionProperties +1. DiskInformation +1. DistributedNodesInfo +1. DpmBackupEngine +1. DpmContainer +1. DpmErrorInfo +1. DpmJob +1. DpmJobExtendedInfo +1. DpmJobTaskDetails +1. EncryptionDetails +1. EngineBase +1. EngineBaseResource +1. EngineBaseResourceList +1. EngineBaseResourceListIterator +1. EngineBaseResourceListPage +1. EngineExtendedInfo +1. EnginesClient +1. ErrorDetail +1. ExportJobsOperationResultInfo +1. ExportJobsOperationResultsClient +1. ExtendedProperties +1. FeatureSupportClient +1. FeatureSupportRequest +1. GenericContainer +1. GenericContainerExtendedInfo +1. GenericProtectedItem +1. GenericProtectionPolicy +1. GenericRecoveryPoint +1. GetProtectedItemQueryObject +1. ILRRequest +1. ILRRequestResource +1. IaaSVMContainer +1. IaaSVMProtectableItem +1. IaasVMBackupRequest +1. IaasVMILRRegistrationRequest +1. IaasVMRecoveryPoint +1. IaasVMRestoreRequest +1. InquiryInfo +1. InquiryValidation +1. InstantItemRecoveryTarget +1. InstantRPAdditionalDetails +1. ItemLevelRecoveryConnectionsClient +1. Job +1. JobCancellationsClient +1. JobDetailsClient +1. JobOperationResultsClient +1. JobQueryObject +1. JobResource +1. JobResourceList +1. JobResourceListIterator +1. JobResourceListPage +1. JobsClient +1. JobsGroupClient +1. KEKDetails +1. KPIResourceHealthDetails +1. KeyAndSecretDetails +1. LogSchedulePolicy +1. LongTermRetentionPolicy +1. LongTermSchedulePolicy +1. MABContainerHealthDetails +1. MabContainer +1. MabContainerExtendedInfo +1. MabErrorInfo +1. MabFileFolderProtectedItem +1. MabFileFolderProtectedItemExtendedInfo +1. MabJob +1. MabJobExtendedInfo +1. MabJobTaskDetails +1. MabProtectionPolicy +1. ManagementUsage +1. ManagementUsageList +1. MonthlyRetentionSchedule +1. NameInfo +1. OperationClient +1. OperationResultInfo +1. OperationResultInfoBase +1. OperationResultInfoBaseResource +1. OperationResultsClient +1. OperationStatusExtendedInfo +1. OperationStatusJobExtendedInfo +1. OperationStatusJobsExtendedInfo +1. OperationStatusProvisionILRExtendedInfo +1. OperationStatusesClient +1. OperationWorkerResponse +1. OperationsClient +1. PointInTimeRange +1. PoliciesClient +1. PreBackupValidation +1. PreValidateEnableBackupRequest +1. PreValidateEnableBackupResponse +1. ProtectableContainer +1. ProtectableContainerResource +1. ProtectableContainerResourceList +1. ProtectableContainerResourceListIterator +1. ProtectableContainerResourceListPage +1. ProtectableContainersClient +1. ProtectableItemsClient +1. ProtectedItem +1. ProtectedItemOperationResultsClient +1. ProtectedItemOperationStatusesClient +1. ProtectedItemQueryObject +1. ProtectedItemResource +1. ProtectedItemResourceList +1. ProtectedItemResourceListIterator +1. ProtectedItemResourceListPage +1. ProtectedItemsClient +1. ProtectedItemsGroupClient +1. ProtectionContainer +1. ProtectionContainerOperationResultsClient +1. ProtectionContainerRefreshOperationResultsClient +1. ProtectionContainerResource +1. ProtectionContainerResourceList +1. ProtectionContainerResourceListIterator +1. ProtectionContainerResourceListPage +1. ProtectionContainersClient +1. ProtectionContainersGroupClient +1. ProtectionIntent +1. ProtectionIntentClient +1. ProtectionIntentGroupClient +1. ProtectionIntentQueryObject +1. ProtectionIntentResource +1. ProtectionIntentResourceList +1. ProtectionIntentResourceListIterator +1. ProtectionIntentResourceListPage +1. ProtectionPoliciesClient +1. ProtectionPolicy +1. ProtectionPolicyOperationResultsClient +1. ProtectionPolicyOperationStatusesClient +1. ProtectionPolicyQueryObject +1. ProtectionPolicyResource +1. ProtectionPolicyResourceList +1. ProtectionPolicyResourceListIterator +1. ProtectionPolicyResourceListPage +1. RecoveryPoint +1. RecoveryPointDiskConfiguration +1. RecoveryPointResource +1. RecoveryPointResourceList +1. RecoveryPointResourceListIterator +1. RecoveryPointResourceListPage +1. RecoveryPointTierInformation +1. RecoveryPointsClient +1. Request +1. RequestResource +1. ResourceConfig +1. ResourceConfigResource +1. ResourceHealthDetails +1. ResourceList +1. ResourceStorageConfigsClient +1. ResourceVaultConfig +1. ResourceVaultConfigResource +1. ResourceVaultConfigsClient +1. RestoreFileSpecs +1. RestoreRequest +1. RestoreRequestResource +1. RestoresClient +1. RetentionDuration +1. RetentionPolicy +1. SQLDataDirectory +1. SQLDataDirectoryMapping +1. SchedulePolicy +1. SecurityPINsClient +1. Settings +1. SimpleRetentionPolicy +1. SimpleSchedulePolicy +1. StatusClient +1. StatusRequest +1. StatusResponse +1. SubProtectionPolicy +1. TargetAFSRestoreInfo +1. TargetRestoreInfo +1. TokenInformation +1. UsageSummariesClient +1. ValidateIaasVMRestoreOperationRequest +1. ValidateOperationRequest +1. ValidateOperationResponse +1. ValidateOperationsResponse +1. ValidateRestoreOperationRequest +1. WeeklyRetentionFormat +1. WeeklyRetentionSchedule +1. WorkloadInquiryDetails +1. WorkloadItem +1. WorkloadItemResource +1. WorkloadItemResourceList +1. WorkloadItemResourceListIterator +1. WorkloadItemResourceListPage +1. WorkloadItemsClient +1. WorkloadProtectableItem +1. WorkloadProtectableItemResource +1. WorkloadProtectableItemResourceList +1. WorkloadProtectableItemResourceListIterator +1. WorkloadProtectableItemResourceListPage +1. YearlyRetentionSchedule + +#### Removed Struct Fields + +1. OperationStatus.Properties + +### Signature Changes + +#### Const Types + +1. Invalid changed type from AzureFileShareType to OperationStatusValues + +## Additive Changes + +### New Constants + +1. OperationStatusValues.Canceled +1. OperationStatusValues.Failed +1. OperationStatusValues.InProgress +1. OperationStatusValues.Succeeded diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/_meta.json b/services/recoveryservices/mgmt/2020-02-02/backup/_meta.json index 5df300a85c6a..ae18a70e25c9 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/_meta.json +++ b/services/recoveryservices/mgmt/2020-02-02/backup/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "4742065e8d48160292fbce6790710c6835f8dc4f", "readme": "/_/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/readme.md", "tag": "package-2020-02", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/backupapi/interfaces.go b/services/recoveryservices/mgmt/2020-02-02/backup/backupapi/interfaces.go index 8383b81808f9..3c0b62c61c18 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/backupapi/interfaces.go +++ b/services/recoveryservices/mgmt/2020-02-02/backup/backupapi/interfaces.go @@ -9,7 +9,6 @@ package backupapi import ( "context" "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2020-02-02/backup" - "github.com/Azure/go-autorest/autorest" ) // BaseClientAPI contains the set of methods on the BaseClient type. @@ -27,298 +26,3 @@ type PrivateEndpointConnectionClientAPI interface { } var _ PrivateEndpointConnectionClientAPI = (*backup.PrivateEndpointConnectionClient)(nil) - -// ResourceVaultConfigsClientAPI contains the set of methods on the ResourceVaultConfigsClient type. -type ResourceVaultConfigsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string) (result backup.ResourceVaultConfigResource, err error) - Put(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.ResourceVaultConfigResource) (result backup.ResourceVaultConfigResource, err error) - Update(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.ResourceVaultConfigResource) (result backup.ResourceVaultConfigResource, err error) -} - -var _ ResourceVaultConfigsClientAPI = (*backup.ResourceVaultConfigsClient)(nil) - -// ProtectedItemsClientAPI contains the set of methods on the ProtectedItemsClient type. -type ProtectedItemsClientAPI interface { - CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters backup.ProtectedItemResource) (result backup.ProtectedItemResource, err error) - Delete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string) (result autorest.Response, err error) - Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result backup.ProtectedItemResource, err error) -} - -var _ ProtectedItemsClientAPI = (*backup.ProtectedItemsClient)(nil) - -// ProtectedItemOperationResultsClientAPI contains the set of methods on the ProtectedItemOperationResultsClient type. -type ProtectedItemOperationResultsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, operationID string) (result backup.ProtectedItemResource, err error) -} - -var _ ProtectedItemOperationResultsClientAPI = (*backup.ProtectedItemOperationResultsClient)(nil) - -// RecoveryPointsClientAPI contains the set of methods on the RecoveryPointsClient type. -type RecoveryPointsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string) (result backup.RecoveryPointResource, err error) - List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result backup.RecoveryPointResourceListPage, err error) - ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result backup.RecoveryPointResourceListIterator, err error) -} - -var _ RecoveryPointsClientAPI = (*backup.RecoveryPointsClient)(nil) - -// RestoresClientAPI contains the set of methods on the RestoresClient type. -type RestoresClientAPI interface { - Trigger(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters backup.RestoreRequestResource) (result autorest.Response, err error) -} - -var _ RestoresClientAPI = (*backup.RestoresClient)(nil) - -// PoliciesClientAPI contains the set of methods on the PoliciesClient type. -type PoliciesClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result backup.ProtectionPolicyResourceListPage, err error) - ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result backup.ProtectionPolicyResourceListIterator, err error) -} - -var _ PoliciesClientAPI = (*backup.PoliciesClient)(nil) - -// ProtectionPoliciesClientAPI contains the set of methods on the ProtectionPoliciesClient type. -type ProtectionPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, policyName string, parameters backup.ProtectionPolicyResource) (result backup.ProtectionPolicyResource, err error) - Delete(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (result autorest.Response, err error) - Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (result backup.ProtectionPolicyResource, err error) -} - -var _ ProtectionPoliciesClientAPI = (*backup.ProtectionPoliciesClient)(nil) - -// ProtectionPolicyOperationResultsClientAPI contains the set of methods on the ProtectionPolicyOperationResultsClient type. -type ProtectionPolicyOperationResultsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string) (result backup.ProtectionPolicyResource, err error) -} - -var _ ProtectionPolicyOperationResultsClientAPI = (*backup.ProtectionPolicyOperationResultsClient)(nil) - -// JobsClientAPI contains the set of methods on the JobsClient type. -type JobsClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.JobResourceListPage, err error) - ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.JobResourceListIterator, err error) -} - -var _ JobsClientAPI = (*backup.JobsClient)(nil) - -// JobDetailsClientAPI contains the set of methods on the JobDetailsClient type. -type JobDetailsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, jobName string) (result backup.JobResource, err error) -} - -var _ JobDetailsClientAPI = (*backup.JobDetailsClient)(nil) - -// JobCancellationsClientAPI contains the set of methods on the JobCancellationsClient type. -type JobCancellationsClientAPI interface { - Trigger(ctx context.Context, vaultName string, resourceGroupName string, jobName string) (result autorest.Response, err error) -} - -var _ JobCancellationsClientAPI = (*backup.JobCancellationsClient)(nil) - -// JobOperationResultsClientAPI contains the set of methods on the JobOperationResultsClient type. -type JobOperationResultsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, jobName string, operationID string) (result autorest.Response, err error) -} - -var _ JobOperationResultsClientAPI = (*backup.JobOperationResultsClient)(nil) - -// ExportJobsOperationResultsClientAPI contains the set of methods on the ExportJobsOperationResultsClient type. -type ExportJobsOperationResultsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result backup.OperationResultInfoBaseResource, err error) -} - -var _ ExportJobsOperationResultsClientAPI = (*backup.ExportJobsOperationResultsClient)(nil) - -// JobsGroupClientAPI contains the set of methods on the JobsGroupClient type. -type JobsGroupClientAPI interface { - Export(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result autorest.Response, err error) -} - -var _ JobsGroupClientAPI = (*backup.JobsGroupClient)(nil) - -// ProtectedItemsGroupClientAPI contains the set of methods on the ProtectedItemsGroupClient type. -type ProtectedItemsGroupClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ProtectedItemResourceListPage, err error) - ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ProtectedItemResourceListIterator, err error) -} - -var _ ProtectedItemsGroupClientAPI = (*backup.ProtectedItemsGroupClient)(nil) - -// OperationClientAPI contains the set of methods on the OperationClient type. -type OperationClientAPI interface { - Validate(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.BasicValidateOperationRequest) (result backup.ValidateOperationsResponse, err error) -} - -var _ OperationClientAPI = (*backup.OperationClient)(nil) - -// ProtectionIntentClientAPI contains the set of methods on the ProtectionIntentClient type. -type ProtectionIntentClientAPI interface { - CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string, parameters backup.ProtectionIntentResource) (result backup.ProtectionIntentResource, err error) - Delete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string) (result autorest.Response, err error) - Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string) (result backup.ProtectionIntentResource, err error) - Validate(ctx context.Context, azureRegion string, parameters backup.PreValidateEnableBackupRequest) (result backup.PreValidateEnableBackupResponse, err error) -} - -var _ ProtectionIntentClientAPI = (*backup.ProtectionIntentClient)(nil) - -// StatusClientAPI contains the set of methods on the StatusClient type. -type StatusClientAPI interface { - Get(ctx context.Context, azureRegion string, parameters backup.StatusRequest) (result backup.StatusResponse, err error) -} - -var _ StatusClientAPI = (*backup.StatusClient)(nil) - -// FeatureSupportClientAPI contains the set of methods on the FeatureSupportClient type. -type FeatureSupportClientAPI interface { - Validate(ctx context.Context, azureRegion string, parameters backup.BasicFeatureSupportRequest) (result backup.AzureVMResourceFeatureSupportResponse, err error) -} - -var _ FeatureSupportClientAPI = (*backup.FeatureSupportClient)(nil) - -// ProtectionIntentGroupClientAPI contains the set of methods on the ProtectionIntentGroupClient type. -type ProtectionIntentGroupClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ProtectionIntentResourceListPage, err error) - ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ProtectionIntentResourceListIterator, err error) -} - -var _ ProtectionIntentGroupClientAPI = (*backup.ProtectionIntentGroupClient)(nil) - -// UsageSummariesClientAPI contains the set of methods on the UsageSummariesClient type. -type UsageSummariesClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ManagementUsageList, err error) -} - -var _ UsageSummariesClientAPI = (*backup.UsageSummariesClient)(nil) - -// EnginesClientAPI contains the set of methods on the EnginesClient type. -type EnginesClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, backupEngineName string, filter string, skipToken string) (result backup.EngineBaseResource, err error) - List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.EngineBaseResourceListPage, err error) - ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.EngineBaseResourceListIterator, err error) -} - -var _ EnginesClientAPI = (*backup.EnginesClient)(nil) - -// ProtectionContainerRefreshOperationResultsClientAPI contains the set of methods on the ProtectionContainerRefreshOperationResultsClient type. -type ProtectionContainerRefreshOperationResultsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, operationID string) (result autorest.Response, err error) -} - -var _ ProtectionContainerRefreshOperationResultsClientAPI = (*backup.ProtectionContainerRefreshOperationResultsClient)(nil) - -// ProtectableContainersClientAPI contains the set of methods on the ProtectableContainersClient type. -type ProtectableContainersClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, filter string) (result backup.ProtectableContainerResourceListPage, err error) - ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, filter string) (result backup.ProtectableContainerResourceListIterator, err error) -} - -var _ ProtectableContainersClientAPI = (*backup.ProtectableContainersClient)(nil) - -// ProtectionContainersClientAPI contains the set of methods on the ProtectionContainersClient type. -type ProtectionContainersClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string) (result backup.ProtectionContainerResource, err error) - Inquire(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, filter string) (result autorest.Response, err error) - Refresh(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, filter string) (result autorest.Response, err error) - Register(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, parameters backup.ProtectionContainerResource) (result backup.ProtectionContainerResource, err error) - Unregister(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string) (result autorest.Response, err error) -} - -var _ ProtectionContainersClientAPI = (*backup.ProtectionContainersClient)(nil) - -// WorkloadItemsClientAPI contains the set of methods on the WorkloadItemsClient type. -type WorkloadItemsClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, filter string, skipToken string) (result backup.WorkloadItemResourceListPage, err error) - ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, filter string, skipToken string) (result backup.WorkloadItemResourceListIterator, err error) -} - -var _ WorkloadItemsClientAPI = (*backup.WorkloadItemsClient)(nil) - -// ProtectionContainerOperationResultsClientAPI contains the set of methods on the ProtectionContainerOperationResultsClient type. -type ProtectionContainerOperationResultsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, operationID string) (result backup.ProtectionContainerResource, err error) -} - -var _ ProtectionContainerOperationResultsClientAPI = (*backup.ProtectionContainerOperationResultsClient)(nil) - -// BackupsClientAPI contains the set of methods on the BackupsClient type. -type BackupsClientAPI interface { - Trigger(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters backup.RequestResource) (result autorest.Response, err error) -} - -var _ BackupsClientAPI = (*backup.BackupsClient)(nil) - -// ProtectedItemOperationStatusesClientAPI contains the set of methods on the ProtectedItemOperationStatusesClient type. -type ProtectedItemOperationStatusesClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, operationID string) (result backup.OperationStatus, err error) -} - -var _ ProtectedItemOperationStatusesClientAPI = (*backup.ProtectedItemOperationStatusesClient)(nil) - -// ItemLevelRecoveryConnectionsClientAPI contains the set of methods on the ItemLevelRecoveryConnectionsClient type. -type ItemLevelRecoveryConnectionsClientAPI interface { - Provision(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters backup.ILRRequestResource) (result autorest.Response, err error) - Revoke(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string) (result autorest.Response, err error) -} - -var _ ItemLevelRecoveryConnectionsClientAPI = (*backup.ItemLevelRecoveryConnectionsClient)(nil) - -// OperationResultsClientAPI contains the set of methods on the OperationResultsClient type. -type OperationResultsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result autorest.Response, err error) -} - -var _ OperationResultsClientAPI = (*backup.OperationResultsClient)(nil) - -// OperationStatusesClientAPI contains the set of methods on the OperationStatusesClient type. -type OperationStatusesClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result backup.OperationStatus, err error) -} - -var _ OperationStatusesClientAPI = (*backup.OperationStatusesClient)(nil) - -// ProtectionPolicyOperationStatusesClientAPI contains the set of methods on the ProtectionPolicyOperationStatusesClient type. -type ProtectionPolicyOperationStatusesClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string) (result backup.OperationStatus, err error) -} - -var _ ProtectionPolicyOperationStatusesClientAPI = (*backup.ProtectionPolicyOperationStatusesClient)(nil) - -// ProtectableItemsClientAPI contains the set of methods on the ProtectableItemsClient type. -type ProtectableItemsClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.WorkloadProtectableItemResourceListPage, err error) - ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.WorkloadProtectableItemResourceListIterator, err error) -} - -var _ ProtectableItemsClientAPI = (*backup.ProtectableItemsClient)(nil) - -// ProtectionContainersGroupClientAPI contains the set of methods on the ProtectionContainersGroupClient type. -type ProtectionContainersGroupClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result backup.ProtectionContainerResourceListPage, err error) - ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result backup.ProtectionContainerResourceListIterator, err error) -} - -var _ ProtectionContainersGroupClientAPI = (*backup.ProtectionContainersGroupClient)(nil) - -// SecurityPINsClientAPI contains the set of methods on the SecurityPINsClient type. -type SecurityPINsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string) (result backup.TokenInformation, err error) -} - -var _ SecurityPINsClientAPI = (*backup.SecurityPINsClient)(nil) - -// ResourceStorageConfigsClientAPI contains the set of methods on the ResourceStorageConfigsClient type. -type ResourceStorageConfigsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string) (result backup.ResourceConfigResource, err error) - Patch(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.ResourceConfigResource) (result autorest.Response, err error) - Update(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.ResourceConfigResource) (result backup.ResourceConfigResource, err error) -} - -var _ ResourceStorageConfigsClientAPI = (*backup.ResourceStorageConfigsClient)(nil) - -// OperationsClientAPI contains the set of methods on the OperationsClient type. -type OperationsClientAPI interface { - List(ctx context.Context) (result backup.ClientDiscoveryResponsePage, err error) - ListComplete(ctx context.Context) (result backup.ClientDiscoveryResponseIterator, err error) -} - -var _ OperationsClientAPI = (*backup.OperationsClient)(nil) diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/client.go b/services/recoveryservices/mgmt/2020-02-02/backup/client.go index a880d5349223..86b8d5775d79 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/client.go +++ b/services/recoveryservices/mgmt/2020-02-02/backup/client.go @@ -1,4 +1,4 @@ -// Package backup implements the Azure ARM Backup service API version . +// Package backup implements the Azure ARM Backup service API version 2020-02-02. // // Open API 2.0 Specs for Azure RecoveryServices Backup service package backup diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/engines.go b/services/recoveryservices/mgmt/2020-02-02/backup/engines.go deleted file mode 100644 index 786747fdbf96..000000000000 --- a/services/recoveryservices/mgmt/2020-02-02/backup/engines.go +++ /dev/null @@ -1,243 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// EnginesClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type EnginesClient struct { - BaseClient -} - -// NewEnginesClient creates an instance of the EnginesClient client. -func NewEnginesClient(subscriptionID string) EnginesClient { - return NewEnginesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewEnginesClientWithBaseURI creates an instance of the EnginesClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewEnginesClientWithBaseURI(baseURI string, subscriptionID string) EnginesClient { - return EnginesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get returns backup management server 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. -// backupEngineName - name of the backup management server. -// filter - oData filter options. -// skipToken - skipToken Filter. -func (client EnginesClient) Get(ctx context.Context, vaultName string, resourceGroupName string, backupEngineName string, filter string, skipToken string) (result EngineBaseResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EnginesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, backupEngineName, filter, skipToken) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.EnginesClient", "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.EnginesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.EnginesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client EnginesClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, backupEngineName string, filter string, skipToken string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "backupEngineName": autorest.Encode("path", backupEngineName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-12-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}/backupEngines/{backupEngineName}", 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 EnginesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client EnginesClient) GetResponder(resp *http.Response) (result EngineBaseResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. -// 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 EnginesClient) List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result EngineBaseResourceListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EnginesClient.List") - defer func() { - sc := -1 - if result.ebrl.Response.Response != nil { - sc = result.ebrl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, vaultName, resourceGroupName, filter, skipToken) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.EnginesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ebrl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.EnginesClient", "List", resp, "Failure sending request") - return - } - - result.ebrl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.EnginesClient", "List", resp, "Failure responding to request") - return - } - if result.ebrl.hasNextLink() && result.ebrl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client EnginesClient) 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 = "2016-12-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}/backupEngines", 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 EnginesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client EnginesClient) ListResponder(resp *http.Response) (result EngineBaseResourceList, err error) { - err = autorest.Respond( - resp, - 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 EnginesClient) listNextResults(ctx context.Context, lastResults EngineBaseResourceList) (result EngineBaseResourceList, err error) { - req, err := lastResults.engineBaseResourceListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "backup.EnginesClient", "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.EnginesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.EnginesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client EnginesClient) ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result EngineBaseResourceListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EnginesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, vaultName, resourceGroupName, filter, skipToken) - return -} diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/enums.go b/services/recoveryservices/mgmt/2020-02-02/backup/enums.go index 9e0446a6f69f..34e5e58d0708 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/enums.go +++ b/services/recoveryservices/mgmt/2020-02-02/backup/enums.go @@ -6,961 +6,25 @@ package backup // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// AzureFileShareType enumerates the values for azure file share type. -type AzureFileShareType string - -const ( - // Invalid ... - Invalid AzureFileShareType = "Invalid" - // XSMB ... - XSMB AzureFileShareType = "XSMB" - // XSync ... - XSync AzureFileShareType = "XSync" -) - -// PossibleAzureFileShareTypeValues returns an array of possible values for the AzureFileShareType const type. -func PossibleAzureFileShareTypeValues() []AzureFileShareType { - return []AzureFileShareType{Invalid, XSMB, XSync} -} - -// ContainerType enumerates the values for container type. -type ContainerType string - -const ( - // ContainerTypeAzureBackupServerContainer ... - ContainerTypeAzureBackupServerContainer ContainerType = "AzureBackupServerContainer" - // ContainerTypeAzureSQLContainer ... - ContainerTypeAzureSQLContainer ContainerType = "AzureSqlContainer" - // ContainerTypeCluster ... - ContainerTypeCluster ContainerType = "Cluster" - // ContainerTypeDPMContainer ... - ContainerTypeDPMContainer ContainerType = "DPMContainer" - // ContainerTypeGenericContainer ... - ContainerTypeGenericContainer ContainerType = "GenericContainer" - // ContainerTypeIaasVMContainer ... - ContainerTypeIaasVMContainer ContainerType = "IaasVMContainer" - // ContainerTypeIaasVMServiceContainer ... - ContainerTypeIaasVMServiceContainer ContainerType = "IaasVMServiceContainer" - // ContainerTypeInvalid ... - ContainerTypeInvalid ContainerType = "Invalid" - // ContainerTypeMABContainer ... - ContainerTypeMABContainer ContainerType = "MABContainer" - // ContainerTypeSQLAGWorkLoadContainer ... - ContainerTypeSQLAGWorkLoadContainer ContainerType = "SQLAGWorkLoadContainer" - // ContainerTypeStorageContainer ... - ContainerTypeStorageContainer ContainerType = "StorageContainer" - // ContainerTypeUnknown ... - ContainerTypeUnknown ContainerType = "Unknown" - // ContainerTypeVCenter ... - ContainerTypeVCenter ContainerType = "VCenter" - // ContainerTypeVMAppContainer ... - ContainerTypeVMAppContainer ContainerType = "VMAppContainer" - // ContainerTypeWindows ... - ContainerTypeWindows ContainerType = "Windows" -) - -// PossibleContainerTypeValues returns an array of possible values for the ContainerType const type. -func PossibleContainerTypeValues() []ContainerType { - return []ContainerType{ContainerTypeAzureBackupServerContainer, ContainerTypeAzureSQLContainer, ContainerTypeCluster, ContainerTypeDPMContainer, ContainerTypeGenericContainer, ContainerTypeIaasVMContainer, ContainerTypeIaasVMServiceContainer, ContainerTypeInvalid, ContainerTypeMABContainer, ContainerTypeSQLAGWorkLoadContainer, ContainerTypeStorageContainer, ContainerTypeUnknown, ContainerTypeVCenter, ContainerTypeVMAppContainer, ContainerTypeWindows} -} - -// ContainerTypeBasicProtectionContainer enumerates the values for container type basic protection container. -type ContainerTypeBasicProtectionContainer string - -const ( - // ContainerTypeAzureBackupServerContainer1 ... - ContainerTypeAzureBackupServerContainer1 ContainerTypeBasicProtectionContainer = "AzureBackupServerContainer" - // ContainerTypeAzureSQLContainer1 ... - ContainerTypeAzureSQLContainer1 ContainerTypeBasicProtectionContainer = "AzureSqlContainer" - // ContainerTypeAzureWorkloadContainer ... - ContainerTypeAzureWorkloadContainer ContainerTypeBasicProtectionContainer = "AzureWorkloadContainer" - // ContainerTypeDPMContainer1 ... - ContainerTypeDPMContainer1 ContainerTypeBasicProtectionContainer = "DPMContainer" - // ContainerTypeGenericContainer1 ... - ContainerTypeGenericContainer1 ContainerTypeBasicProtectionContainer = "GenericContainer" - // ContainerTypeIaaSVMContainer ... - ContainerTypeIaaSVMContainer ContainerTypeBasicProtectionContainer = "IaaSVMContainer" - // ContainerTypeMicrosoftClassicComputevirtualMachines ... - ContainerTypeMicrosoftClassicComputevirtualMachines ContainerTypeBasicProtectionContainer = "Microsoft.ClassicCompute/virtualMachines" - // ContainerTypeMicrosoftComputevirtualMachines ... - ContainerTypeMicrosoftComputevirtualMachines ContainerTypeBasicProtectionContainer = "Microsoft.Compute/virtualMachines" - // ContainerTypeProtectionContainer ... - ContainerTypeProtectionContainer ContainerTypeBasicProtectionContainer = "ProtectionContainer" - // ContainerTypeSQLAGWorkLoadContainer1 ... - ContainerTypeSQLAGWorkLoadContainer1 ContainerTypeBasicProtectionContainer = "SQLAGWorkLoadContainer" - // ContainerTypeStorageContainer1 ... - ContainerTypeStorageContainer1 ContainerTypeBasicProtectionContainer = "StorageContainer" - // ContainerTypeVMAppContainer1 ... - ContainerTypeVMAppContainer1 ContainerTypeBasicProtectionContainer = "VMAppContainer" - // ContainerTypeWindows1 ... - ContainerTypeWindows1 ContainerTypeBasicProtectionContainer = "Windows" -) - -// PossibleContainerTypeBasicProtectionContainerValues returns an array of possible values for the ContainerTypeBasicProtectionContainer const type. -func PossibleContainerTypeBasicProtectionContainerValues() []ContainerTypeBasicProtectionContainer { - return []ContainerTypeBasicProtectionContainer{ContainerTypeAzureBackupServerContainer1, ContainerTypeAzureSQLContainer1, ContainerTypeAzureWorkloadContainer, ContainerTypeDPMContainer1, ContainerTypeGenericContainer1, ContainerTypeIaaSVMContainer, ContainerTypeMicrosoftClassicComputevirtualMachines, ContainerTypeMicrosoftComputevirtualMachines, ContainerTypeProtectionContainer, ContainerTypeSQLAGWorkLoadContainer1, ContainerTypeStorageContainer1, ContainerTypeVMAppContainer1, ContainerTypeWindows1} -} - -// CopyOptions enumerates the values for copy options. -type CopyOptions string - -const ( - // CopyOptionsCreateCopy ... - CopyOptionsCreateCopy CopyOptions = "CreateCopy" - // CopyOptionsFailOnConflict ... - CopyOptionsFailOnConflict CopyOptions = "FailOnConflict" - // CopyOptionsInvalid ... - CopyOptionsInvalid CopyOptions = "Invalid" - // CopyOptionsOverwrite ... - CopyOptionsOverwrite CopyOptions = "Overwrite" - // CopyOptionsSkip ... - CopyOptionsSkip CopyOptions = "Skip" -) - -// PossibleCopyOptionsValues returns an array of possible values for the CopyOptions const type. -func PossibleCopyOptionsValues() []CopyOptions { - return []CopyOptions{CopyOptionsCreateCopy, CopyOptionsFailOnConflict, CopyOptionsInvalid, CopyOptionsOverwrite, CopyOptionsSkip} -} - -// CreateMode enumerates the values for create mode. -type CreateMode string - -const ( - // CreateModeDefault ... - CreateModeDefault CreateMode = "Default" - // CreateModeInvalid ... - CreateModeInvalid CreateMode = "Invalid" - // CreateModeRecover ... - CreateModeRecover CreateMode = "Recover" -) - -// PossibleCreateModeValues returns an array of possible values for the CreateMode const type. -func PossibleCreateModeValues() []CreateMode { - return []CreateMode{CreateModeDefault, CreateModeInvalid, CreateModeRecover} -} - -// DataSourceType enumerates the values for data source type. -type DataSourceType string - -const ( - // DataSourceTypeAzureFileShare ... - DataSourceTypeAzureFileShare DataSourceType = "AzureFileShare" - // DataSourceTypeAzureSQLDb ... - DataSourceTypeAzureSQLDb DataSourceType = "AzureSqlDb" - // DataSourceTypeClient ... - DataSourceTypeClient DataSourceType = "Client" - // DataSourceTypeExchange ... - DataSourceTypeExchange DataSourceType = "Exchange" - // DataSourceTypeFileFolder ... - DataSourceTypeFileFolder DataSourceType = "FileFolder" - // DataSourceTypeGenericDataSource ... - DataSourceTypeGenericDataSource DataSourceType = "GenericDataSource" - // DataSourceTypeInvalid ... - DataSourceTypeInvalid DataSourceType = "Invalid" - // DataSourceTypeSAPAseDatabase ... - DataSourceTypeSAPAseDatabase DataSourceType = "SAPAseDatabase" - // DataSourceTypeSAPHanaDatabase ... - DataSourceTypeSAPHanaDatabase DataSourceType = "SAPHanaDatabase" - // DataSourceTypeSharepoint ... - DataSourceTypeSharepoint DataSourceType = "Sharepoint" - // DataSourceTypeSQLDataBase ... - DataSourceTypeSQLDataBase DataSourceType = "SQLDataBase" - // DataSourceTypeSQLDB ... - DataSourceTypeSQLDB DataSourceType = "SQLDB" - // DataSourceTypeSystemState ... - DataSourceTypeSystemState DataSourceType = "SystemState" - // DataSourceTypeVM ... - DataSourceTypeVM DataSourceType = "VM" - // DataSourceTypeVMwareVM ... - DataSourceTypeVMwareVM DataSourceType = "VMwareVM" -) - -// PossibleDataSourceTypeValues returns an array of possible values for the DataSourceType const type. -func PossibleDataSourceTypeValues() []DataSourceType { - return []DataSourceType{DataSourceTypeAzureFileShare, DataSourceTypeAzureSQLDb, DataSourceTypeClient, DataSourceTypeExchange, DataSourceTypeFileFolder, DataSourceTypeGenericDataSource, DataSourceTypeInvalid, DataSourceTypeSAPAseDatabase, DataSourceTypeSAPHanaDatabase, DataSourceTypeSharepoint, DataSourceTypeSQLDataBase, DataSourceTypeSQLDB, DataSourceTypeSystemState, DataSourceTypeVM, DataSourceTypeVMwareVM} -} - -// DayOfWeek enumerates the values for day of week. -type DayOfWeek string - -const ( - // Friday ... - Friday DayOfWeek = "Friday" - // Monday ... - Monday DayOfWeek = "Monday" - // Saturday ... - Saturday DayOfWeek = "Saturday" - // Sunday ... - Sunday DayOfWeek = "Sunday" - // Thursday ... - Thursday DayOfWeek = "Thursday" - // Tuesday ... - Tuesday DayOfWeek = "Tuesday" - // Wednesday ... - Wednesday DayOfWeek = "Wednesday" -) - -// PossibleDayOfWeekValues returns an array of possible values for the DayOfWeek const type. -func PossibleDayOfWeekValues() []DayOfWeek { - return []DayOfWeek{Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday} -} - -// EngineType enumerates the values for engine type. -type EngineType string - -const ( - // BackupEngineTypeAzureBackupServerEngine ... - BackupEngineTypeAzureBackupServerEngine EngineType = "AzureBackupServerEngine" - // BackupEngineTypeBackupEngineBase ... - BackupEngineTypeBackupEngineBase EngineType = "BackupEngineBase" - // BackupEngineTypeDpmBackupEngine ... - BackupEngineTypeDpmBackupEngine EngineType = "DpmBackupEngine" -) - -// PossibleEngineTypeValues returns an array of possible values for the EngineType const type. -func PossibleEngineTypeValues() []EngineType { - return []EngineType{BackupEngineTypeAzureBackupServerEngine, BackupEngineTypeBackupEngineBase, BackupEngineTypeDpmBackupEngine} -} - -// EnhancedSecurityState enumerates the values for enhanced security state. -type EnhancedSecurityState string - -const ( - // EnhancedSecurityStateDisabled ... - EnhancedSecurityStateDisabled EnhancedSecurityState = "Disabled" - // EnhancedSecurityStateEnabled ... - EnhancedSecurityStateEnabled EnhancedSecurityState = "Enabled" - // EnhancedSecurityStateInvalid ... - EnhancedSecurityStateInvalid EnhancedSecurityState = "Invalid" -) - -// PossibleEnhancedSecurityStateValues returns an array of possible values for the EnhancedSecurityState const type. -func PossibleEnhancedSecurityStateValues() []EnhancedSecurityState { - return []EnhancedSecurityState{EnhancedSecurityStateDisabled, EnhancedSecurityStateEnabled, EnhancedSecurityStateInvalid} -} - -// FabricName enumerates the values for fabric name. -type FabricName string - -const ( - // FabricNameAzure ... - FabricNameAzure FabricName = "Azure" - // FabricNameInvalid ... - FabricNameInvalid FabricName = "Invalid" -) - -// PossibleFabricNameValues returns an array of possible values for the FabricName const type. -func PossibleFabricNameValues() []FabricName { - return []FabricName{FabricNameAzure, FabricNameInvalid} -} - -// FeatureType enumerates the values for feature type. -type FeatureType string - -const ( - // FeatureTypeAzureBackupGoals ... - FeatureTypeAzureBackupGoals FeatureType = "AzureBackupGoals" - // FeatureTypeAzureVMResourceBackup ... - FeatureTypeAzureVMResourceBackup FeatureType = "AzureVMResourceBackup" - // FeatureTypeFeatureSupportRequest ... - FeatureTypeFeatureSupportRequest FeatureType = "FeatureSupportRequest" -) - -// PossibleFeatureTypeValues returns an array of possible values for the FeatureType const type. -func PossibleFeatureTypeValues() []FeatureType { - return []FeatureType{FeatureTypeAzureBackupGoals, FeatureTypeAzureVMResourceBackup, FeatureTypeFeatureSupportRequest} -} - -// HealthState enumerates the values for health state. -type HealthState string - -const ( - // HealthStateActionRequired ... - HealthStateActionRequired HealthState = "ActionRequired" - // HealthStateActionSuggested ... - HealthStateActionSuggested HealthState = "ActionSuggested" - // HealthStateInvalid ... - HealthStateInvalid HealthState = "Invalid" - // HealthStatePassed ... - HealthStatePassed HealthState = "Passed" -) - -// PossibleHealthStateValues returns an array of possible values for the HealthState const type. -func PossibleHealthStateValues() []HealthState { - return []HealthState{HealthStateActionRequired, HealthStateActionSuggested, HealthStateInvalid, HealthStatePassed} -} - -// HealthStatus enumerates the values for health status. -type HealthStatus string - -const ( - // HealthStatusActionRequired ... - HealthStatusActionRequired HealthStatus = "ActionRequired" - // HealthStatusActionSuggested ... - HealthStatusActionSuggested HealthStatus = "ActionSuggested" - // HealthStatusInvalid ... - HealthStatusInvalid HealthStatus = "Invalid" - // HealthStatusPassed ... - HealthStatusPassed HealthStatus = "Passed" -) - -// PossibleHealthStatusValues returns an array of possible values for the HealthStatus const type. -func PossibleHealthStatusValues() []HealthStatus { - return []HealthStatus{HealthStatusActionRequired, HealthStatusActionSuggested, HealthStatusInvalid, HealthStatusPassed} -} - -// HTTPStatusCode enumerates the values for http status code. -type HTTPStatusCode string - -const ( - // Accepted ... - Accepted HTTPStatusCode = "Accepted" - // Ambiguous ... - Ambiguous HTTPStatusCode = "Ambiguous" - // BadGateway ... - BadGateway HTTPStatusCode = "BadGateway" - // BadRequest ... - BadRequest HTTPStatusCode = "BadRequest" - // Conflict ... - Conflict HTTPStatusCode = "Conflict" - // Continue ... - Continue HTTPStatusCode = "Continue" - // Created ... - Created HTTPStatusCode = "Created" - // ExpectationFailed ... - ExpectationFailed HTTPStatusCode = "ExpectationFailed" - // Forbidden ... - Forbidden HTTPStatusCode = "Forbidden" - // Found ... - Found HTTPStatusCode = "Found" - // GatewayTimeout ... - GatewayTimeout HTTPStatusCode = "GatewayTimeout" - // Gone ... - Gone HTTPStatusCode = "Gone" - // HTTPVersionNotSupported ... - HTTPVersionNotSupported HTTPStatusCode = "HttpVersionNotSupported" - // InternalServerError ... - InternalServerError HTTPStatusCode = "InternalServerError" - // LengthRequired ... - LengthRequired HTTPStatusCode = "LengthRequired" - // MethodNotAllowed ... - MethodNotAllowed HTTPStatusCode = "MethodNotAllowed" - // Moved ... - Moved HTTPStatusCode = "Moved" - // MovedPermanently ... - MovedPermanently HTTPStatusCode = "MovedPermanently" - // MultipleChoices ... - MultipleChoices HTTPStatusCode = "MultipleChoices" - // NoContent ... - NoContent HTTPStatusCode = "NoContent" - // NonAuthoritativeInformation ... - NonAuthoritativeInformation HTTPStatusCode = "NonAuthoritativeInformation" - // NotAcceptable ... - NotAcceptable HTTPStatusCode = "NotAcceptable" - // NotFound ... - NotFound HTTPStatusCode = "NotFound" - // NotImplemented ... - NotImplemented HTTPStatusCode = "NotImplemented" - // NotModified ... - NotModified HTTPStatusCode = "NotModified" - // OK ... - OK HTTPStatusCode = "OK" - // PartialContent ... - PartialContent HTTPStatusCode = "PartialContent" - // PaymentRequired ... - PaymentRequired HTTPStatusCode = "PaymentRequired" - // PreconditionFailed ... - PreconditionFailed HTTPStatusCode = "PreconditionFailed" - // ProxyAuthenticationRequired ... - ProxyAuthenticationRequired HTTPStatusCode = "ProxyAuthenticationRequired" - // Redirect ... - Redirect HTTPStatusCode = "Redirect" - // RedirectKeepVerb ... - RedirectKeepVerb HTTPStatusCode = "RedirectKeepVerb" - // RedirectMethod ... - RedirectMethod HTTPStatusCode = "RedirectMethod" - // RequestedRangeNotSatisfiable ... - RequestedRangeNotSatisfiable HTTPStatusCode = "RequestedRangeNotSatisfiable" - // RequestEntityTooLarge ... - RequestEntityTooLarge HTTPStatusCode = "RequestEntityTooLarge" - // RequestTimeout ... - RequestTimeout HTTPStatusCode = "RequestTimeout" - // RequestURITooLong ... - RequestURITooLong HTTPStatusCode = "RequestUriTooLong" - // ResetContent ... - ResetContent HTTPStatusCode = "ResetContent" - // SeeOther ... - SeeOther HTTPStatusCode = "SeeOther" - // ServiceUnavailable ... - ServiceUnavailable HTTPStatusCode = "ServiceUnavailable" - // SwitchingProtocols ... - SwitchingProtocols HTTPStatusCode = "SwitchingProtocols" - // TemporaryRedirect ... - TemporaryRedirect HTTPStatusCode = "TemporaryRedirect" - // Unauthorized ... - Unauthorized HTTPStatusCode = "Unauthorized" - // UnsupportedMediaType ... - UnsupportedMediaType HTTPStatusCode = "UnsupportedMediaType" - // Unused ... - Unused HTTPStatusCode = "Unused" - // UpgradeRequired ... - UpgradeRequired HTTPStatusCode = "UpgradeRequired" - // UseProxy ... - UseProxy HTTPStatusCode = "UseProxy" -) - -// PossibleHTTPStatusCodeValues returns an array of possible values for the HTTPStatusCode const type. -func PossibleHTTPStatusCodeValues() []HTTPStatusCode { - 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} -} - -// InquiryStatus enumerates the values for inquiry status. -type InquiryStatus string - -const ( - // InquiryStatusFailed ... - InquiryStatusFailed InquiryStatus = "Failed" - // InquiryStatusInvalid ... - InquiryStatusInvalid InquiryStatus = "Invalid" - // InquiryStatusSuccess ... - InquiryStatusSuccess InquiryStatus = "Success" -) - -// PossibleInquiryStatusValues returns an array of possible values for the InquiryStatus const type. -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 - -const ( - // ItemTypeAzureFileShare ... - ItemTypeAzureFileShare ItemType = "AzureFileShare" - // ItemTypeAzureSQLDb ... - ItemTypeAzureSQLDb ItemType = "AzureSqlDb" - // ItemTypeClient ... - ItemTypeClient ItemType = "Client" - // ItemTypeExchange ... - ItemTypeExchange ItemType = "Exchange" - // ItemTypeFileFolder ... - ItemTypeFileFolder ItemType = "FileFolder" - // ItemTypeGenericDataSource ... - ItemTypeGenericDataSource ItemType = "GenericDataSource" - // ItemTypeInvalid ... - ItemTypeInvalid ItemType = "Invalid" - // ItemTypeSAPAseDatabase ... - ItemTypeSAPAseDatabase ItemType = "SAPAseDatabase" - // ItemTypeSAPHanaDatabase ... - ItemTypeSAPHanaDatabase ItemType = "SAPHanaDatabase" - // ItemTypeSharepoint ... - ItemTypeSharepoint ItemType = "Sharepoint" - // ItemTypeSQLDataBase ... - ItemTypeSQLDataBase ItemType = "SQLDataBase" - // ItemTypeSQLDB ... - ItemTypeSQLDB ItemType = "SQLDB" - // ItemTypeSystemState ... - ItemTypeSystemState ItemType = "SystemState" - // ItemTypeVM ... - ItemTypeVM ItemType = "VM" - // ItemTypeVMwareVM ... - ItemTypeVMwareVM ItemType = "VMwareVM" -) - -// PossibleItemTypeValues returns an array of possible values for the ItemType const type. -func PossibleItemTypeValues() []ItemType { - return []ItemType{ItemTypeAzureFileShare, ItemTypeAzureSQLDb, ItemTypeClient, ItemTypeExchange, ItemTypeFileFolder, ItemTypeGenericDataSource, ItemTypeInvalid, ItemTypeSAPAseDatabase, ItemTypeSAPHanaDatabase, ItemTypeSharepoint, ItemTypeSQLDataBase, ItemTypeSQLDB, ItemTypeSystemState, ItemTypeVM, ItemTypeVMwareVM} -} - -// JobOperationType enumerates the values for job operation type. -type JobOperationType string - -const ( - // JobOperationTypeBackup ... - JobOperationTypeBackup JobOperationType = "Backup" - // JobOperationTypeConfigureBackup ... - JobOperationTypeConfigureBackup JobOperationType = "ConfigureBackup" - // JobOperationTypeCrossRegionRestore ... - JobOperationTypeCrossRegionRestore JobOperationType = "CrossRegionRestore" - // JobOperationTypeDeleteBackupData ... - JobOperationTypeDeleteBackupData JobOperationType = "DeleteBackupData" - // JobOperationTypeDisableBackup ... - JobOperationTypeDisableBackup JobOperationType = "DisableBackup" - // JobOperationTypeInvalid ... - JobOperationTypeInvalid JobOperationType = "Invalid" - // JobOperationTypeRegister ... - JobOperationTypeRegister JobOperationType = "Register" - // JobOperationTypeRestore ... - JobOperationTypeRestore JobOperationType = "Restore" - // JobOperationTypeUndelete ... - JobOperationTypeUndelete JobOperationType = "Undelete" - // JobOperationTypeUnRegister ... - JobOperationTypeUnRegister JobOperationType = "UnRegister" -) - -// PossibleJobOperationTypeValues returns an array of possible values for the JobOperationType const type. -func PossibleJobOperationTypeValues() []JobOperationType { - return []JobOperationType{JobOperationTypeBackup, JobOperationTypeConfigureBackup, JobOperationTypeCrossRegionRestore, JobOperationTypeDeleteBackupData, JobOperationTypeDisableBackup, JobOperationTypeInvalid, JobOperationTypeRegister, JobOperationTypeRestore, JobOperationTypeUndelete, JobOperationTypeUnRegister} -} - -// JobStatus enumerates the values for job status. -type JobStatus string - -const ( - // JobStatusCancelled ... - JobStatusCancelled JobStatus = "Cancelled" - // JobStatusCancelling ... - JobStatusCancelling JobStatus = "Cancelling" - // JobStatusCompleted ... - JobStatusCompleted JobStatus = "Completed" - // JobStatusCompletedWithWarnings ... - JobStatusCompletedWithWarnings JobStatus = "CompletedWithWarnings" - // JobStatusFailed ... - JobStatusFailed JobStatus = "Failed" - // JobStatusInProgress ... - JobStatusInProgress JobStatus = "InProgress" - // JobStatusInvalid ... - JobStatusInvalid JobStatus = "Invalid" -) - -// PossibleJobStatusValues returns an array of possible values for the JobStatus const type. -func PossibleJobStatusValues() []JobStatus { - return []JobStatus{JobStatusCancelled, JobStatusCancelling, JobStatusCompleted, JobStatusCompletedWithWarnings, JobStatusFailed, JobStatusInProgress, JobStatusInvalid} -} - -// JobSupportedAction enumerates the values for job supported action. -type JobSupportedAction string - -const ( - // JobSupportedActionCancellable ... - JobSupportedActionCancellable JobSupportedAction = "Cancellable" - // JobSupportedActionInvalid ... - JobSupportedActionInvalid JobSupportedAction = "Invalid" - // JobSupportedActionRetriable ... - JobSupportedActionRetriable JobSupportedAction = "Retriable" -) - -// PossibleJobSupportedActionValues returns an array of possible values for the JobSupportedAction const type. -func PossibleJobSupportedActionValues() []JobSupportedAction { - return []JobSupportedAction{JobSupportedActionCancellable, JobSupportedActionInvalid, JobSupportedActionRetriable} -} - -// JobType enumerates the values for job type. -type JobType string - -const ( - // JobTypeAzureIaaSVMJob ... - JobTypeAzureIaaSVMJob JobType = "AzureIaaSVMJob" - // JobTypeAzureStorageJob ... - JobTypeAzureStorageJob JobType = "AzureStorageJob" - // JobTypeAzureWorkloadJob ... - JobTypeAzureWorkloadJob JobType = "AzureWorkloadJob" - // JobTypeDpmJob ... - JobTypeDpmJob JobType = "DpmJob" - // JobTypeJob ... - JobTypeJob JobType = "Job" - // JobTypeMabJob ... - JobTypeMabJob JobType = "MabJob" -) - -// PossibleJobTypeValues returns an array of possible values for the JobType const type. -func PossibleJobTypeValues() []JobType { - return []JobType{JobTypeAzureIaaSVMJob, JobTypeAzureStorageJob, JobTypeAzureWorkloadJob, JobTypeDpmJob, JobTypeJob, JobTypeMabJob} -} - -// LastBackupStatus enumerates the values for last backup status. -type LastBackupStatus string - -const ( - // LastBackupStatusHealthy ... - LastBackupStatusHealthy LastBackupStatus = "Healthy" - // LastBackupStatusInvalid ... - LastBackupStatusInvalid LastBackupStatus = "Invalid" - // LastBackupStatusIRPending ... - LastBackupStatusIRPending LastBackupStatus = "IRPending" - // LastBackupStatusUnhealthy ... - LastBackupStatusUnhealthy LastBackupStatus = "Unhealthy" -) - -// PossibleLastBackupStatusValues returns an array of possible values for the LastBackupStatus const type. -func PossibleLastBackupStatusValues() []LastBackupStatus { - return []LastBackupStatus{LastBackupStatusHealthy, LastBackupStatusInvalid, LastBackupStatusIRPending, LastBackupStatusUnhealthy} -} - -// MabServerType enumerates the values for mab server type. -type MabServerType string - -const ( - // MabServerTypeAzureBackupServerContainer ... - MabServerTypeAzureBackupServerContainer MabServerType = "AzureBackupServerContainer" - // MabServerTypeAzureSQLContainer ... - MabServerTypeAzureSQLContainer MabServerType = "AzureSqlContainer" - // MabServerTypeCluster ... - MabServerTypeCluster MabServerType = "Cluster" - // MabServerTypeDPMContainer ... - MabServerTypeDPMContainer MabServerType = "DPMContainer" - // MabServerTypeGenericContainer ... - MabServerTypeGenericContainer MabServerType = "GenericContainer" - // MabServerTypeIaasVMContainer ... - MabServerTypeIaasVMContainer MabServerType = "IaasVMContainer" - // MabServerTypeIaasVMServiceContainer ... - MabServerTypeIaasVMServiceContainer MabServerType = "IaasVMServiceContainer" - // MabServerTypeInvalid ... - MabServerTypeInvalid MabServerType = "Invalid" - // MabServerTypeMABContainer ... - MabServerTypeMABContainer MabServerType = "MABContainer" - // MabServerTypeSQLAGWorkLoadContainer ... - MabServerTypeSQLAGWorkLoadContainer MabServerType = "SQLAGWorkLoadContainer" - // MabServerTypeStorageContainer ... - MabServerTypeStorageContainer MabServerType = "StorageContainer" - // MabServerTypeUnknown ... - MabServerTypeUnknown MabServerType = "Unknown" - // MabServerTypeVCenter ... - MabServerTypeVCenter MabServerType = "VCenter" - // MabServerTypeVMAppContainer ... - MabServerTypeVMAppContainer MabServerType = "VMAppContainer" - // MabServerTypeWindows ... - MabServerTypeWindows MabServerType = "Windows" -) - -// PossibleMabServerTypeValues returns an array of possible values for the MabServerType const type. -func PossibleMabServerTypeValues() []MabServerType { - return []MabServerType{MabServerTypeAzureBackupServerContainer, MabServerTypeAzureSQLContainer, MabServerTypeCluster, MabServerTypeDPMContainer, MabServerTypeGenericContainer, MabServerTypeIaasVMContainer, MabServerTypeIaasVMServiceContainer, MabServerTypeInvalid, MabServerTypeMABContainer, MabServerTypeSQLAGWorkLoadContainer, MabServerTypeStorageContainer, MabServerTypeUnknown, MabServerTypeVCenter, MabServerTypeVMAppContainer, MabServerTypeWindows} -} - -// ManagementType enumerates the values for management type. -type ManagementType string - -const ( - // ManagementTypeAzureBackupServer ... - ManagementTypeAzureBackupServer ManagementType = "AzureBackupServer" - // ManagementTypeAzureIaasVM ... - ManagementTypeAzureIaasVM ManagementType = "AzureIaasVM" - // ManagementTypeAzureSQL ... - ManagementTypeAzureSQL ManagementType = "AzureSql" - // ManagementTypeAzureStorage ... - ManagementTypeAzureStorage ManagementType = "AzureStorage" - // ManagementTypeAzureWorkload ... - ManagementTypeAzureWorkload ManagementType = "AzureWorkload" - // ManagementTypeDefaultBackup ... - ManagementTypeDefaultBackup ManagementType = "DefaultBackup" - // ManagementTypeDPM ... - ManagementTypeDPM ManagementType = "DPM" - // ManagementTypeInvalid ... - ManagementTypeInvalid ManagementType = "Invalid" - // ManagementTypeMAB ... - ManagementTypeMAB ManagementType = "MAB" -) - -// PossibleManagementTypeValues returns an array of possible values for the ManagementType const type. -func PossibleManagementTypeValues() []ManagementType { - return []ManagementType{ManagementTypeAzureBackupServer, ManagementTypeAzureIaasVM, ManagementTypeAzureSQL, ManagementTypeAzureStorage, ManagementTypeAzureWorkload, ManagementTypeDefaultBackup, ManagementTypeDPM, ManagementTypeInvalid, ManagementTypeMAB} -} - -// ManagementTypeBasicProtectionPolicy enumerates the values for management type basic protection policy. -type ManagementTypeBasicProtectionPolicy string - -const ( - // BackupManagementTypeAzureIaasVM ... - BackupManagementTypeAzureIaasVM ManagementTypeBasicProtectionPolicy = "AzureIaasVM" - // BackupManagementTypeAzureSQL ... - BackupManagementTypeAzureSQL ManagementTypeBasicProtectionPolicy = "AzureSql" - // BackupManagementTypeAzureStorage ... - BackupManagementTypeAzureStorage ManagementTypeBasicProtectionPolicy = "AzureStorage" - // BackupManagementTypeAzureWorkload ... - BackupManagementTypeAzureWorkload ManagementTypeBasicProtectionPolicy = "AzureWorkload" - // BackupManagementTypeGenericProtectionPolicy ... - BackupManagementTypeGenericProtectionPolicy ManagementTypeBasicProtectionPolicy = "GenericProtectionPolicy" - // BackupManagementTypeMAB ... - BackupManagementTypeMAB ManagementTypeBasicProtectionPolicy = "MAB" - // BackupManagementTypeProtectionPolicy ... - BackupManagementTypeProtectionPolicy ManagementTypeBasicProtectionPolicy = "ProtectionPolicy" -) - -// PossibleManagementTypeBasicProtectionPolicyValues returns an array of possible values for the ManagementTypeBasicProtectionPolicy const type. -func PossibleManagementTypeBasicProtectionPolicyValues() []ManagementTypeBasicProtectionPolicy { - return []ManagementTypeBasicProtectionPolicy{BackupManagementTypeAzureIaasVM, BackupManagementTypeAzureSQL, BackupManagementTypeAzureStorage, BackupManagementTypeAzureWorkload, BackupManagementTypeGenericProtectionPolicy, BackupManagementTypeMAB, BackupManagementTypeProtectionPolicy} -} - -// MonthOfYear enumerates the values for month of year. -type MonthOfYear string - -const ( - // MonthOfYearApril ... - MonthOfYearApril MonthOfYear = "April" - // MonthOfYearAugust ... - MonthOfYearAugust MonthOfYear = "August" - // MonthOfYearDecember ... - MonthOfYearDecember MonthOfYear = "December" - // MonthOfYearFebruary ... - MonthOfYearFebruary MonthOfYear = "February" - // MonthOfYearInvalid ... - MonthOfYearInvalid MonthOfYear = "Invalid" - // MonthOfYearJanuary ... - MonthOfYearJanuary MonthOfYear = "January" - // MonthOfYearJuly ... - MonthOfYearJuly MonthOfYear = "July" - // MonthOfYearJune ... - MonthOfYearJune MonthOfYear = "June" - // MonthOfYearMarch ... - MonthOfYearMarch MonthOfYear = "March" - // MonthOfYearMay ... - MonthOfYearMay MonthOfYear = "May" - // MonthOfYearNovember ... - MonthOfYearNovember MonthOfYear = "November" - // MonthOfYearOctober ... - MonthOfYearOctober MonthOfYear = "October" - // MonthOfYearSeptember ... - MonthOfYearSeptember MonthOfYear = "September" -) - -// PossibleMonthOfYearValues returns an array of possible values for the MonthOfYear const type. -func PossibleMonthOfYearValues() []MonthOfYear { - return []MonthOfYear{MonthOfYearApril, MonthOfYearAugust, MonthOfYearDecember, MonthOfYearFebruary, MonthOfYearInvalid, MonthOfYearJanuary, MonthOfYearJuly, MonthOfYearJune, MonthOfYearMarch, MonthOfYearMay, MonthOfYearNovember, MonthOfYearOctober, MonthOfYearSeptember} -} - -// ObjectType enumerates the values for object type. -type ObjectType string - -const ( - // ObjectTypeOperationStatusExtendedInfo ... - ObjectTypeOperationStatusExtendedInfo ObjectType = "OperationStatusExtendedInfo" - // ObjectTypeOperationStatusJobExtendedInfo ... - ObjectTypeOperationStatusJobExtendedInfo ObjectType = "OperationStatusJobExtendedInfo" - // ObjectTypeOperationStatusJobsExtendedInfo ... - ObjectTypeOperationStatusJobsExtendedInfo ObjectType = "OperationStatusJobsExtendedInfo" - // ObjectTypeOperationStatusProvisionILRExtendedInfo ... - ObjectTypeOperationStatusProvisionILRExtendedInfo ObjectType = "OperationStatusProvisionILRExtendedInfo" -) - -// PossibleObjectTypeValues returns an array of possible values for the ObjectType const type. -func PossibleObjectTypeValues() []ObjectType { - return []ObjectType{ObjectTypeOperationStatusExtendedInfo, ObjectTypeOperationStatusJobExtendedInfo, ObjectTypeOperationStatusJobsExtendedInfo, ObjectTypeOperationStatusProvisionILRExtendedInfo} -} - -// ObjectTypeBasicILRRequest enumerates the values for object type basic ilr request. -type ObjectTypeBasicILRRequest string - -const ( - // ObjectTypeAzureFileShareProvisionILRRequest ... - ObjectTypeAzureFileShareProvisionILRRequest ObjectTypeBasicILRRequest = "AzureFileShareProvisionILRRequest" - // ObjectTypeIaasVMILRRegistrationRequest ... - ObjectTypeIaasVMILRRegistrationRequest ObjectTypeBasicILRRequest = "IaasVMILRRegistrationRequest" - // ObjectTypeILRRequest ... - ObjectTypeILRRequest ObjectTypeBasicILRRequest = "ILRRequest" -) - -// PossibleObjectTypeBasicILRRequestValues returns an array of possible values for the ObjectTypeBasicILRRequest const type. -func PossibleObjectTypeBasicILRRequestValues() []ObjectTypeBasicILRRequest { - return []ObjectTypeBasicILRRequest{ObjectTypeAzureFileShareProvisionILRRequest, ObjectTypeIaasVMILRRegistrationRequest, ObjectTypeILRRequest} -} - -// ObjectTypeBasicOperationResultInfoBase enumerates the values for object type basic operation result info -// base. -type ObjectTypeBasicOperationResultInfoBase string - -const ( - // ObjectTypeExportJobsOperationResultInfo ... - ObjectTypeExportJobsOperationResultInfo ObjectTypeBasicOperationResultInfoBase = "ExportJobsOperationResultInfo" - // ObjectTypeOperationResultInfo ... - ObjectTypeOperationResultInfo ObjectTypeBasicOperationResultInfoBase = "OperationResultInfo" - // ObjectTypeOperationResultInfoBase ... - ObjectTypeOperationResultInfoBase ObjectTypeBasicOperationResultInfoBase = "OperationResultInfoBase" -) - -// PossibleObjectTypeBasicOperationResultInfoBaseValues returns an array of possible values for the ObjectTypeBasicOperationResultInfoBase const type. -func PossibleObjectTypeBasicOperationResultInfoBaseValues() []ObjectTypeBasicOperationResultInfoBase { - return []ObjectTypeBasicOperationResultInfoBase{ObjectTypeExportJobsOperationResultInfo, ObjectTypeOperationResultInfo, ObjectTypeOperationResultInfoBase} -} - -// ObjectTypeBasicRecoveryPoint enumerates the values for object type basic recovery point. -type ObjectTypeBasicRecoveryPoint string - -const ( - // ObjectTypeAzureFileShareRecoveryPoint ... - ObjectTypeAzureFileShareRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureFileShareRecoveryPoint" - // ObjectTypeAzureWorkloadPointInTimeRecoveryPoint ... - ObjectTypeAzureWorkloadPointInTimeRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadPointInTimeRecoveryPoint" - // ObjectTypeAzureWorkloadRecoveryPoint ... - ObjectTypeAzureWorkloadRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadRecoveryPoint" - // ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint ... - ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadSAPHanaPointInTimeRecoveryPoint" - // ObjectTypeAzureWorkloadSAPHanaRecoveryPoint ... - ObjectTypeAzureWorkloadSAPHanaRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadSAPHanaRecoveryPoint" - // ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint ... - ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadSQLPointInTimeRecoveryPoint" - // ObjectTypeAzureWorkloadSQLRecoveryPoint ... - ObjectTypeAzureWorkloadSQLRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadSQLRecoveryPoint" - // ObjectTypeGenericRecoveryPoint ... - ObjectTypeGenericRecoveryPoint ObjectTypeBasicRecoveryPoint = "GenericRecoveryPoint" - // ObjectTypeIaasVMRecoveryPoint ... - ObjectTypeIaasVMRecoveryPoint ObjectTypeBasicRecoveryPoint = "IaasVMRecoveryPoint" - // ObjectTypeRecoveryPoint ... - ObjectTypeRecoveryPoint ObjectTypeBasicRecoveryPoint = "RecoveryPoint" -) - -// PossibleObjectTypeBasicRecoveryPointValues returns an array of possible values for the ObjectTypeBasicRecoveryPoint const type. -func PossibleObjectTypeBasicRecoveryPointValues() []ObjectTypeBasicRecoveryPoint { - return []ObjectTypeBasicRecoveryPoint{ObjectTypeAzureFileShareRecoveryPoint, ObjectTypeAzureWorkloadPointInTimeRecoveryPoint, ObjectTypeAzureWorkloadRecoveryPoint, ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint, ObjectTypeAzureWorkloadSAPHanaRecoveryPoint, ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint, ObjectTypeAzureWorkloadSQLRecoveryPoint, ObjectTypeGenericRecoveryPoint, ObjectTypeIaasVMRecoveryPoint, ObjectTypeRecoveryPoint} -} - -// ObjectTypeBasicRequest enumerates the values for object type basic request. -type ObjectTypeBasicRequest string - -const ( - // ObjectTypeAzureFileShareBackupRequest ... - ObjectTypeAzureFileShareBackupRequest ObjectTypeBasicRequest = "AzureFileShareBackupRequest" - // ObjectTypeAzureWorkloadBackupRequest ... - ObjectTypeAzureWorkloadBackupRequest ObjectTypeBasicRequest = "AzureWorkloadBackupRequest" - // ObjectTypeBackupRequest ... - ObjectTypeBackupRequest ObjectTypeBasicRequest = "BackupRequest" - // ObjectTypeIaasVMBackupRequest ... - ObjectTypeIaasVMBackupRequest ObjectTypeBasicRequest = "IaasVMBackupRequest" -) - -// PossibleObjectTypeBasicRequestValues returns an array of possible values for the ObjectTypeBasicRequest const type. -func PossibleObjectTypeBasicRequestValues() []ObjectTypeBasicRequest { - return []ObjectTypeBasicRequest{ObjectTypeAzureFileShareBackupRequest, ObjectTypeAzureWorkloadBackupRequest, ObjectTypeBackupRequest, ObjectTypeIaasVMBackupRequest} -} - -// ObjectTypeBasicRestoreRequest enumerates the values for object type basic restore request. -type ObjectTypeBasicRestoreRequest string - -const ( - // ObjectTypeAzureFileShareRestoreRequest ... - ObjectTypeAzureFileShareRestoreRequest ObjectTypeBasicRestoreRequest = "AzureFileShareRestoreRequest" - // ObjectTypeAzureWorkloadPointInTimeRestoreRequest ... - ObjectTypeAzureWorkloadPointInTimeRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadPointInTimeRestoreRequest" - // ObjectTypeAzureWorkloadRestoreRequest ... - ObjectTypeAzureWorkloadRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadRestoreRequest" - // ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest ... - ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadSAPHanaPointInTimeRestoreRequest" - // ObjectTypeAzureWorkloadSAPHanaRestoreRequest ... - ObjectTypeAzureWorkloadSAPHanaRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadSAPHanaRestoreRequest" - // ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest ... - ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadSQLPointInTimeRestoreRequest" - // ObjectTypeAzureWorkloadSQLRestoreRequest ... - ObjectTypeAzureWorkloadSQLRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadSQLRestoreRequest" - // ObjectTypeIaasVMRestoreRequest ... - ObjectTypeIaasVMRestoreRequest ObjectTypeBasicRestoreRequest = "IaasVMRestoreRequest" - // ObjectTypeRestoreRequest ... - ObjectTypeRestoreRequest ObjectTypeBasicRestoreRequest = "RestoreRequest" -) - -// PossibleObjectTypeBasicRestoreRequestValues returns an array of possible values for the ObjectTypeBasicRestoreRequest const type. -func PossibleObjectTypeBasicRestoreRequestValues() []ObjectTypeBasicRestoreRequest { - return []ObjectTypeBasicRestoreRequest{ObjectTypeAzureFileShareRestoreRequest, ObjectTypeAzureWorkloadPointInTimeRestoreRequest, ObjectTypeAzureWorkloadRestoreRequest, ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest, ObjectTypeAzureWorkloadSAPHanaRestoreRequest, ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest, ObjectTypeAzureWorkloadSQLRestoreRequest, ObjectTypeIaasVMRestoreRequest, ObjectTypeRestoreRequest} -} - -// ObjectTypeBasicValidateOperationRequest enumerates the values for object type basic validate operation -// request. -type ObjectTypeBasicValidateOperationRequest string - -const ( - // ObjectTypeValidateIaasVMRestoreOperationRequest ... - ObjectTypeValidateIaasVMRestoreOperationRequest ObjectTypeBasicValidateOperationRequest = "ValidateIaasVMRestoreOperationRequest" - // ObjectTypeValidateOperationRequest ... - ObjectTypeValidateOperationRequest ObjectTypeBasicValidateOperationRequest = "ValidateOperationRequest" - // ObjectTypeValidateRestoreOperationRequest ... - ObjectTypeValidateRestoreOperationRequest ObjectTypeBasicValidateOperationRequest = "ValidateRestoreOperationRequest" -) - -// PossibleObjectTypeBasicValidateOperationRequestValues returns an array of possible values for the ObjectTypeBasicValidateOperationRequest const type. -func PossibleObjectTypeBasicValidateOperationRequestValues() []ObjectTypeBasicValidateOperationRequest { - return []ObjectTypeBasicValidateOperationRequest{ObjectTypeValidateIaasVMRestoreOperationRequest, ObjectTypeValidateOperationRequest, ObjectTypeValidateRestoreOperationRequest} -} - // OperationStatusValues enumerates the values for operation status values. type OperationStatusValues string const ( - // OperationStatusValuesCanceled ... - OperationStatusValuesCanceled OperationStatusValues = "Canceled" - // OperationStatusValuesFailed ... - OperationStatusValuesFailed OperationStatusValues = "Failed" - // OperationStatusValuesInProgress ... - OperationStatusValuesInProgress OperationStatusValues = "InProgress" - // OperationStatusValuesInvalid ... - OperationStatusValuesInvalid OperationStatusValues = "Invalid" - // OperationStatusValuesSucceeded ... - OperationStatusValuesSucceeded OperationStatusValues = "Succeeded" + // Canceled ... + Canceled OperationStatusValues = "Canceled" + // Failed ... + Failed OperationStatusValues = "Failed" + // InProgress ... + InProgress OperationStatusValues = "InProgress" + // Invalid ... + Invalid OperationStatusValues = "Invalid" + // Succeeded ... + Succeeded OperationStatusValues = "Succeeded" ) // PossibleOperationStatusValuesValues returns an array of possible values for the OperationStatusValues const type. func PossibleOperationStatusValuesValues() []OperationStatusValues { - return []OperationStatusValues{OperationStatusValuesCanceled, OperationStatusValuesFailed, OperationStatusValuesInProgress, OperationStatusValuesInvalid, OperationStatusValuesSucceeded} -} - -// OperationType enumerates the values for operation type. -type OperationType string - -const ( - // OperationTypeInvalid ... - OperationTypeInvalid OperationType = "Invalid" - // OperationTypeRegister ... - OperationTypeRegister OperationType = "Register" - // OperationTypeReregister ... - OperationTypeReregister OperationType = "Reregister" -) - -// PossibleOperationTypeValues returns an array of possible values for the OperationType const type. -func PossibleOperationTypeValues() []OperationType { - return []OperationType{OperationTypeInvalid, OperationTypeRegister, OperationTypeReregister} -} - -// OverwriteOptions enumerates the values for overwrite options. -type OverwriteOptions string - -const ( - // OverwriteOptionsFailOnConflict ... - OverwriteOptionsFailOnConflict OverwriteOptions = "FailOnConflict" - // OverwriteOptionsInvalid ... - OverwriteOptionsInvalid OverwriteOptions = "Invalid" - // OverwriteOptionsOverwrite ... - OverwriteOptionsOverwrite OverwriteOptions = "Overwrite" -) - -// PossibleOverwriteOptionsValues returns an array of possible values for the OverwriteOptions const type. -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} + return []OperationStatusValues{Canceled, Failed, InProgress, Invalid, Succeeded} } // PrivateEndpointConnectionStatus enumerates the values for private endpoint connection status. @@ -982,204 +46,6 @@ func PossiblePrivateEndpointConnectionStatusValues() []PrivateEndpointConnection return []PrivateEndpointConnectionStatus{Approved, Disconnected, Pending, Rejected} } -// ProtectableContainerType enumerates the values for protectable container type. -type ProtectableContainerType string - -const ( - // ProtectableContainerTypeProtectableContainer ... - ProtectableContainerTypeProtectableContainer ProtectableContainerType = "ProtectableContainer" - // ProtectableContainerTypeStorageContainer ... - ProtectableContainerTypeStorageContainer ProtectableContainerType = "StorageContainer" - // ProtectableContainerTypeVMAppContainer ... - ProtectableContainerTypeVMAppContainer ProtectableContainerType = "VMAppContainer" -) - -// PossibleProtectableContainerTypeValues returns an array of possible values for the ProtectableContainerType const type. -func PossibleProtectableContainerTypeValues() []ProtectableContainerType { - return []ProtectableContainerType{ProtectableContainerTypeProtectableContainer, ProtectableContainerTypeStorageContainer, ProtectableContainerTypeVMAppContainer} -} - -// ProtectableItemType enumerates the values for protectable item type. -type ProtectableItemType string - -const ( - // ProtectableItemTypeAzureFileShare ... - ProtectableItemTypeAzureFileShare ProtectableItemType = "AzureFileShare" - // ProtectableItemTypeAzureVMWorkloadProtectableItem ... - ProtectableItemTypeAzureVMWorkloadProtectableItem ProtectableItemType = "AzureVmWorkloadProtectableItem" - // ProtectableItemTypeIaaSVMProtectableItem ... - ProtectableItemTypeIaaSVMProtectableItem ProtectableItemType = "IaaSVMProtectableItem" - // ProtectableItemTypeMicrosoftClassicComputevirtualMachines ... - ProtectableItemTypeMicrosoftClassicComputevirtualMachines ProtectableItemType = "Microsoft.ClassicCompute/virtualMachines" - // ProtectableItemTypeMicrosoftComputevirtualMachines ... - ProtectableItemTypeMicrosoftComputevirtualMachines ProtectableItemType = "Microsoft.Compute/virtualMachines" - // ProtectableItemTypeSAPAseSystem ... - ProtectableItemTypeSAPAseSystem ProtectableItemType = "SAPAseSystem" - // ProtectableItemTypeSAPHanaDatabase ... - ProtectableItemTypeSAPHanaDatabase ProtectableItemType = "SAPHanaDatabase" - // ProtectableItemTypeSAPHanaSystem ... - ProtectableItemTypeSAPHanaSystem ProtectableItemType = "SAPHanaSystem" - // ProtectableItemTypeSQLAvailabilityGroupContainer ... - ProtectableItemTypeSQLAvailabilityGroupContainer ProtectableItemType = "SQLAvailabilityGroupContainer" - // ProtectableItemTypeSQLDataBase ... - ProtectableItemTypeSQLDataBase ProtectableItemType = "SQLDataBase" - // ProtectableItemTypeSQLInstance ... - ProtectableItemTypeSQLInstance ProtectableItemType = "SQLInstance" - // ProtectableItemTypeWorkloadProtectableItem ... - ProtectableItemTypeWorkloadProtectableItem ProtectableItemType = "WorkloadProtectableItem" -) - -// PossibleProtectableItemTypeValues returns an array of possible values for the ProtectableItemType const type. -func PossibleProtectableItemTypeValues() []ProtectableItemType { - return []ProtectableItemType{ProtectableItemTypeAzureFileShare, ProtectableItemTypeAzureVMWorkloadProtectableItem, ProtectableItemTypeIaaSVMProtectableItem, ProtectableItemTypeMicrosoftClassicComputevirtualMachines, ProtectableItemTypeMicrosoftComputevirtualMachines, ProtectableItemTypeSAPAseSystem, ProtectableItemTypeSAPHanaDatabase, ProtectableItemTypeSAPHanaSystem, ProtectableItemTypeSQLAvailabilityGroupContainer, ProtectableItemTypeSQLDataBase, ProtectableItemTypeSQLInstance, ProtectableItemTypeWorkloadProtectableItem} -} - -// ProtectedItemHealthStatus enumerates the values for protected item health status. -type ProtectedItemHealthStatus string - -const ( - // ProtectedItemHealthStatusHealthy ... - ProtectedItemHealthStatusHealthy ProtectedItemHealthStatus = "Healthy" - // ProtectedItemHealthStatusInvalid ... - ProtectedItemHealthStatusInvalid ProtectedItemHealthStatus = "Invalid" - // ProtectedItemHealthStatusIRPending ... - ProtectedItemHealthStatusIRPending ProtectedItemHealthStatus = "IRPending" - // ProtectedItemHealthStatusNotReachable ... - ProtectedItemHealthStatusNotReachable ProtectedItemHealthStatus = "NotReachable" - // ProtectedItemHealthStatusUnhealthy ... - ProtectedItemHealthStatusUnhealthy ProtectedItemHealthStatus = "Unhealthy" -) - -// PossibleProtectedItemHealthStatusValues returns an array of possible values for the ProtectedItemHealthStatus const type. -func PossibleProtectedItemHealthStatusValues() []ProtectedItemHealthStatus { - return []ProtectedItemHealthStatus{ProtectedItemHealthStatusHealthy, ProtectedItemHealthStatusInvalid, ProtectedItemHealthStatusIRPending, ProtectedItemHealthStatusNotReachable, ProtectedItemHealthStatusUnhealthy} -} - -// ProtectedItemState enumerates the values for protected item state. -type ProtectedItemState string - -const ( - // ProtectedItemStateInvalid ... - ProtectedItemStateInvalid ProtectedItemState = "Invalid" - // ProtectedItemStateIRPending ... - ProtectedItemStateIRPending ProtectedItemState = "IRPending" - // ProtectedItemStateProtected ... - ProtectedItemStateProtected ProtectedItemState = "Protected" - // ProtectedItemStateProtectionError ... - ProtectedItemStateProtectionError ProtectedItemState = "ProtectionError" - // ProtectedItemStateProtectionPaused ... - ProtectedItemStateProtectionPaused ProtectedItemState = "ProtectionPaused" - // ProtectedItemStateProtectionStopped ... - ProtectedItemStateProtectionStopped ProtectedItemState = "ProtectionStopped" -) - -// PossibleProtectedItemStateValues returns an array of possible values for the ProtectedItemState const type. -func PossibleProtectedItemStateValues() []ProtectedItemState { - return []ProtectedItemState{ProtectedItemStateInvalid, ProtectedItemStateIRPending, ProtectedItemStateProtected, ProtectedItemStateProtectionError, ProtectedItemStateProtectionPaused, ProtectedItemStateProtectionStopped} -} - -// ProtectedItemType enumerates the values for protected item type. -type ProtectedItemType string - -const ( - // ProtectedItemTypeAzureFileShareProtectedItem ... - ProtectedItemTypeAzureFileShareProtectedItem ProtectedItemType = "AzureFileShareProtectedItem" - // ProtectedItemTypeAzureIaaSVMProtectedItem ... - ProtectedItemTypeAzureIaaSVMProtectedItem ProtectedItemType = "AzureIaaSVMProtectedItem" - // ProtectedItemTypeAzureVMWorkloadProtectedItem ... - ProtectedItemTypeAzureVMWorkloadProtectedItem ProtectedItemType = "AzureVmWorkloadProtectedItem" - // ProtectedItemTypeAzureVMWorkloadSAPAseDatabase ... - ProtectedItemTypeAzureVMWorkloadSAPAseDatabase ProtectedItemType = "AzureVmWorkloadSAPAseDatabase" - // ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase ... - ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase ProtectedItemType = "AzureVmWorkloadSAPHanaDatabase" - // ProtectedItemTypeAzureVMWorkloadSQLDatabase ... - ProtectedItemTypeAzureVMWorkloadSQLDatabase ProtectedItemType = "AzureVmWorkloadSQLDatabase" - // ProtectedItemTypeDPMProtectedItem ... - ProtectedItemTypeDPMProtectedItem ProtectedItemType = "DPMProtectedItem" - // ProtectedItemTypeGenericProtectedItem ... - ProtectedItemTypeGenericProtectedItem ProtectedItemType = "GenericProtectedItem" - // ProtectedItemTypeMabFileFolderProtectedItem ... - ProtectedItemTypeMabFileFolderProtectedItem ProtectedItemType = "MabFileFolderProtectedItem" - // ProtectedItemTypeMicrosoftClassicComputevirtualMachines ... - ProtectedItemTypeMicrosoftClassicComputevirtualMachines ProtectedItemType = "Microsoft.ClassicCompute/virtualMachines" - // ProtectedItemTypeMicrosoftComputevirtualMachines ... - ProtectedItemTypeMicrosoftComputevirtualMachines ProtectedItemType = "Microsoft.Compute/virtualMachines" - // ProtectedItemTypeMicrosoftSqlserversdatabases ... - ProtectedItemTypeMicrosoftSqlserversdatabases ProtectedItemType = "Microsoft.Sql/servers/databases" - // ProtectedItemTypeProtectedItem ... - ProtectedItemTypeProtectedItem ProtectedItemType = "ProtectedItem" -) - -// PossibleProtectedItemTypeValues returns an array of possible values for the ProtectedItemType const type. -func PossibleProtectedItemTypeValues() []ProtectedItemType { - return []ProtectedItemType{ProtectedItemTypeAzureFileShareProtectedItem, ProtectedItemTypeAzureIaaSVMProtectedItem, ProtectedItemTypeAzureVMWorkloadProtectedItem, ProtectedItemTypeAzureVMWorkloadSAPAseDatabase, ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase, ProtectedItemTypeAzureVMWorkloadSQLDatabase, ProtectedItemTypeDPMProtectedItem, ProtectedItemTypeGenericProtectedItem, ProtectedItemTypeMabFileFolderProtectedItem, ProtectedItemTypeMicrosoftClassicComputevirtualMachines, ProtectedItemTypeMicrosoftComputevirtualMachines, ProtectedItemTypeMicrosoftSqlserversdatabases, ProtectedItemTypeProtectedItem} -} - -// ProtectionIntentItemType enumerates the values for protection intent item type. -type ProtectionIntentItemType string - -const ( - // ProtectionIntentItemTypeAzureResourceItem ... - ProtectionIntentItemTypeAzureResourceItem ProtectionIntentItemType = "AzureResourceItem" - // ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent ... - ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent ProtectionIntentItemType = "AzureWorkloadAutoProtectionIntent" - // ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent ... - ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent ProtectionIntentItemType = "AzureWorkloadSQLAutoProtectionIntent" - // ProtectionIntentItemTypeProtectionIntent ... - ProtectionIntentItemTypeProtectionIntent ProtectionIntentItemType = "ProtectionIntent" - // ProtectionIntentItemTypeRecoveryServiceVaultItem ... - ProtectionIntentItemTypeRecoveryServiceVaultItem ProtectionIntentItemType = "RecoveryServiceVaultItem" -) - -// PossibleProtectionIntentItemTypeValues returns an array of possible values for the ProtectionIntentItemType const type. -func PossibleProtectionIntentItemTypeValues() []ProtectionIntentItemType { - return []ProtectionIntentItemType{ProtectionIntentItemTypeAzureResourceItem, ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent, ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent, ProtectionIntentItemTypeProtectionIntent, ProtectionIntentItemTypeRecoveryServiceVaultItem} -} - -// ProtectionState enumerates the values for protection state. -type ProtectionState string - -const ( - // ProtectionStateInvalid ... - ProtectionStateInvalid ProtectionState = "Invalid" - // ProtectionStateIRPending ... - ProtectionStateIRPending ProtectionState = "IRPending" - // ProtectionStateProtected ... - ProtectionStateProtected ProtectionState = "Protected" - // ProtectionStateProtectionError ... - ProtectionStateProtectionError ProtectionState = "ProtectionError" - // ProtectionStateProtectionPaused ... - ProtectionStateProtectionPaused ProtectionState = "ProtectionPaused" - // ProtectionStateProtectionStopped ... - ProtectionStateProtectionStopped ProtectionState = "ProtectionStopped" -) - -// PossibleProtectionStateValues returns an array of possible values for the ProtectionState const type. -func PossibleProtectionStateValues() []ProtectionState { - return []ProtectionState{ProtectionStateInvalid, ProtectionStateIRPending, ProtectionStateProtected, ProtectionStateProtectionError, ProtectionStateProtectionPaused, ProtectionStateProtectionStopped} -} - -// ProtectionStatus enumerates the values for protection status. -type ProtectionStatus string - -const ( - // ProtectionStatusInvalid ... - ProtectionStatusInvalid ProtectionStatus = "Invalid" - // ProtectionStatusNotProtected ... - ProtectionStatusNotProtected ProtectionStatus = "NotProtected" - // ProtectionStatusProtected ... - ProtectionStatusProtected ProtectionStatus = "Protected" - // ProtectionStatusProtecting ... - ProtectionStatusProtecting ProtectionStatus = "Protecting" - // ProtectionStatusProtectionFailed ... - ProtectionStatusProtectionFailed ProtectionStatus = "ProtectionFailed" -) - -// PossibleProtectionStatusValues returns an array of possible values for the ProtectionStatus const type. -func PossibleProtectionStatusValues() []ProtectionStatus { - return []ProtectionStatus{ProtectionStatusInvalid, ProtectionStatusNotProtected, ProtectionStatusProtected, ProtectionStatusProtecting, ProtectionStatusProtectionFailed} -} - // ProvisioningState enumerates the values for provisioning state. type ProvisioningState string @@ -1198,533 +64,3 @@ const ( func PossibleProvisioningStateValues() []ProvisioningState { return []ProvisioningState{ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStatePending, ProvisioningStateSucceeded} } - -// RecoveryMode enumerates the values for recovery mode. -type RecoveryMode string - -const ( - // RecoveryModeFileRecovery ... - RecoveryModeFileRecovery RecoveryMode = "FileRecovery" - // RecoveryModeInvalid ... - RecoveryModeInvalid RecoveryMode = "Invalid" - // RecoveryModeWorkloadRecovery ... - RecoveryModeWorkloadRecovery RecoveryMode = "WorkloadRecovery" -) - -// PossibleRecoveryModeValues returns an array of possible values for the RecoveryMode const type. -func PossibleRecoveryModeValues() []RecoveryMode { - return []RecoveryMode{RecoveryModeFileRecovery, RecoveryModeInvalid, RecoveryModeWorkloadRecovery} -} - -// RecoveryPointTierStatus enumerates the values for recovery point tier status. -type RecoveryPointTierStatus string - -const ( - // RecoveryPointTierStatusDeleted ... - RecoveryPointTierStatusDeleted RecoveryPointTierStatus = "Deleted" - // RecoveryPointTierStatusDisabled ... - RecoveryPointTierStatusDisabled RecoveryPointTierStatus = "Disabled" - // RecoveryPointTierStatusInvalid ... - RecoveryPointTierStatusInvalid RecoveryPointTierStatus = "Invalid" - // RecoveryPointTierStatusValid ... - RecoveryPointTierStatusValid RecoveryPointTierStatus = "Valid" -) - -// PossibleRecoveryPointTierStatusValues returns an array of possible values for the RecoveryPointTierStatus const type. -func PossibleRecoveryPointTierStatusValues() []RecoveryPointTierStatus { - return []RecoveryPointTierStatus{RecoveryPointTierStatusDeleted, RecoveryPointTierStatusDisabled, RecoveryPointTierStatusInvalid, RecoveryPointTierStatusValid} -} - -// RecoveryPointTierType enumerates the values for recovery point tier type. -type RecoveryPointTierType string - -const ( - // RecoveryPointTierTypeHardenedRP ... - RecoveryPointTierTypeHardenedRP RecoveryPointTierType = "HardenedRP" - // RecoveryPointTierTypeInstantRP ... - RecoveryPointTierTypeInstantRP RecoveryPointTierType = "InstantRP" - // RecoveryPointTierTypeInvalid ... - RecoveryPointTierTypeInvalid RecoveryPointTierType = "Invalid" -) - -// PossibleRecoveryPointTierTypeValues returns an array of possible values for the RecoveryPointTierType const type. -func PossibleRecoveryPointTierTypeValues() []RecoveryPointTierType { - return []RecoveryPointTierType{RecoveryPointTierTypeHardenedRP, RecoveryPointTierTypeInstantRP, RecoveryPointTierTypeInvalid} -} - -// RecoveryType enumerates the values for recovery type. -type RecoveryType string - -const ( - // RecoveryTypeAlternateLocation ... - RecoveryTypeAlternateLocation RecoveryType = "AlternateLocation" - // RecoveryTypeInvalid ... - RecoveryTypeInvalid RecoveryType = "Invalid" - // RecoveryTypeOffline ... - RecoveryTypeOffline RecoveryType = "Offline" - // RecoveryTypeOriginalLocation ... - RecoveryTypeOriginalLocation RecoveryType = "OriginalLocation" - // RecoveryTypeRestoreDisks ... - RecoveryTypeRestoreDisks RecoveryType = "RestoreDisks" -) - -// PossibleRecoveryTypeValues returns an array of possible values for the RecoveryType const type. -func PossibleRecoveryTypeValues() []RecoveryType { - return []RecoveryType{RecoveryTypeAlternateLocation, RecoveryTypeInvalid, RecoveryTypeOffline, RecoveryTypeOriginalLocation, RecoveryTypeRestoreDisks} -} - -// ResourceHealthStatus enumerates the values for resource health status. -type ResourceHealthStatus string - -const ( - // ResourceHealthStatusHealthy ... - ResourceHealthStatusHealthy ResourceHealthStatus = "Healthy" - // ResourceHealthStatusInvalid ... - ResourceHealthStatusInvalid ResourceHealthStatus = "Invalid" - // ResourceHealthStatusPersistentDegraded ... - ResourceHealthStatusPersistentDegraded ResourceHealthStatus = "PersistentDegraded" - // ResourceHealthStatusPersistentUnhealthy ... - ResourceHealthStatusPersistentUnhealthy ResourceHealthStatus = "PersistentUnhealthy" - // ResourceHealthStatusTransientDegraded ... - ResourceHealthStatusTransientDegraded ResourceHealthStatus = "TransientDegraded" - // ResourceHealthStatusTransientUnhealthy ... - ResourceHealthStatusTransientUnhealthy ResourceHealthStatus = "TransientUnhealthy" -) - -// PossibleResourceHealthStatusValues returns an array of possible values for the ResourceHealthStatus const type. -func PossibleResourceHealthStatusValues() []ResourceHealthStatus { - return []ResourceHealthStatus{ResourceHealthStatusHealthy, ResourceHealthStatusInvalid, ResourceHealthStatusPersistentDegraded, ResourceHealthStatusPersistentUnhealthy, ResourceHealthStatusTransientDegraded, ResourceHealthStatusTransientUnhealthy} -} - -// RestorePointQueryType enumerates the values for restore point query type. -type RestorePointQueryType string - -const ( - // RestorePointQueryTypeAll ... - RestorePointQueryTypeAll RestorePointQueryType = "All" - // RestorePointQueryTypeDifferential ... - RestorePointQueryTypeDifferential RestorePointQueryType = "Differential" - // RestorePointQueryTypeFull ... - RestorePointQueryTypeFull RestorePointQueryType = "Full" - // RestorePointQueryTypeFullAndDifferential ... - RestorePointQueryTypeFullAndDifferential RestorePointQueryType = "FullAndDifferential" - // RestorePointQueryTypeInvalid ... - RestorePointQueryTypeInvalid RestorePointQueryType = "Invalid" - // RestorePointQueryTypeLog ... - RestorePointQueryTypeLog RestorePointQueryType = "Log" -) - -// PossibleRestorePointQueryTypeValues returns an array of possible values for the RestorePointQueryType const type. -func PossibleRestorePointQueryTypeValues() []RestorePointQueryType { - return []RestorePointQueryType{RestorePointQueryTypeAll, RestorePointQueryTypeDifferential, RestorePointQueryTypeFull, RestorePointQueryTypeFullAndDifferential, RestorePointQueryTypeInvalid, RestorePointQueryTypeLog} -} - -// RestorePointType enumerates the values for restore point type. -type RestorePointType string - -const ( - // RestorePointTypeDifferential ... - RestorePointTypeDifferential RestorePointType = "Differential" - // RestorePointTypeFull ... - RestorePointTypeFull RestorePointType = "Full" - // RestorePointTypeInvalid ... - RestorePointTypeInvalid RestorePointType = "Invalid" - // RestorePointTypeLog ... - RestorePointTypeLog RestorePointType = "Log" -) - -// PossibleRestorePointTypeValues returns an array of possible values for the RestorePointType const type. -func PossibleRestorePointTypeValues() []RestorePointType { - return []RestorePointType{RestorePointTypeDifferential, RestorePointTypeFull, RestorePointTypeInvalid, RestorePointTypeLog} -} - -// RestoreRequestType enumerates the values for restore request type. -type RestoreRequestType string - -const ( - // RestoreRequestTypeFullShareRestore ... - RestoreRequestTypeFullShareRestore RestoreRequestType = "FullShareRestore" - // RestoreRequestTypeInvalid ... - RestoreRequestTypeInvalid RestoreRequestType = "Invalid" - // RestoreRequestTypeItemLevelRestore ... - RestoreRequestTypeItemLevelRestore RestoreRequestType = "ItemLevelRestore" -) - -// PossibleRestoreRequestTypeValues returns an array of possible values for the RestoreRequestType const type. -func PossibleRestoreRequestTypeValues() []RestoreRequestType { - return []RestoreRequestType{RestoreRequestTypeFullShareRestore, RestoreRequestTypeInvalid, RestoreRequestTypeItemLevelRestore} -} - -// RetentionDurationType enumerates the values for retention duration type. -type RetentionDurationType string - -const ( - // RetentionDurationTypeDays ... - RetentionDurationTypeDays RetentionDurationType = "Days" - // RetentionDurationTypeInvalid ... - RetentionDurationTypeInvalid RetentionDurationType = "Invalid" - // RetentionDurationTypeMonths ... - RetentionDurationTypeMonths RetentionDurationType = "Months" - // RetentionDurationTypeWeeks ... - RetentionDurationTypeWeeks RetentionDurationType = "Weeks" - // RetentionDurationTypeYears ... - RetentionDurationTypeYears RetentionDurationType = "Years" -) - -// PossibleRetentionDurationTypeValues returns an array of possible values for the RetentionDurationType const type. -func PossibleRetentionDurationTypeValues() []RetentionDurationType { - return []RetentionDurationType{RetentionDurationTypeDays, RetentionDurationTypeInvalid, RetentionDurationTypeMonths, RetentionDurationTypeWeeks, RetentionDurationTypeYears} -} - -// RetentionPolicyType enumerates the values for retention policy type. -type RetentionPolicyType string - -const ( - // RetentionPolicyTypeLongTermRetentionPolicy ... - RetentionPolicyTypeLongTermRetentionPolicy RetentionPolicyType = "LongTermRetentionPolicy" - // RetentionPolicyTypeRetentionPolicy ... - RetentionPolicyTypeRetentionPolicy RetentionPolicyType = "RetentionPolicy" - // RetentionPolicyTypeSimpleRetentionPolicy ... - RetentionPolicyTypeSimpleRetentionPolicy RetentionPolicyType = "SimpleRetentionPolicy" -) - -// PossibleRetentionPolicyTypeValues returns an array of possible values for the RetentionPolicyType const type. -func PossibleRetentionPolicyTypeValues() []RetentionPolicyType { - return []RetentionPolicyType{RetentionPolicyTypeLongTermRetentionPolicy, RetentionPolicyTypeRetentionPolicy, RetentionPolicyTypeSimpleRetentionPolicy} -} - -// RetentionScheduleFormat enumerates the values for retention schedule format. -type RetentionScheduleFormat string - -const ( - // RetentionScheduleFormatDaily ... - RetentionScheduleFormatDaily RetentionScheduleFormat = "Daily" - // RetentionScheduleFormatInvalid ... - RetentionScheduleFormatInvalid RetentionScheduleFormat = "Invalid" - // RetentionScheduleFormatWeekly ... - RetentionScheduleFormatWeekly RetentionScheduleFormat = "Weekly" -) - -// PossibleRetentionScheduleFormatValues returns an array of possible values for the RetentionScheduleFormat const type. -func PossibleRetentionScheduleFormatValues() []RetentionScheduleFormat { - return []RetentionScheduleFormat{RetentionScheduleFormatDaily, RetentionScheduleFormatInvalid, RetentionScheduleFormatWeekly} -} - -// SchedulePolicyType enumerates the values for schedule policy type. -type SchedulePolicyType string - -const ( - // SchedulePolicyTypeLogSchedulePolicy ... - SchedulePolicyTypeLogSchedulePolicy SchedulePolicyType = "LogSchedulePolicy" - // SchedulePolicyTypeLongTermSchedulePolicy ... - SchedulePolicyTypeLongTermSchedulePolicy SchedulePolicyType = "LongTermSchedulePolicy" - // SchedulePolicyTypeSchedulePolicy ... - SchedulePolicyTypeSchedulePolicy SchedulePolicyType = "SchedulePolicy" - // SchedulePolicyTypeSimpleSchedulePolicy ... - SchedulePolicyTypeSimpleSchedulePolicy SchedulePolicyType = "SimpleSchedulePolicy" -) - -// PossibleSchedulePolicyTypeValues returns an array of possible values for the SchedulePolicyType const type. -func PossibleSchedulePolicyTypeValues() []SchedulePolicyType { - return []SchedulePolicyType{SchedulePolicyTypeLogSchedulePolicy, SchedulePolicyTypeLongTermSchedulePolicy, SchedulePolicyTypeSchedulePolicy, SchedulePolicyTypeSimpleSchedulePolicy} -} - -// ScheduleRunType enumerates the values for schedule run type. -type ScheduleRunType string - -const ( - // ScheduleRunTypeDaily ... - ScheduleRunTypeDaily ScheduleRunType = "Daily" - // ScheduleRunTypeInvalid ... - ScheduleRunTypeInvalid ScheduleRunType = "Invalid" - // ScheduleRunTypeWeekly ... - ScheduleRunTypeWeekly ScheduleRunType = "Weekly" -) - -// PossibleScheduleRunTypeValues returns an array of possible values for the ScheduleRunType const type. -func PossibleScheduleRunTypeValues() []ScheduleRunType { - return []ScheduleRunType{ScheduleRunTypeDaily, ScheduleRunTypeInvalid, ScheduleRunTypeWeekly} -} - -// SoftDeleteFeatureState enumerates the values for soft delete feature state. -type SoftDeleteFeatureState string - -const ( - // SoftDeleteFeatureStateDisabled ... - SoftDeleteFeatureStateDisabled SoftDeleteFeatureState = "Disabled" - // SoftDeleteFeatureStateEnabled ... - SoftDeleteFeatureStateEnabled SoftDeleteFeatureState = "Enabled" - // SoftDeleteFeatureStateInvalid ... - SoftDeleteFeatureStateInvalid SoftDeleteFeatureState = "Invalid" -) - -// PossibleSoftDeleteFeatureStateValues returns an array of possible values for the SoftDeleteFeatureState const type. -func PossibleSoftDeleteFeatureStateValues() []SoftDeleteFeatureState { - return []SoftDeleteFeatureState{SoftDeleteFeatureStateDisabled, SoftDeleteFeatureStateEnabled, SoftDeleteFeatureStateInvalid} -} - -// SQLDataDirectoryType enumerates the values for sql data directory type. -type SQLDataDirectoryType string - -const ( - // SQLDataDirectoryTypeData ... - SQLDataDirectoryTypeData SQLDataDirectoryType = "Data" - // SQLDataDirectoryTypeInvalid ... - SQLDataDirectoryTypeInvalid SQLDataDirectoryType = "Invalid" - // SQLDataDirectoryTypeLog ... - SQLDataDirectoryTypeLog SQLDataDirectoryType = "Log" -) - -// PossibleSQLDataDirectoryTypeValues returns an array of possible values for the SQLDataDirectoryType const type. -func PossibleSQLDataDirectoryTypeValues() []SQLDataDirectoryType { - return []SQLDataDirectoryType{SQLDataDirectoryTypeData, SQLDataDirectoryTypeInvalid, SQLDataDirectoryTypeLog} -} - -// StorageType enumerates the values for storage type. -type StorageType string - -const ( - // StorageTypeGeoRedundant ... - StorageTypeGeoRedundant StorageType = "GeoRedundant" - // StorageTypeInvalid ... - StorageTypeInvalid StorageType = "Invalid" - // StorageTypeLocallyRedundant ... - StorageTypeLocallyRedundant StorageType = "LocallyRedundant" -) - -// PossibleStorageTypeValues returns an array of possible values for the StorageType const type. -func PossibleStorageTypeValues() []StorageType { - return []StorageType{StorageTypeGeoRedundant, StorageTypeInvalid, StorageTypeLocallyRedundant} -} - -// StorageTypeState enumerates the values for storage type state. -type StorageTypeState string - -const ( - // StorageTypeStateInvalid ... - StorageTypeStateInvalid StorageTypeState = "Invalid" - // StorageTypeStateLocked ... - StorageTypeStateLocked StorageTypeState = "Locked" - // StorageTypeStateUnlocked ... - StorageTypeStateUnlocked StorageTypeState = "Unlocked" -) - -// PossibleStorageTypeStateValues returns an array of possible values for the StorageTypeState const type. -func PossibleStorageTypeStateValues() []StorageTypeState { - return []StorageTypeState{StorageTypeStateInvalid, StorageTypeStateLocked, StorageTypeStateUnlocked} -} - -// SupportStatus enumerates the values for support status. -type SupportStatus string - -const ( - // SupportStatusDefaultOFF ... - SupportStatusDefaultOFF SupportStatus = "DefaultOFF" - // SupportStatusDefaultON ... - SupportStatusDefaultON SupportStatus = "DefaultON" - // SupportStatusInvalid ... - SupportStatusInvalid SupportStatus = "Invalid" - // SupportStatusNotSupported ... - SupportStatusNotSupported SupportStatus = "NotSupported" - // SupportStatusSupported ... - SupportStatusSupported SupportStatus = "Supported" -) - -// PossibleSupportStatusValues returns an array of possible values for the SupportStatus const type. -func PossibleSupportStatusValues() []SupportStatus { - return []SupportStatus{SupportStatusDefaultOFF, SupportStatusDefaultON, SupportStatusInvalid, SupportStatusNotSupported, SupportStatusSupported} -} - -// Type enumerates the values for type. -type Type string - -const ( - // TypeBackupProtectedItemCountSummary ... - TypeBackupProtectedItemCountSummary Type = "BackupProtectedItemCountSummary" - // TypeBackupProtectionContainerCountSummary ... - TypeBackupProtectionContainerCountSummary Type = "BackupProtectionContainerCountSummary" - // TypeInvalid ... - TypeInvalid Type = "Invalid" -) - -// PossibleTypeValues returns an array of possible values for the Type const type. -func PossibleTypeValues() []Type { - return []Type{TypeBackupProtectedItemCountSummary, TypeBackupProtectionContainerCountSummary, TypeInvalid} -} - -// TypeEnum enumerates the values for type enum. -type TypeEnum string - -const ( - // TypeEnumCopyOnlyFull ... - TypeEnumCopyOnlyFull TypeEnum = "CopyOnlyFull" - // TypeEnumDifferential ... - TypeEnumDifferential TypeEnum = "Differential" - // TypeEnumFull ... - TypeEnumFull TypeEnum = "Full" - // TypeEnumInvalid ... - TypeEnumInvalid TypeEnum = "Invalid" - // TypeEnumLog ... - TypeEnumLog TypeEnum = "Log" -) - -// PossibleTypeEnumValues returns an array of possible values for the TypeEnum const type. -func PossibleTypeEnumValues() []TypeEnum { - return []TypeEnum{TypeEnumCopyOnlyFull, TypeEnumDifferential, TypeEnumFull, TypeEnumInvalid, TypeEnumLog} -} - -// UsagesUnit enumerates the values for usages unit. -type UsagesUnit string - -const ( - // Bytes ... - Bytes UsagesUnit = "Bytes" - // BytesPerSecond ... - BytesPerSecond UsagesUnit = "BytesPerSecond" - // Count ... - Count UsagesUnit = "Count" - // CountPerSecond ... - CountPerSecond UsagesUnit = "CountPerSecond" - // Percent ... - Percent UsagesUnit = "Percent" - // Seconds ... - Seconds UsagesUnit = "Seconds" -) - -// PossibleUsagesUnitValues returns an array of possible values for the UsagesUnit const type. -func PossibleUsagesUnitValues() []UsagesUnit { - return []UsagesUnit{Bytes, BytesPerSecond, Count, CountPerSecond, Percent, Seconds} -} - -// ValidationStatus enumerates the values for validation status. -type ValidationStatus string - -const ( - // ValidationStatusFailed ... - ValidationStatusFailed ValidationStatus = "Failed" - // ValidationStatusInvalid ... - ValidationStatusInvalid ValidationStatus = "Invalid" - // ValidationStatusSucceeded ... - ValidationStatusSucceeded ValidationStatus = "Succeeded" -) - -// PossibleValidationStatusValues returns an array of possible values for the ValidationStatus const type. -func PossibleValidationStatusValues() []ValidationStatus { - return []ValidationStatus{ValidationStatusFailed, ValidationStatusInvalid, ValidationStatusSucceeded} -} - -// WeekOfMonth enumerates the values for week of month. -type WeekOfMonth string - -const ( - // WeekOfMonthFirst ... - WeekOfMonthFirst WeekOfMonth = "First" - // WeekOfMonthFourth ... - WeekOfMonthFourth WeekOfMonth = "Fourth" - // WeekOfMonthInvalid ... - WeekOfMonthInvalid WeekOfMonth = "Invalid" - // WeekOfMonthLast ... - WeekOfMonthLast WeekOfMonth = "Last" - // WeekOfMonthSecond ... - WeekOfMonthSecond WeekOfMonth = "Second" - // WeekOfMonthThird ... - WeekOfMonthThird WeekOfMonth = "Third" -) - -// PossibleWeekOfMonthValues returns an array of possible values for the WeekOfMonth const type. -func PossibleWeekOfMonthValues() []WeekOfMonth { - return []WeekOfMonth{WeekOfMonthFirst, WeekOfMonthFourth, WeekOfMonthInvalid, WeekOfMonthLast, WeekOfMonthSecond, WeekOfMonthThird} -} - -// WorkloadItemType enumerates the values for workload item type. -type WorkloadItemType string - -const ( - // WorkloadItemTypeInvalid ... - WorkloadItemTypeInvalid WorkloadItemType = "Invalid" - // WorkloadItemTypeSAPAseDatabase ... - WorkloadItemTypeSAPAseDatabase WorkloadItemType = "SAPAseDatabase" - // WorkloadItemTypeSAPAseSystem ... - WorkloadItemTypeSAPAseSystem WorkloadItemType = "SAPAseSystem" - // WorkloadItemTypeSAPHanaDatabase ... - WorkloadItemTypeSAPHanaDatabase WorkloadItemType = "SAPHanaDatabase" - // WorkloadItemTypeSAPHanaSystem ... - WorkloadItemTypeSAPHanaSystem WorkloadItemType = "SAPHanaSystem" - // WorkloadItemTypeSQLDataBase ... - WorkloadItemTypeSQLDataBase WorkloadItemType = "SQLDataBase" - // WorkloadItemTypeSQLInstance ... - WorkloadItemTypeSQLInstance WorkloadItemType = "SQLInstance" -) - -// PossibleWorkloadItemTypeValues returns an array of possible values for the WorkloadItemType const type. -func PossibleWorkloadItemTypeValues() []WorkloadItemType { - return []WorkloadItemType{WorkloadItemTypeInvalid, WorkloadItemTypeSAPAseDatabase, WorkloadItemTypeSAPAseSystem, WorkloadItemTypeSAPHanaDatabase, WorkloadItemTypeSAPHanaSystem, WorkloadItemTypeSQLDataBase, WorkloadItemTypeSQLInstance} -} - -// WorkloadItemTypeBasicWorkloadItem enumerates the values for workload item type basic workload item. -type WorkloadItemTypeBasicWorkloadItem string - -const ( - // WorkloadItemTypeAzureVMWorkloadItem ... - WorkloadItemTypeAzureVMWorkloadItem WorkloadItemTypeBasicWorkloadItem = "AzureVmWorkloadItem" - // WorkloadItemTypeSAPAseDatabase1 ... - WorkloadItemTypeSAPAseDatabase1 WorkloadItemTypeBasicWorkloadItem = "SAPAseDatabase" - // WorkloadItemTypeSAPAseSystem1 ... - WorkloadItemTypeSAPAseSystem1 WorkloadItemTypeBasicWorkloadItem = "SAPAseSystem" - // WorkloadItemTypeSAPHanaDatabase1 ... - WorkloadItemTypeSAPHanaDatabase1 WorkloadItemTypeBasicWorkloadItem = "SAPHanaDatabase" - // WorkloadItemTypeSAPHanaSystem1 ... - WorkloadItemTypeSAPHanaSystem1 WorkloadItemTypeBasicWorkloadItem = "SAPHanaSystem" - // WorkloadItemTypeSQLDataBase1 ... - WorkloadItemTypeSQLDataBase1 WorkloadItemTypeBasicWorkloadItem = "SQLDataBase" - // WorkloadItemTypeSQLInstance1 ... - WorkloadItemTypeSQLInstance1 WorkloadItemTypeBasicWorkloadItem = "SQLInstance" - // WorkloadItemTypeWorkloadItem ... - WorkloadItemTypeWorkloadItem WorkloadItemTypeBasicWorkloadItem = "WorkloadItem" -) - -// PossibleWorkloadItemTypeBasicWorkloadItemValues returns an array of possible values for the WorkloadItemTypeBasicWorkloadItem const type. -func PossibleWorkloadItemTypeBasicWorkloadItemValues() []WorkloadItemTypeBasicWorkloadItem { - return []WorkloadItemTypeBasicWorkloadItem{WorkloadItemTypeAzureVMWorkloadItem, WorkloadItemTypeSAPAseDatabase1, WorkloadItemTypeSAPAseSystem1, WorkloadItemTypeSAPHanaDatabase1, WorkloadItemTypeSAPHanaSystem1, WorkloadItemTypeSQLDataBase1, WorkloadItemTypeSQLInstance1, WorkloadItemTypeWorkloadItem} -} - -// WorkloadType enumerates the values for workload type. -type WorkloadType string - -const ( - // WorkloadTypeAzureFileShare ... - WorkloadTypeAzureFileShare WorkloadType = "AzureFileShare" - // WorkloadTypeAzureSQLDb ... - WorkloadTypeAzureSQLDb WorkloadType = "AzureSqlDb" - // WorkloadTypeClient ... - WorkloadTypeClient WorkloadType = "Client" - // WorkloadTypeExchange ... - WorkloadTypeExchange WorkloadType = "Exchange" - // WorkloadTypeFileFolder ... - WorkloadTypeFileFolder WorkloadType = "FileFolder" - // WorkloadTypeGenericDataSource ... - WorkloadTypeGenericDataSource WorkloadType = "GenericDataSource" - // WorkloadTypeInvalid ... - WorkloadTypeInvalid WorkloadType = "Invalid" - // WorkloadTypeSAPAseDatabase ... - WorkloadTypeSAPAseDatabase WorkloadType = "SAPAseDatabase" - // WorkloadTypeSAPHanaDatabase ... - WorkloadTypeSAPHanaDatabase WorkloadType = "SAPHanaDatabase" - // WorkloadTypeSharepoint ... - WorkloadTypeSharepoint WorkloadType = "Sharepoint" - // WorkloadTypeSQLDataBase ... - WorkloadTypeSQLDataBase WorkloadType = "SQLDataBase" - // WorkloadTypeSQLDB ... - WorkloadTypeSQLDB WorkloadType = "SQLDB" - // WorkloadTypeSystemState ... - WorkloadTypeSystemState WorkloadType = "SystemState" - // WorkloadTypeVM ... - WorkloadTypeVM WorkloadType = "VM" - // WorkloadTypeVMwareVM ... - WorkloadTypeVMwareVM WorkloadType = "VMwareVM" -) - -// PossibleWorkloadTypeValues returns an array of possible values for the WorkloadType const type. -func PossibleWorkloadTypeValues() []WorkloadType { - return []WorkloadType{WorkloadTypeAzureFileShare, WorkloadTypeAzureSQLDb, WorkloadTypeClient, WorkloadTypeExchange, WorkloadTypeFileFolder, WorkloadTypeGenericDataSource, WorkloadTypeInvalid, WorkloadTypeSAPAseDatabase, WorkloadTypeSAPHanaDatabase, WorkloadTypeSharepoint, WorkloadTypeSQLDataBase, WorkloadTypeSQLDB, WorkloadTypeSystemState, WorkloadTypeVM, WorkloadTypeVMwareVM} -} diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/models.go b/services/recoveryservices/mgmt/2020-02-02/backup/models.go index 4f81efd0c8ee..b01b281796d6 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/models.go +++ b/services/recoveryservices/mgmt/2020-02-02/backup/models.go @@ -12,19478 +12,217 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/autorest/to" - "github.com/Azure/go-autorest/tracing" "net/http" ) // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2020-02-02/backup" -// AzureBackupGoalFeatureSupportRequest azure backup goal feature specific request. -type AzureBackupGoalFeatureSupportRequest struct { - // FeatureType - Possible values include: 'FeatureTypeFeatureSupportRequest', 'FeatureTypeAzureBackupGoals', 'FeatureTypeAzureVMResourceBackup' - FeatureType FeatureType `json:"featureType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureBackupGoalFeatureSupportRequest. -func (abgfsr AzureBackupGoalFeatureSupportRequest) MarshalJSON() ([]byte, error) { - abgfsr.FeatureType = FeatureTypeAzureBackupGoals - objectMap := make(map[string]interface{}) - if abgfsr.FeatureType != "" { - objectMap["featureType"] = abgfsr.FeatureType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupGoalFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. -func (abgfsr AzureBackupGoalFeatureSupportRequest) AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) { - return &abgfsr, true -} - -// AsAzureVMResourceFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. -func (abgfsr AzureBackupGoalFeatureSupportRequest) AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) { - return nil, false -} - -// AsFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. -func (abgfsr AzureBackupGoalFeatureSupportRequest) AsFeatureSupportRequest() (*FeatureSupportRequest, bool) { - return nil, false -} - -// AsBasicFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. -func (abgfsr AzureBackupGoalFeatureSupportRequest) AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) { - return &abgfsr, true -} - -// AzureBackupServerContainer azureBackupServer (DPMVenus) workload-specific protection container. -type AzureBackupServerContainer struct { - // CanReRegister - Specifies whether the container is re-registrable. - CanReRegister *bool `json:"canReRegister,omitempty"` - // ContainerID - ID of container. - ContainerID *string `json:"containerId,omitempty"` - // ProtectedItemCount - Number of protected items in the BackupEngine - ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` - // DpmAgentVersion - Backup engine Agent version - DpmAgentVersion *string `json:"dpmAgentVersion,omitempty"` - // DpmServers - List of BackupEngines protecting the container - DpmServers *[]string `json:"dpmServers,omitempty"` - // UpgradeAvailable - To check if upgrade available - UpgradeAvailable *bool `json:"upgradeAvailable,omitempty"` - // ProtectionStatus - Protection status of the container. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ExtendedInfo - Extended Info of the container. - ExtendedInfo *DPMContainerExtendedInfo `json:"extendedInfo,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) MarshalJSON() ([]byte, error) { - absc.ContainerType = ContainerTypeAzureBackupServerContainer1 - objectMap := make(map[string]interface{}) - if absc.CanReRegister != nil { - objectMap["canReRegister"] = absc.CanReRegister - } - if absc.ContainerID != nil { - objectMap["containerId"] = absc.ContainerID - } - if absc.ProtectedItemCount != nil { - objectMap["protectedItemCount"] = absc.ProtectedItemCount - } - if absc.DpmAgentVersion != nil { - objectMap["dpmAgentVersion"] = absc.DpmAgentVersion - } - if absc.DpmServers != nil { - objectMap["dpmServers"] = absc.DpmServers - } - if absc.UpgradeAvailable != nil { - objectMap["upgradeAvailable"] = absc.UpgradeAvailable - } - if absc.ProtectionStatus != nil { - objectMap["protectionStatus"] = absc.ProtectionStatus - } - if absc.ExtendedInfo != nil { - objectMap["extendedInfo"] = absc.ExtendedInfo - } - if absc.FriendlyName != nil { - objectMap["friendlyName"] = absc.FriendlyName - } - if absc.BackupManagementType != "" { - objectMap["backupManagementType"] = absc.BackupManagementType - } - if absc.RegistrationStatus != nil { - objectMap["registrationStatus"] = absc.RegistrationStatus - } - if absc.HealthStatus != nil { - objectMap["healthStatus"] = absc.HealthStatus - } - if absc.ContainerType != "" { - objectMap["containerType"] = absc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return &absc, true -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return &absc, true -} - -// AsGenericContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false -} - -// AsMabContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. -func (absc AzureBackupServerContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &absc, true -} - -// AzureBackupServerEngine backup engine type when Azure Backup Server is used to manage the backups. -type AzureBackupServerEngine struct { - // FriendlyName - Friendly name of the backup engine. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Registration status of the backup engine with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // BackupEngineState - Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} - BackupEngineState *string `json:"backupEngineState,omitempty"` - // HealthStatus - Backup status of the backup engine. - HealthStatus *string `json:"healthStatus,omitempty"` - // CanReRegister - Flag indicating if the backup engine be registered, once already registered. - CanReRegister *bool `json:"canReRegister,omitempty"` - // BackupEngineID - ID of the backup engine. - BackupEngineID *string `json:"backupEngineId,omitempty"` - // DpmVersion - Backup engine version - DpmVersion *string `json:"dpmVersion,omitempty"` - // AzureBackupAgentVersion - Backup agent version - AzureBackupAgentVersion *string `json:"azureBackupAgentVersion,omitempty"` - // IsAzureBackupAgentUpgradeAvailable - To check if backup agent upgrade available - IsAzureBackupAgentUpgradeAvailable *bool `json:"isAzureBackupAgentUpgradeAvailable,omitempty"` - // IsDpmUpgradeAvailable - To check if backup engine upgrade available - IsDpmUpgradeAvailable *bool `json:"isDpmUpgradeAvailable,omitempty"` - // ExtendedInfo - Extended info of the backupengine - ExtendedInfo *EngineExtendedInfo `json:"extendedInfo,omitempty"` - // BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine' - BackupEngineType EngineType `json:"backupEngineType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureBackupServerEngine. -func (abse AzureBackupServerEngine) MarshalJSON() ([]byte, error) { - abse.BackupEngineType = BackupEngineTypeAzureBackupServerEngine - objectMap := make(map[string]interface{}) - if abse.FriendlyName != nil { - objectMap["friendlyName"] = abse.FriendlyName - } - if abse.BackupManagementType != "" { - objectMap["backupManagementType"] = abse.BackupManagementType - } - if abse.RegistrationStatus != nil { - objectMap["registrationStatus"] = abse.RegistrationStatus - } - if abse.BackupEngineState != nil { - objectMap["backupEngineState"] = abse.BackupEngineState - } - if abse.HealthStatus != nil { - objectMap["healthStatus"] = abse.HealthStatus - } - if abse.CanReRegister != nil { - objectMap["canReRegister"] = abse.CanReRegister - } - if abse.BackupEngineID != nil { - objectMap["backupEngineId"] = abse.BackupEngineID - } - if abse.DpmVersion != nil { - objectMap["dpmVersion"] = abse.DpmVersion - } - if abse.AzureBackupAgentVersion != nil { - objectMap["azureBackupAgentVersion"] = abse.AzureBackupAgentVersion - } - if abse.IsAzureBackupAgentUpgradeAvailable != nil { - objectMap["isAzureBackupAgentUpgradeAvailable"] = abse.IsAzureBackupAgentUpgradeAvailable - } - if abse.IsDpmUpgradeAvailable != nil { - objectMap["isDpmUpgradeAvailable"] = abse.IsDpmUpgradeAvailable - } - if abse.ExtendedInfo != nil { - objectMap["extendedInfo"] = abse.ExtendedInfo - } - if abse.BackupEngineType != "" { - objectMap["backupEngineType"] = abse.BackupEngineType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerEngine is the BasicEngineBase implementation for AzureBackupServerEngine. -func (abse AzureBackupServerEngine) AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) { - return &abse, true -} - -// AsDpmBackupEngine is the BasicEngineBase implementation for AzureBackupServerEngine. -func (abse AzureBackupServerEngine) AsDpmBackupEngine() (*DpmBackupEngine, bool) { - return nil, false -} - -// AsEngineBase is the BasicEngineBase implementation for AzureBackupServerEngine. -func (abse AzureBackupServerEngine) AsEngineBase() (*EngineBase, bool) { - return nil, false -} - -// AsBasicEngineBase is the BasicEngineBase implementation for AzureBackupServerEngine. -func (abse AzureBackupServerEngine) AsBasicEngineBase() (BasicEngineBase, bool) { - return &abse, true -} - -// AzureFileShareBackupRequest azureFileShare workload-specific backup request. -type AzureFileShareBackupRequest struct { - // RecoveryPointExpiryTimeInUTC - Backup copy will expire after the time specified (UTC). - RecoveryPointExpiryTimeInUTC *date.Time `json:"recoveryPointExpiryTimeInUTC,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' - ObjectType ObjectTypeBasicRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFileShareBackupRequest. -func (afsbr AzureFileShareBackupRequest) MarshalJSON() ([]byte, error) { - afsbr.ObjectType = ObjectTypeAzureFileShareBackupRequest - objectMap := make(map[string]interface{}) - if afsbr.RecoveryPointExpiryTimeInUTC != nil { - objectMap["recoveryPointExpiryTimeInUTC"] = afsbr.RecoveryPointExpiryTimeInUTC - } - if afsbr.ObjectType != "" { - objectMap["objectType"] = afsbr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareBackupRequest is the BasicRequest implementation for AzureFileShareBackupRequest. -func (afsbr AzureFileShareBackupRequest) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { - return &afsbr, true -} - -// AsAzureWorkloadBackupRequest is the BasicRequest implementation for AzureFileShareBackupRequest. -func (afsbr AzureFileShareBackupRequest) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { - return nil, false -} - -// AsIaasVMBackupRequest is the BasicRequest implementation for AzureFileShareBackupRequest. -func (afsbr AzureFileShareBackupRequest) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { - return nil, false -} - -// AsRequest is the BasicRequest implementation for AzureFileShareBackupRequest. -func (afsbr AzureFileShareBackupRequest) AsRequest() (*Request, bool) { - return nil, false -} - -// AsBasicRequest is the BasicRequest implementation for AzureFileShareBackupRequest. -func (afsbr AzureFileShareBackupRequest) AsBasicRequest() (BasicRequest, bool) { - return &afsbr, true -} - -// AzureFileShareProtectableItem protectable item for Azure Fileshare workloads. -type AzureFileShareProtectableItem struct { - // ParentContainerFabricID - Full Fabric ID of container to which this protectable item belongs. For example, ARM ID. - ParentContainerFabricID *string `json:"parentContainerFabricId,omitempty"` - // ParentContainerFriendlyName - Friendly name of container to which this protectable item belongs. - ParentContainerFriendlyName *string `json:"parentContainerFriendlyName,omitempty"` - // AzureFileShareType - File Share type XSync or XSMB. Possible values include: 'Invalid', 'XSMB', 'XSync' - AzureFileShareType AzureFileShareType `json:"azureFileShareType,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) MarshalJSON() ([]byte, error) { - afspi.ProtectableItemType = ProtectableItemTypeAzureFileShare - objectMap := make(map[string]interface{}) - if afspi.ParentContainerFabricID != nil { - objectMap["parentContainerFabricId"] = afspi.ParentContainerFabricID - } - if afspi.ParentContainerFriendlyName != nil { - objectMap["parentContainerFriendlyName"] = afspi.ParentContainerFriendlyName - } - if afspi.AzureFileShareType != "" { - objectMap["azureFileShareType"] = afspi.AzureFileShareType - } - if afspi.BackupManagementType != nil { - objectMap["backupManagementType"] = afspi.BackupManagementType - } - if afspi.WorkloadType != nil { - objectMap["workloadType"] = afspi.WorkloadType - } - if afspi.FriendlyName != nil { - objectMap["friendlyName"] = afspi.FriendlyName - } - if afspi.ProtectionState != "" { - objectMap["protectionState"] = afspi.ProtectionState - } - if afspi.ProtectableItemType != "" { - objectMap["protectableItemType"] = afspi.ProtectableItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return &afspi, true -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false -} - -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return nil, false -} - -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return nil, false -} - -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. -func (afspi AzureFileShareProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &afspi, true -} - -// AzureFileshareProtectedItem azure File Share workload-specific backup item. -type AzureFileshareProtectedItem struct { - // FriendlyName - Friendly name of the fileshare represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionStatus - Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // KpisHealths - Health details of different KPIs - KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` - // ExtendedInfo - Additional information with this backup item. - ExtendedInfo *AzureFileshareProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) MarshalJSON() ([]byte, error) { - afpi.ProtectedItemType = ProtectedItemTypeAzureFileShareProtectedItem - objectMap := make(map[string]interface{}) - if afpi.FriendlyName != nil { - objectMap["friendlyName"] = afpi.FriendlyName - } - if afpi.ProtectionStatus != nil { - objectMap["protectionStatus"] = afpi.ProtectionStatus - } - if afpi.ProtectionState != "" { - objectMap["protectionState"] = afpi.ProtectionState - } - if afpi.LastBackupStatus != nil { - objectMap["lastBackupStatus"] = afpi.LastBackupStatus - } - if afpi.LastBackupTime != nil { - objectMap["lastBackupTime"] = afpi.LastBackupTime - } - if afpi.KpisHealths != nil { - objectMap["kpisHealths"] = afpi.KpisHealths - } - if afpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = afpi.ExtendedInfo - } - if afpi.BackupManagementType != "" { - objectMap["backupManagementType"] = afpi.BackupManagementType - } - if afpi.WorkloadType != "" { - objectMap["workloadType"] = afpi.WorkloadType - } - if afpi.ContainerName != nil { - objectMap["containerName"] = afpi.ContainerName - } - if afpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = afpi.SourceResourceID - } - if afpi.PolicyID != nil { - objectMap["policyId"] = afpi.PolicyID - } - if afpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = afpi.LastRecoveryPoint - } - if afpi.BackupSetName != nil { - objectMap["backupSetName"] = afpi.BackupSetName - } - if afpi.CreateMode != "" { - objectMap["createMode"] = afpi.CreateMode - } - if afpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = afpi.DeferredDeleteTimeInUTC - } - if afpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = afpi.IsScheduledForDeferredDelete - } - if afpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = afpi.DeferredDeleteTimeRemaining - } - if afpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = afpi.IsDeferredDeleteScheduleUpcoming - } - if afpi.IsRehydrate != nil { - objectMap["isRehydrate"] = afpi.IsRehydrate - } - if afpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = afpi.ProtectedItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return &afpi, true -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return nil, false -} - -// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return nil, false -} - -// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return nil, false -} - -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return nil, false -} - -// AsProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return nil, false -} - -// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. -func (afpi AzureFileshareProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &afpi, true -} - -// AzureFileshareProtectedItemExtendedInfo additional information about Azure File Share backup item. -type AzureFileshareProtectedItemExtendedInfo struct { - // OldestRecoveryPoint - The oldest backup copy available for this item in the service. - OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` - // RecoveryPointCount - Number of available backup copies associated with this backup item. - RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` - // PolicyState - Indicates consistency of policy object and policy applied to this backup item. - PolicyState *string `json:"policyState,omitempty"` - // ResourceState - READ-ONLY; Indicates the state of this resource. Possible values are from enum ResourceState {Invalid, Active, SoftDeleted, Deleted} - ResourceState *string `json:"resourceState,omitempty"` - // ResourceStateSyncTime - READ-ONLY; The resource state sync time for this backup item. - ResourceStateSyncTime *date.Time `json:"resourceStateSyncTime,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFileshareProtectedItemExtendedInfo. -func (afpiei AzureFileshareProtectedItemExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if afpiei.OldestRecoveryPoint != nil { - objectMap["oldestRecoveryPoint"] = afpiei.OldestRecoveryPoint - } - if afpiei.RecoveryPointCount != nil { - objectMap["recoveryPointCount"] = afpiei.RecoveryPointCount - } - if afpiei.PolicyState != nil { - objectMap["policyState"] = afpiei.PolicyState - } - return json.Marshal(objectMap) -} - -// AzureFileShareProtectionPolicy azureStorage backup policy. -type AzureFileShareProtectionPolicy struct { - // 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', 'WorkloadTypeSAPAseDatabase' - 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. - RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` - // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". - TimeZone *string `json:"timeZone,omitempty"` - // ProtectedItemsCount - Number of items associated with this policy. - ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' - BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFileShareProtectionPolicy. -func (afspp AzureFileShareProtectionPolicy) MarshalJSON() ([]byte, error) { - afspp.BackupManagementType = BackupManagementTypeAzureStorage - objectMap := make(map[string]interface{}) - if afspp.WorkLoadType != "" { - objectMap["workLoadType"] = afspp.WorkLoadType - } - objectMap["schedulePolicy"] = afspp.SchedulePolicy - objectMap["retentionPolicy"] = afspp.RetentionPolicy - if afspp.TimeZone != nil { - objectMap["timeZone"] = afspp.TimeZone - } - if afspp.ProtectedItemsCount != nil { - objectMap["protectedItemsCount"] = afspp.ProtectedItemsCount - } - if afspp.BackupManagementType != "" { - objectMap["backupManagementType"] = afspp.BackupManagementType - } - return json.Marshal(objectMap) -} - -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. -func (afspp AzureFileShareProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { - return nil, false -} - -// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. -func (afspp AzureFileShareProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { - return &afspp, true -} - -// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. -func (afspp AzureFileShareProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { - return nil, false -} - -// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. -func (afspp AzureFileShareProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { - return nil, false -} - -// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. -func (afspp AzureFileShareProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { - return nil, false -} - -// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. -func (afspp AzureFileShareProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { - return nil, false -} - -// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. -func (afspp AzureFileShareProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { - return nil, false -} - -// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. -func (afspp AzureFileShareProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { - return &afspp, true -} - -// UnmarshalJSON is the custom unmarshaler for AzureFileShareProtectionPolicy struct. -func (afspp *AzureFileShareProtectionPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "workLoadType": - if v != nil { - var workLoadType WorkloadType - err = json.Unmarshal(*v, &workLoadType) - if err != nil { - return err - } - afspp.WorkLoadType = workLoadType - } - case "schedulePolicy": - if v != nil { - schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) - if err != nil { - return err - } - afspp.SchedulePolicy = schedulePolicy - } - case "retentionPolicy": - if v != nil { - retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) - if err != nil { - return err - } - afspp.RetentionPolicy = retentionPolicy - } - case "timeZone": - if v != nil { - var timeZone string - err = json.Unmarshal(*v, &timeZone) - if err != nil { - return err - } - afspp.TimeZone = &timeZone - } - case "protectedItemsCount": - if v != nil { - var protectedItemsCount int32 - err = json.Unmarshal(*v, &protectedItemsCount) - if err != nil { - return err - } - afspp.ProtectedItemsCount = &protectedItemsCount - } - case "backupManagementType": - if v != nil { - var backupManagementType ManagementTypeBasicProtectionPolicy - err = json.Unmarshal(*v, &backupManagementType) - if err != nil { - return err - } - afspp.BackupManagementType = backupManagementType - } - } - } - - return nil -} - -// AzureFileShareProvisionILRRequest update snapshot Uri with the correct friendly Name of the source Azure -// file share. -type AzureFileShareProvisionILRRequest struct { - // RecoveryPointID - Recovery point ID. - RecoveryPointID *string `json:"recoveryPointId,omitempty"` - // SourceResourceID - Source Storage account ARM Id - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeAzureFileShareProvisionILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest' - ObjectType ObjectTypeBasicILRRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFileShareProvisionILRRequest. -func (afspir AzureFileShareProvisionILRRequest) MarshalJSON() ([]byte, error) { - afspir.ObjectType = ObjectTypeAzureFileShareProvisionILRRequest - objectMap := make(map[string]interface{}) - if afspir.RecoveryPointID != nil { - objectMap["recoveryPointId"] = afspir.RecoveryPointID - } - if afspir.SourceResourceID != nil { - objectMap["sourceResourceId"] = afspir.SourceResourceID - } - if afspir.ObjectType != "" { - objectMap["objectType"] = afspir.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProvisionILRRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. -func (afspir AzureFileShareProvisionILRRequest) AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) { - return &afspir, true -} - -// AsIaasVMILRRegistrationRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. -func (afspir AzureFileShareProvisionILRRequest) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) { - return nil, false -} - -// AsILRRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. -func (afspir AzureFileShareProvisionILRRequest) AsILRRequest() (*ILRRequest, bool) { - return nil, false -} - -// AsBasicILRRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. -func (afspir AzureFileShareProvisionILRRequest) AsBasicILRRequest() (BasicILRRequest, bool) { - return &afspir, true -} - -// AzureFileShareRecoveryPoint azure File Share workload specific backup copy. -type AzureFileShareRecoveryPoint struct { - // RecoveryPointType - READ-ONLY; Type of the backup copy. Specifies whether it is a crash consistent backup or app consistent. - RecoveryPointType *string `json:"recoveryPointType,omitempty"` - // RecoveryPointTime - READ-ONLY; Time at which this backup copy was created. - RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` - // FileShareSnapshotURI - READ-ONLY; Contains Url to the snapshot of fileshare, if applicable - FileShareSnapshotURI *string `json:"fileShareSnapshotUri,omitempty"` - // RecoveryPointSizeInGB - READ-ONLY; Contains recovery point size - RecoveryPointSizeInGB *int32 `json:"recoveryPointSizeInGB,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) MarshalJSON() ([]byte, error) { - afsrp.ObjectType = ObjectTypeAzureFileShareRecoveryPoint - objectMap := make(map[string]interface{}) - if afsrp.ObjectType != "" { - objectMap["objectType"] = afsrp.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return &afsrp, true -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { - return nil, false -} - -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return nil, false -} - -// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return nil, false -} - -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. -func (afsrp AzureFileShareRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &afsrp, true -} - -// AzureFileShareRestoreRequest azureFileShare Restore Request -type AzureFileShareRestoreRequest struct { - // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Source storage account ARM Id - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // CopyOptions - Options to resolve copy conflicts. Possible values include: 'CopyOptionsInvalid', 'CopyOptionsCreateCopy', 'CopyOptionsSkip', 'CopyOptionsOverwrite', 'CopyOptionsFailOnConflict' - CopyOptions CopyOptions `json:"copyOptions,omitempty"` - // RestoreRequestType - Restore Type (FullShareRestore or ItemLevelRestore). Possible values include: 'RestoreRequestTypeInvalid', 'RestoreRequestTypeFullShareRestore', 'RestoreRequestTypeItemLevelRestore' - RestoreRequestType RestoreRequestType `json:"restoreRequestType,omitempty"` - // RestoreFileSpecs - List of Source Files/Folders(which need to recover) and TargetFolderPath details - RestoreFileSpecs *[]RestoreFileSpecs `json:"restoreFileSpecs,omitempty"` - // TargetDetails - Target File Share Details - TargetDetails *TargetAFSRestoreInfo `json:"targetDetails,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) MarshalJSON() ([]byte, error) { - afsrr.ObjectType = ObjectTypeAzureFileShareRestoreRequest - objectMap := make(map[string]interface{}) - if afsrr.RecoveryType != "" { - objectMap["recoveryType"] = afsrr.RecoveryType - } - if afsrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = afsrr.SourceResourceID - } - if afsrr.CopyOptions != "" { - objectMap["copyOptions"] = afsrr.CopyOptions - } - if afsrr.RestoreRequestType != "" { - objectMap["restoreRequestType"] = afsrr.RestoreRequestType - } - if afsrr.RestoreFileSpecs != nil { - objectMap["restoreFileSpecs"] = afsrr.RestoreFileSpecs - } - if afsrr.TargetDetails != nil { - objectMap["targetDetails"] = afsrr.TargetDetails - } - if afsrr.ObjectType != "" { - objectMap["objectType"] = afsrr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return &afsrr, true -} - -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { - return nil, false -} - -// AsRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return nil, false -} - -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. -func (afsrr AzureFileShareRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &afsrr, true -} - -// AzureIaaSClassicComputeVMContainer iaaS VM workload-specific backup item representing a classic virtual -// machine. -type AzureIaaSClassicComputeVMContainer struct { - // VirtualMachineID - Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // VirtualMachineVersion - Specifies whether the container represents a Classic or an Azure Resource Manager VM. - VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` - // ResourceGroup - Resource group name of Recovery Services Vault. - ResourceGroup *string `json:"resourceGroup,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) MarshalJSON() ([]byte, error) { - aisccvc.ContainerType = ContainerTypeMicrosoftClassicComputevirtualMachines - objectMap := make(map[string]interface{}) - if aisccvc.VirtualMachineID != nil { - objectMap["virtualMachineId"] = aisccvc.VirtualMachineID - } - if aisccvc.VirtualMachineVersion != nil { - objectMap["virtualMachineVersion"] = aisccvc.VirtualMachineVersion - } - if aisccvc.ResourceGroup != nil { - objectMap["resourceGroup"] = aisccvc.ResourceGroup - } - if aisccvc.FriendlyName != nil { - objectMap["friendlyName"] = aisccvc.FriendlyName - } - if aisccvc.BackupManagementType != "" { - objectMap["backupManagementType"] = aisccvc.BackupManagementType - } - if aisccvc.RegistrationStatus != nil { - objectMap["registrationStatus"] = aisccvc.RegistrationStatus - } - if aisccvc.HealthStatus != nil { - objectMap["healthStatus"] = aisccvc.HealthStatus - } - if aisccvc.ContainerType != "" { - objectMap["containerType"] = aisccvc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return &aisccvc, true -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return &aisccvc, true -} - -// AsMabContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. -func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &aisccvc, true -} - -// AzureIaaSClassicComputeVMProtectableItem iaaS VM workload-specific backup item representing the Classic -// Compute VM. -type AzureIaaSClassicComputeVMProtectableItem struct { - // VirtualMachineID - Fully qualified ARM ID of the virtual machine. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) MarshalJSON() ([]byte, error) { - aisccvpi.ProtectableItemType = ProtectableItemTypeMicrosoftClassicComputevirtualMachines - objectMap := make(map[string]interface{}) - if aisccvpi.VirtualMachineID != nil { - objectMap["virtualMachineId"] = aisccvpi.VirtualMachineID - } - if aisccvpi.BackupManagementType != nil { - objectMap["backupManagementType"] = aisccvpi.BackupManagementType - } - if aisccvpi.WorkloadType != nil { - objectMap["workloadType"] = aisccvpi.WorkloadType - } - if aisccvpi.FriendlyName != nil { - objectMap["friendlyName"] = aisccvpi.FriendlyName - } - if aisccvpi.ProtectionState != "" { - objectMap["protectionState"] = aisccvpi.ProtectionState - } - if aisccvpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = aisccvpi.ProtectableItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return &aisccvpi, true -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false -} - -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return nil, false -} - -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return &aisccvpi, true -} - -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &aisccvpi, true -} - -// AzureIaaSClassicComputeVMProtectedItem iaaS VM workload-specific backup item representing the Classic -// Compute VM. -type AzureIaaSClassicComputeVMProtectedItem struct { - // FriendlyName - Friendly name of the VM represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // VirtualMachineID - Fully qualified ARM ID of the virtual machine represented by this item. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // ProtectionStatus - Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // HealthStatus - Health status of protected item. Possible values include: 'HealthStatusPassed', 'HealthStatusActionRequired', 'HealthStatusActionSuggested', 'HealthStatusInvalid' - HealthStatus HealthStatus `json:"healthStatus,omitempty"` - // HealthDetails - Health details on this backup item. - HealthDetails *[]AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` - // KpisHealths - Health details of different KPIs - KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` - // LastBackupStatus - Last backup operation status. - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // ProtectedItemDataID - Data ID of the protected item. - ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` - // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) MarshalJSON() ([]byte, error) { - aisccvpi.ProtectedItemType = ProtectedItemTypeMicrosoftClassicComputevirtualMachines - objectMap := make(map[string]interface{}) - if aisccvpi.FriendlyName != nil { - objectMap["friendlyName"] = aisccvpi.FriendlyName - } - if aisccvpi.VirtualMachineID != nil { - objectMap["virtualMachineId"] = aisccvpi.VirtualMachineID - } - if aisccvpi.ProtectionStatus != nil { - objectMap["protectionStatus"] = aisccvpi.ProtectionStatus - } - if aisccvpi.ProtectionState != "" { - objectMap["protectionState"] = aisccvpi.ProtectionState - } - if aisccvpi.HealthStatus != "" { - objectMap["healthStatus"] = aisccvpi.HealthStatus - } - if aisccvpi.HealthDetails != nil { - objectMap["healthDetails"] = aisccvpi.HealthDetails - } - if aisccvpi.KpisHealths != nil { - objectMap["kpisHealths"] = aisccvpi.KpisHealths - } - if aisccvpi.LastBackupStatus != nil { - objectMap["lastBackupStatus"] = aisccvpi.LastBackupStatus - } - if aisccvpi.LastBackupTime != nil { - objectMap["lastBackupTime"] = aisccvpi.LastBackupTime - } - if aisccvpi.ProtectedItemDataID != nil { - objectMap["protectedItemDataId"] = aisccvpi.ProtectedItemDataID - } - if aisccvpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = aisccvpi.ExtendedInfo - } - if aisccvpi.ExtendedProperties != nil { - objectMap["extendedProperties"] = aisccvpi.ExtendedProperties - } - if aisccvpi.BackupManagementType != "" { - objectMap["backupManagementType"] = aisccvpi.BackupManagementType - } - if aisccvpi.WorkloadType != "" { - objectMap["workloadType"] = aisccvpi.WorkloadType - } - if aisccvpi.ContainerName != nil { - objectMap["containerName"] = aisccvpi.ContainerName - } - if aisccvpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = aisccvpi.SourceResourceID - } - if aisccvpi.PolicyID != nil { - objectMap["policyId"] = aisccvpi.PolicyID - } - if aisccvpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = aisccvpi.LastRecoveryPoint - } - if aisccvpi.BackupSetName != nil { - objectMap["backupSetName"] = aisccvpi.BackupSetName - } - if aisccvpi.CreateMode != "" { - objectMap["createMode"] = aisccvpi.CreateMode - } - if aisccvpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = aisccvpi.DeferredDeleteTimeInUTC - } - if aisccvpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = aisccvpi.IsScheduledForDeferredDelete - } - if aisccvpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = aisccvpi.DeferredDeleteTimeRemaining - } - if aisccvpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = aisccvpi.IsDeferredDeleteScheduleUpcoming - } - if aisccvpi.IsRehydrate != nil { - objectMap["isRehydrate"] = aisccvpi.IsRehydrate - } - if aisccvpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = aisccvpi.ProtectedItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return &aisccvpi, true -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return &aisccvpi, true -} - -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return nil, false -} - -// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return nil, false -} - -// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return nil, false -} - -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return nil, false -} - -// AsProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return nil, false -} - -// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. -func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &aisccvpi, true -} - -// AzureIaaSComputeVMContainer iaaS VM workload-specific backup item representing an Azure Resource Manager -// virtual machine. -type AzureIaaSComputeVMContainer struct { - // VirtualMachineID - Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // VirtualMachineVersion - Specifies whether the container represents a Classic or an Azure Resource Manager VM. - VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` - // ResourceGroup - Resource group name of Recovery Services Vault. - ResourceGroup *string `json:"resourceGroup,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) MarshalJSON() ([]byte, error) { - aiscvc.ContainerType = ContainerTypeMicrosoftComputevirtualMachines - objectMap := make(map[string]interface{}) - if aiscvc.VirtualMachineID != nil { - objectMap["virtualMachineId"] = aiscvc.VirtualMachineID - } - if aiscvc.VirtualMachineVersion != nil { - objectMap["virtualMachineVersion"] = aiscvc.VirtualMachineVersion - } - if aiscvc.ResourceGroup != nil { - objectMap["resourceGroup"] = aiscvc.ResourceGroup - } - if aiscvc.FriendlyName != nil { - objectMap["friendlyName"] = aiscvc.FriendlyName - } - if aiscvc.BackupManagementType != "" { - objectMap["backupManagementType"] = aiscvc.BackupManagementType - } - if aiscvc.RegistrationStatus != nil { - objectMap["registrationStatus"] = aiscvc.RegistrationStatus - } - if aiscvc.HealthStatus != nil { - objectMap["healthStatus"] = aiscvc.HealthStatus - } - if aiscvc.ContainerType != "" { - objectMap["containerType"] = aiscvc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return &aiscvc, true -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return &aiscvc, true -} - -// AsMabContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. -func (aiscvc AzureIaaSComputeVMContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &aiscvc, true -} - -// AzureIaaSComputeVMProtectableItem iaaS VM workload-specific backup item representing the Azure Resource -// Manager VM. -type AzureIaaSComputeVMProtectableItem struct { - // VirtualMachineID - Fully qualified ARM ID of the virtual machine. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) MarshalJSON() ([]byte, error) { - aiscvpi.ProtectableItemType = ProtectableItemTypeMicrosoftComputevirtualMachines - objectMap := make(map[string]interface{}) - if aiscvpi.VirtualMachineID != nil { - objectMap["virtualMachineId"] = aiscvpi.VirtualMachineID - } - if aiscvpi.BackupManagementType != nil { - objectMap["backupManagementType"] = aiscvpi.BackupManagementType - } - if aiscvpi.WorkloadType != nil { - objectMap["workloadType"] = aiscvpi.WorkloadType - } - if aiscvpi.FriendlyName != nil { - objectMap["friendlyName"] = aiscvpi.FriendlyName - } - if aiscvpi.ProtectionState != "" { - objectMap["protectionState"] = aiscvpi.ProtectionState - } - if aiscvpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = aiscvpi.ProtectableItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return &aiscvpi, true -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false -} - -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return nil, false -} - -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return &aiscvpi, true -} - -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. -func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &aiscvpi, true -} - -// AzureIaaSComputeVMProtectedItem iaaS VM workload-specific backup item representing the Azure Resource -// Manager VM. -type AzureIaaSComputeVMProtectedItem struct { - // FriendlyName - Friendly name of the VM represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // VirtualMachineID - Fully qualified ARM ID of the virtual machine represented by this item. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // ProtectionStatus - Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // HealthStatus - Health status of protected item. Possible values include: 'HealthStatusPassed', 'HealthStatusActionRequired', 'HealthStatusActionSuggested', 'HealthStatusInvalid' - HealthStatus HealthStatus `json:"healthStatus,omitempty"` - // HealthDetails - Health details on this backup item. - HealthDetails *[]AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` - // KpisHealths - Health details of different KPIs - KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` - // LastBackupStatus - Last backup operation status. - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // ProtectedItemDataID - Data ID of the protected item. - ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` - // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) MarshalJSON() ([]byte, error) { - aiscvpi.ProtectedItemType = ProtectedItemTypeMicrosoftComputevirtualMachines - objectMap := make(map[string]interface{}) - if aiscvpi.FriendlyName != nil { - objectMap["friendlyName"] = aiscvpi.FriendlyName - } - if aiscvpi.VirtualMachineID != nil { - objectMap["virtualMachineId"] = aiscvpi.VirtualMachineID - } - if aiscvpi.ProtectionStatus != nil { - objectMap["protectionStatus"] = aiscvpi.ProtectionStatus - } - if aiscvpi.ProtectionState != "" { - objectMap["protectionState"] = aiscvpi.ProtectionState - } - if aiscvpi.HealthStatus != "" { - objectMap["healthStatus"] = aiscvpi.HealthStatus - } - if aiscvpi.HealthDetails != nil { - objectMap["healthDetails"] = aiscvpi.HealthDetails - } - if aiscvpi.KpisHealths != nil { - objectMap["kpisHealths"] = aiscvpi.KpisHealths - } - if aiscvpi.LastBackupStatus != nil { - objectMap["lastBackupStatus"] = aiscvpi.LastBackupStatus - } - if aiscvpi.LastBackupTime != nil { - objectMap["lastBackupTime"] = aiscvpi.LastBackupTime - } - if aiscvpi.ProtectedItemDataID != nil { - objectMap["protectedItemDataId"] = aiscvpi.ProtectedItemDataID - } - if aiscvpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = aiscvpi.ExtendedInfo - } - if aiscvpi.ExtendedProperties != nil { - objectMap["extendedProperties"] = aiscvpi.ExtendedProperties - } - if aiscvpi.BackupManagementType != "" { - objectMap["backupManagementType"] = aiscvpi.BackupManagementType - } - if aiscvpi.WorkloadType != "" { - objectMap["workloadType"] = aiscvpi.WorkloadType - } - if aiscvpi.ContainerName != nil { - objectMap["containerName"] = aiscvpi.ContainerName - } - if aiscvpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = aiscvpi.SourceResourceID - } - if aiscvpi.PolicyID != nil { - objectMap["policyId"] = aiscvpi.PolicyID - } - if aiscvpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = aiscvpi.LastRecoveryPoint - } - if aiscvpi.BackupSetName != nil { - objectMap["backupSetName"] = aiscvpi.BackupSetName - } - if aiscvpi.CreateMode != "" { - objectMap["createMode"] = aiscvpi.CreateMode - } - if aiscvpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = aiscvpi.DeferredDeleteTimeInUTC - } - if aiscvpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = aiscvpi.IsScheduledForDeferredDelete - } - if aiscvpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = aiscvpi.DeferredDeleteTimeRemaining - } - if aiscvpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = aiscvpi.IsDeferredDeleteScheduleUpcoming - } - if aiscvpi.IsRehydrate != nil { - objectMap["isRehydrate"] = aiscvpi.IsRehydrate - } - if aiscvpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = aiscvpi.ProtectedItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return &aiscvpi, true -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return &aiscvpi, true -} - -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return nil, false -} - -// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return nil, false -} - -// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return nil, false -} - -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return nil, false -} - -// AsProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return nil, false -} - -// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. -func (aiscvpi AzureIaaSComputeVMProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &aiscvpi, true -} - -// AzureIaaSVMErrorInfo azure IaaS VM workload-specific error information. -type AzureIaaSVMErrorInfo struct { - // ErrorCode - READ-ONLY; Error code. - ErrorCode *int32 `json:"errorCode,omitempty"` - // ErrorTitle - READ-ONLY; Title: Typically, the entity that the error pertains to. - ErrorTitle *string `json:"errorTitle,omitempty"` - // ErrorString - READ-ONLY; Localized error string. - ErrorString *string `json:"errorString,omitempty"` - // Recommendations - READ-ONLY; List of localized recommendations for above error code. - Recommendations *[]string `json:"recommendations,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureIaaSVMErrorInfo. -func (aisei AzureIaaSVMErrorInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// AzureIaaSVMHealthDetails azure IaaS VM workload-specific Health Details. -type AzureIaaSVMHealthDetails struct { - // Code - READ-ONLY; Health Code - Code *int32 `json:"code,omitempty"` - // Title - READ-ONLY; Health Title - Title *string `json:"title,omitempty"` - // Message - READ-ONLY; Health Message - Message *string `json:"message,omitempty"` - // Recommendations - READ-ONLY; Health Recommended Actions - Recommendations *[]string `json:"recommendations,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureIaaSVMHealthDetails. -func (aishd AzureIaaSVMHealthDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// AzureIaaSVMJob azure IaaS VM workload-specific job object. -type AzureIaaSVMJob struct { - // Duration - Time elapsed during the execution of this job. - Duration *string `json:"duration,omitempty"` - // ActionsInfo - Gets or sets the state/actions applicable on this job like cancel/retry. - ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` - // ErrorDetails - Error details on execution of this job. - ErrorDetails *[]AzureIaaSVMErrorInfo `json:"errorDetails,omitempty"` - // VirtualMachineVersion - Specifies whether the backup item is a Classic or an Azure Resource Manager VM. - VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` - // ExtendedInfo - Additional information for this job. - ExtendedInfo *AzureIaaSVMJobExtendedInfo `json:"extendedInfo,omitempty"` - // EntityFriendlyName - Friendly name of the entity on which the current job is executing. - EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` - // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // Operation - The operation name. - Operation *string `json:"operation,omitempty"` - // Status - Job status. - Status *string `json:"status,omitempty"` - // StartTime - The start time. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time. - EndTime *date.Time `json:"endTime,omitempty"` - // ActivityID - ActivityId of job. - ActivityID *string `json:"activityId,omitempty"` - // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' - JobType JobType `json:"jobType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureIaaSVMJob. -func (aisj AzureIaaSVMJob) MarshalJSON() ([]byte, error) { - aisj.JobType = JobTypeAzureIaaSVMJob - objectMap := make(map[string]interface{}) - if aisj.Duration != nil { - objectMap["duration"] = aisj.Duration - } - if aisj.ActionsInfo != nil { - objectMap["actionsInfo"] = aisj.ActionsInfo - } - if aisj.ErrorDetails != nil { - objectMap["errorDetails"] = aisj.ErrorDetails - } - if aisj.VirtualMachineVersion != nil { - objectMap["virtualMachineVersion"] = aisj.VirtualMachineVersion - } - if aisj.ExtendedInfo != nil { - objectMap["extendedInfo"] = aisj.ExtendedInfo - } - if aisj.EntityFriendlyName != nil { - objectMap["entityFriendlyName"] = aisj.EntityFriendlyName - } - if aisj.BackupManagementType != "" { - objectMap["backupManagementType"] = aisj.BackupManagementType - } - if aisj.Operation != nil { - objectMap["operation"] = aisj.Operation - } - if aisj.Status != nil { - objectMap["status"] = aisj.Status - } - if aisj.StartTime != nil { - objectMap["startTime"] = aisj.StartTime - } - if aisj.EndTime != nil { - objectMap["endTime"] = aisj.EndTime - } - if aisj.ActivityID != nil { - objectMap["activityId"] = aisj.ActivityID - } - if aisj.JobType != "" { - objectMap["jobType"] = aisj.JobType - } - return json.Marshal(objectMap) -} - -// AsAzureIaaSVMJob is the BasicJob implementation for AzureIaaSVMJob. -func (aisj AzureIaaSVMJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { - return &aisj, true -} - -// AsAzureStorageJob is the BasicJob implementation for AzureIaaSVMJob. -func (aisj AzureIaaSVMJob) AsAzureStorageJob() (*AzureStorageJob, bool) { - return nil, false -} - -// AsAzureWorkloadJob is the BasicJob implementation for AzureIaaSVMJob. -func (aisj AzureIaaSVMJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { - return nil, false -} - -// AsDpmJob is the BasicJob implementation for AzureIaaSVMJob. -func (aisj AzureIaaSVMJob) AsDpmJob() (*DpmJob, bool) { - return nil, false -} - -// AsMabJob is the BasicJob implementation for AzureIaaSVMJob. -func (aisj AzureIaaSVMJob) AsMabJob() (*MabJob, bool) { - return nil, false -} - -// AsJob is the BasicJob implementation for AzureIaaSVMJob. -func (aisj AzureIaaSVMJob) AsJob() (*Job, bool) { - return nil, false -} - -// AsBasicJob is the BasicJob implementation for AzureIaaSVMJob. -func (aisj AzureIaaSVMJob) AsBasicJob() (BasicJob, bool) { - return &aisj, true -} - -// AzureIaaSVMJobExtendedInfo azure IaaS VM workload-specific additional information for job. -type AzureIaaSVMJobExtendedInfo struct { - // TasksList - List of tasks associated with this job. - TasksList *[]AzureIaaSVMJobTaskDetails `json:"tasksList,omitempty"` - // PropertyBag - Job properties. - PropertyBag map[string]*string `json:"propertyBag"` - // InternalPropertyBag - Job internal properties. - InternalPropertyBag map[string]*string `json:"internalPropertyBag"` - // ProgressPercentage - Indicates progress of the job. Null if it has not started or completed. - ProgressPercentage *float64 `json:"progressPercentage,omitempty"` - // EstimatedRemainingDuration - Time remaining for execution of this job. - EstimatedRemainingDuration *string `json:"estimatedRemainingDuration,omitempty"` - // DynamicErrorMessage - Non localized error message on job execution. - DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureIaaSVMJobExtendedInfo. -func (aisjei AzureIaaSVMJobExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if aisjei.TasksList != nil { - objectMap["tasksList"] = aisjei.TasksList - } - if aisjei.PropertyBag != nil { - objectMap["propertyBag"] = aisjei.PropertyBag - } - if aisjei.InternalPropertyBag != nil { - objectMap["internalPropertyBag"] = aisjei.InternalPropertyBag - } - if aisjei.ProgressPercentage != nil { - objectMap["progressPercentage"] = aisjei.ProgressPercentage - } - if aisjei.EstimatedRemainingDuration != nil { - objectMap["estimatedRemainingDuration"] = aisjei.EstimatedRemainingDuration - } - if aisjei.DynamicErrorMessage != nil { - objectMap["dynamicErrorMessage"] = aisjei.DynamicErrorMessage - } - return json.Marshal(objectMap) -} - -// AzureIaaSVMJobTaskDetails azure IaaS VM workload-specific job task details. -type AzureIaaSVMJobTaskDetails struct { - // TaskID - The task display name. - TaskID *string `json:"taskId,omitempty"` - // StartTime - The start time. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time. - EndTime *date.Time `json:"endTime,omitempty"` - // InstanceID - The instanceId. - InstanceID *string `json:"instanceId,omitempty"` - // Duration - Time elapsed for task. - Duration *string `json:"duration,omitempty"` - // Status - The status. - Status *string `json:"status,omitempty"` - // ProgressPercentage - Progress of the task. - ProgressPercentage *float64 `json:"progressPercentage,omitempty"` - // TaskExecutionDetails - Details about execution of the task. - // eg: number of bytes transferred etc - TaskExecutionDetails *string `json:"taskExecutionDetails,omitempty"` -} - -// BasicAzureIaaSVMProtectedItem iaaS VM workload-specific backup item. -type BasicAzureIaaSVMProtectedItem interface { - AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) - AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) - AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) -} - -// AzureIaaSVMProtectedItem iaaS VM workload-specific backup item. -type AzureIaaSVMProtectedItem struct { - // FriendlyName - Friendly name of the VM represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // VirtualMachineID - Fully qualified ARM ID of the virtual machine represented by this item. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // ProtectionStatus - Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // HealthStatus - Health status of protected item. Possible values include: 'HealthStatusPassed', 'HealthStatusActionRequired', 'HealthStatusActionSuggested', 'HealthStatusInvalid' - HealthStatus HealthStatus `json:"healthStatus,omitempty"` - // HealthDetails - Health details on this backup item. - HealthDetails *[]AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` - // KpisHealths - Health details of different KPIs - KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` - // LastBackupStatus - Last backup operation status. - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // ProtectedItemDataID - Data ID of the protected item. - ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` - // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -func unmarshalBasicAzureIaaSVMProtectedItem(body []byte) (BasicAzureIaaSVMProtectedItem, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["protectedItemType"] { - case string(ProtectedItemTypeMicrosoftClassicComputevirtualMachines): - var aisccvpi AzureIaaSClassicComputeVMProtectedItem - err := json.Unmarshal(body, &aisccvpi) - return aisccvpi, err - case string(ProtectedItemTypeMicrosoftComputevirtualMachines): - var aiscvpi AzureIaaSComputeVMProtectedItem - err := json.Unmarshal(body, &aiscvpi) - return aiscvpi, err - default: - var aispi AzureIaaSVMProtectedItem - err := json.Unmarshal(body, &aispi) - return aispi, err - } -} -func unmarshalBasicAzureIaaSVMProtectedItemArray(body []byte) ([]BasicAzureIaaSVMProtectedItem, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - aispiArray := make([]BasicAzureIaaSVMProtectedItem, len(rawMessages)) - - for index, rawMessage := range rawMessages { - aispi, err := unmarshalBasicAzureIaaSVMProtectedItem(*rawMessage) - if err != nil { - return nil, err - } - aispiArray[index] = aispi - } - return aispiArray, nil -} - -// MarshalJSON is the custom marshaler for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) MarshalJSON() ([]byte, error) { - aispi.ProtectedItemType = ProtectedItemTypeAzureIaaSVMProtectedItem - objectMap := make(map[string]interface{}) - if aispi.FriendlyName != nil { - objectMap["friendlyName"] = aispi.FriendlyName - } - if aispi.VirtualMachineID != nil { - objectMap["virtualMachineId"] = aispi.VirtualMachineID - } - if aispi.ProtectionStatus != nil { - objectMap["protectionStatus"] = aispi.ProtectionStatus - } - if aispi.ProtectionState != "" { - objectMap["protectionState"] = aispi.ProtectionState - } - if aispi.HealthStatus != "" { - objectMap["healthStatus"] = aispi.HealthStatus - } - if aispi.HealthDetails != nil { - objectMap["healthDetails"] = aispi.HealthDetails - } - if aispi.KpisHealths != nil { - objectMap["kpisHealths"] = aispi.KpisHealths - } - if aispi.LastBackupStatus != nil { - objectMap["lastBackupStatus"] = aispi.LastBackupStatus - } - if aispi.LastBackupTime != nil { - objectMap["lastBackupTime"] = aispi.LastBackupTime - } - if aispi.ProtectedItemDataID != nil { - objectMap["protectedItemDataId"] = aispi.ProtectedItemDataID - } - if aispi.ExtendedInfo != nil { - objectMap["extendedInfo"] = aispi.ExtendedInfo - } - if aispi.ExtendedProperties != nil { - objectMap["extendedProperties"] = aispi.ExtendedProperties - } - if aispi.BackupManagementType != "" { - objectMap["backupManagementType"] = aispi.BackupManagementType - } - if aispi.WorkloadType != "" { - objectMap["workloadType"] = aispi.WorkloadType - } - if aispi.ContainerName != nil { - objectMap["containerName"] = aispi.ContainerName - } - if aispi.SourceResourceID != nil { - objectMap["sourceResourceId"] = aispi.SourceResourceID - } - if aispi.PolicyID != nil { - objectMap["policyId"] = aispi.PolicyID - } - if aispi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = aispi.LastRecoveryPoint - } - if aispi.BackupSetName != nil { - objectMap["backupSetName"] = aispi.BackupSetName - } - if aispi.CreateMode != "" { - objectMap["createMode"] = aispi.CreateMode - } - if aispi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = aispi.DeferredDeleteTimeInUTC - } - if aispi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = aispi.IsScheduledForDeferredDelete - } - if aispi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = aispi.DeferredDeleteTimeRemaining - } - if aispi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = aispi.IsDeferredDeleteScheduleUpcoming - } - if aispi.IsRehydrate != nil { - objectMap["isRehydrate"] = aispi.IsRehydrate - } - if aispi.ProtectedItemType != "" { - objectMap["protectedItemType"] = aispi.ProtectedItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return &aispi, true -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return &aispi, true -} - -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return nil, false -} - -// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return nil, false -} - -// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return nil, false -} - -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return nil, false -} - -// AsProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return nil, false -} - -// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. -func (aispi AzureIaaSVMProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &aispi, true -} - -// AzureIaaSVMProtectedItemExtendedInfo additional information on Azure IaaS VM specific backup item. -type AzureIaaSVMProtectedItemExtendedInfo struct { - // OldestRecoveryPoint - The oldest backup copy available for this backup item. - OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` - // RecoveryPointCount - Number of backup copies available for this backup item. - RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` - // PolicyInconsistent - Specifies if backup policy associated with the backup item is inconsistent. - PolicyInconsistent *bool `json:"policyInconsistent,omitempty"` -} - -// AzureIaaSVMProtectionPolicy iaaS VM workload-specific backup policy. -type AzureIaaSVMProtectionPolicy struct { - InstantRPDetails *InstantRPAdditionalDetails `json:"instantRPDetails,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. - RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` - // InstantRpRetentionRangeInDays - Instant RP retention policy range in days - InstantRpRetentionRangeInDays *int32 `json:"instantRpRetentionRangeInDays,omitempty"` - // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". - TimeZone *string `json:"timeZone,omitempty"` - // ProtectedItemsCount - Number of items associated with this policy. - ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' - BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureIaaSVMProtectionPolicy. -func (aispp AzureIaaSVMProtectionPolicy) MarshalJSON() ([]byte, error) { - aispp.BackupManagementType = BackupManagementTypeAzureIaasVM - objectMap := make(map[string]interface{}) - if aispp.InstantRPDetails != nil { - objectMap["instantRPDetails"] = aispp.InstantRPDetails - } - objectMap["schedulePolicy"] = aispp.SchedulePolicy - objectMap["retentionPolicy"] = aispp.RetentionPolicy - if aispp.InstantRpRetentionRangeInDays != nil { - objectMap["instantRpRetentionRangeInDays"] = aispp.InstantRpRetentionRangeInDays - } - if aispp.TimeZone != nil { - objectMap["timeZone"] = aispp.TimeZone - } - if aispp.ProtectedItemsCount != nil { - objectMap["protectedItemsCount"] = aispp.ProtectedItemsCount - } - if aispp.BackupManagementType != "" { - objectMap["backupManagementType"] = aispp.BackupManagementType - } - return json.Marshal(objectMap) -} - -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. -func (aispp AzureIaaSVMProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { - return nil, false -} - -// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. -func (aispp AzureIaaSVMProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. -func (aispp AzureIaaSVMProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { - return &aispp, true -} - -// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. -func (aispp AzureIaaSVMProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { - return nil, false -} - -// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. -func (aispp AzureIaaSVMProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { - return nil, false -} - -// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. -func (aispp AzureIaaSVMProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { - return nil, false -} - -// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. -func (aispp AzureIaaSVMProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { - return nil, false -} - -// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. -func (aispp AzureIaaSVMProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { - return &aispp, true -} - -// UnmarshalJSON is the custom unmarshaler for AzureIaaSVMProtectionPolicy struct. -func (aispp *AzureIaaSVMProtectionPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "instantRPDetails": - if v != nil { - var instantRPDetails InstantRPAdditionalDetails - err = json.Unmarshal(*v, &instantRPDetails) - if err != nil { - return err - } - aispp.InstantRPDetails = &instantRPDetails - } - case "schedulePolicy": - if v != nil { - schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) - if err != nil { - return err - } - aispp.SchedulePolicy = schedulePolicy - } - case "retentionPolicy": - if v != nil { - retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) - if err != nil { - return err - } - aispp.RetentionPolicy = retentionPolicy - } - case "instantRpRetentionRangeInDays": - if v != nil { - var instantRpRetentionRangeInDays int32 - err = json.Unmarshal(*v, &instantRpRetentionRangeInDays) - if err != nil { - return err - } - aispp.InstantRpRetentionRangeInDays = &instantRpRetentionRangeInDays - } - case "timeZone": - if v != nil { - var timeZone string - err = json.Unmarshal(*v, &timeZone) - if err != nil { - return err - } - aispp.TimeZone = &timeZone - } - case "protectedItemsCount": - if v != nil { - var protectedItemsCount int32 - err = json.Unmarshal(*v, &protectedItemsCount) - if err != nil { - return err - } - aispp.ProtectedItemsCount = &protectedItemsCount - } - case "backupManagementType": - if v != nil { - var backupManagementType ManagementTypeBasicProtectionPolicy - err = json.Unmarshal(*v, &backupManagementType) - if err != nil { - return err - } - aispp.BackupManagementType = backupManagementType - } - } - } - - return nil -} - -// BasicAzureRecoveryServiceVaultProtectionIntent azure Recovery Services Vault specific protection intent item. -type BasicAzureRecoveryServiceVaultProtectionIntent interface { - AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) - AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) - AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) - AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) -} - -// AzureRecoveryServiceVaultProtectionIntent azure Recovery Services Vault specific protection intent item. -type AzureRecoveryServiceVaultProtectionIntent struct { - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId - ItemID *string `json:"itemId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' - ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` -} - -func unmarshalBasicAzureRecoveryServiceVaultProtectionIntent(body []byte) (BasicAzureRecoveryServiceVaultProtectionIntent, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["protectionIntentItemType"] { - case string(ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent): - var awapi AzureWorkloadAutoProtectionIntent - err := json.Unmarshal(body, &awapi) - return awapi, err - case string(ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent): - var awsapi AzureWorkloadSQLAutoProtectionIntent - err := json.Unmarshal(body, &awsapi) - return awsapi, err - default: - var arsvpi AzureRecoveryServiceVaultProtectionIntent - err := json.Unmarshal(body, &arsvpi) - return arsvpi, err - } -} -func unmarshalBasicAzureRecoveryServiceVaultProtectionIntentArray(body []byte) ([]BasicAzureRecoveryServiceVaultProtectionIntent, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - arsvpiArray := make([]BasicAzureRecoveryServiceVaultProtectionIntent, len(rawMessages)) - - for index, rawMessage := range rawMessages { - arsvpi, err := unmarshalBasicAzureRecoveryServiceVaultProtectionIntent(*rawMessage) - if err != nil { - return nil, err - } - arsvpiArray[index] = arsvpi - } - return arsvpiArray, nil -} - -// MarshalJSON is the custom marshaler for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) MarshalJSON() ([]byte, error) { - arsvpi.ProtectionIntentItemType = ProtectionIntentItemTypeRecoveryServiceVaultItem - objectMap := make(map[string]interface{}) - if arsvpi.BackupManagementType != "" { - objectMap["backupManagementType"] = arsvpi.BackupManagementType - } - if arsvpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = arsvpi.SourceResourceID - } - if arsvpi.ItemID != nil { - objectMap["itemId"] = arsvpi.ItemID - } - if arsvpi.PolicyID != nil { - objectMap["policyId"] = arsvpi.PolicyID - } - if arsvpi.ProtectionState != "" { - objectMap["protectionState"] = arsvpi.ProtectionState - } - if arsvpi.ProtectionIntentItemType != "" { - objectMap["protectionIntentItemType"] = arsvpi.ProtectionIntentItemType - } - return json.Marshal(objectMap) -} - -// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { - return &arsvpi, true -} - -// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { - return &arsvpi, true -} - -// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { - return nil, false -} - -// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { - return nil, false -} - -// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { - return nil, false -} - -// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { - return nil, false -} - -// AsProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { - return nil, false -} - -// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { - return &arsvpi, true -} - -// AzureResourceProtectionIntent iaaS VM specific backup protection intent item. -type AzureResourceProtectionIntent struct { - // FriendlyName - Friendly name of the VM represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId - ItemID *string `json:"itemId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' - ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) MarshalJSON() ([]byte, error) { - arpi.ProtectionIntentItemType = ProtectionIntentItemTypeAzureResourceItem - objectMap := make(map[string]interface{}) - if arpi.FriendlyName != nil { - objectMap["friendlyName"] = arpi.FriendlyName - } - if arpi.BackupManagementType != "" { - objectMap["backupManagementType"] = arpi.BackupManagementType - } - if arpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = arpi.SourceResourceID - } - if arpi.ItemID != nil { - objectMap["itemId"] = arpi.ItemID - } - if arpi.PolicyID != nil { - objectMap["policyId"] = arpi.PolicyID - } - if arpi.ProtectionState != "" { - objectMap["protectionState"] = arpi.ProtectionState - } - if arpi.ProtectionIntentItemType != "" { - objectMap["protectionIntentItemType"] = arpi.ProtectionIntentItemType - } - return json.Marshal(objectMap) -} - -// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { - return nil, false -} - -// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { - return nil, false -} - -// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { - return &arpi, true -} - -// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { - return nil, false -} - -// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { - return nil, false -} - -// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { - return nil, false -} - -// AsProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { - return nil, false -} - -// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { - return &arpi, true -} - -// AzureSQLAGWorkloadContainerProtectionContainer container for SQL workloads under SQL Availability Group. -type AzureSQLAGWorkloadContainerProtectionContainer struct { - // SourceResourceID - ARM ID of the virtual machine represented by this Azure Workload Container - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // LastUpdatedTime - Time stamp when this container was updated. - LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` - // ExtendedInfo - Additional details of a workload container. - ExtendedInfo *AzureWorkloadContainerExtendedInfo `json:"extendedInfo,omitempty"` - // WorkloadType - Workload type for which registration was sent. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` - // OperationType - Re-Do Operation. Possible values include: 'OperationTypeInvalid', 'OperationTypeRegister', 'OperationTypeReregister' - OperationType OperationType `json:"operationType,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) MarshalJSON() ([]byte, error) { - aswcpc.ContainerType = ContainerTypeSQLAGWorkLoadContainer1 - objectMap := make(map[string]interface{}) - if aswcpc.SourceResourceID != nil { - objectMap["sourceResourceId"] = aswcpc.SourceResourceID - } - if aswcpc.LastUpdatedTime != nil { - objectMap["lastUpdatedTime"] = aswcpc.LastUpdatedTime - } - if aswcpc.ExtendedInfo != nil { - objectMap["extendedInfo"] = aswcpc.ExtendedInfo - } - if aswcpc.WorkloadType != "" { - objectMap["workloadType"] = aswcpc.WorkloadType - } - if aswcpc.OperationType != "" { - objectMap["operationType"] = aswcpc.OperationType - } - if aswcpc.FriendlyName != nil { - objectMap["friendlyName"] = aswcpc.FriendlyName - } - if aswcpc.BackupManagementType != "" { - objectMap["backupManagementType"] = aswcpc.BackupManagementType - } - if aswcpc.RegistrationStatus != nil { - objectMap["registrationStatus"] = aswcpc.RegistrationStatus - } - if aswcpc.HealthStatus != nil { - objectMap["healthStatus"] = aswcpc.HealthStatus - } - if aswcpc.ContainerType != "" { - objectMap["containerType"] = aswcpc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return &aswcpc, true -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return &aswcpc, true -} - -// AsDpmContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false -} - -// AsMabContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. -func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &aswcpc, true -} - -// AzureSQLContainer azure Sql workload-specific container. -type AzureSQLContainer struct { - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureSQLContainer. -func (asc AzureSQLContainer) MarshalJSON() ([]byte, error) { - asc.ContainerType = ContainerTypeAzureSQLContainer1 - objectMap := make(map[string]interface{}) - if asc.FriendlyName != nil { - objectMap["friendlyName"] = asc.FriendlyName - } - if asc.BackupManagementType != "" { - objectMap["backupManagementType"] = asc.BackupManagementType - } - if asc.RegistrationStatus != nil { - objectMap["registrationStatus"] = asc.RegistrationStatus - } - if asc.HealthStatus != nil { - objectMap["healthStatus"] = asc.HealthStatus - } - if asc.ContainerType != "" { - objectMap["containerType"] = asc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return &asc, true -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false -} - -// AsMabContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. -func (asc AzureSQLContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &asc, true -} - -// AzureSQLProtectedItem azure SQL workload-specific backup item. -type AzureSQLProtectedItem struct { - // ProtectedItemDataID - Internal ID of a backup item. Used by Azure SQL Backup engine to contact Recovery Services. - ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` - // ProtectionState - Backup state of the backed up item. Possible values include: 'ProtectedItemStateInvalid', 'ProtectedItemStateIRPending', 'ProtectedItemStateProtected', 'ProtectedItemStateProtectionError', 'ProtectedItemStateProtectionStopped', 'ProtectedItemStateProtectionPaused' - ProtectionState ProtectedItemState `json:"protectionState,omitempty"` - // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureSQLProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) MarshalJSON() ([]byte, error) { - aspi.ProtectedItemType = ProtectedItemTypeMicrosoftSqlserversdatabases - objectMap := make(map[string]interface{}) - if aspi.ProtectedItemDataID != nil { - objectMap["protectedItemDataId"] = aspi.ProtectedItemDataID - } - if aspi.ProtectionState != "" { - objectMap["protectionState"] = aspi.ProtectionState - } - if aspi.ExtendedInfo != nil { - objectMap["extendedInfo"] = aspi.ExtendedInfo - } - if aspi.BackupManagementType != "" { - objectMap["backupManagementType"] = aspi.BackupManagementType - } - if aspi.WorkloadType != "" { - objectMap["workloadType"] = aspi.WorkloadType - } - if aspi.ContainerName != nil { - objectMap["containerName"] = aspi.ContainerName - } - if aspi.SourceResourceID != nil { - objectMap["sourceResourceId"] = aspi.SourceResourceID - } - if aspi.PolicyID != nil { - objectMap["policyId"] = aspi.PolicyID - } - if aspi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = aspi.LastRecoveryPoint - } - if aspi.BackupSetName != nil { - objectMap["backupSetName"] = aspi.BackupSetName - } - if aspi.CreateMode != "" { - objectMap["createMode"] = aspi.CreateMode - } - if aspi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = aspi.DeferredDeleteTimeInUTC - } - if aspi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = aspi.IsScheduledForDeferredDelete - } - if aspi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = aspi.DeferredDeleteTimeRemaining - } - if aspi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = aspi.IsDeferredDeleteScheduleUpcoming - } - if aspi.IsRehydrate != nil { - objectMap["isRehydrate"] = aspi.IsRehydrate - } - if aspi.ProtectedItemType != "" { - objectMap["protectedItemType"] = aspi.ProtectedItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return &aspi, true -} - -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return nil, false -} - -// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return nil, false -} - -// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return nil, false -} - -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return nil, false -} - -// AsProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return nil, false -} - -// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. -func (aspi AzureSQLProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &aspi, true -} - -// AzureSQLProtectedItemExtendedInfo additional information on Azure Sql specific protected item. -type AzureSQLProtectedItemExtendedInfo struct { - // OldestRecoveryPoint - The oldest backup copy available for this item in the service. - OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` - // RecoveryPointCount - Number of available backup copies associated with this backup item. - RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` - // PolicyState - State of the backup policy associated with this backup item. - PolicyState *string `json:"policyState,omitempty"` -} - -// AzureSQLProtectionPolicy azure SQL workload-specific backup policy. -type AzureSQLProtectionPolicy struct { - // RetentionPolicy - Retention policy details. - RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` - // ProtectedItemsCount - Number of items associated with this policy. - ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' - BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) MarshalJSON() ([]byte, error) { - aspp.BackupManagementType = BackupManagementTypeAzureSQL - objectMap := make(map[string]interface{}) - objectMap["retentionPolicy"] = aspp.RetentionPolicy - if aspp.ProtectedItemsCount != nil { - objectMap["protectedItemsCount"] = aspp.ProtectedItemsCount - } - if aspp.BackupManagementType != "" { - objectMap["backupManagementType"] = aspp.BackupManagementType - } - return json.Marshal(objectMap) -} - -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { - return nil, false -} - -// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { - return nil, false -} - -// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { - return &aspp, true -} - -// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { - return nil, false -} - -// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { - return nil, false -} - -// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { - return nil, false -} - -// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. -func (aspp AzureSQLProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { - return &aspp, true -} - -// UnmarshalJSON is the custom unmarshaler for AzureSQLProtectionPolicy struct. -func (aspp *AzureSQLProtectionPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "retentionPolicy": - if v != nil { - retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) - if err != nil { - return err - } - aspp.RetentionPolicy = retentionPolicy - } - case "protectedItemsCount": - if v != nil { - var protectedItemsCount int32 - err = json.Unmarshal(*v, &protectedItemsCount) - if err != nil { - return err - } - aspp.ProtectedItemsCount = &protectedItemsCount - } - case "backupManagementType": - if v != nil { - var backupManagementType ManagementTypeBasicProtectionPolicy - err = json.Unmarshal(*v, &backupManagementType) - if err != nil { - return err - } - aspp.BackupManagementType = backupManagementType - } - } - } - - return nil -} - -// AzureStorageContainer azure Storage Account workload-specific container. -type AzureStorageContainer struct { - // SourceResourceID - Fully qualified ARM url. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // StorageAccountVersion - Storage account version. - StorageAccountVersion *string `json:"storageAccountVersion,omitempty"` - // ResourceGroup - Resource group name of Recovery Services Vault. - ResourceGroup *string `json:"resourceGroup,omitempty"` - // ProtectedItemCount - Number of items backed up in this container. - ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureStorageContainer. -func (asc AzureStorageContainer) MarshalJSON() ([]byte, error) { - asc.ContainerType = ContainerTypeStorageContainer1 - objectMap := make(map[string]interface{}) - if asc.SourceResourceID != nil { - objectMap["sourceResourceId"] = asc.SourceResourceID - } - if asc.StorageAccountVersion != nil { - objectMap["storageAccountVersion"] = asc.StorageAccountVersion - } - if asc.ResourceGroup != nil { - objectMap["resourceGroup"] = asc.ResourceGroup - } - if asc.ProtectedItemCount != nil { - objectMap["protectedItemCount"] = asc.ProtectedItemCount - } - if asc.FriendlyName != nil { - objectMap["friendlyName"] = asc.FriendlyName - } - if asc.BackupManagementType != "" { - objectMap["backupManagementType"] = asc.BackupManagementType - } - if asc.RegistrationStatus != nil { - objectMap["registrationStatus"] = asc.RegistrationStatus - } - if asc.HealthStatus != nil { - objectMap["healthStatus"] = asc.HealthStatus - } - if asc.ContainerType != "" { - objectMap["containerType"] = asc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return &asc, true -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false -} - -// AsMabContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. -func (asc AzureStorageContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &asc, true -} - -// AzureStorageErrorInfo azure storage specific error information -type AzureStorageErrorInfo struct { - // ErrorCode - Error code. - ErrorCode *int32 `json:"errorCode,omitempty"` - // ErrorString - Localized error string. - ErrorString *string `json:"errorString,omitempty"` - // Recommendations - List of localized recommendations for above error code. - Recommendations *[]string `json:"recommendations,omitempty"` -} - -// AzureStorageJob azure storage specific job. -type AzureStorageJob struct { - // Duration - Time elapsed during the execution of this job. - Duration *string `json:"duration,omitempty"` - // ActionsInfo - Gets or sets the state/actions applicable on this job like cancel/retry. - ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` - // ErrorDetails - Error details on execution of this job. - ErrorDetails *[]AzureStorageErrorInfo `json:"errorDetails,omitempty"` - // StorageAccountName - Specifies friendly name of the storage account. - StorageAccountName *string `json:"storageAccountName,omitempty"` - // StorageAccountVersion - Specifies whether the Storage account is a Classic or an Azure Resource Manager Storage account. - StorageAccountVersion *string `json:"storageAccountVersion,omitempty"` - // ExtendedInfo - Additional information about the job. - ExtendedInfo *AzureStorageJobExtendedInfo `json:"extendedInfo,omitempty"` - // EntityFriendlyName - Friendly name of the entity on which the current job is executing. - EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` - // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // Operation - The operation name. - Operation *string `json:"operation,omitempty"` - // Status - Job status. - Status *string `json:"status,omitempty"` - // StartTime - The start time. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time. - EndTime *date.Time `json:"endTime,omitempty"` - // ActivityID - ActivityId of job. - ActivityID *string `json:"activityId,omitempty"` - // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' - JobType JobType `json:"jobType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureStorageJob. -func (asj AzureStorageJob) MarshalJSON() ([]byte, error) { - asj.JobType = JobTypeAzureStorageJob - objectMap := make(map[string]interface{}) - if asj.Duration != nil { - objectMap["duration"] = asj.Duration - } - if asj.ActionsInfo != nil { - objectMap["actionsInfo"] = asj.ActionsInfo - } - if asj.ErrorDetails != nil { - objectMap["errorDetails"] = asj.ErrorDetails - } - if asj.StorageAccountName != nil { - objectMap["storageAccountName"] = asj.StorageAccountName - } - if asj.StorageAccountVersion != nil { - objectMap["storageAccountVersion"] = asj.StorageAccountVersion - } - if asj.ExtendedInfo != nil { - objectMap["extendedInfo"] = asj.ExtendedInfo - } - if asj.EntityFriendlyName != nil { - objectMap["entityFriendlyName"] = asj.EntityFriendlyName - } - if asj.BackupManagementType != "" { - objectMap["backupManagementType"] = asj.BackupManagementType - } - if asj.Operation != nil { - objectMap["operation"] = asj.Operation - } - if asj.Status != nil { - objectMap["status"] = asj.Status - } - if asj.StartTime != nil { - objectMap["startTime"] = asj.StartTime - } - if asj.EndTime != nil { - objectMap["endTime"] = asj.EndTime - } - if asj.ActivityID != nil { - objectMap["activityId"] = asj.ActivityID - } - if asj.JobType != "" { - objectMap["jobType"] = asj.JobType - } - return json.Marshal(objectMap) -} - -// AsAzureIaaSVMJob is the BasicJob implementation for AzureStorageJob. -func (asj AzureStorageJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { - return nil, false -} - -// AsAzureStorageJob is the BasicJob implementation for AzureStorageJob. -func (asj AzureStorageJob) AsAzureStorageJob() (*AzureStorageJob, bool) { - return &asj, true -} - -// AsAzureWorkloadJob is the BasicJob implementation for AzureStorageJob. -func (asj AzureStorageJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { - return nil, false -} - -// AsDpmJob is the BasicJob implementation for AzureStorageJob. -func (asj AzureStorageJob) AsDpmJob() (*DpmJob, bool) { - return nil, false -} - -// AsMabJob is the BasicJob implementation for AzureStorageJob. -func (asj AzureStorageJob) AsMabJob() (*MabJob, bool) { - return nil, false -} - -// AsJob is the BasicJob implementation for AzureStorageJob. -func (asj AzureStorageJob) AsJob() (*Job, bool) { - return nil, false -} - -// AsBasicJob is the BasicJob implementation for AzureStorageJob. -func (asj AzureStorageJob) AsBasicJob() (BasicJob, bool) { - return &asj, true -} - -// AzureStorageJobExtendedInfo azure Storage workload-specific additional information for job. -type AzureStorageJobExtendedInfo struct { - // TasksList - List of tasks for this job - TasksList *[]AzureStorageJobTaskDetails `json:"tasksList,omitempty"` - // PropertyBag - Job properties. - PropertyBag map[string]*string `json:"propertyBag"` - // DynamicErrorMessage - Non localized error message on job execution. - DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureStorageJobExtendedInfo. -func (asjei AzureStorageJobExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if asjei.TasksList != nil { - objectMap["tasksList"] = asjei.TasksList - } - if asjei.PropertyBag != nil { - objectMap["propertyBag"] = asjei.PropertyBag - } - if asjei.DynamicErrorMessage != nil { - objectMap["dynamicErrorMessage"] = asjei.DynamicErrorMessage - } - return json.Marshal(objectMap) -} - -// AzureStorageJobTaskDetails azure storage workload specific job task details. -type AzureStorageJobTaskDetails struct { - // TaskID - The task display name. - TaskID *string `json:"taskId,omitempty"` - // Status - The status. - Status *string `json:"status,omitempty"` -} - -// AzureStorageProtectableContainer azure Storage-specific protectable containers -type AzureStorageProtectableContainer struct { - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerID - Fabric Id of the container such as ARM Id. - ContainerID *string `json:"containerId,omitempty"` - // ProtectableContainerType - Possible values include: 'ProtectableContainerTypeProtectableContainer', 'ProtectableContainerTypeStorageContainer', 'ProtectableContainerTypeVMAppContainer' - ProtectableContainerType ProtectableContainerType `json:"protectableContainerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureStorageProtectableContainer. -func (aspc AzureStorageProtectableContainer) MarshalJSON() ([]byte, error) { - aspc.ProtectableContainerType = ProtectableContainerTypeStorageContainer - objectMap := make(map[string]interface{}) - if aspc.FriendlyName != nil { - objectMap["friendlyName"] = aspc.FriendlyName - } - if aspc.BackupManagementType != "" { - objectMap["backupManagementType"] = aspc.BackupManagementType - } - if aspc.HealthStatus != nil { - objectMap["healthStatus"] = aspc.HealthStatus - } - if aspc.ContainerID != nil { - objectMap["containerId"] = aspc.ContainerID - } - if aspc.ProtectableContainerType != "" { - objectMap["protectableContainerType"] = aspc.ProtectableContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureStorageProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. -func (aspc AzureStorageProtectableContainer) AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) { - return &aspc, true -} - -// AsAzureVMAppContainerProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. -func (aspc AzureStorageProtectableContainer) AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) { - return nil, false -} - -// AsProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. -func (aspc AzureStorageProtectableContainer) AsProtectableContainer() (*ProtectableContainer, bool) { - return nil, false -} - -// AsBasicProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. -func (aspc AzureStorageProtectableContainer) AsBasicProtectableContainer() (BasicProtectableContainer, bool) { - return &aspc, true -} - -// AzureVMAppContainerProtectableContainer azure workload-specific container -type AzureVMAppContainerProtectableContainer struct { - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerID - Fabric Id of the container such as ARM Id. - ContainerID *string `json:"containerId,omitempty"` - // ProtectableContainerType - Possible values include: 'ProtectableContainerTypeProtectableContainer', 'ProtectableContainerTypeStorageContainer', 'ProtectableContainerTypeVMAppContainer' - ProtectableContainerType ProtectableContainerType `json:"protectableContainerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMAppContainerProtectableContainer. -func (avacpc AzureVMAppContainerProtectableContainer) MarshalJSON() ([]byte, error) { - avacpc.ProtectableContainerType = ProtectableContainerTypeVMAppContainer - objectMap := make(map[string]interface{}) - if avacpc.FriendlyName != nil { - objectMap["friendlyName"] = avacpc.FriendlyName - } - if avacpc.BackupManagementType != "" { - objectMap["backupManagementType"] = avacpc.BackupManagementType - } - if avacpc.HealthStatus != nil { - objectMap["healthStatus"] = avacpc.HealthStatus - } - if avacpc.ContainerID != nil { - objectMap["containerId"] = avacpc.ContainerID - } - if avacpc.ProtectableContainerType != "" { - objectMap["protectableContainerType"] = avacpc.ProtectableContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureStorageProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. -func (avacpc AzureVMAppContainerProtectableContainer) AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. -func (avacpc AzureVMAppContainerProtectableContainer) AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) { - return &avacpc, true -} - -// AsProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. -func (avacpc AzureVMAppContainerProtectableContainer) AsProtectableContainer() (*ProtectableContainer, bool) { - return nil, false -} - -// AsBasicProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. -func (avacpc AzureVMAppContainerProtectableContainer) AsBasicProtectableContainer() (BasicProtectableContainer, bool) { - return &avacpc, true -} - -// AzureVMAppContainerProtectionContainer container for SQL workloads under Azure Virtual Machines. -type AzureVMAppContainerProtectionContainer struct { - // SourceResourceID - ARM ID of the virtual machine represented by this Azure Workload Container - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // LastUpdatedTime - Time stamp when this container was updated. - LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` - // ExtendedInfo - Additional details of a workload container. - ExtendedInfo *AzureWorkloadContainerExtendedInfo `json:"extendedInfo,omitempty"` - // WorkloadType - Workload type for which registration was sent. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` - // OperationType - Re-Do Operation. Possible values include: 'OperationTypeInvalid', 'OperationTypeRegister', 'OperationTypeReregister' - OperationType OperationType `json:"operationType,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) MarshalJSON() ([]byte, error) { - avacpc.ContainerType = ContainerTypeVMAppContainer1 - objectMap := make(map[string]interface{}) - if avacpc.SourceResourceID != nil { - objectMap["sourceResourceId"] = avacpc.SourceResourceID - } - if avacpc.LastUpdatedTime != nil { - objectMap["lastUpdatedTime"] = avacpc.LastUpdatedTime - } - if avacpc.ExtendedInfo != nil { - objectMap["extendedInfo"] = avacpc.ExtendedInfo - } - if avacpc.WorkloadType != "" { - objectMap["workloadType"] = avacpc.WorkloadType - } - if avacpc.OperationType != "" { - objectMap["operationType"] = avacpc.OperationType - } - if avacpc.FriendlyName != nil { - objectMap["friendlyName"] = avacpc.FriendlyName - } - if avacpc.BackupManagementType != "" { - objectMap["backupManagementType"] = avacpc.BackupManagementType - } - if avacpc.RegistrationStatus != nil { - objectMap["registrationStatus"] = avacpc.RegistrationStatus - } - if avacpc.HealthStatus != nil { - objectMap["healthStatus"] = avacpc.HealthStatus - } - if avacpc.ContainerType != "" { - objectMap["containerType"] = avacpc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return &avacpc, true -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return &avacpc, true -} - -// AsDpmContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false -} - -// AsMabContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. -func (avacpc AzureVMAppContainerProtectionContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &avacpc, true -} - -// AzureVMResourceFeatureSupportRequest azureResource(IaaS VM) Specific feature support request -type AzureVMResourceFeatureSupportRequest struct { - // VMSize - Size of the resource: VM size(A/D series etc) in case of IaasVM - VMSize *string `json:"vmSize,omitempty"` - // VMSku - SKUs (Premium/Managed etc) in case of IaasVM - VMSku *string `json:"vmSku,omitempty"` - // FeatureType - Possible values include: 'FeatureTypeFeatureSupportRequest', 'FeatureTypeAzureBackupGoals', 'FeatureTypeAzureVMResourceBackup' - FeatureType FeatureType `json:"featureType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMResourceFeatureSupportRequest. -func (avrfsr AzureVMResourceFeatureSupportRequest) MarshalJSON() ([]byte, error) { - avrfsr.FeatureType = FeatureTypeAzureVMResourceBackup - objectMap := make(map[string]interface{}) - if avrfsr.VMSize != nil { - objectMap["vmSize"] = avrfsr.VMSize - } - if avrfsr.VMSku != nil { - objectMap["vmSku"] = avrfsr.VMSku - } - if avrfsr.FeatureType != "" { - objectMap["featureType"] = avrfsr.FeatureType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupGoalFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureVMResourceFeatureSupportRequest. -func (avrfsr AzureVMResourceFeatureSupportRequest) AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) { - return nil, false -} - -// AsAzureVMResourceFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureVMResourceFeatureSupportRequest. -func (avrfsr AzureVMResourceFeatureSupportRequest) AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) { - return &avrfsr, true -} - -// AsFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureVMResourceFeatureSupportRequest. -func (avrfsr AzureVMResourceFeatureSupportRequest) AsFeatureSupportRequest() (*FeatureSupportRequest, bool) { - return nil, false -} - -// AsBasicFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureVMResourceFeatureSupportRequest. -func (avrfsr AzureVMResourceFeatureSupportRequest) AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) { - return &avrfsr, true -} - -// AzureVMResourceFeatureSupportResponse response for feature support requests for Azure IaasVm -type AzureVMResourceFeatureSupportResponse struct { - autorest.Response `json:"-"` - // SupportStatus - Support status of feature. Possible values include: 'SupportStatusInvalid', 'SupportStatusSupported', 'SupportStatusDefaultOFF', 'SupportStatusDefaultON', 'SupportStatusNotSupported' - SupportStatus SupportStatus `json:"supportStatus,omitempty"` -} - -// BasicAzureVMWorkloadItem azure VM workload-specific workload item. -type BasicAzureVMWorkloadItem interface { - AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) - AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) - AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) - AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) - AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) - AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) - AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) -} - -// AzureVMWorkloadItem azure VM workload-specific workload item. -type AzureVMWorkloadItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if workload item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DB's present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected - SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` -} - -func unmarshalBasicAzureVMWorkloadItem(body []byte) (BasicAzureVMWorkloadItem, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["workloadItemType"] { - case string(WorkloadItemTypeSAPAseDatabase1): - var avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem - err := json.Unmarshal(body, &avwsadwi) - return avwsadwi, err - case string(WorkloadItemTypeSAPAseSystem1): - var avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem - err := json.Unmarshal(body, &avwsaswi) - return avwsaswi, err - case string(WorkloadItemTypeSAPHanaDatabase1): - var avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem - err := json.Unmarshal(body, &avwshdwi) - return avwshdwi, err - case string(WorkloadItemTypeSAPHanaSystem1): - var avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem - err := json.Unmarshal(body, &avwshswi) - return avwshswi, err - case string(WorkloadItemTypeSQLDataBase1): - var avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem - err := json.Unmarshal(body, &avwsdwi) - return avwsdwi, err - case string(WorkloadItemTypeSQLInstance1): - var avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem - err := json.Unmarshal(body, &avwsiwi) - return avwsiwi, err - default: - var avwi AzureVMWorkloadItem - err := json.Unmarshal(body, &avwi) - return avwi, err - } -} -func unmarshalBasicAzureVMWorkloadItemArray(body []byte) ([]BasicAzureVMWorkloadItem, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - avwiArray := make([]BasicAzureVMWorkloadItem, len(rawMessages)) - - for index, rawMessage := range rawMessages { - avwi, err := unmarshalBasicAzureVMWorkloadItem(*rawMessage) - if err != nil { - return nil, err - } - avwiArray[index] = avwi - } - return avwiArray, nil -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) MarshalJSON() ([]byte, error) { - avwi.WorkloadItemType = WorkloadItemTypeAzureVMWorkloadItem - objectMap := make(map[string]interface{}) - if avwi.ParentName != nil { - objectMap["parentName"] = avwi.ParentName - } - if avwi.ServerName != nil { - objectMap["serverName"] = avwi.ServerName - } - if avwi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwi.IsAutoProtectable - } - if avwi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwi.Subinquireditemcount - } - if avwi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwi.SubWorkloadItemCount - } - if avwi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwi.BackupManagementType - } - if avwi.WorkloadType != nil { - objectMap["workloadType"] = avwi.WorkloadType - } - if avwi.FriendlyName != nil { - objectMap["friendlyName"] = avwi.FriendlyName - } - if avwi.ProtectionState != "" { - objectMap["protectionState"] = avwi.ProtectionState - } - if avwi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwi.WorkloadItemType - } - return json.Marshal(objectMap) -} - -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { - return &avwi, true -} - -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { - return nil, false -} - -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { - return nil, false -} - -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. -func (avwi AzureVMWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwi, true -} - -// BasicAzureVMWorkloadProtectableItem azure VM workload-specific protectable item. -type BasicAzureVMWorkloadProtectableItem interface { - AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) - AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) - AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) - AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) - AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) - AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) - AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) -} - -// AzureVMWorkloadProtectableItem azure VM workload-specific protectable item. -type AzureVMWorkloadProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - 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 - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -func unmarshalBasicAzureVMWorkloadProtectableItem(body []byte) (BasicAzureVMWorkloadProtectableItem, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["protectableItemType"] { - case string(ProtectableItemTypeSAPAseSystem): - var avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem - err := json.Unmarshal(body, &avwsaspi) - return avwsaspi, err - case string(ProtectableItemTypeSAPHanaDatabase): - var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem - err := json.Unmarshal(body, &avwshdpi) - return avwshdpi, err - case string(ProtectableItemTypeSAPHanaSystem): - var avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem - err := json.Unmarshal(body, &avwshspi) - return avwshspi, err - case string(ProtectableItemTypeSQLAvailabilityGroupContainer): - var avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem - err := json.Unmarshal(body, &avwsagpi) - return avwsagpi, err - case string(ProtectableItemTypeSQLDataBase): - var avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem - err := json.Unmarshal(body, &avwsdpi) - return avwsdpi, err - case string(ProtectableItemTypeSQLInstance): - var avwsipi AzureVMWorkloadSQLInstanceProtectableItem - err := json.Unmarshal(body, &avwsipi) - return avwsipi, err - default: - var avwpi AzureVMWorkloadProtectableItem - err := json.Unmarshal(body, &avwpi) - return avwpi, err - } -} -func unmarshalBasicAzureVMWorkloadProtectableItemArray(body []byte) ([]BasicAzureVMWorkloadProtectableItem, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - avwpiArray := make([]BasicAzureVMWorkloadProtectableItem, len(rawMessages)) - - for index, rawMessage := range rawMessages { - avwpi, err := unmarshalBasicAzureVMWorkloadProtectableItem(*rawMessage) - if err != nil { - return nil, err - } - avwpiArray[index] = avwpi - } - return avwpiArray, nil -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) MarshalJSON() ([]byte, error) { - avwpi.ProtectableItemType = ProtectableItemTypeAzureVMWorkloadProtectableItem - objectMap := make(map[string]interface{}) - if avwpi.ParentName != nil { - objectMap["parentName"] = avwpi.ParentName - } - if avwpi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwpi.ParentUniqueName - } - if avwpi.ServerName != nil { - objectMap["serverName"] = avwpi.ServerName - } - if avwpi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwpi.IsAutoProtectable - } - if avwpi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwpi.IsAutoProtected - } - if avwpi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwpi.Subinquireditemcount - } - if avwpi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwpi.Subprotectableitemcount - } - if avwpi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwpi.Prebackupvalidation - } - if avwpi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwpi.BackupManagementType - } - if avwpi.WorkloadType != nil { - objectMap["workloadType"] = avwpi.WorkloadType - } - if avwpi.FriendlyName != nil { - objectMap["friendlyName"] = avwpi.FriendlyName - } - if avwpi.ProtectionState != "" { - objectMap["protectionState"] = avwpi.ProtectionState - } - if avwpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwpi.ProtectableItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return &avwpi, true -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwpi, true -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false -} - -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return nil, false -} - -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return nil, false -} - -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. -func (avwpi AzureVMWorkloadProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwpi, true -} - -// BasicAzureVMWorkloadProtectedItem azure VM workload-specific protected item. -type BasicAzureVMWorkloadProtectedItem interface { - AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) - AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) - AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) - AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) -} - -// AzureVMWorkloadProtectedItem azure VM workload-specific protected item. -type AzureVMWorkloadProtectedItem struct { - // FriendlyName - Friendly name of the DB represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // ParentName - Parent name of the DB such as Instance or Availability Group. - ParentName *string `json:"parentName,omitempty"` - // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed - ParentType *string `json:"parentType,omitempty"` - // ProtectionStatus - Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' - LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // LastBackupErrorDetail - Error details in last backup - LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` - // ProtectedItemDataSourceID - Data ID of the protected item. - ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` - // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' - ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` - // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // KpisHealths - Health details of different KPIs - KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -func unmarshalBasicAzureVMWorkloadProtectedItem(body []byte) (BasicAzureVMWorkloadProtectedItem, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["protectedItemType"] { - case string(ProtectedItemTypeAzureVMWorkloadSAPAseDatabase): - var avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem - err := json.Unmarshal(body, &avwsadpi) - return avwsadpi, err - case string(ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase): - var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem - err := json.Unmarshal(body, &avwshdpi) - return avwshdpi, err - case string(ProtectedItemTypeAzureVMWorkloadSQLDatabase): - var avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem - err := json.Unmarshal(body, &avwsdpi) - return avwsdpi, err - default: - var avwpi AzureVMWorkloadProtectedItem - err := json.Unmarshal(body, &avwpi) - return avwpi, err - } -} -func unmarshalBasicAzureVMWorkloadProtectedItemArray(body []byte) ([]BasicAzureVMWorkloadProtectedItem, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - avwpiArray := make([]BasicAzureVMWorkloadProtectedItem, len(rawMessages)) - - for index, rawMessage := range rawMessages { - avwpi, err := unmarshalBasicAzureVMWorkloadProtectedItem(*rawMessage) - if err != nil { - return nil, err - } - avwpiArray[index] = avwpi - } - return avwpiArray, nil -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) MarshalJSON() ([]byte, error) { - avwpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadProtectedItem - objectMap := make(map[string]interface{}) - if avwpi.FriendlyName != nil { - objectMap["friendlyName"] = avwpi.FriendlyName - } - if avwpi.ServerName != nil { - objectMap["serverName"] = avwpi.ServerName - } - if avwpi.ParentName != nil { - objectMap["parentName"] = avwpi.ParentName - } - if avwpi.ParentType != nil { - objectMap["parentType"] = avwpi.ParentType - } - if avwpi.ProtectionStatus != nil { - objectMap["protectionStatus"] = avwpi.ProtectionStatus - } - if avwpi.ProtectionState != "" { - objectMap["protectionState"] = avwpi.ProtectionState - } - if avwpi.LastBackupStatus != "" { - objectMap["lastBackupStatus"] = avwpi.LastBackupStatus - } - if avwpi.LastBackupTime != nil { - objectMap["lastBackupTime"] = avwpi.LastBackupTime - } - if avwpi.LastBackupErrorDetail != nil { - objectMap["lastBackupErrorDetail"] = avwpi.LastBackupErrorDetail - } - if avwpi.ProtectedItemDataSourceID != nil { - objectMap["protectedItemDataSourceId"] = avwpi.ProtectedItemDataSourceID - } - if avwpi.ProtectedItemHealthStatus != "" { - objectMap["protectedItemHealthStatus"] = avwpi.ProtectedItemHealthStatus - } - if avwpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = avwpi.ExtendedInfo - } - if avwpi.KpisHealths != nil { - objectMap["kpisHealths"] = avwpi.KpisHealths - } - if avwpi.BackupManagementType != "" { - objectMap["backupManagementType"] = avwpi.BackupManagementType - } - if avwpi.WorkloadType != "" { - objectMap["workloadType"] = avwpi.WorkloadType - } - if avwpi.ContainerName != nil { - objectMap["containerName"] = avwpi.ContainerName - } - if avwpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = avwpi.SourceResourceID - } - if avwpi.PolicyID != nil { - objectMap["policyId"] = avwpi.PolicyID - } - if avwpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = avwpi.LastRecoveryPoint - } - if avwpi.BackupSetName != nil { - objectMap["backupSetName"] = avwpi.BackupSetName - } - if avwpi.CreateMode != "" { - objectMap["createMode"] = avwpi.CreateMode - } - if avwpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = avwpi.DeferredDeleteTimeInUTC - } - if avwpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = avwpi.IsScheduledForDeferredDelete - } - if avwpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = avwpi.DeferredDeleteTimeRemaining - } - if avwpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = avwpi.IsDeferredDeleteScheduleUpcoming - } - if avwpi.IsRehydrate != nil { - objectMap["isRehydrate"] = avwpi.IsRehydrate - } - if avwpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = avwpi.ProtectedItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return &avwpi, true -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return &avwpi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return nil, false -} - -// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return nil, false -} - -// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return nil, false -} - -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return nil, false -} - -// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return nil, false -} - -// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. -func (avwpi AzureVMWorkloadProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &avwpi, true -} - -// AzureVMWorkloadProtectedItemExtendedInfo additional information on Azure Workload for SQL specific -// backup item. -type AzureVMWorkloadProtectedItemExtendedInfo struct { - // OldestRecoveryPoint - The oldest backup copy available for this backup item. - OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` - // RecoveryPointCount - Number of backup copies available for this backup item. - RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` - // PolicyState - Indicates consistency of policy object and policy applied to this backup item. - PolicyState *string `json:"policyState,omitempty"` -} - -// AzureVMWorkloadProtectionPolicy azure VM (Mercury) workload-specific backup policy. -type AzureVMWorkloadProtectionPolicy struct { - // 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', 'WorkloadTypeSAPAseDatabase' - 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 - SubProtectionPolicy *[]SubProtectionPolicy `json:"subProtectionPolicy,omitempty"` - // MakePolicyConsistent - Fix the policy inconsistency - MakePolicyConsistent *bool `json:"makePolicyConsistent,omitempty"` - // ProtectedItemsCount - Number of items associated with this policy. - ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' - BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) MarshalJSON() ([]byte, error) { - avwpp.BackupManagementType = BackupManagementTypeAzureWorkload - objectMap := make(map[string]interface{}) - if avwpp.WorkLoadType != "" { - objectMap["workLoadType"] = avwpp.WorkLoadType - } - if avwpp.Settings != nil { - objectMap["settings"] = avwpp.Settings - } - if avwpp.SubProtectionPolicy != nil { - objectMap["subProtectionPolicy"] = avwpp.SubProtectionPolicy - } - if avwpp.MakePolicyConsistent != nil { - objectMap["makePolicyConsistent"] = avwpp.MakePolicyConsistent - } - if avwpp.ProtectedItemsCount != nil { - objectMap["protectedItemsCount"] = avwpp.ProtectedItemsCount - } - if avwpp.BackupManagementType != "" { - objectMap["backupManagementType"] = avwpp.BackupManagementType - } - return json.Marshal(objectMap) -} - -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { - return &avwpp, true -} - -// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { - return nil, false -} - -// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { - return nil, false -} - -// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { - return nil, false -} - -// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { - return nil, false -} - -// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { - return nil, false -} - -// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. -func (avwpp AzureVMWorkloadProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { - return &avwpp, true -} - -// AzureVMWorkloadSAPAseDatabaseProtectedItem azure VM workload-specific protected item representing SAP -// ASE Database. -type AzureVMWorkloadSAPAseDatabaseProtectedItem struct { - // FriendlyName - Friendly name of the DB represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // ParentName - Parent name of the DB such as Instance or Availability Group. - ParentName *string `json:"parentName,omitempty"` - // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed - ParentType *string `json:"parentType,omitempty"` - // ProtectionStatus - Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' - LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // LastBackupErrorDetail - Error details in last backup - LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` - // ProtectedItemDataSourceID - Data ID of the protected item. - ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` - // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' - ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` - // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // KpisHealths - Health details of different KPIs - KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) MarshalJSON() ([]byte, error) { - avwsadpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadSAPAseDatabase - objectMap := make(map[string]interface{}) - if avwsadpi.FriendlyName != nil { - objectMap["friendlyName"] = avwsadpi.FriendlyName - } - if avwsadpi.ServerName != nil { - objectMap["serverName"] = avwsadpi.ServerName - } - if avwsadpi.ParentName != nil { - objectMap["parentName"] = avwsadpi.ParentName - } - if avwsadpi.ParentType != nil { - objectMap["parentType"] = avwsadpi.ParentType - } - if avwsadpi.ProtectionStatus != nil { - objectMap["protectionStatus"] = avwsadpi.ProtectionStatus - } - if avwsadpi.ProtectionState != "" { - objectMap["protectionState"] = avwsadpi.ProtectionState - } - if avwsadpi.LastBackupStatus != "" { - objectMap["lastBackupStatus"] = avwsadpi.LastBackupStatus - } - if avwsadpi.LastBackupTime != nil { - objectMap["lastBackupTime"] = avwsadpi.LastBackupTime - } - if avwsadpi.LastBackupErrorDetail != nil { - objectMap["lastBackupErrorDetail"] = avwsadpi.LastBackupErrorDetail - } - if avwsadpi.ProtectedItemDataSourceID != nil { - objectMap["protectedItemDataSourceId"] = avwsadpi.ProtectedItemDataSourceID - } - if avwsadpi.ProtectedItemHealthStatus != "" { - objectMap["protectedItemHealthStatus"] = avwsadpi.ProtectedItemHealthStatus - } - if avwsadpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = avwsadpi.ExtendedInfo - } - if avwsadpi.KpisHealths != nil { - objectMap["kpisHealths"] = avwsadpi.KpisHealths - } - if avwsadpi.BackupManagementType != "" { - objectMap["backupManagementType"] = avwsadpi.BackupManagementType - } - if avwsadpi.WorkloadType != "" { - objectMap["workloadType"] = avwsadpi.WorkloadType - } - if avwsadpi.ContainerName != nil { - objectMap["containerName"] = avwsadpi.ContainerName - } - if avwsadpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = avwsadpi.SourceResourceID - } - if avwsadpi.PolicyID != nil { - objectMap["policyId"] = avwsadpi.PolicyID - } - if avwsadpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = avwsadpi.LastRecoveryPoint - } - if avwsadpi.BackupSetName != nil { - objectMap["backupSetName"] = avwsadpi.BackupSetName - } - if avwsadpi.CreateMode != "" { - objectMap["createMode"] = avwsadpi.CreateMode - } - if avwsadpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = avwsadpi.DeferredDeleteTimeInUTC - } - if avwsadpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = avwsadpi.IsScheduledForDeferredDelete - } - if avwsadpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = avwsadpi.DeferredDeleteTimeRemaining - } - if avwsadpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = avwsadpi.IsDeferredDeleteScheduleUpcoming - } - if avwsadpi.IsRehydrate != nil { - objectMap["isRehydrate"] = avwsadpi.IsRehydrate - } - if avwsadpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = avwsadpi.ProtectedItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return &avwsadpi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return &avwsadpi, true -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return nil, false -} - -// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return nil, false -} - -// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return nil, false -} - -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return nil, false -} - -// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return nil, false -} - -// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. -func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &avwsadpi, true -} - -// AzureVMWorkloadSAPAseDatabaseWorkloadItem azure VM workload-specific workload item representing SAP ASE -// Database. -type AzureVMWorkloadSAPAseDatabaseWorkloadItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if workload item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DB's present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected - SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { - avwsadwi.WorkloadItemType = WorkloadItemTypeSAPAseDatabase1 - objectMap := make(map[string]interface{}) - if avwsadwi.ParentName != nil { - objectMap["parentName"] = avwsadwi.ParentName - } - if avwsadwi.ServerName != nil { - objectMap["serverName"] = avwsadwi.ServerName - } - if avwsadwi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsadwi.IsAutoProtectable - } - if avwsadwi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsadwi.Subinquireditemcount - } - if avwsadwi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwsadwi.SubWorkloadItemCount - } - if avwsadwi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsadwi.BackupManagementType - } - if avwsadwi.WorkloadType != nil { - objectMap["workloadType"] = avwsadwi.WorkloadType - } - if avwsadwi.FriendlyName != nil { - objectMap["friendlyName"] = avwsadwi.FriendlyName - } - if avwsadwi.ProtectionState != "" { - objectMap["protectionState"] = avwsadwi.ProtectionState - } - if avwsadwi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwsadwi.WorkloadItemType - } - return json.Marshal(objectMap) -} - -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwsadwi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { - return &avwsadwi, true -} - -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { - return nil, false -} - -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { - return nil, false -} - -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. -func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwsadwi, true -} - -// AzureVMWorkloadSAPAseSystemProtectableItem azure VM workload-specific protectable item representing SAP -// ASE System. -type AzureVMWorkloadSAPAseSystemProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - 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 - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) MarshalJSON() ([]byte, error) { - avwsaspi.ProtectableItemType = ProtectableItemTypeSAPAseSystem - objectMap := make(map[string]interface{}) - if avwsaspi.ParentName != nil { - objectMap["parentName"] = avwsaspi.ParentName - } - if avwsaspi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwsaspi.ParentUniqueName - } - if avwsaspi.ServerName != nil { - objectMap["serverName"] = avwsaspi.ServerName - } - if avwsaspi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsaspi.IsAutoProtectable - } - if avwsaspi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwsaspi.IsAutoProtected - } - if avwsaspi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsaspi.Subinquireditemcount - } - if avwsaspi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwsaspi.Subprotectableitemcount - } - if avwsaspi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwsaspi.Prebackupvalidation - } - if avwsaspi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsaspi.BackupManagementType - } - if avwsaspi.WorkloadType != nil { - objectMap["workloadType"] = avwsaspi.WorkloadType - } - if avwsaspi.FriendlyName != nil { - objectMap["friendlyName"] = avwsaspi.FriendlyName - } - if avwsaspi.ProtectionState != "" { - objectMap["protectionState"] = avwsaspi.ProtectionState - } - if avwsaspi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwsaspi.ProtectableItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwsaspi, true -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return &avwsaspi, true -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false -} - -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return nil, false -} - -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return nil, false -} - -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. -func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwsaspi, true -} - -// AzureVMWorkloadSAPAseSystemWorkloadItem azure VM workload-specific workload item representing SAP ASE -// System. -type AzureVMWorkloadSAPAseSystemWorkloadItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if workload item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DB's present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected - SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) MarshalJSON() ([]byte, error) { - avwsaswi.WorkloadItemType = WorkloadItemTypeSAPAseSystem1 - objectMap := make(map[string]interface{}) - if avwsaswi.ParentName != nil { - objectMap["parentName"] = avwsaswi.ParentName - } - if avwsaswi.ServerName != nil { - objectMap["serverName"] = avwsaswi.ServerName - } - if avwsaswi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsaswi.IsAutoProtectable - } - if avwsaswi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsaswi.Subinquireditemcount - } - if avwsaswi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwsaswi.SubWorkloadItemCount - } - if avwsaswi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsaswi.BackupManagementType - } - if avwsaswi.WorkloadType != nil { - objectMap["workloadType"] = avwsaswi.WorkloadType - } - if avwsaswi.FriendlyName != nil { - objectMap["friendlyName"] = avwsaswi.FriendlyName - } - if avwsaswi.ProtectionState != "" { - objectMap["protectionState"] = avwsaswi.ProtectionState - } - if avwsaswi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwsaswi.WorkloadItemType - } - return json.Marshal(objectMap) -} - -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwsaswi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { - return &avwsaswi, true -} - -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { - return nil, false -} - -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { - return nil, false -} - -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. -func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwsaswi, true -} - -// AzureVMWorkloadSAPHanaDatabaseProtectableItem azure VM workload-specific protectable item representing -// SAP HANA Database. -type AzureVMWorkloadSAPHanaDatabaseProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - 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 - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) MarshalJSON() ([]byte, error) { - avwshdpi.ProtectableItemType = ProtectableItemTypeSAPHanaDatabase - objectMap := make(map[string]interface{}) - if avwshdpi.ParentName != nil { - objectMap["parentName"] = avwshdpi.ParentName - } - if avwshdpi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwshdpi.ParentUniqueName - } - if avwshdpi.ServerName != nil { - objectMap["serverName"] = avwshdpi.ServerName - } - if avwshdpi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwshdpi.IsAutoProtectable - } - if avwshdpi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwshdpi.IsAutoProtected - } - if avwshdpi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwshdpi.Subinquireditemcount - } - if avwshdpi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwshdpi.Subprotectableitemcount - } - if avwshdpi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwshdpi.Prebackupvalidation - } - if avwshdpi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwshdpi.BackupManagementType - } - if avwshdpi.WorkloadType != nil { - objectMap["workloadType"] = avwshdpi.WorkloadType - } - if avwshdpi.FriendlyName != nil { - objectMap["friendlyName"] = avwshdpi.FriendlyName - } - if avwshdpi.ProtectionState != "" { - objectMap["protectionState"] = avwshdpi.ProtectionState - } - if avwshdpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwshdpi.ProtectableItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwshdpi, true -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return &avwshdpi, true -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false -} - -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return nil, false -} - -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return nil, false -} - -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwshdpi, true -} - -// AzureVMWorkloadSAPHanaDatabaseProtectedItem azure VM workload-specific protected item representing SAP -// HANA Database. -type AzureVMWorkloadSAPHanaDatabaseProtectedItem struct { - // FriendlyName - Friendly name of the DB represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // ParentName - Parent name of the DB such as Instance or Availability Group. - ParentName *string `json:"parentName,omitempty"` - // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed - ParentType *string `json:"parentType,omitempty"` - // ProtectionStatus - Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' - LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // LastBackupErrorDetail - Error details in last backup - LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` - // ProtectedItemDataSourceID - Data ID of the protected item. - ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` - // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' - ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` - // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // KpisHealths - Health details of different KPIs - KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) MarshalJSON() ([]byte, error) { - avwshdpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase - objectMap := make(map[string]interface{}) - if avwshdpi.FriendlyName != nil { - objectMap["friendlyName"] = avwshdpi.FriendlyName - } - if avwshdpi.ServerName != nil { - objectMap["serverName"] = avwshdpi.ServerName - } - if avwshdpi.ParentName != nil { - objectMap["parentName"] = avwshdpi.ParentName - } - if avwshdpi.ParentType != nil { - objectMap["parentType"] = avwshdpi.ParentType - } - if avwshdpi.ProtectionStatus != nil { - objectMap["protectionStatus"] = avwshdpi.ProtectionStatus - } - if avwshdpi.ProtectionState != "" { - objectMap["protectionState"] = avwshdpi.ProtectionState - } - if avwshdpi.LastBackupStatus != "" { - objectMap["lastBackupStatus"] = avwshdpi.LastBackupStatus - } - if avwshdpi.LastBackupTime != nil { - objectMap["lastBackupTime"] = avwshdpi.LastBackupTime - } - if avwshdpi.LastBackupErrorDetail != nil { - objectMap["lastBackupErrorDetail"] = avwshdpi.LastBackupErrorDetail - } - if avwshdpi.ProtectedItemDataSourceID != nil { - objectMap["protectedItemDataSourceId"] = avwshdpi.ProtectedItemDataSourceID - } - if avwshdpi.ProtectedItemHealthStatus != "" { - objectMap["protectedItemHealthStatus"] = avwshdpi.ProtectedItemHealthStatus - } - if avwshdpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = avwshdpi.ExtendedInfo - } - if avwshdpi.KpisHealths != nil { - objectMap["kpisHealths"] = avwshdpi.KpisHealths - } - if avwshdpi.BackupManagementType != "" { - objectMap["backupManagementType"] = avwshdpi.BackupManagementType - } - if avwshdpi.WorkloadType != "" { - objectMap["workloadType"] = avwshdpi.WorkloadType - } - if avwshdpi.ContainerName != nil { - objectMap["containerName"] = avwshdpi.ContainerName - } - if avwshdpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = avwshdpi.SourceResourceID - } - if avwshdpi.PolicyID != nil { - objectMap["policyId"] = avwshdpi.PolicyID - } - if avwshdpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = avwshdpi.LastRecoveryPoint - } - if avwshdpi.BackupSetName != nil { - objectMap["backupSetName"] = avwshdpi.BackupSetName - } - if avwshdpi.CreateMode != "" { - objectMap["createMode"] = avwshdpi.CreateMode - } - if avwshdpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = avwshdpi.DeferredDeleteTimeInUTC - } - if avwshdpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = avwshdpi.IsScheduledForDeferredDelete - } - if avwshdpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = avwshdpi.DeferredDeleteTimeRemaining - } - if avwshdpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = avwshdpi.IsDeferredDeleteScheduleUpcoming - } - if avwshdpi.IsRehydrate != nil { - objectMap["isRehydrate"] = avwshdpi.IsRehydrate - } - if avwshdpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = avwshdpi.ProtectedItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return &avwshdpi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return &avwshdpi, true -} - -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return nil, false -} - -// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return nil, false -} - -// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return nil, false -} - -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return nil, false -} - -// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return nil, false -} - -// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &avwshdpi, true -} - -// AzureVMWorkloadSAPHanaDatabaseWorkloadItem azure VM workload-specific workload item representing SAP -// HANA Database. -type AzureVMWorkloadSAPHanaDatabaseWorkloadItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if workload item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DB's present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected - SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { - avwshdwi.WorkloadItemType = WorkloadItemTypeSAPHanaDatabase1 - objectMap := make(map[string]interface{}) - if avwshdwi.ParentName != nil { - objectMap["parentName"] = avwshdwi.ParentName - } - if avwshdwi.ServerName != nil { - objectMap["serverName"] = avwshdwi.ServerName - } - if avwshdwi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwshdwi.IsAutoProtectable - } - if avwshdwi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwshdwi.Subinquireditemcount - } - if avwshdwi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwshdwi.SubWorkloadItemCount - } - if avwshdwi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwshdwi.BackupManagementType - } - if avwshdwi.WorkloadType != nil { - objectMap["workloadType"] = avwshdwi.WorkloadType - } - if avwshdwi.FriendlyName != nil { - objectMap["friendlyName"] = avwshdwi.FriendlyName - } - if avwshdwi.ProtectionState != "" { - objectMap["protectionState"] = avwshdwi.ProtectionState - } - if avwshdwi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwshdwi.WorkloadItemType - } - return json.Marshal(objectMap) -} - -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwshdwi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { - return &avwshdwi, true -} - -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { - return nil, false -} - -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { - return nil, false -} - -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwshdwi, true -} - -// AzureVMWorkloadSAPHanaSystemProtectableItem azure VM workload-specific protectable item representing SAP -// HANA System. -type AzureVMWorkloadSAPHanaSystemProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - 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 - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) MarshalJSON() ([]byte, error) { - avwshspi.ProtectableItemType = ProtectableItemTypeSAPHanaSystem - objectMap := make(map[string]interface{}) - if avwshspi.ParentName != nil { - objectMap["parentName"] = avwshspi.ParentName - } - if avwshspi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwshspi.ParentUniqueName - } - if avwshspi.ServerName != nil { - objectMap["serverName"] = avwshspi.ServerName - } - if avwshspi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwshspi.IsAutoProtectable - } - if avwshspi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwshspi.IsAutoProtected - } - if avwshspi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwshspi.Subinquireditemcount - } - if avwshspi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwshspi.Subprotectableitemcount - } - if avwshspi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwshspi.Prebackupvalidation - } - if avwshspi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwshspi.BackupManagementType - } - if avwshspi.WorkloadType != nil { - objectMap["workloadType"] = avwshspi.WorkloadType - } - if avwshspi.FriendlyName != nil { - objectMap["friendlyName"] = avwshspi.FriendlyName - } - if avwshspi.ProtectionState != "" { - objectMap["protectionState"] = avwshspi.ProtectionState - } - if avwshspi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwshspi.ProtectableItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwshspi, true -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return &avwshspi, true -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false -} - -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return nil, false -} - -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return nil, false -} - -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. -func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwshspi, true -} - -// AzureVMWorkloadSAPHanaSystemWorkloadItem azure VM workload-specific workload item representing SAP HANA -// System. -type AzureVMWorkloadSAPHanaSystemWorkloadItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if workload item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DB's present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected - SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) MarshalJSON() ([]byte, error) { - avwshswi.WorkloadItemType = WorkloadItemTypeSAPHanaSystem1 - objectMap := make(map[string]interface{}) - if avwshswi.ParentName != nil { - objectMap["parentName"] = avwshswi.ParentName - } - if avwshswi.ServerName != nil { - objectMap["serverName"] = avwshswi.ServerName - } - if avwshswi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwshswi.IsAutoProtectable - } - if avwshswi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwshswi.Subinquireditemcount - } - if avwshswi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwshswi.SubWorkloadItemCount - } - if avwshswi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwshswi.BackupManagementType - } - if avwshswi.WorkloadType != nil { - objectMap["workloadType"] = avwshswi.WorkloadType - } - if avwshswi.FriendlyName != nil { - objectMap["friendlyName"] = avwshswi.FriendlyName - } - if avwshswi.ProtectionState != "" { - objectMap["protectionState"] = avwshswi.ProtectionState - } - if avwshswi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwshswi.WorkloadItemType - } - return json.Marshal(objectMap) -} - -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwshswi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { - return &avwshswi, true -} - -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { - return nil, false -} - -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { - return nil, false -} - -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwshswi, true -} - -// AzureVMWorkloadSQLAvailabilityGroupProtectableItem azure VM workload-specific protectable item -// representing SQL Availability Group. -type AzureVMWorkloadSQLAvailabilityGroupProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - 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 - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) MarshalJSON() ([]byte, error) { - avwsagpi.ProtectableItemType = ProtectableItemTypeSQLAvailabilityGroupContainer - objectMap := make(map[string]interface{}) - if avwsagpi.ParentName != nil { - objectMap["parentName"] = avwsagpi.ParentName - } - if avwsagpi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwsagpi.ParentUniqueName - } - if avwsagpi.ServerName != nil { - objectMap["serverName"] = avwsagpi.ServerName - } - if avwsagpi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsagpi.IsAutoProtectable - } - if avwsagpi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwsagpi.IsAutoProtected - } - if avwsagpi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsagpi.Subinquireditemcount - } - if avwsagpi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwsagpi.Subprotectableitemcount - } - if avwsagpi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwsagpi.Prebackupvalidation - } - if avwsagpi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsagpi.BackupManagementType - } - if avwsagpi.WorkloadType != nil { - objectMap["workloadType"] = avwsagpi.WorkloadType - } - if avwsagpi.FriendlyName != nil { - objectMap["friendlyName"] = avwsagpi.FriendlyName - } - if avwsagpi.ProtectionState != "" { - objectMap["protectionState"] = avwsagpi.ProtectionState - } - if avwsagpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwsagpi.ProtectableItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwsagpi, true -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return &avwsagpi, true -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false -} - -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return nil, false -} - -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return nil, false -} - -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwsagpi, true -} - -// AzureVMWorkloadSQLDatabaseProtectableItem azure VM workload-specific protectable item representing SQL -// Database. -type AzureVMWorkloadSQLDatabaseProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - 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 - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) MarshalJSON() ([]byte, error) { - avwsdpi.ProtectableItemType = ProtectableItemTypeSQLDataBase - objectMap := make(map[string]interface{}) - if avwsdpi.ParentName != nil { - objectMap["parentName"] = avwsdpi.ParentName - } - if avwsdpi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwsdpi.ParentUniqueName - } - if avwsdpi.ServerName != nil { - objectMap["serverName"] = avwsdpi.ServerName - } - if avwsdpi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsdpi.IsAutoProtectable - } - if avwsdpi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwsdpi.IsAutoProtected - } - if avwsdpi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsdpi.Subinquireditemcount - } - if avwsdpi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwsdpi.Subprotectableitemcount - } - if avwsdpi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwsdpi.Prebackupvalidation - } - if avwsdpi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsdpi.BackupManagementType - } - if avwsdpi.WorkloadType != nil { - objectMap["workloadType"] = avwsdpi.WorkloadType - } - if avwsdpi.FriendlyName != nil { - objectMap["friendlyName"] = avwsdpi.FriendlyName - } - if avwsdpi.ProtectionState != "" { - objectMap["protectionState"] = avwsdpi.ProtectionState - } - if avwsdpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwsdpi.ProtectableItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwsdpi, true -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return &avwsdpi, true -} - -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false -} - -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return nil, false -} - -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return nil, false -} - -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwsdpi, true -} - -// AzureVMWorkloadSQLDatabaseProtectedItem azure VM workload-specific protected item representing SQL -// Database. -type AzureVMWorkloadSQLDatabaseProtectedItem struct { - // FriendlyName - Friendly name of the DB represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // ParentName - Parent name of the DB such as Instance or Availability Group. - ParentName *string `json:"parentName,omitempty"` - // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed - ParentType *string `json:"parentType,omitempty"` - // ProtectionStatus - Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' - LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // LastBackupErrorDetail - Error details in last backup - LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` - // ProtectedItemDataSourceID - Data ID of the protected item. - ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` - // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' - ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` - // ExtendedInfo - Additional information for this backup item. - ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // KpisHealths - Health details of different KPIs - KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) MarshalJSON() ([]byte, error) { - avwsdpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadSQLDatabase - objectMap := make(map[string]interface{}) - if avwsdpi.FriendlyName != nil { - objectMap["friendlyName"] = avwsdpi.FriendlyName - } - if avwsdpi.ServerName != nil { - objectMap["serverName"] = avwsdpi.ServerName - } - if avwsdpi.ParentName != nil { - objectMap["parentName"] = avwsdpi.ParentName - } - if avwsdpi.ParentType != nil { - objectMap["parentType"] = avwsdpi.ParentType - } - if avwsdpi.ProtectionStatus != nil { - objectMap["protectionStatus"] = avwsdpi.ProtectionStatus - } - if avwsdpi.ProtectionState != "" { - objectMap["protectionState"] = avwsdpi.ProtectionState - } - if avwsdpi.LastBackupStatus != "" { - objectMap["lastBackupStatus"] = avwsdpi.LastBackupStatus - } - if avwsdpi.LastBackupTime != nil { - objectMap["lastBackupTime"] = avwsdpi.LastBackupTime - } - if avwsdpi.LastBackupErrorDetail != nil { - objectMap["lastBackupErrorDetail"] = avwsdpi.LastBackupErrorDetail - } - if avwsdpi.ProtectedItemDataSourceID != nil { - objectMap["protectedItemDataSourceId"] = avwsdpi.ProtectedItemDataSourceID - } - if avwsdpi.ProtectedItemHealthStatus != "" { - objectMap["protectedItemHealthStatus"] = avwsdpi.ProtectedItemHealthStatus - } - if avwsdpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = avwsdpi.ExtendedInfo - } - if avwsdpi.KpisHealths != nil { - objectMap["kpisHealths"] = avwsdpi.KpisHealths - } - if avwsdpi.BackupManagementType != "" { - objectMap["backupManagementType"] = avwsdpi.BackupManagementType - } - if avwsdpi.WorkloadType != "" { - objectMap["workloadType"] = avwsdpi.WorkloadType - } - if avwsdpi.ContainerName != nil { - objectMap["containerName"] = avwsdpi.ContainerName - } - if avwsdpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = avwsdpi.SourceResourceID - } - if avwsdpi.PolicyID != nil { - objectMap["policyId"] = avwsdpi.PolicyID - } - if avwsdpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = avwsdpi.LastRecoveryPoint - } - if avwsdpi.BackupSetName != nil { - objectMap["backupSetName"] = avwsdpi.BackupSetName - } - if avwsdpi.CreateMode != "" { - objectMap["createMode"] = avwsdpi.CreateMode - } - if avwsdpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = avwsdpi.DeferredDeleteTimeInUTC - } - if avwsdpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = avwsdpi.IsScheduledForDeferredDelete - } - if avwsdpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = avwsdpi.DeferredDeleteTimeRemaining - } - if avwsdpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = avwsdpi.IsDeferredDeleteScheduleUpcoming - } - if avwsdpi.IsRehydrate != nil { - objectMap["isRehydrate"] = avwsdpi.IsRehydrate - } - if avwsdpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = avwsdpi.ProtectedItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return &avwsdpi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return &avwsdpi, true -} - -// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return nil, false -} - -// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return nil, false -} - -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return nil, false -} - -// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return nil, false -} - -// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. -func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &avwsdpi, true -} - -// AzureVMWorkloadSQLDatabaseWorkloadItem azure VM workload-specific workload item representing SQL -// Database. -type AzureVMWorkloadSQLDatabaseWorkloadItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if workload item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DB's present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected - SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { - avwsdwi.WorkloadItemType = WorkloadItemTypeSQLDataBase1 - objectMap := make(map[string]interface{}) - if avwsdwi.ParentName != nil { - objectMap["parentName"] = avwsdwi.ParentName - } - if avwsdwi.ServerName != nil { - objectMap["serverName"] = avwsdwi.ServerName - } - if avwsdwi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsdwi.IsAutoProtectable - } - if avwsdwi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsdwi.Subinquireditemcount - } - if avwsdwi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwsdwi.SubWorkloadItemCount - } - if avwsdwi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsdwi.BackupManagementType - } - if avwsdwi.WorkloadType != nil { - objectMap["workloadType"] = avwsdwi.WorkloadType - } - if avwsdwi.FriendlyName != nil { - objectMap["friendlyName"] = avwsdwi.FriendlyName - } - if avwsdwi.ProtectionState != "" { - objectMap["protectionState"] = avwsdwi.ProtectionState - } - if avwsdwi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwsdwi.WorkloadItemType - } - return json.Marshal(objectMap) -} - -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwsdwi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { - return &avwsdwi, true -} - -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { - return nil, false -} - -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { - return nil, false -} - -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. -func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwsdwi, true -} - -// AzureVMWorkloadSQLInstanceProtectableItem azure VM workload-specific protectable item representing SQL -// Instance. -type AzureVMWorkloadSQLInstanceProtectableItem struct { - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent - // Only Applicable for data bases where the parent would be either Instance or a SQL AG. - ParentUniqueName *string `json:"parentUniqueName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - 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 - Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` - // Prebackupvalidation - Pre-backup validation for protectable objects - Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) MarshalJSON() ([]byte, error) { - avwsipi.ProtectableItemType = ProtectableItemTypeSQLInstance - objectMap := make(map[string]interface{}) - if avwsipi.ParentName != nil { - objectMap["parentName"] = avwsipi.ParentName - } - if avwsipi.ParentUniqueName != nil { - objectMap["parentUniqueName"] = avwsipi.ParentUniqueName - } - if avwsipi.ServerName != nil { - objectMap["serverName"] = avwsipi.ServerName - } - if avwsipi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsipi.IsAutoProtectable - } - if avwsipi.IsAutoProtected != nil { - objectMap["isAutoProtected"] = avwsipi.IsAutoProtected - } - if avwsipi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsipi.Subinquireditemcount - } - if avwsipi.Subprotectableitemcount != nil { - objectMap["subprotectableitemcount"] = avwsipi.Subprotectableitemcount - } - if avwsipi.Prebackupvalidation != nil { - objectMap["prebackupvalidation"] = avwsipi.Prebackupvalidation - } - if avwsipi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsipi.BackupManagementType - } - if avwsipi.WorkloadType != nil { - objectMap["workloadType"] = avwsipi.WorkloadType - } - if avwsipi.FriendlyName != nil { - objectMap["friendlyName"] = avwsipi.FriendlyName - } - if avwsipi.ProtectionState != "" { - objectMap["protectionState"] = avwsipi.ProtectionState - } - if avwsipi.ProtectableItemType != "" { - objectMap["protectableItemType"] = avwsipi.ProtectableItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return &avwsipi, true -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return &avwsipi, true -} - -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return nil, false -} - -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return nil, false -} - -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. -func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &avwsipi, true -} - -// AzureVMWorkloadSQLInstanceWorkloadItem azure VM workload-specific workload item representing SQL -// Instance. -type AzureVMWorkloadSQLInstanceWorkloadItem struct { - // DataDirectoryPaths - Data Directory Paths for default directories - DataDirectoryPaths *[]SQLDataDirectory `json:"dataDirectoryPaths,omitempty"` - // ParentName - Name for instance or AG - ParentName *string `json:"parentName,omitempty"` - // ServerName - Host/Cluster Name for instance or AG - ServerName *string `json:"serverName,omitempty"` - // IsAutoProtectable - Indicates if workload item is auto-protectable - IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` - // Subinquireditemcount - For instance or AG, indicates number of DB's present - Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` - // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected - SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) MarshalJSON() ([]byte, error) { - avwsiwi.WorkloadItemType = WorkloadItemTypeSQLInstance1 - objectMap := make(map[string]interface{}) - if avwsiwi.DataDirectoryPaths != nil { - objectMap["dataDirectoryPaths"] = avwsiwi.DataDirectoryPaths - } - if avwsiwi.ParentName != nil { - objectMap["parentName"] = avwsiwi.ParentName - } - if avwsiwi.ServerName != nil { - objectMap["serverName"] = avwsiwi.ServerName - } - if avwsiwi.IsAutoProtectable != nil { - objectMap["isAutoProtectable"] = avwsiwi.IsAutoProtectable - } - if avwsiwi.Subinquireditemcount != nil { - objectMap["subinquireditemcount"] = avwsiwi.Subinquireditemcount - } - if avwsiwi.SubWorkloadItemCount != nil { - objectMap["subWorkloadItemCount"] = avwsiwi.SubWorkloadItemCount - } - if avwsiwi.BackupManagementType != nil { - objectMap["backupManagementType"] = avwsiwi.BackupManagementType - } - if avwsiwi.WorkloadType != nil { - objectMap["workloadType"] = avwsiwi.WorkloadType - } - if avwsiwi.FriendlyName != nil { - objectMap["friendlyName"] = avwsiwi.FriendlyName - } - if avwsiwi.ProtectionState != "" { - objectMap["protectionState"] = avwsiwi.ProtectionState - } - if avwsiwi.WorkloadItemType != "" { - objectMap["workloadItemType"] = avwsiwi.WorkloadItemType - } - return json.Marshal(objectMap) -} - -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return &avwsiwi, true -} - -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { - return &avwsiwi, true -} - -// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { - return nil, false -} - -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. -func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &avwsiwi, true -} - -// BasicAzureWorkloadAutoProtectionIntent azure Recovery Services Vault specific protection intent item. -type BasicAzureWorkloadAutoProtectionIntent interface { - AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) - AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) -} - -// AzureWorkloadAutoProtectionIntent azure Recovery Services Vault specific protection intent item. -type AzureWorkloadAutoProtectionIntent struct { - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId - ItemID *string `json:"itemId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' - ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` -} - -func unmarshalBasicAzureWorkloadAutoProtectionIntent(body []byte) (BasicAzureWorkloadAutoProtectionIntent, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["protectionIntentItemType"] { - case string(ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent): - var awsapi AzureWorkloadSQLAutoProtectionIntent - err := json.Unmarshal(body, &awsapi) - return awsapi, err - default: - var awapi AzureWorkloadAutoProtectionIntent - err := json.Unmarshal(body, &awapi) - return awapi, err - } -} -func unmarshalBasicAzureWorkloadAutoProtectionIntentArray(body []byte) ([]BasicAzureWorkloadAutoProtectionIntent, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - awapiArray := make([]BasicAzureWorkloadAutoProtectionIntent, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awapi, err := unmarshalBasicAzureWorkloadAutoProtectionIntent(*rawMessage) - if err != nil { - return nil, err - } - awapiArray[index] = awapi - } - return awapiArray, nil -} - -// MarshalJSON is the custom marshaler for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) MarshalJSON() ([]byte, error) { - awapi.ProtectionIntentItemType = ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent - objectMap := make(map[string]interface{}) - if awapi.BackupManagementType != "" { - objectMap["backupManagementType"] = awapi.BackupManagementType - } - if awapi.SourceResourceID != nil { - objectMap["sourceResourceId"] = awapi.SourceResourceID - } - if awapi.ItemID != nil { - objectMap["itemId"] = awapi.ItemID - } - if awapi.PolicyID != nil { - objectMap["policyId"] = awapi.PolicyID - } - if awapi.ProtectionState != "" { - objectMap["protectionState"] = awapi.ProtectionState - } - if awapi.ProtectionIntentItemType != "" { - objectMap["protectionIntentItemType"] = awapi.ProtectionIntentItemType - } - return json.Marshal(objectMap) -} - -// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { - return nil, false -} - -// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { - return &awapi, true -} - -// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { - return nil, false -} - -// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { - return &awapi, true -} - -// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { - return &awapi, true -} - -// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { - return nil, false -} - -// AsProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { - return nil, false -} - -// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { - return &awapi, true -} - -// AzureWorkloadBackupRequest azureWorkload workload-specific backup request. -type AzureWorkloadBackupRequest struct { - // BackupType - Type of backup, viz. Full, Differential, Log or CopyOnlyFull. Possible values include: 'TypeEnumInvalid', 'TypeEnumFull', 'TypeEnumDifferential', 'TypeEnumLog', 'TypeEnumCopyOnlyFull' - BackupType TypeEnum `json:"backupType,omitempty"` - // EnableCompression - Bool for Compression setting - EnableCompression *bool `json:"enableCompression,omitempty"` - // RecoveryPointExpiryTimeInUTC - Backup copy will expire after the time specified (UTC). - RecoveryPointExpiryTimeInUTC *date.Time `json:"recoveryPointExpiryTimeInUTC,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' - ObjectType ObjectTypeBasicRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWorkloadBackupRequest. -func (awbr AzureWorkloadBackupRequest) MarshalJSON() ([]byte, error) { - awbr.ObjectType = ObjectTypeAzureWorkloadBackupRequest - objectMap := make(map[string]interface{}) - if awbr.BackupType != "" { - objectMap["backupType"] = awbr.BackupType - } - if awbr.EnableCompression != nil { - objectMap["enableCompression"] = awbr.EnableCompression - } - if awbr.RecoveryPointExpiryTimeInUTC != nil { - objectMap["recoveryPointExpiryTimeInUTC"] = awbr.RecoveryPointExpiryTimeInUTC - } - if awbr.ObjectType != "" { - objectMap["objectType"] = awbr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareBackupRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. -func (awbr AzureWorkloadBackupRequest) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { - return nil, false -} - -// AsAzureWorkloadBackupRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. -func (awbr AzureWorkloadBackupRequest) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { - return &awbr, true -} - -// AsIaasVMBackupRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. -func (awbr AzureWorkloadBackupRequest) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { - return nil, false -} - -// AsRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. -func (awbr AzureWorkloadBackupRequest) AsRequest() (*Request, bool) { - return nil, false -} - -// AsBasicRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. -func (awbr AzureWorkloadBackupRequest) AsBasicRequest() (BasicRequest, bool) { - return &awbr, true -} - -// BasicAzureWorkloadContainer container for the workloads running inside Azure Compute or Classic Compute. -type BasicAzureWorkloadContainer interface { - AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) - AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) - AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) -} - -// AzureWorkloadContainer container for the workloads running inside Azure Compute or Classic Compute. -type AzureWorkloadContainer struct { - // SourceResourceID - ARM ID of the virtual machine represented by this Azure Workload Container - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // LastUpdatedTime - Time stamp when this container was updated. - LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` - // ExtendedInfo - Additional details of a workload container. - ExtendedInfo *AzureWorkloadContainerExtendedInfo `json:"extendedInfo,omitempty"` - // WorkloadType - Workload type for which registration was sent. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` - // OperationType - Re-Do Operation. Possible values include: 'OperationTypeInvalid', 'OperationTypeRegister', 'OperationTypeReregister' - OperationType OperationType `json:"operationType,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -func unmarshalBasicAzureWorkloadContainer(body []byte) (BasicAzureWorkloadContainer, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["containerType"] { - case string(ContainerTypeSQLAGWorkLoadContainer1): - var aswcpc AzureSQLAGWorkloadContainerProtectionContainer - err := json.Unmarshal(body, &aswcpc) - return aswcpc, err - case string(ContainerTypeVMAppContainer1): - var avacpc AzureVMAppContainerProtectionContainer - err := json.Unmarshal(body, &avacpc) - return avacpc, err - default: - var awc AzureWorkloadContainer - err := json.Unmarshal(body, &awc) - return awc, err - } -} -func unmarshalBasicAzureWorkloadContainerArray(body []byte) ([]BasicAzureWorkloadContainer, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - awcArray := make([]BasicAzureWorkloadContainer, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awc, err := unmarshalBasicAzureWorkloadContainer(*rawMessage) - if err != nil { - return nil, err - } - awcArray[index] = awc - } - return awcArray, nil -} - -// MarshalJSON is the custom marshaler for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) MarshalJSON() ([]byte, error) { - awc.ContainerType = ContainerTypeAzureWorkloadContainer - objectMap := make(map[string]interface{}) - if awc.SourceResourceID != nil { - objectMap["sourceResourceId"] = awc.SourceResourceID - } - if awc.LastUpdatedTime != nil { - objectMap["lastUpdatedTime"] = awc.LastUpdatedTime - } - if awc.ExtendedInfo != nil { - objectMap["extendedInfo"] = awc.ExtendedInfo - } - if awc.WorkloadType != "" { - objectMap["workloadType"] = awc.WorkloadType - } - if awc.OperationType != "" { - objectMap["operationType"] = awc.OperationType - } - if awc.FriendlyName != nil { - objectMap["friendlyName"] = awc.FriendlyName - } - if awc.BackupManagementType != "" { - objectMap["backupManagementType"] = awc.BackupManagementType - } - if awc.RegistrationStatus != nil { - objectMap["registrationStatus"] = awc.RegistrationStatus - } - if awc.HealthStatus != nil { - objectMap["healthStatus"] = awc.HealthStatus - } - if awc.ContainerType != "" { - objectMap["containerType"] = awc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return &awc, true -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return &awc, true -} - -// AsDpmContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false -} - -// AsMabContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. -func (awc AzureWorkloadContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &awc, true -} - -// AzureWorkloadContainerExtendedInfo extended information of the container. -type AzureWorkloadContainerExtendedInfo struct { - // HostServerName - Host Os Name in case of Stand Alone and Cluster Name in case of distributed container. - HostServerName *string `json:"hostServerName,omitempty"` - // InquiryInfo - Inquiry Status for the container. - InquiryInfo *InquiryInfo `json:"inquiryInfo,omitempty"` - // NodesList - List of the nodes in case of distributed container. - NodesList *[]DistributedNodesInfo `json:"nodesList,omitempty"` -} - -// AzureWorkloadErrorInfo azure storage specific error information -type AzureWorkloadErrorInfo struct { - // ErrorCode - Error code. - ErrorCode *int32 `json:"errorCode,omitempty"` - // ErrorString - Localized error string. - ErrorString *string `json:"errorString,omitempty"` - // ErrorTitle - Title: Typically, the entity that the error pertains to. - ErrorTitle *string `json:"errorTitle,omitempty"` - // Recommendations - List of localized recommendations for above error code. - Recommendations *[]string `json:"recommendations,omitempty"` - // AdditionalDetails - Additional details for above error code. - AdditionalDetails *string `json:"additionalDetails,omitempty"` -} - -// AzureWorkloadJob azure storage specific job. -type AzureWorkloadJob struct { - // WorkloadType - Workload type of the job - WorkloadType *string `json:"workloadType,omitempty"` - // Duration - Time elapsed during the execution of this job. - Duration *string `json:"duration,omitempty"` - // ActionsInfo - Gets or sets the state/actions applicable on this job like cancel/retry. - ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` - // ErrorDetails - Error details on execution of this job. - ErrorDetails *[]AzureWorkloadErrorInfo `json:"errorDetails,omitempty"` - // ExtendedInfo - Additional information about the job. - ExtendedInfo *AzureWorkloadJobExtendedInfo `json:"extendedInfo,omitempty"` - // EntityFriendlyName - Friendly name of the entity on which the current job is executing. - EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` - // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // Operation - The operation name. - Operation *string `json:"operation,omitempty"` - // Status - Job status. - Status *string `json:"status,omitempty"` - // StartTime - The start time. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time. - EndTime *date.Time `json:"endTime,omitempty"` - // ActivityID - ActivityId of job. - ActivityID *string `json:"activityId,omitempty"` - // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' - JobType JobType `json:"jobType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWorkloadJob. -func (awj AzureWorkloadJob) MarshalJSON() ([]byte, error) { - awj.JobType = JobTypeAzureWorkloadJob - objectMap := make(map[string]interface{}) - if awj.WorkloadType != nil { - objectMap["workloadType"] = awj.WorkloadType - } - if awj.Duration != nil { - objectMap["duration"] = awj.Duration - } - if awj.ActionsInfo != nil { - objectMap["actionsInfo"] = awj.ActionsInfo - } - if awj.ErrorDetails != nil { - objectMap["errorDetails"] = awj.ErrorDetails - } - if awj.ExtendedInfo != nil { - objectMap["extendedInfo"] = awj.ExtendedInfo - } - if awj.EntityFriendlyName != nil { - objectMap["entityFriendlyName"] = awj.EntityFriendlyName - } - if awj.BackupManagementType != "" { - objectMap["backupManagementType"] = awj.BackupManagementType - } - if awj.Operation != nil { - objectMap["operation"] = awj.Operation - } - if awj.Status != nil { - objectMap["status"] = awj.Status - } - if awj.StartTime != nil { - objectMap["startTime"] = awj.StartTime - } - if awj.EndTime != nil { - objectMap["endTime"] = awj.EndTime - } - if awj.ActivityID != nil { - objectMap["activityId"] = awj.ActivityID - } - if awj.JobType != "" { - objectMap["jobType"] = awj.JobType - } - return json.Marshal(objectMap) -} - -// AsAzureIaaSVMJob is the BasicJob implementation for AzureWorkloadJob. -func (awj AzureWorkloadJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { - return nil, false -} - -// AsAzureStorageJob is the BasicJob implementation for AzureWorkloadJob. -func (awj AzureWorkloadJob) AsAzureStorageJob() (*AzureStorageJob, bool) { - return nil, false -} - -// AsAzureWorkloadJob is the BasicJob implementation for AzureWorkloadJob. -func (awj AzureWorkloadJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { - return &awj, true -} - -// AsDpmJob is the BasicJob implementation for AzureWorkloadJob. -func (awj AzureWorkloadJob) AsDpmJob() (*DpmJob, bool) { - return nil, false -} - -// AsMabJob is the BasicJob implementation for AzureWorkloadJob. -func (awj AzureWorkloadJob) AsMabJob() (*MabJob, bool) { - return nil, false -} - -// AsJob is the BasicJob implementation for AzureWorkloadJob. -func (awj AzureWorkloadJob) AsJob() (*Job, bool) { - return nil, false -} - -// AsBasicJob is the BasicJob implementation for AzureWorkloadJob. -func (awj AzureWorkloadJob) AsBasicJob() (BasicJob, bool) { - return &awj, true -} - -// AzureWorkloadJobExtendedInfo azure VM workload-specific additional information for job. -type AzureWorkloadJobExtendedInfo struct { - // TasksList - List of tasks for this job - TasksList *[]AzureWorkloadJobTaskDetails `json:"tasksList,omitempty"` - // PropertyBag - Job properties. - PropertyBag map[string]*string `json:"propertyBag"` - // DynamicErrorMessage - Non localized error message on job execution. - DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWorkloadJobExtendedInfo. -func (awjei AzureWorkloadJobExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if awjei.TasksList != nil { - objectMap["tasksList"] = awjei.TasksList - } - if awjei.PropertyBag != nil { - objectMap["propertyBag"] = awjei.PropertyBag - } - if awjei.DynamicErrorMessage != nil { - objectMap["dynamicErrorMessage"] = awjei.DynamicErrorMessage - } - return json.Marshal(objectMap) -} - -// AzureWorkloadJobTaskDetails azure VM workload specific job task details. -type AzureWorkloadJobTaskDetails struct { - // TaskID - The task display name. - TaskID *string `json:"taskId,omitempty"` - // Status - The status. - Status *string `json:"status,omitempty"` -} - -// BasicAzureWorkloadPointInTimeRecoveryPoint recovery point specific to PointInTime -type BasicAzureWorkloadPointInTimeRecoveryPoint interface { - AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) - AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) -} - -// AzureWorkloadPointInTimeRecoveryPoint recovery point specific to PointInTime -type AzureWorkloadPointInTimeRecoveryPoint struct { - // TimeRanges - List of log ranges - TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created - RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' - Type RestorePointType `json:"type,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` -} - -func unmarshalBasicAzureWorkloadPointInTimeRecoveryPoint(body []byte) (BasicAzureWorkloadPointInTimeRecoveryPoint, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): - var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awshpitrp) - return awshpitrp, err - default: - var awpitrp AzureWorkloadPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awpitrp) - return awpitrp, err - } -} -func unmarshalBasicAzureWorkloadPointInTimeRecoveryPointArray(body []byte) ([]BasicAzureWorkloadPointInTimeRecoveryPoint, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - awpitrpArray := make([]BasicAzureWorkloadPointInTimeRecoveryPoint, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awpitrp, err := unmarshalBasicAzureWorkloadPointInTimeRecoveryPoint(*rawMessage) - if err != nil { - return nil, err - } - awpitrpArray[index] = awpitrp - } - return awpitrpArray, nil -} - -// MarshalJSON is the custom marshaler for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { - awpitrp.ObjectType = ObjectTypeAzureWorkloadPointInTimeRecoveryPoint - objectMap := make(map[string]interface{}) - if awpitrp.TimeRanges != nil { - objectMap["timeRanges"] = awpitrp.TimeRanges - } - if awpitrp.ObjectType != "" { - objectMap["objectType"] = awpitrp.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return &awpitrp, true -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return &awpitrp, true -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return &awpitrp, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { - return nil, false -} - -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return nil, false -} - -// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return nil, false -} - -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. -func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &awpitrp, true -} - -// AzureWorkloadPointInTimeRestoreRequest azureWorkload SAP Hana -specific restore. Specifically for -// PointInTime/Log restore -type AzureWorkloadPointInTimeRestoreRequest struct { - // PointInTime - PointInTime value - PointInTime *date.Time `json:"pointInTime,omitempty"` - // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PropertyBag - Workload specific property bag. - PropertyBag map[string]*string `json:"propertyBag"` - // TargetInfo - Details of target database - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' - RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { - awpitrr.ObjectType = ObjectTypeAzureWorkloadPointInTimeRestoreRequest - objectMap := make(map[string]interface{}) - if awpitrr.PointInTime != nil { - objectMap["pointInTime"] = awpitrr.PointInTime - } - if awpitrr.RecoveryType != "" { - objectMap["recoveryType"] = awpitrr.RecoveryType - } - if awpitrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = awpitrr.SourceResourceID - } - if awpitrr.PropertyBag != nil { - objectMap["propertyBag"] = awpitrr.PropertyBag - } - if awpitrr.TargetInfo != nil { - objectMap["targetInfo"] = awpitrr.TargetInfo - } - if awpitrr.RecoveryMode != "" { - objectMap["recoveryMode"] = awpitrr.RecoveryMode - } - if awpitrr.ObjectType != "" { - objectMap["objectType"] = awpitrr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return &awpitrr, true -} - -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return &awpitrr, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { - return nil, false -} - -// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return nil, false -} - -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. -func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &awpitrr, true -} - -// BasicAzureWorkloadRecoveryPoint workload specific recovery point, specifically encapsulates full/diff recovery point -type BasicAzureWorkloadRecoveryPoint interface { - AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) - AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) - AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) - AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) - AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) - AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) - AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) - AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) -} - -// AzureWorkloadRecoveryPoint workload specific recovery point, specifically encapsulates full/diff recovery -// point -type AzureWorkloadRecoveryPoint struct { - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created - RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' - Type RestorePointType `json:"type,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` -} - -func unmarshalBasicAzureWorkloadRecoveryPoint(body []byte) (BasicAzureWorkloadRecoveryPoint, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeAzureWorkloadPointInTimeRecoveryPoint): - var awpitrp AzureWorkloadPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awpitrp) - return awpitrp, err - case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): - var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awshpitrp) - return awshpitrp, err - case string(ObjectTypeAzureWorkloadSAPHanaRecoveryPoint): - var awshrp AzureWorkloadSAPHanaRecoveryPoint - err := json.Unmarshal(body, &awshrp) - return awshrp, err - case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): - var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awspitrp) - return awspitrp, err - case string(ObjectTypeAzureWorkloadSQLRecoveryPoint): - var awsrp AzureWorkloadSQLRecoveryPoint - err := json.Unmarshal(body, &awsrp) - return awsrp, err - default: - var awrp AzureWorkloadRecoveryPoint - err := json.Unmarshal(body, &awrp) - return awrp, err - } -} -func unmarshalBasicAzureWorkloadRecoveryPointArray(body []byte) ([]BasicAzureWorkloadRecoveryPoint, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - awrpArray := make([]BasicAzureWorkloadRecoveryPoint, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awrp, err := unmarshalBasicAzureWorkloadRecoveryPoint(*rawMessage) - if err != nil { - return nil, err - } - awrpArray[index] = awrp - } - return awrpArray, nil -} - -// MarshalJSON is the custom marshaler for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) MarshalJSON() ([]byte, error) { - awrp.ObjectType = ObjectTypeAzureWorkloadRecoveryPoint - objectMap := make(map[string]interface{}) - if awrp.ObjectType != "" { - objectMap["objectType"] = awrp.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return &awrp, true -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return &awrp, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { - return nil, false -} - -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return nil, false -} - -// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return nil, false -} - -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. -func (awrp AzureWorkloadRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &awrp, true -} - -// BasicAzureWorkloadRestoreRequest azureWorkload-specific restore. -type BasicAzureWorkloadRestoreRequest interface { - AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) - AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) - AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) - AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) - AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) - AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) - AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) - AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) -} - -// AzureWorkloadRestoreRequest azureWorkload-specific restore. -type AzureWorkloadRestoreRequest struct { - // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PropertyBag - Workload specific property bag. - PropertyBag map[string]*string `json:"propertyBag"` - // TargetInfo - Details of target database - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' - RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` -} - -func unmarshalBasicAzureWorkloadRestoreRequest(body []byte) (BasicAzureWorkloadRestoreRequest, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeAzureWorkloadPointInTimeRestoreRequest): - var awpitrr AzureWorkloadPointInTimeRestoreRequest - err := json.Unmarshal(body, &awpitrr) - return awpitrr, err - case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): - var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest - err := json.Unmarshal(body, &awshpitrr) - return awshpitrr, err - case string(ObjectTypeAzureWorkloadSAPHanaRestoreRequest): - var awshrr AzureWorkloadSAPHanaRestoreRequest - err := json.Unmarshal(body, &awshrr) - return awshrr, err - case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): - var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest - err := json.Unmarshal(body, &awspitrr) - return awspitrr, err - case string(ObjectTypeAzureWorkloadSQLRestoreRequest): - var awsrr AzureWorkloadSQLRestoreRequest - err := json.Unmarshal(body, &awsrr) - return awsrr, err - default: - var awrr AzureWorkloadRestoreRequest - err := json.Unmarshal(body, &awrr) - return awrr, err - } -} -func unmarshalBasicAzureWorkloadRestoreRequestArray(body []byte) ([]BasicAzureWorkloadRestoreRequest, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - awrrArray := make([]BasicAzureWorkloadRestoreRequest, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awrr, err := unmarshalBasicAzureWorkloadRestoreRequest(*rawMessage) - if err != nil { - return nil, err - } - awrrArray[index] = awrr - } - return awrrArray, nil -} - -// MarshalJSON is the custom marshaler for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) MarshalJSON() ([]byte, error) { - awrr.ObjectType = ObjectTypeAzureWorkloadRestoreRequest - objectMap := make(map[string]interface{}) - if awrr.RecoveryType != "" { - objectMap["recoveryType"] = awrr.RecoveryType - } - if awrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = awrr.SourceResourceID - } - if awrr.PropertyBag != nil { - objectMap["propertyBag"] = awrr.PropertyBag - } - if awrr.TargetInfo != nil { - objectMap["targetInfo"] = awrr.TargetInfo - } - if awrr.RecoveryMode != "" { - objectMap["recoveryMode"] = awrr.RecoveryMode - } - if awrr.ObjectType != "" { - objectMap["objectType"] = awrr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return &awrr, true -} - -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return &awrr, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { - return nil, false -} - -// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return nil, false -} - -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. -func (awrr AzureWorkloadRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &awrr, true -} - -// AzureWorkloadSAPHanaPointInTimeRecoveryPoint recovery point specific to PointInTime in SAPHana -type AzureWorkloadSAPHanaPointInTimeRecoveryPoint struct { - // TimeRanges - List of log ranges - TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created - RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' - Type RestorePointType `json:"type,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { - awshpitrp.ObjectType = ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint - objectMap := make(map[string]interface{}) - if awshpitrp.TimeRanges != nil { - objectMap["timeRanges"] = awshpitrp.TimeRanges - } - if awshpitrp.ObjectType != "" { - objectMap["objectType"] = awshpitrp.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return &awshpitrp, true -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return &awshpitrp, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return &awshpitrp, true -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { - return nil, false -} - -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return nil, false -} - -// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return nil, false -} - -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &awshpitrp, true -} - -// AzureWorkloadSAPHanaPointInTimeRestoreRequest azureWorkload SAP Hana -specific restore. Specifically for -// PointInTime/Log restore -type AzureWorkloadSAPHanaPointInTimeRestoreRequest struct { - // PointInTime - PointInTime value - PointInTime *date.Time `json:"pointInTime,omitempty"` - // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PropertyBag - Workload specific property bag. - PropertyBag map[string]*string `json:"propertyBag"` - // TargetInfo - Details of target database - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' - RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { - awshpitrr.ObjectType = ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest - objectMap := make(map[string]interface{}) - if awshpitrr.PointInTime != nil { - objectMap["pointInTime"] = awshpitrr.PointInTime - } - if awshpitrr.RecoveryType != "" { - objectMap["recoveryType"] = awshpitrr.RecoveryType - } - if awshpitrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = awshpitrr.SourceResourceID - } - if awshpitrr.PropertyBag != nil { - objectMap["propertyBag"] = awshpitrr.PropertyBag - } - if awshpitrr.TargetInfo != nil { - objectMap["targetInfo"] = awshpitrr.TargetInfo - } - if awshpitrr.RecoveryMode != "" { - objectMap["recoveryMode"] = awshpitrr.RecoveryMode - } - if awshpitrr.ObjectType != "" { - objectMap["objectType"] = awshpitrr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return &awshpitrr, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return &awshpitrr, true -} - -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return &awshpitrr, true -} - -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { - return nil, false -} - -// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return nil, false -} - -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &awshpitrr, true -} - -// AzureWorkloadSAPHanaRecoveryPoint sAPHana specific recoverypoint, specifically encapsulates full/diff -// recoverypoints -type AzureWorkloadSAPHanaRecoveryPoint struct { - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created - RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' - Type RestorePointType `json:"type,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) MarshalJSON() ([]byte, error) { - awshrp.ObjectType = ObjectTypeAzureWorkloadSAPHanaRecoveryPoint - objectMap := make(map[string]interface{}) - if awshrp.ObjectType != "" { - objectMap["objectType"] = awshrp.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return &awshrp, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return &awshrp, true -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { - return nil, false -} - -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return nil, false -} - -// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return nil, false -} - -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. -func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &awshrp, true -} - -// BasicAzureWorkloadSAPHanaRestoreRequest azureWorkload SAP Hana-specific restore. -type BasicAzureWorkloadSAPHanaRestoreRequest interface { - AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) - AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) -} - -// AzureWorkloadSAPHanaRestoreRequest azureWorkload SAP Hana-specific restore. -type AzureWorkloadSAPHanaRestoreRequest struct { - // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PropertyBag - Workload specific property bag. - PropertyBag map[string]*string `json:"propertyBag"` - // TargetInfo - Details of target database - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' - RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` -} - -func unmarshalBasicAzureWorkloadSAPHanaRestoreRequest(body []byte) (BasicAzureWorkloadSAPHanaRestoreRequest, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): - var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest - err := json.Unmarshal(body, &awshpitrr) - return awshpitrr, err - default: - var awshrr AzureWorkloadSAPHanaRestoreRequest - err := json.Unmarshal(body, &awshrr) - return awshrr, err - } -} -func unmarshalBasicAzureWorkloadSAPHanaRestoreRequestArray(body []byte) ([]BasicAzureWorkloadSAPHanaRestoreRequest, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - awshrrArray := make([]BasicAzureWorkloadSAPHanaRestoreRequest, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awshrr, err := unmarshalBasicAzureWorkloadSAPHanaRestoreRequest(*rawMessage) - if err != nil { - return nil, err - } - awshrrArray[index] = awshrr - } - return awshrrArray, nil -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) MarshalJSON() ([]byte, error) { - awshrr.ObjectType = ObjectTypeAzureWorkloadSAPHanaRestoreRequest - objectMap := make(map[string]interface{}) - if awshrr.RecoveryType != "" { - objectMap["recoveryType"] = awshrr.RecoveryType - } - if awshrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = awshrr.SourceResourceID - } - if awshrr.PropertyBag != nil { - objectMap["propertyBag"] = awshrr.PropertyBag - } - if awshrr.TargetInfo != nil { - objectMap["targetInfo"] = awshrr.TargetInfo - } - if awshrr.RecoveryMode != "" { - objectMap["recoveryMode"] = awshrr.RecoveryMode - } - if awshrr.ObjectType != "" { - objectMap["objectType"] = awshrr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return &awshrr, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return &awshrr, true -} - -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return &awshrr, true -} - -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { - return nil, false -} - -// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return nil, false -} - -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. -func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &awshrr, true -} - -// AzureWorkloadSQLAutoProtectionIntent azure Workload SQL Auto Protection intent item. -type AzureWorkloadSQLAutoProtectionIntent struct { - // WorkloadItemType - Workload item type of the item for which intent is to be set. Possible values include: 'WorkloadItemTypeInvalid', 'WorkloadItemTypeSQLInstance', 'WorkloadItemTypeSQLDataBase', 'WorkloadItemTypeSAPHanaSystem', 'WorkloadItemTypeSAPHanaDatabase', 'WorkloadItemTypeSAPAseSystem', 'WorkloadItemTypeSAPAseDatabase' - WorkloadItemType WorkloadItemType `json:"workloadItemType,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId - ItemID *string `json:"itemId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' - ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) MarshalJSON() ([]byte, error) { - awsapi.ProtectionIntentItemType = ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent - objectMap := make(map[string]interface{}) - if awsapi.WorkloadItemType != "" { - objectMap["workloadItemType"] = awsapi.WorkloadItemType - } - if awsapi.BackupManagementType != "" { - objectMap["backupManagementType"] = awsapi.BackupManagementType - } - if awsapi.SourceResourceID != nil { - objectMap["sourceResourceId"] = awsapi.SourceResourceID - } - if awsapi.ItemID != nil { - objectMap["itemId"] = awsapi.ItemID - } - if awsapi.PolicyID != nil { - objectMap["policyId"] = awsapi.PolicyID - } - if awsapi.ProtectionState != "" { - objectMap["protectionState"] = awsapi.ProtectionState - } - if awsapi.ProtectionIntentItemType != "" { - objectMap["protectionIntentItemType"] = awsapi.ProtectionIntentItemType - } - return json.Marshal(objectMap) -} - -// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { - return nil, false -} - -// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { - return &awsapi, true -} - -// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { - return nil, false -} - -// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { - return nil, false -} - -// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { - return &awsapi, true -} - -// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { - return &awsapi, true -} - -// AsProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { - return nil, false -} - -// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { - return &awsapi, true -} - -// AzureWorkloadSQLPointInTimeRecoveryPoint recovery point specific to PointInTime -type AzureWorkloadSQLPointInTimeRecoveryPoint struct { - // TimeRanges - List of log ranges - TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` - // ExtendedInfo - Extended Info that provides data directory details. Will be populated in two cases: - // When a specific recovery point is accessed using GetRecoveryPoint - // Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter - ExtendedInfo *AzureWorkloadSQLRecoveryPointExtendedInfo `json:"extendedInfo,omitempty"` - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created - RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' - Type RestorePointType `json:"type,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { - awspitrp.ObjectType = ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint - objectMap := make(map[string]interface{}) - if awspitrp.TimeRanges != nil { - objectMap["timeRanges"] = awspitrp.TimeRanges - } - if awspitrp.ExtendedInfo != nil { - objectMap["extendedInfo"] = awspitrp.ExtendedInfo - } - if awspitrp.ObjectType != "" { - objectMap["objectType"] = awspitrp.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return &awspitrp, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return &awspitrp, true -} - -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return &awspitrp, true -} - -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { - return nil, false -} - -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return nil, false -} - -// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return nil, false -} - -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. -func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &awspitrp, true -} - -// AzureWorkloadSQLPointInTimeRestoreRequest azureWorkload SQL -specific restore. Specifically for -// PointInTime/Log restore -type AzureWorkloadSQLPointInTimeRestoreRequest struct { - // PointInTime - PointInTime value - PointInTime *date.Time `json:"pointInTime,omitempty"` - // ShouldUseAlternateTargetLocation - Default option set to true. If this is set to false, alternate data directory must be provided - ShouldUseAlternateTargetLocation *bool `json:"shouldUseAlternateTargetLocation,omitempty"` - // IsNonRecoverable - SQL specific property where user can chose to set no-recovery when restore operation is tried - IsNonRecoverable *bool `json:"isNonRecoverable,omitempty"` - // AlternateDirectoryPaths - Data directory details - AlternateDirectoryPaths *[]SQLDataDirectoryMapping `json:"alternateDirectoryPaths,omitempty"` - // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PropertyBag - Workload specific property bag. - PropertyBag map[string]*string `json:"propertyBag"` - // TargetInfo - Details of target database - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' - RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { - awspitrr.ObjectType = ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest - objectMap := make(map[string]interface{}) - if awspitrr.PointInTime != nil { - objectMap["pointInTime"] = awspitrr.PointInTime - } - if awspitrr.ShouldUseAlternateTargetLocation != nil { - objectMap["shouldUseAlternateTargetLocation"] = awspitrr.ShouldUseAlternateTargetLocation - } - if awspitrr.IsNonRecoverable != nil { - objectMap["isNonRecoverable"] = awspitrr.IsNonRecoverable - } - if awspitrr.AlternateDirectoryPaths != nil { - objectMap["alternateDirectoryPaths"] = awspitrr.AlternateDirectoryPaths - } - if awspitrr.RecoveryType != "" { - objectMap["recoveryType"] = awspitrr.RecoveryType - } - if awspitrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = awspitrr.SourceResourceID - } - if awspitrr.PropertyBag != nil { - objectMap["propertyBag"] = awspitrr.PropertyBag - } - if awspitrr.TargetInfo != nil { - objectMap["targetInfo"] = awspitrr.TargetInfo - } - if awspitrr.RecoveryMode != "" { - objectMap["recoveryMode"] = awspitrr.RecoveryMode - } - if awspitrr.ObjectType != "" { - objectMap["objectType"] = awspitrr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return &awspitrr, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return &awspitrr, true -} - -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { - return &awspitrr, true -} - -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { - return nil, false -} - -// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return nil, false -} - -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. -func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &awspitrr, true -} - -// BasicAzureWorkloadSQLRecoveryPoint SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint -// along with extended info -type BasicAzureWorkloadSQLRecoveryPoint interface { - AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) - AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) -} - -// AzureWorkloadSQLRecoveryPoint SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint -// along with extended info -type AzureWorkloadSQLRecoveryPoint struct { - // ExtendedInfo - Extended Info that provides data directory details. Will be populated in two cases: - // When a specific recovery point is accessed using GetRecoveryPoint - // Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter - ExtendedInfo *AzureWorkloadSQLRecoveryPointExtendedInfo `json:"extendedInfo,omitempty"` - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created - RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential' - Type RestorePointType `json:"type,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` -} - -func unmarshalBasicAzureWorkloadSQLRecoveryPoint(body []byte) (BasicAzureWorkloadSQLRecoveryPoint, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): - var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awspitrp) - return awspitrp, err - default: - var awsrp AzureWorkloadSQLRecoveryPoint - err := json.Unmarshal(body, &awsrp) - return awsrp, err - } -} -func unmarshalBasicAzureWorkloadSQLRecoveryPointArray(body []byte) ([]BasicAzureWorkloadSQLRecoveryPoint, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - awsrpArray := make([]BasicAzureWorkloadSQLRecoveryPoint, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awsrp, err := unmarshalBasicAzureWorkloadSQLRecoveryPoint(*rawMessage) - if err != nil { - return nil, err - } - awsrpArray[index] = awsrp - } - return awsrpArray, nil -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) MarshalJSON() ([]byte, error) { - awsrp.ObjectType = ObjectTypeAzureWorkloadSQLRecoveryPoint - objectMap := make(map[string]interface{}) - if awsrp.ExtendedInfo != nil { - objectMap["extendedInfo"] = awsrp.ExtendedInfo - } - if awsrp.ObjectType != "" { - objectMap["objectType"] = awsrp.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return &awsrp, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return &awsrp, true -} - -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return &awsrp, true -} - -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { - return nil, false -} - -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return nil, false -} - -// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return nil, false -} - -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. -func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &awsrp, true -} - -// AzureWorkloadSQLRecoveryPointExtendedInfo extended info class details -type AzureWorkloadSQLRecoveryPointExtendedInfo struct { - // DataDirectoryTimeInUTC - READ-ONLY; UTC time at which data directory info was captured - DataDirectoryTimeInUTC *date.Time `json:"dataDirectoryTimeInUTC,omitempty"` - // DataDirectoryPaths - READ-ONLY; List of data directory paths during restore operation. - DataDirectoryPaths *[]SQLDataDirectory `json:"dataDirectoryPaths,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSQLRecoveryPointExtendedInfo. -func (awsrpei AzureWorkloadSQLRecoveryPointExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// BasicAzureWorkloadSQLRestoreRequest azureWorkload SQL -specific restore. Specifically for full/diff restore -type BasicAzureWorkloadSQLRestoreRequest interface { - AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) - AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) -} - -// AzureWorkloadSQLRestoreRequest azureWorkload SQL -specific restore. Specifically for full/diff restore -type AzureWorkloadSQLRestoreRequest struct { - // ShouldUseAlternateTargetLocation - Default option set to true. If this is set to false, alternate data directory must be provided - ShouldUseAlternateTargetLocation *bool `json:"shouldUseAlternateTargetLocation,omitempty"` - // IsNonRecoverable - SQL specific property where user can chose to set no-recovery when restore operation is tried - IsNonRecoverable *bool `json:"isNonRecoverable,omitempty"` - // AlternateDirectoryPaths - Data directory details - AlternateDirectoryPaths *[]SQLDataDirectoryMapping `json:"alternateDirectoryPaths,omitempty"` - // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PropertyBag - Workload specific property bag. - PropertyBag map[string]*string `json:"propertyBag"` - // TargetInfo - Details of target database - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' - RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` -} - -func unmarshalBasicAzureWorkloadSQLRestoreRequest(body []byte) (BasicAzureWorkloadSQLRestoreRequest, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): - var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest - err := json.Unmarshal(body, &awspitrr) - return awspitrr, err - default: - var awsrr AzureWorkloadSQLRestoreRequest - err := json.Unmarshal(body, &awsrr) - return awsrr, err - } -} -func unmarshalBasicAzureWorkloadSQLRestoreRequestArray(body []byte) ([]BasicAzureWorkloadSQLRestoreRequest, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - awsrrArray := make([]BasicAzureWorkloadSQLRestoreRequest, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awsrr, err := unmarshalBasicAzureWorkloadSQLRestoreRequest(*rawMessage) - if err != nil { - return nil, err - } - awsrrArray[index] = awsrr - } - return awsrrArray, nil -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) MarshalJSON() ([]byte, error) { - awsrr.ObjectType = ObjectTypeAzureWorkloadSQLRestoreRequest - objectMap := make(map[string]interface{}) - if awsrr.ShouldUseAlternateTargetLocation != nil { - objectMap["shouldUseAlternateTargetLocation"] = awsrr.ShouldUseAlternateTargetLocation - } - if awsrr.IsNonRecoverable != nil { - objectMap["isNonRecoverable"] = awsrr.IsNonRecoverable - } - if awsrr.AlternateDirectoryPaths != nil { - objectMap["alternateDirectoryPaths"] = awsrr.AlternateDirectoryPaths - } - if awsrr.RecoveryType != "" { - objectMap["recoveryType"] = awsrr.RecoveryType - } - if awsrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = awsrr.SourceResourceID - } - if awsrr.PropertyBag != nil { - objectMap["propertyBag"] = awsrr.PropertyBag - } - if awsrr.TargetInfo != nil { - objectMap["targetInfo"] = awsrr.TargetInfo - } - if awsrr.RecoveryMode != "" { - objectMap["recoveryMode"] = awsrr.RecoveryMode - } - if awsrr.ObjectType != "" { - objectMap["objectType"] = awsrr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return &awsrr, true -} - -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { - return &awsrr, true -} - -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { - return &awsrr, true -} - -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { - return nil, false -} - -// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return nil, false -} - -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. -func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &awsrr, true -} - -// BEKDetails BEK is bitlocker encryption key. -type BEKDetails struct { - // SecretURL - Secret is BEK. - SecretURL *string `json:"secretUrl,omitempty"` - // SecretVaultID - ID of the Key Vault where this Secret is stored. - SecretVaultID *string `json:"secretVaultId,omitempty"` - // SecretData - BEK data. - SecretData *string `json:"secretData,omitempty"` -} - -// BMSBackupEngineQueryObject query parameters to fetch list of backup engines. -type BMSBackupEngineQueryObject struct { - // Expand - attribute to add extended info - Expand *string `json:"expand,omitempty"` -} - -// BMSBackupEnginesQueryObject query parameters to fetch list of backup engines. -type BMSBackupEnginesQueryObject struct { - // BackupManagementType - Backup management type for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // FriendlyName - Friendly name of the backup engine. - FriendlyName *string `json:"friendlyName,omitempty"` - // Expand - Attribute to add extended info. - Expand *string `json:"expand,omitempty"` -} - -// BMSBackupSummariesQueryObject query parameters to fetch backup summaries. -type BMSBackupSummariesQueryObject struct { - // Type - Backup management type for this container. Possible values include: 'TypeInvalid', 'TypeBackupProtectedItemCountSummary', 'TypeBackupProtectionContainerCountSummary' - Type Type `json:"type,omitempty"` -} - -// BMSContainerQueryObject the query filters that can be used with the list containers API. -type BMSContainerQueryObject struct { - // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // ContainerType - Type of container for filter. Possible values include: 'ContainerTypeInvalid', 'ContainerTypeUnknown', 'ContainerTypeIaasVMContainer', 'ContainerTypeIaasVMServiceContainer', 'ContainerTypeDPMContainer', 'ContainerTypeAzureBackupServerContainer', 'ContainerTypeMABContainer', 'ContainerTypeCluster', 'ContainerTypeAzureSQLContainer', 'ContainerTypeWindows', 'ContainerTypeVCenter', 'ContainerTypeVMAppContainer', 'ContainerTypeSQLAGWorkLoadContainer', 'ContainerTypeStorageContainer', 'ContainerTypeGenericContainer' - ContainerType ContainerType `json:"containerType,omitempty"` - // BackupEngineName - Backup engine name - BackupEngineName *string `json:"backupEngineName,omitempty"` - // FabricName - Fabric name for filter - FabricName *string `json:"fabricName,omitempty"` - // Status - Status of registration of this container with the Recovery Services Vault. - Status *string `json:"status,omitempty"` - // FriendlyName - Friendly name of this container. - FriendlyName *string `json:"friendlyName,omitempty"` -} - -// BMSContainersInquiryQueryObject the query filters that can be used with the inquire container API. -type BMSContainersInquiryQueryObject struct { - // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Workload type for this container. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` -} - -// BMSPOQueryObject filters to list items that can be backed up. -type BMSPOQueryObject struct { - // BackupManagementType - Backup management type. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Workload type. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` - // ContainerName - Full name of the container whose Protectable Objects should be returned. - ContainerName *string `json:"containerName,omitempty"` - // Status - Backup status query parameter. - Status *string `json:"status,omitempty"` - // FriendlyName - Friendly name. - FriendlyName *string `json:"friendlyName,omitempty"` -} - -// BMSRefreshContainersQueryObject the query filters that can be used with the refresh container API. -type BMSRefreshContainersQueryObject struct { - // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` -} - -// BMSRPQueryObject filters to list backup copies. -type BMSRPQueryObject struct { - // StartDate - Backup copies created after this time. - StartDate *date.Time `json:"startDate,omitempty"` - // EndDate - Backup copies created before this time. - EndDate *date.Time `json:"endDate,omitempty"` - // RestorePointQueryType - RestorePoint type. Possible values include: 'RestorePointQueryTypeInvalid', 'RestorePointQueryTypeFull', 'RestorePointQueryTypeLog', 'RestorePointQueryTypeDifferential', 'RestorePointQueryTypeFullAndDifferential', 'RestorePointQueryTypeAll' - RestorePointQueryType RestorePointQueryType `json:"restorePointQueryType,omitempty"` - // ExtendedInfo - In Get Recovery Point, it tells whether extended information about recovery point is asked. - ExtendedInfo *bool `json:"extendedInfo,omitempty"` -} - -// BMSWorkloadItemQueryObject filters to list items that can be backed up. -type BMSWorkloadItemQueryObject struct { - // BackupManagementType - Backup management type. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadItemType - Workload Item type. Possible values include: 'WorkloadItemTypeInvalid', 'WorkloadItemTypeSQLInstance', 'WorkloadItemTypeSQLDataBase', 'WorkloadItemTypeSAPHanaSystem', 'WorkloadItemTypeSAPHanaDatabase', 'WorkloadItemTypeSAPAseSystem', 'WorkloadItemTypeSAPAseDatabase' - WorkloadItemType WorkloadItemType `json:"workloadItemType,omitempty"` - // WorkloadType - Workload type. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` - // ProtectionStatus - Backup status query parameter. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionStatus ProtectionStatus `json:"protectionStatus,omitempty"` -} - -// ClientDiscoveryDisplay localized display information of an operation. -type ClientDiscoveryDisplay struct { - // Provider - Name of the provider for display purposes - Provider *string `json:"provider,omitempty"` - // Resource - ResourceType for which this Operation can be performed. - Resource *string `json:"resource,omitempty"` - // Operation - Operations Name itself. - Operation *string `json:"operation,omitempty"` - // Description - Description of the operation having details of what operation is about. - Description *string `json:"description,omitempty"` -} - -// ClientDiscoveryForLogSpecification class to represent shoebox log specification in json client -// discovery. -type ClientDiscoveryForLogSpecification struct { - // Name - Name for shoebox log specification. - Name *string `json:"name,omitempty"` - // DisplayName - Localized display name - DisplayName *string `json:"displayName,omitempty"` - // BlobDuration - blob duration of shoebox log specification - BlobDuration *string `json:"blobDuration,omitempty"` -} - -// ClientDiscoveryForProperties class to represent shoebox properties in json client discovery. -type ClientDiscoveryForProperties struct { - // ServiceSpecification - Operation properties. - ServiceSpecification *ClientDiscoveryForServiceSpecification `json:"serviceSpecification,omitempty"` -} - -// ClientDiscoveryForServiceSpecification class to represent shoebox service specification in json client -// discovery. -type ClientDiscoveryForServiceSpecification struct { - // LogSpecifications - List of log specifications of this operation. - LogSpecifications *[]ClientDiscoveryForLogSpecification `json:"logSpecifications,omitempty"` -} - -// ClientDiscoveryResponse operations List response which contains list of available APIs. -type ClientDiscoveryResponse struct { - autorest.Response `json:"-"` - // Value - List of available operations. - Value *[]ClientDiscoveryValueForSingleAPI `json:"value,omitempty"` - // NextLink - Link to the next chunk of Response. - NextLink *string `json:"nextLink,omitempty"` -} - -// ClientDiscoveryResponseIterator provides access to a complete listing of -// ClientDiscoveryValueForSingleAPI values. -type ClientDiscoveryResponseIterator struct { - i int - page ClientDiscoveryResponsePage -} - -// NextWithContext 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 *ClientDiscoveryResponseIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ClientDiscoveryResponseIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ClientDiscoveryResponseIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ClientDiscoveryResponseIterator) 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 ClientDiscoveryResponseIterator) Response() ClientDiscoveryResponse { - 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 ClientDiscoveryResponseIterator) Value() ClientDiscoveryValueForSingleAPI { - if !iter.page.NotDone() { - return ClientDiscoveryValueForSingleAPI{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ClientDiscoveryResponseIterator type. -func NewClientDiscoveryResponseIterator(page ClientDiscoveryResponsePage) ClientDiscoveryResponseIterator { - return ClientDiscoveryResponseIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (cdr ClientDiscoveryResponse) IsEmpty() bool { - return cdr.Value == nil || len(*cdr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (cdr ClientDiscoveryResponse) hasNextLink() bool { - return cdr.NextLink != nil && len(*cdr.NextLink) != 0 -} - -// clientDiscoveryResponsePreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cdr ClientDiscoveryResponse) clientDiscoveryResponsePreparer(ctx context.Context) (*http.Request, error) { - if !cdr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cdr.NextLink))) -} - -// ClientDiscoveryResponsePage contains a page of ClientDiscoveryValueForSingleAPI values. -type ClientDiscoveryResponsePage struct { - fn func(context.Context, ClientDiscoveryResponse) (ClientDiscoveryResponse, error) - cdr ClientDiscoveryResponse -} - -// NextWithContext 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 *ClientDiscoveryResponsePage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ClientDiscoveryResponsePage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.cdr) - if err != nil { - return err - } - page.cdr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *ClientDiscoveryResponsePage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ClientDiscoveryResponsePage) NotDone() bool { - return !page.cdr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ClientDiscoveryResponsePage) Response() ClientDiscoveryResponse { - return page.cdr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ClientDiscoveryResponsePage) Values() []ClientDiscoveryValueForSingleAPI { - if page.cdr.IsEmpty() { - return nil - } - return *page.cdr.Value -} - -// Creates a new instance of the ClientDiscoveryResponsePage type. -func NewClientDiscoveryResponsePage(cur ClientDiscoveryResponse, getNextPage func(context.Context, ClientDiscoveryResponse) (ClientDiscoveryResponse, error)) ClientDiscoveryResponsePage { - return ClientDiscoveryResponsePage{ - fn: getNextPage, - cdr: cur, - } -} - -// ClientDiscoveryValueForSingleAPI available operation details. -type ClientDiscoveryValueForSingleAPI struct { - // Name - Name of the Operation. - Name *string `json:"name,omitempty"` - // Display - Contains the localized display information for this particular operation - Display *ClientDiscoveryDisplay `json:"display,omitempty"` - // Origin - The intended executor of the operation;governs the display of the operation in the RBAC UX and the audit logs UX - Origin *string `json:"origin,omitempty"` - // Properties - ShoeBox properties for the given operation. - Properties *ClientDiscoveryForProperties `json:"properties,omitempty"` -} - -// ClientScriptForConnect client script details for file / folder restore. -type ClientScriptForConnect struct { - // ScriptContent - File content of the client script for file / folder restore. - ScriptContent *string `json:"scriptContent,omitempty"` - // ScriptExtension - File extension of the client script for file / folder restore - .ps1 , .sh , etc. - ScriptExtension *string `json:"scriptExtension,omitempty"` - // OsType - OS type - Windows, Linux etc. for which this file / folder restore client script works. - OsType *string `json:"osType,omitempty"` - // URL - URL of Executable from where to source the content. If this is not null then ScriptContent should not be used - URL *string `json:"url,omitempty"` - // ScriptNameSuffix - Mandatory suffix that should be added to the name of script that is given for download to user. - // If its null or empty then , ignore it. - ScriptNameSuffix *string `json:"scriptNameSuffix,omitempty"` -} - -// ContainerIdentityInfo container identity information -type ContainerIdentityInfo struct { - // UniqueName - Unique name of the container - UniqueName *string `json:"uniqueName,omitempty"` - // AadTenantID - Protection container identity - AAD Tenant - AadTenantID *string `json:"aadTenantId,omitempty"` - // ServicePrincipalClientID - Protection container identity - AAD Service Principal - ServicePrincipalClientID *string `json:"servicePrincipalClientId,omitempty"` - // Audience - Protection container identity - Audience - Audience *string `json:"audience,omitempty"` -} - -// DailyRetentionFormat daily retention format. -type DailyRetentionFormat struct { - // DaysOfTheMonth - List of days of the month. - DaysOfTheMonth *[]Day `json:"daysOfTheMonth,omitempty"` -} - -// DailyRetentionSchedule daily retention schedule. -type DailyRetentionSchedule struct { - // RetentionTimes - Retention times of retention policy. - RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` - // RetentionDuration - Retention duration of retention Policy. - RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` -} - -// Day day of the week. -type Day struct { - // Date - Date of the month - Date *int32 `json:"date,omitempty"` - // IsLast - Whether Date is last date of month - IsLast *bool `json:"isLast,omitempty"` -} - -// DiskExclusionProperties ... -type DiskExclusionProperties struct { - // DiskLunList - List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. - DiskLunList *[]int32 `json:"diskLunList,omitempty"` - // IsInclusionList - Flag to indicate whether DiskLunList is to be included/ excluded from backup. - IsInclusionList *bool `json:"isInclusionList,omitempty"` -} - -// DiskInformation disk information -type DiskInformation struct { - Lun *int32 `json:"lun,omitempty"` - Name *string `json:"name,omitempty"` -} - -// DistributedNodesInfo this is used to represent the various nodes of the distributed container. -type DistributedNodesInfo struct { - // NodeName - Name of the node under a distributed container. - NodeName *string `json:"nodeName,omitempty"` - // Status - Status of this Node. - // Failed | Succeeded - Status *string `json:"status,omitempty"` - // ErrorDetail - Error Details if the Status is non-success. - ErrorDetail *ErrorDetail `json:"errorDetail,omitempty"` -} - -// DpmBackupEngine data Protection Manager (DPM) specific backup engine. -type DpmBackupEngine struct { - // FriendlyName - Friendly name of the backup engine. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Registration status of the backup engine with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // BackupEngineState - Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} - BackupEngineState *string `json:"backupEngineState,omitempty"` - // HealthStatus - Backup status of the backup engine. - HealthStatus *string `json:"healthStatus,omitempty"` - // CanReRegister - Flag indicating if the backup engine be registered, once already registered. - CanReRegister *bool `json:"canReRegister,omitempty"` - // BackupEngineID - ID of the backup engine. - BackupEngineID *string `json:"backupEngineId,omitempty"` - // DpmVersion - Backup engine version - DpmVersion *string `json:"dpmVersion,omitempty"` - // AzureBackupAgentVersion - Backup agent version - AzureBackupAgentVersion *string `json:"azureBackupAgentVersion,omitempty"` - // IsAzureBackupAgentUpgradeAvailable - To check if backup agent upgrade available - IsAzureBackupAgentUpgradeAvailable *bool `json:"isAzureBackupAgentUpgradeAvailable,omitempty"` - // IsDpmUpgradeAvailable - To check if backup engine upgrade available - IsDpmUpgradeAvailable *bool `json:"isDpmUpgradeAvailable,omitempty"` - // ExtendedInfo - Extended info of the backupengine - ExtendedInfo *EngineExtendedInfo `json:"extendedInfo,omitempty"` - // BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine' - BackupEngineType EngineType `json:"backupEngineType,omitempty"` -} - -// MarshalJSON is the custom marshaler for DpmBackupEngine. -func (dbe DpmBackupEngine) MarshalJSON() ([]byte, error) { - dbe.BackupEngineType = BackupEngineTypeDpmBackupEngine - objectMap := make(map[string]interface{}) - if dbe.FriendlyName != nil { - objectMap["friendlyName"] = dbe.FriendlyName - } - if dbe.BackupManagementType != "" { - objectMap["backupManagementType"] = dbe.BackupManagementType - } - if dbe.RegistrationStatus != nil { - objectMap["registrationStatus"] = dbe.RegistrationStatus - } - if dbe.BackupEngineState != nil { - objectMap["backupEngineState"] = dbe.BackupEngineState - } - if dbe.HealthStatus != nil { - objectMap["healthStatus"] = dbe.HealthStatus - } - if dbe.CanReRegister != nil { - objectMap["canReRegister"] = dbe.CanReRegister - } - if dbe.BackupEngineID != nil { - objectMap["backupEngineId"] = dbe.BackupEngineID - } - if dbe.DpmVersion != nil { - objectMap["dpmVersion"] = dbe.DpmVersion - } - if dbe.AzureBackupAgentVersion != nil { - objectMap["azureBackupAgentVersion"] = dbe.AzureBackupAgentVersion - } - if dbe.IsAzureBackupAgentUpgradeAvailable != nil { - objectMap["isAzureBackupAgentUpgradeAvailable"] = dbe.IsAzureBackupAgentUpgradeAvailable - } - if dbe.IsDpmUpgradeAvailable != nil { - objectMap["isDpmUpgradeAvailable"] = dbe.IsDpmUpgradeAvailable - } - if dbe.ExtendedInfo != nil { - objectMap["extendedInfo"] = dbe.ExtendedInfo - } - if dbe.BackupEngineType != "" { - objectMap["backupEngineType"] = dbe.BackupEngineType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerEngine is the BasicEngineBase implementation for DpmBackupEngine. -func (dbe DpmBackupEngine) AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) { - return nil, false -} - -// AsDpmBackupEngine is the BasicEngineBase implementation for DpmBackupEngine. -func (dbe DpmBackupEngine) AsDpmBackupEngine() (*DpmBackupEngine, bool) { - return &dbe, true -} - -// AsEngineBase is the BasicEngineBase implementation for DpmBackupEngine. -func (dbe DpmBackupEngine) AsEngineBase() (*EngineBase, bool) { - return nil, false -} - -// AsBasicEngineBase is the BasicEngineBase implementation for DpmBackupEngine. -func (dbe DpmBackupEngine) AsBasicEngineBase() (BasicEngineBase, bool) { - return &dbe, true -} - -// BasicDpmContainer DPM workload-specific protection container. -type BasicDpmContainer interface { - AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) - AsDpmContainer() (*DpmContainer, bool) -} - -// DpmContainer DPM workload-specific protection container. -type DpmContainer struct { - // CanReRegister - Specifies whether the container is re-registrable. - CanReRegister *bool `json:"canReRegister,omitempty"` - // ContainerID - ID of container. - ContainerID *string `json:"containerId,omitempty"` - // ProtectedItemCount - Number of protected items in the BackupEngine - ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` - // DpmAgentVersion - Backup engine Agent version - DpmAgentVersion *string `json:"dpmAgentVersion,omitempty"` - // DpmServers - List of BackupEngines protecting the container - DpmServers *[]string `json:"dpmServers,omitempty"` - // UpgradeAvailable - To check if upgrade available - UpgradeAvailable *bool `json:"upgradeAvailable,omitempty"` - // ProtectionStatus - Protection status of the container. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ExtendedInfo - Extended Info of the container. - ExtendedInfo *DPMContainerExtendedInfo `json:"extendedInfo,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -func unmarshalBasicDpmContainer(body []byte) (BasicDpmContainer, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["containerType"] { - case string(ContainerTypeAzureBackupServerContainer1): - var absc AzureBackupServerContainer - err := json.Unmarshal(body, &absc) - return absc, err - default: - var dc DpmContainer - err := json.Unmarshal(body, &dc) - return dc, err - } -} -func unmarshalBasicDpmContainerArray(body []byte) ([]BasicDpmContainer, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - dcArray := make([]BasicDpmContainer, len(rawMessages)) - - for index, rawMessage := range rawMessages { - dc, err := unmarshalBasicDpmContainer(*rawMessage) - if err != nil { - return nil, err - } - dcArray[index] = dc - } - return dcArray, nil -} - -// MarshalJSON is the custom marshaler for DpmContainer. -func (dc DpmContainer) MarshalJSON() ([]byte, error) { - dc.ContainerType = ContainerTypeDPMContainer1 - objectMap := make(map[string]interface{}) - if dc.CanReRegister != nil { - objectMap["canReRegister"] = dc.CanReRegister - } - if dc.ContainerID != nil { - objectMap["containerId"] = dc.ContainerID - } - if dc.ProtectedItemCount != nil { - objectMap["protectedItemCount"] = dc.ProtectedItemCount - } - if dc.DpmAgentVersion != nil { - objectMap["dpmAgentVersion"] = dc.DpmAgentVersion - } - if dc.DpmServers != nil { - objectMap["dpmServers"] = dc.DpmServers - } - if dc.UpgradeAvailable != nil { - objectMap["upgradeAvailable"] = dc.UpgradeAvailable - } - if dc.ProtectionStatus != nil { - objectMap["protectionStatus"] = dc.ProtectionStatus - } - if dc.ExtendedInfo != nil { - objectMap["extendedInfo"] = dc.ExtendedInfo - } - if dc.FriendlyName != nil { - objectMap["friendlyName"] = dc.FriendlyName - } - if dc.BackupManagementType != "" { - objectMap["backupManagementType"] = dc.BackupManagementType - } - if dc.RegistrationStatus != nil { - objectMap["registrationStatus"] = dc.RegistrationStatus - } - if dc.HealthStatus != nil { - objectMap["healthStatus"] = dc.HealthStatus - } - if dc.ContainerType != "" { - objectMap["containerType"] = dc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsDpmContainer() (*DpmContainer, bool) { - return &dc, true -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return &dc, true -} - -// AsGenericContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false -} - -// AsMabContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. -func (dc DpmContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &dc, true -} - -// DPMContainerExtendedInfo additional information of the DPMContainer. -type DPMContainerExtendedInfo struct { - // LastRefreshedAt - Last refresh time of the DPMContainer. - LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` -} - -// DpmErrorInfo DPM workload-specific error information. -type DpmErrorInfo struct { - // ErrorString - Localized error string. - ErrorString *string `json:"errorString,omitempty"` - // Recommendations - List of localized recommendations for above error code. - Recommendations *[]string `json:"recommendations,omitempty"` -} - -// DpmJob DPM workload-specific job object. -type DpmJob struct { - // Duration - Time elapsed for job. - Duration *string `json:"duration,omitempty"` - // DpmServerName - DPM server name managing the backup item or backup job. - DpmServerName *string `json:"dpmServerName,omitempty"` - // ContainerName - Name of cluster/server protecting current backup item, if any. - ContainerName *string `json:"containerName,omitempty"` - // ContainerType - Type of container. - ContainerType *string `json:"containerType,omitempty"` - // WorkloadType - Type of backup item. - WorkloadType *string `json:"workloadType,omitempty"` - // ActionsInfo - The state/actions applicable on this job like cancel/retry. - ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` - // ErrorDetails - The errors. - ErrorDetails *[]DpmErrorInfo `json:"errorDetails,omitempty"` - // ExtendedInfo - Additional information for this job. - ExtendedInfo *DpmJobExtendedInfo `json:"extendedInfo,omitempty"` - // EntityFriendlyName - Friendly name of the entity on which the current job is executing. - EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` - // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // Operation - The operation name. - Operation *string `json:"operation,omitempty"` - // Status - Job status. - Status *string `json:"status,omitempty"` - // StartTime - The start time. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time. - EndTime *date.Time `json:"endTime,omitempty"` - // ActivityID - ActivityId of job. - ActivityID *string `json:"activityId,omitempty"` - // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' - JobType JobType `json:"jobType,omitempty"` -} - -// MarshalJSON is the custom marshaler for DpmJob. -func (dj DpmJob) MarshalJSON() ([]byte, error) { - dj.JobType = JobTypeDpmJob - objectMap := make(map[string]interface{}) - if dj.Duration != nil { - objectMap["duration"] = dj.Duration - } - if dj.DpmServerName != nil { - objectMap["dpmServerName"] = dj.DpmServerName - } - if dj.ContainerName != nil { - objectMap["containerName"] = dj.ContainerName - } - if dj.ContainerType != nil { - objectMap["containerType"] = dj.ContainerType - } - if dj.WorkloadType != nil { - objectMap["workloadType"] = dj.WorkloadType - } - if dj.ActionsInfo != nil { - objectMap["actionsInfo"] = dj.ActionsInfo - } - if dj.ErrorDetails != nil { - objectMap["errorDetails"] = dj.ErrorDetails - } - if dj.ExtendedInfo != nil { - objectMap["extendedInfo"] = dj.ExtendedInfo - } - if dj.EntityFriendlyName != nil { - objectMap["entityFriendlyName"] = dj.EntityFriendlyName - } - if dj.BackupManagementType != "" { - objectMap["backupManagementType"] = dj.BackupManagementType - } - if dj.Operation != nil { - objectMap["operation"] = dj.Operation - } - if dj.Status != nil { - objectMap["status"] = dj.Status - } - if dj.StartTime != nil { - objectMap["startTime"] = dj.StartTime - } - if dj.EndTime != nil { - objectMap["endTime"] = dj.EndTime - } - if dj.ActivityID != nil { - objectMap["activityId"] = dj.ActivityID - } - if dj.JobType != "" { - objectMap["jobType"] = dj.JobType - } - return json.Marshal(objectMap) -} - -// AsAzureIaaSVMJob is the BasicJob implementation for DpmJob. -func (dj DpmJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { - return nil, false -} - -// AsAzureStorageJob is the BasicJob implementation for DpmJob. -func (dj DpmJob) AsAzureStorageJob() (*AzureStorageJob, bool) { - return nil, false -} - -// AsAzureWorkloadJob is the BasicJob implementation for DpmJob. -func (dj DpmJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { - return nil, false -} - -// AsDpmJob is the BasicJob implementation for DpmJob. -func (dj DpmJob) AsDpmJob() (*DpmJob, bool) { - return &dj, true -} - -// AsMabJob is the BasicJob implementation for DpmJob. -func (dj DpmJob) AsMabJob() (*MabJob, bool) { - return nil, false -} - -// AsJob is the BasicJob implementation for DpmJob. -func (dj DpmJob) AsJob() (*Job, bool) { - return nil, false -} - -// AsBasicJob is the BasicJob implementation for DpmJob. -func (dj DpmJob) AsBasicJob() (BasicJob, bool) { - return &dj, true -} - -// DpmJobExtendedInfo additional information on the DPM workload-specific job. -type DpmJobExtendedInfo struct { - // TasksList - List of tasks associated with this job. - TasksList *[]DpmJobTaskDetails `json:"tasksList,omitempty"` - // PropertyBag - The job properties. - PropertyBag map[string]*string `json:"propertyBag"` - // DynamicErrorMessage - Non localized error message on job execution. - DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` -} - -// MarshalJSON is the custom marshaler for DpmJobExtendedInfo. -func (djei DpmJobExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if djei.TasksList != nil { - objectMap["tasksList"] = djei.TasksList - } - if djei.PropertyBag != nil { - objectMap["propertyBag"] = djei.PropertyBag - } - if djei.DynamicErrorMessage != nil { - objectMap["dynamicErrorMessage"] = djei.DynamicErrorMessage - } - return json.Marshal(objectMap) -} - -// DpmJobTaskDetails DPM workload-specific job task details. -type DpmJobTaskDetails struct { - // TaskID - The task display name. - TaskID *string `json:"taskId,omitempty"` - // StartTime - The start time. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time. - EndTime *date.Time `json:"endTime,omitempty"` - // Duration - Time elapsed for task. - Duration *string `json:"duration,omitempty"` - // Status - The status. - Status *string `json:"status,omitempty"` -} - -// DPMProtectedItem additional information on Backup engine specific backup item. -type DPMProtectedItem struct { - // FriendlyName - Friendly name of the managed item - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupEngineName - Backup Management server protecting this backup item - BackupEngineName *string `json:"backupEngineName,omitempty"` - // ProtectionState - Protection state of the backup engine. Possible values include: 'ProtectedItemStateInvalid', 'ProtectedItemStateIRPending', 'ProtectedItemStateProtected', 'ProtectedItemStateProtectionError', 'ProtectedItemStateProtectionStopped', 'ProtectedItemStateProtectionPaused' - ProtectionState ProtectedItemState `json:"protectionState,omitempty"` - // ExtendedInfo - Extended info of the backup item. - ExtendedInfo *DPMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for DPMProtectedItem. -func (dpi DPMProtectedItem) MarshalJSON() ([]byte, error) { - dpi.ProtectedItemType = ProtectedItemTypeDPMProtectedItem - objectMap := make(map[string]interface{}) - if dpi.FriendlyName != nil { - objectMap["friendlyName"] = dpi.FriendlyName - } - if dpi.BackupEngineName != nil { - objectMap["backupEngineName"] = dpi.BackupEngineName - } - if dpi.ProtectionState != "" { - objectMap["protectionState"] = dpi.ProtectionState - } - if dpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = dpi.ExtendedInfo - } - if dpi.BackupManagementType != "" { - objectMap["backupManagementType"] = dpi.BackupManagementType - } - if dpi.WorkloadType != "" { - objectMap["workloadType"] = dpi.WorkloadType - } - if dpi.ContainerName != nil { - objectMap["containerName"] = dpi.ContainerName - } - if dpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = dpi.SourceResourceID - } - if dpi.PolicyID != nil { - objectMap["policyId"] = dpi.PolicyID - } - if dpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = dpi.LastRecoveryPoint - } - if dpi.BackupSetName != nil { - objectMap["backupSetName"] = dpi.BackupSetName - } - if dpi.CreateMode != "" { - objectMap["createMode"] = dpi.CreateMode - } - if dpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = dpi.DeferredDeleteTimeInUTC - } - if dpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = dpi.IsScheduledForDeferredDelete - } - if dpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = dpi.DeferredDeleteTimeRemaining - } - if dpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = dpi.IsDeferredDeleteScheduleUpcoming - } - if dpi.IsRehydrate != nil { - objectMap["isRehydrate"] = dpi.IsRehydrate - } - if dpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = dpi.ProtectedItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return nil, false -} - -// AsDPMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return &dpi, true -} - -// AsGenericProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return nil, false -} - -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return nil, false -} - -// AsProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return nil, false -} - -// AsBasicProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. -func (dpi DPMProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &dpi, true -} - -// DPMProtectedItemExtendedInfo additional information of DPM Protected item. -type DPMProtectedItemExtendedInfo struct { - // ProtectableObjectLoadPath - Attribute to provide information on various DBs. - ProtectableObjectLoadPath map[string]*string `json:"protectableObjectLoadPath"` - // Protected - To check if backup item is disk protected. - Protected *bool `json:"protected,omitempty"` - // IsPresentOnCloud - To check if backup item is cloud protected. - IsPresentOnCloud *bool `json:"isPresentOnCloud,omitempty"` - // LastBackupStatus - Last backup status information on backup item. - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - // LastRefreshedAt - Last refresh time on backup item. - LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` - // OldestRecoveryPoint - Oldest cloud recovery point time. - OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` - // RecoveryPointCount - cloud recovery point count. - RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` - // OnPremiseOldestRecoveryPoint - Oldest disk recovery point time. - OnPremiseOldestRecoveryPoint *date.Time `json:"onPremiseOldestRecoveryPoint,omitempty"` - // OnPremiseLatestRecoveryPoint - latest disk recovery point time. - OnPremiseLatestRecoveryPoint *date.Time `json:"onPremiseLatestRecoveryPoint,omitempty"` - // OnPremiseRecoveryPointCount - disk recovery point count. - OnPremiseRecoveryPointCount *int32 `json:"onPremiseRecoveryPointCount,omitempty"` - // IsCollocated - To check if backup item is collocated. - IsCollocated *bool `json:"isCollocated,omitempty"` - // ProtectionGroupName - Protection group name of the backup item. - ProtectionGroupName *string `json:"protectionGroupName,omitempty"` - // DiskStorageUsedInBytes - Used Disk storage in bytes. - DiskStorageUsedInBytes *string `json:"diskStorageUsedInBytes,omitempty"` - // TotalDiskStorageSizeInBytes - total Disk storage in bytes. - TotalDiskStorageSizeInBytes *string `json:"totalDiskStorageSizeInBytes,omitempty"` -} - -// MarshalJSON is the custom marshaler for DPMProtectedItemExtendedInfo. -func (dpiei DPMProtectedItemExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dpiei.ProtectableObjectLoadPath != nil { - objectMap["protectableObjectLoadPath"] = dpiei.ProtectableObjectLoadPath - } - if dpiei.Protected != nil { - objectMap["protected"] = dpiei.Protected - } - if dpiei.IsPresentOnCloud != nil { - objectMap["isPresentOnCloud"] = dpiei.IsPresentOnCloud - } - if dpiei.LastBackupStatus != nil { - objectMap["lastBackupStatus"] = dpiei.LastBackupStatus - } - if dpiei.LastRefreshedAt != nil { - objectMap["lastRefreshedAt"] = dpiei.LastRefreshedAt - } - if dpiei.OldestRecoveryPoint != nil { - objectMap["oldestRecoveryPoint"] = dpiei.OldestRecoveryPoint - } - if dpiei.RecoveryPointCount != nil { - objectMap["recoveryPointCount"] = dpiei.RecoveryPointCount - } - if dpiei.OnPremiseOldestRecoveryPoint != nil { - objectMap["onPremiseOldestRecoveryPoint"] = dpiei.OnPremiseOldestRecoveryPoint - } - if dpiei.OnPremiseLatestRecoveryPoint != nil { - objectMap["onPremiseLatestRecoveryPoint"] = dpiei.OnPremiseLatestRecoveryPoint - } - if dpiei.OnPremiseRecoveryPointCount != nil { - objectMap["onPremiseRecoveryPointCount"] = dpiei.OnPremiseRecoveryPointCount - } - if dpiei.IsCollocated != nil { - objectMap["isCollocated"] = dpiei.IsCollocated - } - if dpiei.ProtectionGroupName != nil { - objectMap["protectionGroupName"] = dpiei.ProtectionGroupName - } - if dpiei.DiskStorageUsedInBytes != nil { - objectMap["diskStorageUsedInBytes"] = dpiei.DiskStorageUsedInBytes - } - if dpiei.TotalDiskStorageSizeInBytes != nil { - objectMap["totalDiskStorageSizeInBytes"] = dpiei.TotalDiskStorageSizeInBytes - } - return json.Marshal(objectMap) -} - -// EncryptionDetails details needed if the VM was encrypted at the time of backup. -type EncryptionDetails struct { - // EncryptionEnabled - Identifies whether this backup copy represents an encrypted VM at the time of backup. - EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` - // KekURL - Key Url. - KekURL *string `json:"kekUrl,omitempty"` - // SecretKeyURL - Secret Url. - SecretKeyURL *string `json:"secretKeyUrl,omitempty"` - // KekVaultID - ID of Key Vault where KEK is stored. - KekVaultID *string `json:"kekVaultId,omitempty"` - // SecretKeyVaultID - ID of Key Vault where Secret is stored. - SecretKeyVaultID *string `json:"secretKeyVaultId,omitempty"` -} - -// BasicEngineBase the base backup engine class. All workload specific backup engines derive from this class. -type BasicEngineBase interface { - AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) - AsDpmBackupEngine() (*DpmBackupEngine, bool) - AsEngineBase() (*EngineBase, bool) -} - -// EngineBase the base backup engine class. All workload specific backup engines derive from this class. -type EngineBase struct { - // FriendlyName - Friendly name of the backup engine. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Registration status of the backup engine with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // BackupEngineState - Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} - BackupEngineState *string `json:"backupEngineState,omitempty"` - // HealthStatus - Backup status of the backup engine. - HealthStatus *string `json:"healthStatus,omitempty"` - // CanReRegister - Flag indicating if the backup engine be registered, once already registered. - CanReRegister *bool `json:"canReRegister,omitempty"` - // BackupEngineID - ID of the backup engine. - BackupEngineID *string `json:"backupEngineId,omitempty"` - // DpmVersion - Backup engine version - DpmVersion *string `json:"dpmVersion,omitempty"` - // AzureBackupAgentVersion - Backup agent version - AzureBackupAgentVersion *string `json:"azureBackupAgentVersion,omitempty"` - // IsAzureBackupAgentUpgradeAvailable - To check if backup agent upgrade available - IsAzureBackupAgentUpgradeAvailable *bool `json:"isAzureBackupAgentUpgradeAvailable,omitempty"` - // IsDpmUpgradeAvailable - To check if backup engine upgrade available - IsDpmUpgradeAvailable *bool `json:"isDpmUpgradeAvailable,omitempty"` - // ExtendedInfo - Extended info of the backupengine - ExtendedInfo *EngineExtendedInfo `json:"extendedInfo,omitempty"` - // BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine' - BackupEngineType EngineType `json:"backupEngineType,omitempty"` -} - -func unmarshalBasicEngineBase(body []byte) (BasicEngineBase, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["backupEngineType"] { - case string(BackupEngineTypeAzureBackupServerEngine): - var abse AzureBackupServerEngine - err := json.Unmarshal(body, &abse) - return abse, err - case string(BackupEngineTypeDpmBackupEngine): - var dbe DpmBackupEngine - err := json.Unmarshal(body, &dbe) - return dbe, err - default: - var eb EngineBase - err := json.Unmarshal(body, &eb) - return eb, err - } -} -func unmarshalBasicEngineBaseArray(body []byte) ([]BasicEngineBase, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - ebArray := make([]BasicEngineBase, len(rawMessages)) - - for index, rawMessage := range rawMessages { - eb, err := unmarshalBasicEngineBase(*rawMessage) - if err != nil { - return nil, err - } - ebArray[index] = eb - } - return ebArray, nil -} - -// MarshalJSON is the custom marshaler for EngineBase. -func (eb EngineBase) MarshalJSON() ([]byte, error) { - eb.BackupEngineType = BackupEngineTypeBackupEngineBase - objectMap := make(map[string]interface{}) - if eb.FriendlyName != nil { - objectMap["friendlyName"] = eb.FriendlyName - } - if eb.BackupManagementType != "" { - objectMap["backupManagementType"] = eb.BackupManagementType - } - if eb.RegistrationStatus != nil { - objectMap["registrationStatus"] = eb.RegistrationStatus - } - if eb.BackupEngineState != nil { - objectMap["backupEngineState"] = eb.BackupEngineState - } - if eb.HealthStatus != nil { - objectMap["healthStatus"] = eb.HealthStatus - } - if eb.CanReRegister != nil { - objectMap["canReRegister"] = eb.CanReRegister - } - if eb.BackupEngineID != nil { - objectMap["backupEngineId"] = eb.BackupEngineID - } - if eb.DpmVersion != nil { - objectMap["dpmVersion"] = eb.DpmVersion - } - if eb.AzureBackupAgentVersion != nil { - objectMap["azureBackupAgentVersion"] = eb.AzureBackupAgentVersion - } - if eb.IsAzureBackupAgentUpgradeAvailable != nil { - objectMap["isAzureBackupAgentUpgradeAvailable"] = eb.IsAzureBackupAgentUpgradeAvailable - } - if eb.IsDpmUpgradeAvailable != nil { - objectMap["isDpmUpgradeAvailable"] = eb.IsDpmUpgradeAvailable - } - if eb.ExtendedInfo != nil { - objectMap["extendedInfo"] = eb.ExtendedInfo - } - if eb.BackupEngineType != "" { - objectMap["backupEngineType"] = eb.BackupEngineType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerEngine is the BasicEngineBase implementation for EngineBase. -func (eb EngineBase) AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) { - return nil, false -} - -// AsDpmBackupEngine is the BasicEngineBase implementation for EngineBase. -func (eb EngineBase) AsDpmBackupEngine() (*DpmBackupEngine, bool) { - return nil, false -} - -// AsEngineBase is the BasicEngineBase implementation for EngineBase. -func (eb EngineBase) AsEngineBase() (*EngineBase, bool) { - return &eb, true -} - -// AsBasicEngineBase is the BasicEngineBase implementation for EngineBase. -func (eb EngineBase) AsBasicEngineBase() (BasicEngineBase, bool) { - return &eb, true -} - -// EngineBaseResource the base backup engine class. All workload specific backup engines derive from this -// class. -type EngineBaseResource struct { - autorest.Response `json:"-"` - // Properties - BackupEngineBaseResource properties - Properties BasicEngineBase `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for EngineBaseResource. -func (ebr EngineBaseResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = ebr.Properties - if ebr.Location != nil { - objectMap["location"] = ebr.Location - } - if ebr.Tags != nil { - objectMap["tags"] = ebr.Tags - } - if ebr.ETag != nil { - objectMap["eTag"] = ebr.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for EngineBaseResource struct. -func (ebr *EngineBaseResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicEngineBase(*v) - if err != nil { - return err - } - ebr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ebr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ebr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ebr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ebr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ebr.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - ebr.ETag = &eTag - } - } - } - - return nil -} - -// EngineBaseResourceList list of BackupEngineBase resources -type EngineBaseResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]EngineBaseResource `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"` -} - -// EngineBaseResourceListIterator provides access to a complete listing of EngineBaseResource values. -type EngineBaseResourceListIterator struct { - i int - page EngineBaseResourceListPage -} - -// NextWithContext 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 *EngineBaseResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EngineBaseResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *EngineBaseResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter EngineBaseResourceListIterator) 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 EngineBaseResourceListIterator) Response() EngineBaseResourceList { - 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 EngineBaseResourceListIterator) Value() EngineBaseResource { - if !iter.page.NotDone() { - return EngineBaseResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the EngineBaseResourceListIterator type. -func NewEngineBaseResourceListIterator(page EngineBaseResourceListPage) EngineBaseResourceListIterator { - return EngineBaseResourceListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ebrl EngineBaseResourceList) IsEmpty() bool { - return ebrl.Value == nil || len(*ebrl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ebrl EngineBaseResourceList) hasNextLink() bool { - return ebrl.NextLink != nil && len(*ebrl.NextLink) != 0 -} - -// engineBaseResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ebrl EngineBaseResourceList) engineBaseResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !ebrl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ebrl.NextLink))) -} - -// EngineBaseResourceListPage contains a page of EngineBaseResource values. -type EngineBaseResourceListPage struct { - fn func(context.Context, EngineBaseResourceList) (EngineBaseResourceList, error) - ebrl EngineBaseResourceList -} - -// NextWithContext 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 *EngineBaseResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EngineBaseResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ebrl) - if err != nil { - return err - } - page.ebrl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *EngineBaseResourceListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page EngineBaseResourceListPage) NotDone() bool { - return !page.ebrl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page EngineBaseResourceListPage) Response() EngineBaseResourceList { - return page.ebrl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page EngineBaseResourceListPage) Values() []EngineBaseResource { - if page.ebrl.IsEmpty() { - return nil - } - return *page.ebrl.Value -} - -// Creates a new instance of the EngineBaseResourceListPage type. -func NewEngineBaseResourceListPage(cur EngineBaseResourceList, getNextPage func(context.Context, EngineBaseResourceList) (EngineBaseResourceList, error)) EngineBaseResourceListPage { - return EngineBaseResourceListPage{ - fn: getNextPage, - ebrl: cur, - } -} - -// EngineExtendedInfo additional information on backup engine. -type EngineExtendedInfo struct { - // DatabaseName - Database name of backup engine. - DatabaseName *string `json:"databaseName,omitempty"` - // ProtectedItemsCount - Number of protected items in the backup engine. - ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // ProtectedServersCount - Number of protected servers in the backup engine. - ProtectedServersCount *int32 `json:"protectedServersCount,omitempty"` - // DiskCount - Number of disks in the backup engine. - DiskCount *int32 `json:"diskCount,omitempty"` - // UsedDiskSpace - Disk space used in the backup engine. - UsedDiskSpace *float64 `json:"usedDiskSpace,omitempty"` - // AvailableDiskSpace - Disk space currently available in the backup engine. - AvailableDiskSpace *float64 `json:"availableDiskSpace,omitempty"` - // RefreshedAt - Last refresh time in the backup engine. - RefreshedAt *date.Time `json:"refreshedAt,omitempty"` - // AzureProtectedInstances - Protected instances in the backup engine. - AzureProtectedInstances *int32 `json:"azureProtectedInstances,omitempty"` -} - -// ErrorAdditionalInfo the resource management error additional info. -type ErrorAdditionalInfo struct { - // Type - READ-ONLY; The additional info type. - Type *string `json:"type,omitempty"` - // Info - READ-ONLY; The additional info. - Info interface{} `json:"info,omitempty"` -} - -// MarshalJSON is the custom marshaler for ErrorAdditionalInfo. -func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ErrorDetail error Detail class which encapsulates Code, Message and Recommendations. -type ErrorDetail struct { - // Code - READ-ONLY; Error code. - Code *string `json:"code,omitempty"` - // Message - READ-ONLY; Error Message related to the Code. - Message *string `json:"message,omitempty"` - // Recommendations - READ-ONLY; List of recommendation strings. - Recommendations *[]string `json:"recommendations,omitempty"` -} - -// MarshalJSON is the custom marshaler for ErrorDetail. -func (ed ErrorDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ErrorResponse common error response for all Azure Resource Manager APIs to return error details for -// failed operations. (This also follows the OData error response format.) -type ErrorResponse struct { - // Code - READ-ONLY; The error code. - Code *string `json:"code,omitempty"` - // Message - READ-ONLY; The error message. - Message *string `json:"message,omitempty"` - // Target - READ-ONLY; The error target. - Target *string `json:"target,omitempty"` - // Details - READ-ONLY; The error details. - Details *[]ErrorResponse `json:"details,omitempty"` - // AdditionalInfo - READ-ONLY; The error additional info. - AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` -} - -// MarshalJSON is the custom marshaler for ErrorResponse. -func (er ErrorResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ExportJobsOperationResultInfo this class is used to send blob details after exporting jobs. -type ExportJobsOperationResultInfo struct { - // BlobURL - URL of the blob into which the serialized string of list of jobs is exported. - BlobURL *string `json:"blobUrl,omitempty"` - // BlobSasKey - SAS key to access the blob. It expires in 15 mins. - BlobSasKey *string `json:"blobSasKey,omitempty"` - // ExcelFileBlobURL - URL of the blob into which the ExcelFile is uploaded. - ExcelFileBlobURL *string `json:"excelFileBlobUrl,omitempty"` - // ExcelFileBlobSasKey - SAS key to access the blob. It expires in 15 mins. - ExcelFileBlobSasKey *string `json:"excelFileBlobSasKey,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeOperationResultInfoBase', 'ObjectTypeExportJobsOperationResultInfo', 'ObjectTypeOperationResultInfo' - ObjectType ObjectTypeBasicOperationResultInfoBase `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExportJobsOperationResultInfo. -func (ejori ExportJobsOperationResultInfo) MarshalJSON() ([]byte, error) { - ejori.ObjectType = ObjectTypeExportJobsOperationResultInfo - objectMap := make(map[string]interface{}) - if ejori.BlobURL != nil { - objectMap["blobUrl"] = ejori.BlobURL - } - if ejori.BlobSasKey != nil { - objectMap["blobSasKey"] = ejori.BlobSasKey - } - if ejori.ExcelFileBlobURL != nil { - objectMap["excelFileBlobUrl"] = ejori.ExcelFileBlobURL - } - if ejori.ExcelFileBlobSasKey != nil { - objectMap["excelFileBlobSasKey"] = ejori.ExcelFileBlobSasKey - } - if ejori.ObjectType != "" { - objectMap["objectType"] = ejori.ObjectType - } - return json.Marshal(objectMap) -} - -// AsExportJobsOperationResultInfo is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. -func (ejori ExportJobsOperationResultInfo) AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) { - return &ejori, true -} - -// AsOperationResultInfo is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. -func (ejori ExportJobsOperationResultInfo) AsOperationResultInfo() (*OperationResultInfo, bool) { - return nil, false -} - -// AsOperationResultInfoBase is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. -func (ejori ExportJobsOperationResultInfo) AsOperationResultInfoBase() (*OperationResultInfoBase, bool) { - return nil, false -} - -// AsBasicOperationResultInfoBase is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. -func (ejori ExportJobsOperationResultInfo) AsBasicOperationResultInfoBase() (BasicOperationResultInfoBase, bool) { - return &ejori, true -} - -// ExtendedProperties extended Properties for Azure IaasVM Backup. -type ExtendedProperties struct { - // DiskExclusionProperties - Extended Properties for Disk Exclusion. - DiskExclusionProperties *DiskExclusionProperties `json:"diskExclusionProperties,omitempty"` -} - -// BasicFeatureSupportRequest base class for feature request -type BasicFeatureSupportRequest interface { - AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) - AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) - AsFeatureSupportRequest() (*FeatureSupportRequest, bool) -} - -// FeatureSupportRequest base class for feature request -type FeatureSupportRequest struct { - // FeatureType - Possible values include: 'FeatureTypeFeatureSupportRequest', 'FeatureTypeAzureBackupGoals', 'FeatureTypeAzureVMResourceBackup' - FeatureType FeatureType `json:"featureType,omitempty"` -} - -func unmarshalBasicFeatureSupportRequest(body []byte) (BasicFeatureSupportRequest, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["featureType"] { - case string(FeatureTypeAzureBackupGoals): - var abgfsr AzureBackupGoalFeatureSupportRequest - err := json.Unmarshal(body, &abgfsr) - return abgfsr, err - case string(FeatureTypeAzureVMResourceBackup): - var avrfsr AzureVMResourceFeatureSupportRequest - err := json.Unmarshal(body, &avrfsr) - return avrfsr, err - default: - var fsr FeatureSupportRequest - err := json.Unmarshal(body, &fsr) - return fsr, err - } -} -func unmarshalBasicFeatureSupportRequestArray(body []byte) ([]BasicFeatureSupportRequest, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - fsrArray := make([]BasicFeatureSupportRequest, len(rawMessages)) - - for index, rawMessage := range rawMessages { - fsr, err := unmarshalBasicFeatureSupportRequest(*rawMessage) - if err != nil { - return nil, err - } - fsrArray[index] = fsr - } - return fsrArray, nil -} - -// MarshalJSON is the custom marshaler for FeatureSupportRequest. -func (fsr FeatureSupportRequest) MarshalJSON() ([]byte, error) { - fsr.FeatureType = FeatureTypeFeatureSupportRequest - objectMap := make(map[string]interface{}) - if fsr.FeatureType != "" { - objectMap["featureType"] = fsr.FeatureType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupGoalFeatureSupportRequest is the BasicFeatureSupportRequest implementation for FeatureSupportRequest. -func (fsr FeatureSupportRequest) AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) { - return nil, false -} - -// AsAzureVMResourceFeatureSupportRequest is the BasicFeatureSupportRequest implementation for FeatureSupportRequest. -func (fsr FeatureSupportRequest) AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) { - return nil, false -} - -// AsFeatureSupportRequest is the BasicFeatureSupportRequest implementation for FeatureSupportRequest. -func (fsr FeatureSupportRequest) AsFeatureSupportRequest() (*FeatureSupportRequest, bool) { - return &fsr, true -} - -// AsBasicFeatureSupportRequest is the BasicFeatureSupportRequest implementation for FeatureSupportRequest. -func (fsr FeatureSupportRequest) AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) { - return &fsr, true -} - -// GenericContainer base class for generic container of backup items -type GenericContainer struct { - // FabricName - Name of the container's fabric - FabricName *string `json:"fabricName,omitempty"` - // ExtendedInformation - Extended information (not returned in List container API calls) - ExtendedInformation *GenericContainerExtendedInfo `json:"extendedInformation,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for GenericContainer. -func (gc GenericContainer) MarshalJSON() ([]byte, error) { - gc.ContainerType = ContainerTypeGenericContainer1 - objectMap := make(map[string]interface{}) - if gc.FabricName != nil { - objectMap["fabricName"] = gc.FabricName - } - if gc.ExtendedInformation != nil { - objectMap["extendedInformation"] = gc.ExtendedInformation - } - if gc.FriendlyName != nil { - objectMap["friendlyName"] = gc.FriendlyName - } - if gc.BackupManagementType != "" { - objectMap["backupManagementType"] = gc.BackupManagementType - } - if gc.RegistrationStatus != nil { - objectMap["registrationStatus"] = gc.RegistrationStatus - } - if gc.HealthStatus != nil { - objectMap["healthStatus"] = gc.HealthStatus - } - if gc.ContainerType != "" { - objectMap["containerType"] = gc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsGenericContainer() (*GenericContainer, bool) { - return &gc, true -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false -} - -// AsMabContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. -func (gc GenericContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &gc, true -} - -// GenericContainerExtendedInfo container extended information -type GenericContainerExtendedInfo struct { - // RawCertData - Public key of container cert - RawCertData *string `json:"rawCertData,omitempty"` - // ContainerIdentityInfo - Container identity information - ContainerIdentityInfo *ContainerIdentityInfo `json:"containerIdentityInfo,omitempty"` - // ServiceEndpoints - Azure Backup Service Endpoints for the container - ServiceEndpoints map[string]*string `json:"serviceEndpoints"` -} - -// MarshalJSON is the custom marshaler for GenericContainerExtendedInfo. -func (gcei GenericContainerExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gcei.RawCertData != nil { - objectMap["rawCertData"] = gcei.RawCertData - } - if gcei.ContainerIdentityInfo != nil { - objectMap["containerIdentityInfo"] = gcei.ContainerIdentityInfo - } - if gcei.ServiceEndpoints != nil { - objectMap["serviceEndpoints"] = gcei.ServiceEndpoints - } - return json.Marshal(objectMap) -} - -// GenericProtectedItem base class for backup items. -type GenericProtectedItem struct { - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // PolicyState - Indicates consistency of policy object and policy applied to this backup item. - PolicyState *string `json:"policyState,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' - ProtectionState ProtectionState `json:"protectionState,omitempty"` - // ProtectedItemID - Data Plane Service ID of the protected item. - ProtectedItemID *int64 `json:"protectedItemId,omitempty"` - // SourceAssociations - Loosely coupled (type, value) associations (example - parent of a protected item) - SourceAssociations map[string]*string `json:"sourceAssociations"` - // FabricName - Name of this backup item's fabric. - FabricName *string `json:"fabricName,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for GenericProtectedItem. -func (gpi GenericProtectedItem) MarshalJSON() ([]byte, error) { - gpi.ProtectedItemType = ProtectedItemTypeGenericProtectedItem - objectMap := make(map[string]interface{}) - if gpi.FriendlyName != nil { - objectMap["friendlyName"] = gpi.FriendlyName - } - if gpi.PolicyState != nil { - objectMap["policyState"] = gpi.PolicyState - } - if gpi.ProtectionState != "" { - objectMap["protectionState"] = gpi.ProtectionState - } - if gpi.ProtectedItemID != nil { - objectMap["protectedItemId"] = gpi.ProtectedItemID - } - if gpi.SourceAssociations != nil { - objectMap["sourceAssociations"] = gpi.SourceAssociations - } - if gpi.FabricName != nil { - objectMap["fabricName"] = gpi.FabricName - } - if gpi.BackupManagementType != "" { - objectMap["backupManagementType"] = gpi.BackupManagementType - } - if gpi.WorkloadType != "" { - objectMap["workloadType"] = gpi.WorkloadType - } - if gpi.ContainerName != nil { - objectMap["containerName"] = gpi.ContainerName - } - if gpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = gpi.SourceResourceID - } - if gpi.PolicyID != nil { - objectMap["policyId"] = gpi.PolicyID - } - if gpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = gpi.LastRecoveryPoint - } - if gpi.BackupSetName != nil { - objectMap["backupSetName"] = gpi.BackupSetName - } - if gpi.CreateMode != "" { - objectMap["createMode"] = gpi.CreateMode - } - if gpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = gpi.DeferredDeleteTimeInUTC - } - if gpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = gpi.IsScheduledForDeferredDelete - } - if gpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = gpi.DeferredDeleteTimeRemaining - } - if gpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = gpi.IsDeferredDeleteScheduleUpcoming - } - if gpi.IsRehydrate != nil { - objectMap["isRehydrate"] = gpi.IsRehydrate - } - if gpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = gpi.ProtectedItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return nil, false -} - -// AsDPMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return nil, false -} - -// AsGenericProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return &gpi, true -} - -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return nil, false -} - -// AsProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return nil, false -} - -// AsBasicProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. -func (gpi GenericProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &gpi, true -} - -// GenericProtectionPolicy azure VM (Mercury) workload-specific backup policy. -type GenericProtectionPolicy struct { - // SubProtectionPolicy - List of sub-protection policies which includes schedule and retention - SubProtectionPolicy *[]SubProtectionPolicy `json:"subProtectionPolicy,omitempty"` - // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". - TimeZone *string `json:"timeZone,omitempty"` - // FabricName - Name of this policy's fabric. - FabricName *string `json:"fabricName,omitempty"` - // ProtectedItemsCount - Number of items associated with this policy. - ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' - BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` -} - -// MarshalJSON is the custom marshaler for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) MarshalJSON() ([]byte, error) { - gpp.BackupManagementType = BackupManagementTypeGenericProtectionPolicy - objectMap := make(map[string]interface{}) - if gpp.SubProtectionPolicy != nil { - objectMap["subProtectionPolicy"] = gpp.SubProtectionPolicy - } - if gpp.TimeZone != nil { - objectMap["timeZone"] = gpp.TimeZone - } - if gpp.FabricName != nil { - objectMap["fabricName"] = gpp.FabricName - } - if gpp.ProtectedItemsCount != nil { - objectMap["protectedItemsCount"] = gpp.ProtectedItemsCount - } - if gpp.BackupManagementType != "" { - objectMap["backupManagementType"] = gpp.BackupManagementType - } - return json.Marshal(objectMap) -} - -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { - return nil, false -} - -// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { - return nil, false -} - -// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { - return nil, false -} - -// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { - return &gpp, true -} - -// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { - return nil, false -} - -// AsProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { - return nil, false -} - -// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. -func (gpp GenericProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { - return &gpp, true -} - -// GenericRecoveryPoint generic backup copy. -type GenericRecoveryPoint struct { - // FriendlyName - Friendly name of the backup copy. - FriendlyName *string `json:"friendlyName,omitempty"` - // RecoveryPointType - Type of the backup copy. - RecoveryPointType *string `json:"recoveryPointType,omitempty"` - // RecoveryPointTime - Time at which this backup copy was created. - RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` - // RecoveryPointAdditionalInfo - Additional information associated with this backup copy. - RecoveryPointAdditionalInfo *string `json:"recoveryPointAdditionalInfo,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) MarshalJSON() ([]byte, error) { - grp.ObjectType = ObjectTypeGenericRecoveryPoint - objectMap := make(map[string]interface{}) - if grp.FriendlyName != nil { - objectMap["friendlyName"] = grp.FriendlyName - } - if grp.RecoveryPointType != nil { - objectMap["recoveryPointType"] = grp.RecoveryPointType - } - if grp.RecoveryPointTime != nil { - objectMap["recoveryPointTime"] = grp.RecoveryPointTime - } - if grp.RecoveryPointAdditionalInfo != nil { - objectMap["recoveryPointAdditionalInfo"] = grp.RecoveryPointAdditionalInfo - } - if grp.ObjectType != "" { - objectMap["objectType"] = grp.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { - return &grp, true -} - -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return nil, false -} - -// AsRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return nil, false -} - -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. -func (grp GenericRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &grp, true -} - -// GetProtectedItemQueryObject filters to list backup items. -type GetProtectedItemQueryObject struct { - // Expand - Specifies if the additional information should be provided for this item. - Expand *string `json:"expand,omitempty"` -} - -// IaasVMBackupRequest iaaS VM workload-specific backup request. -type IaasVMBackupRequest struct { - // RecoveryPointExpiryTimeInUTC - Backup copy will expire after the time specified (UTC). - RecoveryPointExpiryTimeInUTC *date.Time `json:"recoveryPointExpiryTimeInUTC,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' - ObjectType ObjectTypeBasicRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for IaasVMBackupRequest. -func (ivbr IaasVMBackupRequest) MarshalJSON() ([]byte, error) { - ivbr.ObjectType = ObjectTypeIaasVMBackupRequest - objectMap := make(map[string]interface{}) - if ivbr.RecoveryPointExpiryTimeInUTC != nil { - objectMap["recoveryPointExpiryTimeInUTC"] = ivbr.RecoveryPointExpiryTimeInUTC - } - if ivbr.ObjectType != "" { - objectMap["objectType"] = ivbr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareBackupRequest is the BasicRequest implementation for IaasVMBackupRequest. -func (ivbr IaasVMBackupRequest) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { - return nil, false -} - -// AsAzureWorkloadBackupRequest is the BasicRequest implementation for IaasVMBackupRequest. -func (ivbr IaasVMBackupRequest) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { - return nil, false -} - -// AsIaasVMBackupRequest is the BasicRequest implementation for IaasVMBackupRequest. -func (ivbr IaasVMBackupRequest) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { - return &ivbr, true -} - -// AsRequest is the BasicRequest implementation for IaasVMBackupRequest. -func (ivbr IaasVMBackupRequest) AsRequest() (*Request, bool) { - return nil, false -} - -// AsBasicRequest is the BasicRequest implementation for IaasVMBackupRequest. -func (ivbr IaasVMBackupRequest) AsBasicRequest() (BasicRequest, bool) { - return &ivbr, true -} - -// BasicIaaSVMContainer iaaS VM workload-specific container. -type BasicIaaSVMContainer interface { - AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) - AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) - AsIaaSVMContainer() (*IaaSVMContainer, bool) -} - -// IaaSVMContainer iaaS VM workload-specific container. -type IaaSVMContainer struct { - // VirtualMachineID - Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // VirtualMachineVersion - Specifies whether the container represents a Classic or an Azure Resource Manager VM. - VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` - // ResourceGroup - Resource group name of Recovery Services Vault. - ResourceGroup *string `json:"resourceGroup,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -func unmarshalBasicIaaSVMContainer(body []byte) (BasicIaaSVMContainer, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["containerType"] { - case string(ContainerTypeMicrosoftClassicComputevirtualMachines): - var aisccvc AzureIaaSClassicComputeVMContainer - err := json.Unmarshal(body, &aisccvc) - return aisccvc, err - case string(ContainerTypeMicrosoftComputevirtualMachines): - var aiscvc AzureIaaSComputeVMContainer - err := json.Unmarshal(body, &aiscvc) - return aiscvc, err - default: - var isc IaaSVMContainer - err := json.Unmarshal(body, &isc) - return isc, err - } -} -func unmarshalBasicIaaSVMContainerArray(body []byte) ([]BasicIaaSVMContainer, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - iscArray := make([]BasicIaaSVMContainer, len(rawMessages)) - - for index, rawMessage := range rawMessages { - isc, err := unmarshalBasicIaaSVMContainer(*rawMessage) - if err != nil { - return nil, err - } - iscArray[index] = isc - } - return iscArray, nil -} - -// MarshalJSON is the custom marshaler for IaaSVMContainer. -func (isc IaaSVMContainer) MarshalJSON() ([]byte, error) { - isc.ContainerType = ContainerTypeIaaSVMContainer - objectMap := make(map[string]interface{}) - if isc.VirtualMachineID != nil { - objectMap["virtualMachineId"] = isc.VirtualMachineID - } - if isc.VirtualMachineVersion != nil { - objectMap["virtualMachineVersion"] = isc.VirtualMachineVersion - } - if isc.ResourceGroup != nil { - objectMap["resourceGroup"] = isc.ResourceGroup - } - if isc.FriendlyName != nil { - objectMap["friendlyName"] = isc.FriendlyName - } - if isc.BackupManagementType != "" { - objectMap["backupManagementType"] = isc.BackupManagementType - } - if isc.RegistrationStatus != nil { - objectMap["registrationStatus"] = isc.RegistrationStatus - } - if isc.HealthStatus != nil { - objectMap["healthStatus"] = isc.HealthStatus - } - if isc.ContainerType != "" { - objectMap["containerType"] = isc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return &isc, true -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return &isc, true -} - -// AsMabContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. -func (isc IaaSVMContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &isc, true -} - -// IaasVMILRRegistrationRequest restore files/folders from a backup copy of IaaS VM. -type IaasVMILRRegistrationRequest struct { - // RecoveryPointID - ID of the IaaS VM backup copy from where the files/folders have to be restored. - RecoveryPointID *string `json:"recoveryPointId,omitempty"` - // VirtualMachineID - Fully qualified ARM ID of the virtual machine whose the files / folders have to be restored. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // InitiatorName - iSCSI initiator name. - InitiatorName *string `json:"initiatorName,omitempty"` - // RenewExistingRegistration - Whether to renew existing registration with the iSCSI server. - RenewExistingRegistration *bool `json:"renewExistingRegistration,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeAzureFileShareProvisionILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest' - ObjectType ObjectTypeBasicILRRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for IaasVMILRRegistrationRequest. -func (ivrr IaasVMILRRegistrationRequest) MarshalJSON() ([]byte, error) { - ivrr.ObjectType = ObjectTypeIaasVMILRRegistrationRequest - objectMap := make(map[string]interface{}) - if ivrr.RecoveryPointID != nil { - objectMap["recoveryPointId"] = ivrr.RecoveryPointID - } - if ivrr.VirtualMachineID != nil { - objectMap["virtualMachineId"] = ivrr.VirtualMachineID - } - if ivrr.InitiatorName != nil { - objectMap["initiatorName"] = ivrr.InitiatorName - } - if ivrr.RenewExistingRegistration != nil { - objectMap["renewExistingRegistration"] = ivrr.RenewExistingRegistration - } - if ivrr.ObjectType != "" { - objectMap["objectType"] = ivrr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProvisionILRRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. -func (ivrr IaasVMILRRegistrationRequest) AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) { - return nil, false -} - -// AsIaasVMILRRegistrationRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. -func (ivrr IaasVMILRRegistrationRequest) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) { - return &ivrr, true -} - -// AsILRRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. -func (ivrr IaasVMILRRegistrationRequest) AsILRRequest() (*ILRRequest, bool) { - return nil, false -} - -// AsBasicILRRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. -func (ivrr IaasVMILRRegistrationRequest) AsBasicILRRequest() (BasicILRRequest, bool) { - return &ivrr, true -} - -// BasicIaaSVMProtectableItem iaaS VM workload-specific backup item. -type BasicIaaSVMProtectableItem interface { - AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) - AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) - AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) -} - -// IaaSVMProtectableItem iaaS VM workload-specific backup item. -type IaaSVMProtectableItem struct { - // VirtualMachineID - Fully qualified ARM ID of the virtual machine. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` -} - -func unmarshalBasicIaaSVMProtectableItem(body []byte) (BasicIaaSVMProtectableItem, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["protectableItemType"] { - case string(ProtectableItemTypeMicrosoftClassicComputevirtualMachines): - var aisccvpi AzureIaaSClassicComputeVMProtectableItem - err := json.Unmarshal(body, &aisccvpi) - return aisccvpi, err - case string(ProtectableItemTypeMicrosoftComputevirtualMachines): - var aiscvpi AzureIaaSComputeVMProtectableItem - err := json.Unmarshal(body, &aiscvpi) - return aiscvpi, err - default: - var ispi IaaSVMProtectableItem - err := json.Unmarshal(body, &ispi) - return ispi, err - } -} -func unmarshalBasicIaaSVMProtectableItemArray(body []byte) ([]BasicIaaSVMProtectableItem, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - ispiArray := make([]BasicIaaSVMProtectableItem, len(rawMessages)) - - for index, rawMessage := range rawMessages { - ispi, err := unmarshalBasicIaaSVMProtectableItem(*rawMessage) - if err != nil { - return nil, err - } - ispiArray[index] = ispi - } - return ispiArray, nil -} - -// MarshalJSON is the custom marshaler for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) MarshalJSON() ([]byte, error) { - ispi.ProtectableItemType = ProtectableItemTypeIaaSVMProtectableItem - objectMap := make(map[string]interface{}) - if ispi.VirtualMachineID != nil { - objectMap["virtualMachineId"] = ispi.VirtualMachineID - } - if ispi.BackupManagementType != nil { - objectMap["backupManagementType"] = ispi.BackupManagementType - } - if ispi.WorkloadType != nil { - objectMap["workloadType"] = ispi.WorkloadType - } - if ispi.FriendlyName != nil { - objectMap["friendlyName"] = ispi.FriendlyName - } - if ispi.ProtectionState != "" { - objectMap["protectionState"] = ispi.ProtectionState - } - if ispi.ProtectableItemType != "" { - objectMap["protectableItemType"] = ispi.ProtectableItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false -} - -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return &ispi, true -} - -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return &ispi, true -} - -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. -func (ispi IaaSVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &ispi, true -} - -// IaasVMRecoveryPoint iaaS VM workload specific backup copy. -type IaasVMRecoveryPoint struct { - // RecoveryPointType - READ-ONLY; Type of the backup copy. - RecoveryPointType *string `json:"recoveryPointType,omitempty"` - // RecoveryPointTime - READ-ONLY; Time at which this backup copy was created. - RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` - // RecoveryPointAdditionalInfo - READ-ONLY; Additional information associated with this backup copy. - RecoveryPointAdditionalInfo *string `json:"recoveryPointAdditionalInfo,omitempty"` - // SourceVMStorageType - READ-ONLY; Storage type of the VM whose backup copy is created. - SourceVMStorageType *string `json:"sourceVMStorageType,omitempty"` - // IsSourceVMEncrypted - READ-ONLY; Identifies whether the VM was encrypted when the backup copy is created. - IsSourceVMEncrypted *bool `json:"isSourceVMEncrypted,omitempty"` - // KeyAndSecret - Required details for recovering an encrypted VM. Applicable only when IsSourceVMEncrypted is true. - KeyAndSecret *KeyAndSecretDetails `json:"keyAndSecret,omitempty"` - // IsInstantIlrSessionActive - Is the session to recover items from this backup copy still active. - IsInstantIlrSessionActive *bool `json:"isInstantIlrSessionActive,omitempty"` - // RecoveryPointTierDetails - Recovery point tier information. - RecoveryPointTierDetails *[]RecoveryPointTierInformation `json:"recoveryPointTierDetails,omitempty"` - // IsManagedVirtualMachine - Whether VM is with Managed Disks - IsManagedVirtualMachine *bool `json:"isManagedVirtualMachine,omitempty"` - // VirtualMachineSize - Virtual Machine Size - VirtualMachineSize *string `json:"virtualMachineSize,omitempty"` - // OriginalStorageAccountOption - Original Storage Account Option - OriginalStorageAccountOption *bool `json:"originalStorageAccountOption,omitempty"` - // OsType - OS type - OsType *string `json:"osType,omitempty"` - // RecoveryPointDiskConfiguration - Disk configuration - RecoveryPointDiskConfiguration *RecoveryPointDiskConfiguration `json:"recoveryPointDiskConfiguration,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) MarshalJSON() ([]byte, error) { - ivrp.ObjectType = ObjectTypeIaasVMRecoveryPoint - objectMap := make(map[string]interface{}) - if ivrp.KeyAndSecret != nil { - objectMap["keyAndSecret"] = ivrp.KeyAndSecret - } - if ivrp.IsInstantIlrSessionActive != nil { - objectMap["isInstantIlrSessionActive"] = ivrp.IsInstantIlrSessionActive - } - if ivrp.RecoveryPointTierDetails != nil { - objectMap["recoveryPointTierDetails"] = ivrp.RecoveryPointTierDetails - } - if ivrp.IsManagedVirtualMachine != nil { - objectMap["isManagedVirtualMachine"] = ivrp.IsManagedVirtualMachine - } - if ivrp.VirtualMachineSize != nil { - objectMap["virtualMachineSize"] = ivrp.VirtualMachineSize - } - if ivrp.OriginalStorageAccountOption != nil { - objectMap["originalStorageAccountOption"] = ivrp.OriginalStorageAccountOption - } - if ivrp.OsType != nil { - objectMap["osType"] = ivrp.OsType - } - if ivrp.RecoveryPointDiskConfiguration != nil { - objectMap["recoveryPointDiskConfiguration"] = ivrp.RecoveryPointDiskConfiguration - } - if ivrp.ObjectType != "" { - objectMap["objectType"] = ivrp.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { - return nil, false -} - -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return &ivrp, true -} - -// AsRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return nil, false -} - -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. -func (ivrp IaasVMRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &ivrp, true -} - -// IaasVMRestoreRequest iaaS VM workload-specific restore. -type IaasVMRestoreRequest struct { - // RecoveryPointID - ID of the backup copy to be recovered. - RecoveryPointID *string `json:"recoveryPointId,omitempty"` - // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' - RecoveryType RecoveryType `json:"recoveryType,omitempty"` - // SourceResourceID - Fully qualified ARM ID of the VM which is being recovered. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // TargetVirtualMachineID - This is the complete ARM Id of the VM that will be created. - // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} - TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` - // TargetResourceGroupID - This is the ARM Id of the resource group that you want to create for this Virtual machine and other artifacts. - // For e.g. /subscriptions/{subId}/resourcegroups/{rg} - TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` - // StorageAccountID - Fully qualified ARM ID of the storage account to which the VM has to be restored. - StorageAccountID *string `json:"storageAccountId,omitempty"` - // VirtualNetworkID - This is the virtual network Id of the vnet that will be attached to the virtual machine. - // User will be validated for join action permissions in the linked access. - VirtualNetworkID *string `json:"virtualNetworkId,omitempty"` - // SubnetID - Subnet ID, is the subnet ID associated with the to be restored VM. For Classic VMs it would be - // {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager VMs it would be ARM resource ID used to represent - // the subnet. - SubnetID *string `json:"subnetId,omitempty"` - // TargetDomainNameID - Fully qualified ARM ID of the domain name to be associated to the VM being restored. This applies only to Classic - // Virtual Machines. - TargetDomainNameID *string `json:"targetDomainNameId,omitempty"` - // Region - Region in which the virtual machine is restored. - Region *string `json:"region,omitempty"` - // AffinityGroup - Affinity group associated to VM to be restored. Used only for Classic Compute Virtual Machines. - AffinityGroup *string `json:"affinityGroup,omitempty"` - // CreateNewCloudService - Should a new cloud service be created while restoring the VM. If this is false, VM will be restored to the same - // cloud service as it was at the time of backup. - CreateNewCloudService *bool `json:"createNewCloudService,omitempty"` - // OriginalStorageAccountOption - Original Storage Account Option - OriginalStorageAccountOption *bool `json:"originalStorageAccountOption,omitempty"` - // EncryptionDetails - Details needed if the VM was encrypted at the time of backup. - EncryptionDetails *EncryptionDetails `json:"encryptionDetails,omitempty"` - // RestoreDiskLunList - List of Disk LUNs for partial restore - RestoreDiskLunList *[]int32 `json:"restoreDiskLunList,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) MarshalJSON() ([]byte, error) { - ivrr.ObjectType = ObjectTypeIaasVMRestoreRequest - objectMap := make(map[string]interface{}) - if ivrr.RecoveryPointID != nil { - objectMap["recoveryPointId"] = ivrr.RecoveryPointID - } - if ivrr.RecoveryType != "" { - objectMap["recoveryType"] = ivrr.RecoveryType - } - if ivrr.SourceResourceID != nil { - objectMap["sourceResourceId"] = ivrr.SourceResourceID - } - if ivrr.TargetVirtualMachineID != nil { - objectMap["targetVirtualMachineId"] = ivrr.TargetVirtualMachineID - } - if ivrr.TargetResourceGroupID != nil { - objectMap["targetResourceGroupId"] = ivrr.TargetResourceGroupID - } - if ivrr.StorageAccountID != nil { - objectMap["storageAccountId"] = ivrr.StorageAccountID - } - if ivrr.VirtualNetworkID != nil { - objectMap["virtualNetworkId"] = ivrr.VirtualNetworkID - } - if ivrr.SubnetID != nil { - objectMap["subnetId"] = ivrr.SubnetID - } - if ivrr.TargetDomainNameID != nil { - objectMap["targetDomainNameId"] = ivrr.TargetDomainNameID - } - if ivrr.Region != nil { - objectMap["region"] = ivrr.Region - } - if ivrr.AffinityGroup != nil { - objectMap["affinityGroup"] = ivrr.AffinityGroup - } - if ivrr.CreateNewCloudService != nil { - objectMap["createNewCloudService"] = ivrr.CreateNewCloudService - } - if ivrr.OriginalStorageAccountOption != nil { - objectMap["originalStorageAccountOption"] = ivrr.OriginalStorageAccountOption - } - if ivrr.EncryptionDetails != nil { - objectMap["encryptionDetails"] = ivrr.EncryptionDetails - } - if ivrr.RestoreDiskLunList != nil { - objectMap["restoreDiskLunList"] = ivrr.RestoreDiskLunList - } - if ivrr.ObjectType != "" { - objectMap["objectType"] = ivrr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { - return &ivrr, true -} - -// AsRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return nil, false -} - -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. -func (ivrr IaasVMRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &ivrr, true -} - -// BasicILRRequest parameters to Provision ILR API. -type BasicILRRequest interface { - AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) - AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) - AsILRRequest() (*ILRRequest, bool) -} - -// ILRRequest parameters to Provision ILR API. -type ILRRequest struct { - // ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeAzureFileShareProvisionILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest' - ObjectType ObjectTypeBasicILRRequest `json:"objectType,omitempty"` -} - -func unmarshalBasicILRRequest(body []byte) (BasicILRRequest, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeAzureFileShareProvisionILRRequest): - var afspir AzureFileShareProvisionILRRequest - err := json.Unmarshal(body, &afspir) - return afspir, err - case string(ObjectTypeIaasVMILRRegistrationRequest): - var ivrr IaasVMILRRegistrationRequest - err := json.Unmarshal(body, &ivrr) - return ivrr, err - default: - var ir ILRRequest - err := json.Unmarshal(body, &ir) - return ir, err - } -} -func unmarshalBasicILRRequestArray(body []byte) ([]BasicILRRequest, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - irArray := make([]BasicILRRequest, len(rawMessages)) - - for index, rawMessage := range rawMessages { - ir, err := unmarshalBasicILRRequest(*rawMessage) - if err != nil { - return nil, err - } - irArray[index] = ir - } - return irArray, nil -} - -// MarshalJSON is the custom marshaler for ILRRequest. -func (ir ILRRequest) MarshalJSON() ([]byte, error) { - ir.ObjectType = ObjectTypeILRRequest - objectMap := make(map[string]interface{}) - if ir.ObjectType != "" { - objectMap["objectType"] = ir.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareProvisionILRRequest is the BasicILRRequest implementation for ILRRequest. -func (ir ILRRequest) AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) { - return nil, false -} - -// AsIaasVMILRRegistrationRequest is the BasicILRRequest implementation for ILRRequest. -func (ir ILRRequest) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) { - return nil, false -} - -// AsILRRequest is the BasicILRRequest implementation for ILRRequest. -func (ir ILRRequest) AsILRRequest() (*ILRRequest, bool) { - return &ir, true -} - -// AsBasicILRRequest is the BasicILRRequest implementation for ILRRequest. -func (ir ILRRequest) AsBasicILRRequest() (BasicILRRequest, bool) { - return &ir, true -} - -// ILRRequestResource parameters to Provision ILR API. -type ILRRequestResource struct { - // Properties - ILRRequestResource properties - Properties BasicILRRequest `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ILRRequestResource. -func (irr ILRRequestResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = irr.Properties - if irr.Location != nil { - objectMap["location"] = irr.Location - } - if irr.Tags != nil { - objectMap["tags"] = irr.Tags - } - if irr.ETag != nil { - objectMap["eTag"] = irr.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ILRRequestResource struct. -func (irr *ILRRequestResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicILRRequest(*v) - if err != nil { - return err - } - irr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - irr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - irr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - irr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - irr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - irr.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - irr.ETag = &eTag - } - } - } - - return nil -} - -// InquiryInfo details about inquired protectable items under a given container. -type InquiryInfo struct { - // Status - Inquiry Status for this container such as - // InProgress | Failed | Succeeded - Status *string `json:"status,omitempty"` - // ErrorDetail - Error Details if the Status is non-success. - ErrorDetail *ErrorDetail `json:"errorDetail,omitempty"` - // InquiryDetails - Inquiry Details which will have workload specific details. - // For e.g. - For SQL and oracle this will contain different details. - InquiryDetails *[]WorkloadInquiryDetails `json:"inquiryDetails,omitempty"` -} - -// InquiryValidation validation for inquired protectable items under a given container. -type InquiryValidation struct { - // Status - Status for the Inquiry Validation. - Status *string `json:"status,omitempty"` - // ErrorDetail - Error Detail in case the status is non-success. - ErrorDetail *ErrorDetail `json:"errorDetail,omitempty"` - // AdditionalDetail - READ-ONLY; Error Additional Detail in case the status is non-success. - AdditionalDetail *string `json:"additionalDetail,omitempty"` -} - -// MarshalJSON is the custom marshaler for InquiryValidation. -func (iv InquiryValidation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if iv.Status != nil { - objectMap["status"] = iv.Status - } - if iv.ErrorDetail != nil { - objectMap["errorDetail"] = iv.ErrorDetail - } - return json.Marshal(objectMap) -} - -// InstantItemRecoveryTarget target details for file / folder restore. -type InstantItemRecoveryTarget struct { - // ClientScripts - List of client scripts. - ClientScripts *[]ClientScriptForConnect `json:"clientScripts,omitempty"` -} - -// InstantRPAdditionalDetails ... -type InstantRPAdditionalDetails struct { - AzureBackupRGNamePrefix *string `json:"azureBackupRGNamePrefix,omitempty"` - AzureBackupRGNameSuffix *string `json:"azureBackupRGNameSuffix,omitempty"` -} - -// BasicJob defines workload agnostic properties for a job. -type BasicJob interface { - AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) - AsAzureStorageJob() (*AzureStorageJob, bool) - AsAzureWorkloadJob() (*AzureWorkloadJob, bool) - AsDpmJob() (*DpmJob, bool) - AsMabJob() (*MabJob, bool) - AsJob() (*Job, bool) -} - -// Job defines workload agnostic properties for a job. -type Job struct { - // EntityFriendlyName - Friendly name of the entity on which the current job is executing. - EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` - // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // Operation - The operation name. - Operation *string `json:"operation,omitempty"` - // Status - Job status. - Status *string `json:"status,omitempty"` - // StartTime - The start time. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time. - EndTime *date.Time `json:"endTime,omitempty"` - // ActivityID - ActivityId of job. - ActivityID *string `json:"activityId,omitempty"` - // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' - JobType JobType `json:"jobType,omitempty"` -} - -func unmarshalBasicJob(body []byte) (BasicJob, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["jobType"] { - case string(JobTypeAzureIaaSVMJob): - var aisj AzureIaaSVMJob - err := json.Unmarshal(body, &aisj) - return aisj, err - case string(JobTypeAzureStorageJob): - var asj AzureStorageJob - err := json.Unmarshal(body, &asj) - return asj, err - case string(JobTypeAzureWorkloadJob): - var awj AzureWorkloadJob - err := json.Unmarshal(body, &awj) - return awj, err - case string(JobTypeDpmJob): - var dj DpmJob - err := json.Unmarshal(body, &dj) - return dj, err - case string(JobTypeMabJob): - var mj MabJob - err := json.Unmarshal(body, &mj) - return mj, err - default: - var j Job - err := json.Unmarshal(body, &j) - return j, err - } -} -func unmarshalBasicJobArray(body []byte) ([]BasicJob, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - jArray := make([]BasicJob, len(rawMessages)) - - for index, rawMessage := range rawMessages { - j, err := unmarshalBasicJob(*rawMessage) - if err != nil { - return nil, err - } - jArray[index] = j - } - return jArray, nil -} - -// MarshalJSON is the custom marshaler for Job. -func (j Job) MarshalJSON() ([]byte, error) { - j.JobType = JobTypeJob - objectMap := make(map[string]interface{}) - if j.EntityFriendlyName != nil { - objectMap["entityFriendlyName"] = j.EntityFriendlyName - } - if j.BackupManagementType != "" { - objectMap["backupManagementType"] = j.BackupManagementType - } - if j.Operation != nil { - objectMap["operation"] = j.Operation - } - if j.Status != nil { - objectMap["status"] = j.Status - } - if j.StartTime != nil { - objectMap["startTime"] = j.StartTime - } - if j.EndTime != nil { - objectMap["endTime"] = j.EndTime - } - if j.ActivityID != nil { - objectMap["activityId"] = j.ActivityID - } - if j.JobType != "" { - objectMap["jobType"] = j.JobType - } - return json.Marshal(objectMap) -} - -// AsAzureIaaSVMJob is the BasicJob implementation for Job. -func (j Job) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { - return nil, false -} - -// AsAzureStorageJob is the BasicJob implementation for Job. -func (j Job) AsAzureStorageJob() (*AzureStorageJob, bool) { - return nil, false -} - -// AsAzureWorkloadJob is the BasicJob implementation for Job. -func (j Job) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { - return nil, false -} - -// AsDpmJob is the BasicJob implementation for Job. -func (j Job) AsDpmJob() (*DpmJob, bool) { - return nil, false -} - -// AsMabJob is the BasicJob implementation for Job. -func (j Job) AsMabJob() (*MabJob, bool) { - return nil, false -} - -// AsJob is the BasicJob implementation for Job. -func (j Job) AsJob() (*Job, bool) { - return &j, true -} - -// AsBasicJob is the BasicJob implementation for Job. -func (j Job) AsBasicJob() (BasicJob, bool) { - return &j, true -} - -// JobQueryObject filters to list the jobs. -type JobQueryObject struct { - // Status - Status of the job. Possible values include: 'JobStatusInvalid', 'JobStatusInProgress', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusCompletedWithWarnings', 'JobStatusCancelled', 'JobStatusCancelling' - Status JobStatus `json:"status,omitempty"` - // BackupManagementType - Type of backup management for the job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // Operation - Type of operation. Possible values include: 'JobOperationTypeInvalid', 'JobOperationTypeRegister', 'JobOperationTypeUnRegister', 'JobOperationTypeConfigureBackup', 'JobOperationTypeBackup', 'JobOperationTypeRestore', 'JobOperationTypeDisableBackup', 'JobOperationTypeDeleteBackupData', 'JobOperationTypeCrossRegionRestore', 'JobOperationTypeUndelete' - Operation JobOperationType `json:"operation,omitempty"` - // JobID - JobID represents the job uniquely. - JobID *string `json:"jobId,omitempty"` - // StartTime - Job has started at this time. Value is in UTC. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - Job has ended at this time. Value is in UTC. - EndTime *date.Time `json:"endTime,omitempty"` -} - -// JobResource defines workload agnostic properties for a job. -type JobResource struct { - autorest.Response `json:"-"` - // Properties - JobResource properties - Properties BasicJob `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for JobResource. -func (jr JobResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = jr.Properties - if jr.Location != nil { - objectMap["location"] = jr.Location - } - if jr.Tags != nil { - objectMap["tags"] = jr.Tags - } - if jr.ETag != nil { - objectMap["eTag"] = jr.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for JobResource struct. -func (jr *JobResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicJob(*v) - if err != nil { - return err - } - jr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - jr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - jr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - jr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - jr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - jr.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - jr.ETag = &eTag - } - } - } - - return nil -} - -// JobResourceList list of Job resources -type JobResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]JobResource `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"` -} - -// JobResourceListIterator provides access to a complete listing of JobResource values. -type JobResourceListIterator struct { - i int - page JobResourceListPage -} - -// NextWithContext 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 *JobResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *JobResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter JobResourceListIterator) 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 JobResourceListIterator) Response() JobResourceList { - 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 JobResourceListIterator) Value() JobResource { - if !iter.page.NotDone() { - return JobResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the JobResourceListIterator type. -func NewJobResourceListIterator(page JobResourceListPage) JobResourceListIterator { - return JobResourceListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (jrl JobResourceList) IsEmpty() bool { - return jrl.Value == nil || len(*jrl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (jrl JobResourceList) hasNextLink() bool { - return jrl.NextLink != nil && len(*jrl.NextLink) != 0 -} - -// jobResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (jrl JobResourceList) jobResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !jrl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(jrl.NextLink))) -} - -// JobResourceListPage contains a page of JobResource values. -type JobResourceListPage struct { - fn func(context.Context, JobResourceList) (JobResourceList, error) - jrl JobResourceList -} - -// NextWithContext 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 *JobResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JobResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.jrl) - if err != nil { - return err - } - page.jrl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *JobResourceListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page JobResourceListPage) NotDone() bool { - return !page.jrl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page JobResourceListPage) Response() JobResourceList { - return page.jrl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page JobResourceListPage) Values() []JobResource { - if page.jrl.IsEmpty() { - return nil - } - return *page.jrl.Value -} - -// Creates a new instance of the JobResourceListPage type. -func NewJobResourceListPage(cur JobResourceList, getNextPage func(context.Context, JobResourceList) (JobResourceList, error)) JobResourceListPage { - return JobResourceListPage{ - fn: getNextPage, - jrl: cur, - } -} - -// KEKDetails KEK is encryption key for BEK. -type KEKDetails struct { - // KeyURL - Key is KEK. - KeyURL *string `json:"keyUrl,omitempty"` - // KeyVaultID - Key Vault ID where this Key is stored. - KeyVaultID *string `json:"keyVaultId,omitempty"` - // KeyBackupData - KEK data. - KeyBackupData *string `json:"keyBackupData,omitempty"` -} - -// KeyAndSecretDetails BEK is bitlocker key. -// KEK is encryption key for BEK -// If the VM was encrypted then we will store following details : -// 1. Secret(BEK) - Url + Backup Data + vaultId. -// 2. Key(KEK) - Url + Backup Data + vaultId. -// 3. EncryptionMechanism -// BEK and KEK can potentially have different vault ids. -type KeyAndSecretDetails struct { - // KekDetails - KEK is encryption key for BEK. - KekDetails *KEKDetails `json:"kekDetails,omitempty"` - // BekDetails - BEK is bitlocker encryption key. - BekDetails *BEKDetails `json:"bekDetails,omitempty"` - // EncryptionMechanism - Encryption mechanism: None/ SinglePass/ DoublePass - EncryptionMechanism *string `json:"encryptionMechanism,omitempty"` -} - -// KPIResourceHealthDetails KPI Resource Health Details -type KPIResourceHealthDetails struct { - // ResourceHealthStatus - Resource Health Status. Possible values include: 'ResourceHealthStatusHealthy', 'ResourceHealthStatusTransientDegraded', 'ResourceHealthStatusPersistentDegraded', 'ResourceHealthStatusTransientUnhealthy', 'ResourceHealthStatusPersistentUnhealthy', 'ResourceHealthStatusInvalid' - ResourceHealthStatus ResourceHealthStatus `json:"resourceHealthStatus,omitempty"` - // ResourceHealthDetails - Resource Health Status - ResourceHealthDetails *[]ResourceHealthDetails `json:"resourceHealthDetails,omitempty"` -} - -// LogSchedulePolicy log policy schedule. -type LogSchedulePolicy struct { - // ScheduleFrequencyInMins - Frequency of the log schedule operation of this policy in minutes. - ScheduleFrequencyInMins *int32 `json:"scheduleFrequencyInMins,omitempty"` - // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' - SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` -} - -// MarshalJSON is the custom marshaler for LogSchedulePolicy. -func (lsp LogSchedulePolicy) MarshalJSON() ([]byte, error) { - lsp.SchedulePolicyType = SchedulePolicyTypeLogSchedulePolicy - objectMap := make(map[string]interface{}) - if lsp.ScheduleFrequencyInMins != nil { - objectMap["scheduleFrequencyInMins"] = lsp.ScheduleFrequencyInMins - } - if lsp.SchedulePolicyType != "" { - objectMap["schedulePolicyType"] = lsp.SchedulePolicyType - } - return json.Marshal(objectMap) -} - -// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. -func (lsp LogSchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { - return &lsp, true -} - -// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. -func (lsp LogSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { - return nil, false -} - -// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. -func (lsp LogSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { - return nil, false -} - -// AsSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. -func (lsp LogSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { - return nil, false -} - -// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. -func (lsp LogSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { - return &lsp, true -} - -// LongTermRetentionPolicy long term retention policy. -type LongTermRetentionPolicy struct { - // DailySchedule - Daily retention schedule of the protection policy. - DailySchedule *DailyRetentionSchedule `json:"dailySchedule,omitempty"` - // WeeklySchedule - Weekly retention schedule of the protection policy. - WeeklySchedule *WeeklyRetentionSchedule `json:"weeklySchedule,omitempty"` - // MonthlySchedule - Monthly retention schedule of the protection policy. - MonthlySchedule *MonthlyRetentionSchedule `json:"monthlySchedule,omitempty"` - // YearlySchedule - Yearly retention schedule of the protection policy. - YearlySchedule *YearlyRetentionSchedule `json:"yearlySchedule,omitempty"` - // RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy' - RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"` -} - -// MarshalJSON is the custom marshaler for LongTermRetentionPolicy. -func (ltrp LongTermRetentionPolicy) MarshalJSON() ([]byte, error) { - ltrp.RetentionPolicyType = RetentionPolicyTypeLongTermRetentionPolicy - objectMap := make(map[string]interface{}) - if ltrp.DailySchedule != nil { - objectMap["dailySchedule"] = ltrp.DailySchedule - } - if ltrp.WeeklySchedule != nil { - objectMap["weeklySchedule"] = ltrp.WeeklySchedule - } - if ltrp.MonthlySchedule != nil { - objectMap["monthlySchedule"] = ltrp.MonthlySchedule - } - if ltrp.YearlySchedule != nil { - objectMap["yearlySchedule"] = ltrp.YearlySchedule - } - if ltrp.RetentionPolicyType != "" { - objectMap["retentionPolicyType"] = ltrp.RetentionPolicyType - } - return json.Marshal(objectMap) -} - -// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. -func (ltrp LongTermRetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) { - return <rp, true -} - -// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. -func (ltrp LongTermRetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) { - return nil, false -} - -// AsRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. -func (ltrp LongTermRetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) { - return nil, false -} - -// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. -func (ltrp LongTermRetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) { - return <rp, true -} - -// LongTermSchedulePolicy long term policy schedule. -type LongTermSchedulePolicy struct { - // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' - SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` -} - -// MarshalJSON is the custom marshaler for LongTermSchedulePolicy. -func (ltsp LongTermSchedulePolicy) MarshalJSON() ([]byte, error) { - ltsp.SchedulePolicyType = SchedulePolicyTypeLongTermSchedulePolicy - objectMap := make(map[string]interface{}) - if ltsp.SchedulePolicyType != "" { - objectMap["schedulePolicyType"] = ltsp.SchedulePolicyType - } - return json.Marshal(objectMap) -} - -// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. -func (ltsp LongTermSchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { - return nil, false -} - -// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. -func (ltsp LongTermSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { - return <sp, true -} - -// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. -func (ltsp LongTermSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { - return nil, false -} - -// AsSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. -func (ltsp LongTermSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { - return nil, false -} - -// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. -func (ltsp LongTermSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { - return <sp, true -} - -// MabContainer container with items backed up using MAB backup engine. -type MabContainer struct { - // CanReRegister - Can the container be registered one more time. - CanReRegister *bool `json:"canReRegister,omitempty"` - // ContainerID - ContainerID represents the container. - ContainerID *int64 `json:"containerId,omitempty"` - // ProtectedItemCount - Number of items backed up in this container. - ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` - // AgentVersion - Agent version of this container. - AgentVersion *string `json:"agentVersion,omitempty"` - // ExtendedInfo - Additional information for this container - ExtendedInfo *MabContainerExtendedInfo `json:"extendedInfo,omitempty"` - // MabContainerHealthDetails - Health details on this mab container. - MabContainerHealthDetails *[]MABContainerHealthDetails `json:"mabContainerHealthDetails,omitempty"` - // ContainerHealthState - Health state of mab container. - ContainerHealthState *string `json:"containerHealthState,omitempty"` - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -// MarshalJSON is the custom marshaler for MabContainer. -func (mc MabContainer) MarshalJSON() ([]byte, error) { - mc.ContainerType = ContainerTypeWindows1 - objectMap := make(map[string]interface{}) - if mc.CanReRegister != nil { - objectMap["canReRegister"] = mc.CanReRegister - } - if mc.ContainerID != nil { - objectMap["containerId"] = mc.ContainerID - } - if mc.ProtectedItemCount != nil { - objectMap["protectedItemCount"] = mc.ProtectedItemCount - } - if mc.AgentVersion != nil { - objectMap["agentVersion"] = mc.AgentVersion - } - if mc.ExtendedInfo != nil { - objectMap["extendedInfo"] = mc.ExtendedInfo - } - if mc.MabContainerHealthDetails != nil { - objectMap["mabContainerHealthDetails"] = mc.MabContainerHealthDetails - } - if mc.ContainerHealthState != nil { - objectMap["containerHealthState"] = mc.ContainerHealthState - } - if mc.FriendlyName != nil { - objectMap["friendlyName"] = mc.FriendlyName - } - if mc.BackupManagementType != "" { - objectMap["backupManagementType"] = mc.BackupManagementType - } - if mc.RegistrationStatus != nil { - objectMap["registrationStatus"] = mc.RegistrationStatus - } - if mc.HealthStatus != nil { - objectMap["healthStatus"] = mc.HealthStatus - } - if mc.ContainerType != "" { - objectMap["containerType"] = mc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false -} - -// AsMabContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsMabContainer() (*MabContainer, bool) { - return &mc, true -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return nil, false -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for MabContainer. -func (mc MabContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &mc, true -} - -// MabContainerExtendedInfo additional information of the container. -type MabContainerExtendedInfo struct { - // LastRefreshedAt - Time stamp when this container was refreshed. - LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` - // BackupItemType - Type of backup items associated with this container. Possible values include: 'ItemTypeInvalid', 'ItemTypeVM', 'ItemTypeFileFolder', 'ItemTypeAzureSQLDb', 'ItemTypeSQLDB', 'ItemTypeExchange', 'ItemTypeSharepoint', 'ItemTypeVMwareVM', 'ItemTypeSystemState', 'ItemTypeClient', 'ItemTypeGenericDataSource', 'ItemTypeSQLDataBase', 'ItemTypeAzureFileShare', 'ItemTypeSAPHanaDatabase', 'ItemTypeSAPAseDatabase' - BackupItemType ItemType `json:"backupItemType,omitempty"` - // BackupItems - List of backup items associated with this container. - BackupItems *[]string `json:"backupItems,omitempty"` - // PolicyName - Backup policy associated with this container. - PolicyName *string `json:"policyName,omitempty"` - // LastBackupStatus - Latest backup status of this container. - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` -} - -// MABContainerHealthDetails MAB workload-specific Health Details. -type MABContainerHealthDetails struct { - // Code - Health Code - Code *int32 `json:"code,omitempty"` - // Title - Health Title - Title *string `json:"title,omitempty"` - // Message - Health Message - Message *string `json:"message,omitempty"` - // Recommendations - Health Recommended Actions - Recommendations *[]string `json:"recommendations,omitempty"` -} - -// MabErrorInfo MAB workload-specific error information. -type MabErrorInfo struct { - // ErrorString - READ-ONLY; Localized error string. - ErrorString *string `json:"errorString,omitempty"` - // Recommendations - READ-ONLY; List of localized recommendations. - Recommendations *[]string `json:"recommendations,omitempty"` -} - -// MarshalJSON is the custom marshaler for MabErrorInfo. -func (mei MabErrorInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// MabFileFolderProtectedItem MAB workload-specific backup item. -type MabFileFolderProtectedItem struct { - // FriendlyName - Friendly name of this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ComputerName - Name of the computer associated with this backup item. - ComputerName *string `json:"computerName,omitempty"` - // LastBackupStatus - Status of last backup operation. - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - // LastBackupTime - Timestamp of the last backup operation on this backup item. - LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` - // ProtectionState - Protected, ProtectionStopped, IRPending or ProtectionError - ProtectionState *string `json:"protectionState,omitempty"` - // DeferredDeleteSyncTimeInUTC - Sync time for deferred deletion in UTC - DeferredDeleteSyncTimeInUTC *int64 `json:"deferredDeleteSyncTimeInUTC,omitempty"` - // ExtendedInfo - Additional information with this backup item. - ExtendedInfo *MabFileFolderProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) MarshalJSON() ([]byte, error) { - mffpi.ProtectedItemType = ProtectedItemTypeMabFileFolderProtectedItem - objectMap := make(map[string]interface{}) - if mffpi.FriendlyName != nil { - objectMap["friendlyName"] = mffpi.FriendlyName - } - if mffpi.ComputerName != nil { - objectMap["computerName"] = mffpi.ComputerName - } - if mffpi.LastBackupStatus != nil { - objectMap["lastBackupStatus"] = mffpi.LastBackupStatus - } - if mffpi.LastBackupTime != nil { - objectMap["lastBackupTime"] = mffpi.LastBackupTime - } - if mffpi.ProtectionState != nil { - objectMap["protectionState"] = mffpi.ProtectionState - } - if mffpi.DeferredDeleteSyncTimeInUTC != nil { - objectMap["deferredDeleteSyncTimeInUTC"] = mffpi.DeferredDeleteSyncTimeInUTC - } - if mffpi.ExtendedInfo != nil { - objectMap["extendedInfo"] = mffpi.ExtendedInfo - } - if mffpi.BackupManagementType != "" { - objectMap["backupManagementType"] = mffpi.BackupManagementType - } - if mffpi.WorkloadType != "" { - objectMap["workloadType"] = mffpi.WorkloadType - } - if mffpi.ContainerName != nil { - objectMap["containerName"] = mffpi.ContainerName - } - if mffpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = mffpi.SourceResourceID - } - if mffpi.PolicyID != nil { - objectMap["policyId"] = mffpi.PolicyID - } - if mffpi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = mffpi.LastRecoveryPoint - } - if mffpi.BackupSetName != nil { - objectMap["backupSetName"] = mffpi.BackupSetName - } - if mffpi.CreateMode != "" { - objectMap["createMode"] = mffpi.CreateMode - } - if mffpi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = mffpi.DeferredDeleteTimeInUTC - } - if mffpi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = mffpi.IsScheduledForDeferredDelete - } - if mffpi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = mffpi.DeferredDeleteTimeRemaining - } - if mffpi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = mffpi.IsDeferredDeleteScheduleUpcoming - } - if mffpi.IsRehydrate != nil { - objectMap["isRehydrate"] = mffpi.IsRehydrate - } - if mffpi.ProtectedItemType != "" { - objectMap["protectedItemType"] = mffpi.ProtectedItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return nil, false -} - -// AsDPMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return nil, false -} - -// AsGenericProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return nil, false -} - -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return &mffpi, true -} - -// AsProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return nil, false -} - -// AsBasicProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. -func (mffpi MabFileFolderProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &mffpi, true -} - -// MabFileFolderProtectedItemExtendedInfo additional information on the backed up item. -type MabFileFolderProtectedItemExtendedInfo struct { - // LastRefreshedAt - Last time when the agent data synced to service. - LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` - // OldestRecoveryPoint - The oldest backup copy available. - OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` - // RecoveryPointCount - Number of backup copies associated with the backup item. - RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` -} - -// MabJob MAB workload-specific job. -type MabJob struct { - // Duration - Time taken by job to run. - Duration *string `json:"duration,omitempty"` - // ActionsInfo - The state/actions applicable on jobs like cancel/retry. - ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` - // MabServerName - Name of server protecting the DS. - MabServerName *string `json:"mabServerName,omitempty"` - // MabServerType - Server type of MAB container. Possible values include: 'MabServerTypeInvalid', 'MabServerTypeUnknown', 'MabServerTypeIaasVMContainer', 'MabServerTypeIaasVMServiceContainer', 'MabServerTypeDPMContainer', 'MabServerTypeAzureBackupServerContainer', 'MabServerTypeMABContainer', 'MabServerTypeCluster', 'MabServerTypeAzureSQLContainer', 'MabServerTypeWindows', 'MabServerTypeVCenter', 'MabServerTypeVMAppContainer', 'MabServerTypeSQLAGWorkLoadContainer', 'MabServerTypeStorageContainer', 'MabServerTypeGenericContainer' - MabServerType MabServerType `json:"mabServerType,omitempty"` - // WorkloadType - Workload type of backup item. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` - // ErrorDetails - The errors. - ErrorDetails *[]MabErrorInfo `json:"errorDetails,omitempty"` - // ExtendedInfo - Additional information on the job. - ExtendedInfo *MabJobExtendedInfo `json:"extendedInfo,omitempty"` - // EntityFriendlyName - Friendly name of the entity on which the current job is executing. - EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` - // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // Operation - The operation name. - Operation *string `json:"operation,omitempty"` - // Status - Job status. - Status *string `json:"status,omitempty"` - // StartTime - The start time. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time. - EndTime *date.Time `json:"endTime,omitempty"` - // ActivityID - ActivityId of job. - ActivityID *string `json:"activityId,omitempty"` - // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob' - JobType JobType `json:"jobType,omitempty"` -} - -// MarshalJSON is the custom marshaler for MabJob. -func (mj MabJob) MarshalJSON() ([]byte, error) { - mj.JobType = JobTypeMabJob - objectMap := make(map[string]interface{}) - if mj.Duration != nil { - objectMap["duration"] = mj.Duration - } - if mj.ActionsInfo != nil { - objectMap["actionsInfo"] = mj.ActionsInfo - } - if mj.MabServerName != nil { - objectMap["mabServerName"] = mj.MabServerName - } - if mj.MabServerType != "" { - objectMap["mabServerType"] = mj.MabServerType - } - if mj.WorkloadType != "" { - objectMap["workloadType"] = mj.WorkloadType - } - if mj.ErrorDetails != nil { - objectMap["errorDetails"] = mj.ErrorDetails - } - if mj.ExtendedInfo != nil { - objectMap["extendedInfo"] = mj.ExtendedInfo - } - if mj.EntityFriendlyName != nil { - objectMap["entityFriendlyName"] = mj.EntityFriendlyName - } - if mj.BackupManagementType != "" { - objectMap["backupManagementType"] = mj.BackupManagementType - } - if mj.Operation != nil { - objectMap["operation"] = mj.Operation - } - if mj.Status != nil { - objectMap["status"] = mj.Status - } - if mj.StartTime != nil { - objectMap["startTime"] = mj.StartTime - } - if mj.EndTime != nil { - objectMap["endTime"] = mj.EndTime - } - if mj.ActivityID != nil { - objectMap["activityId"] = mj.ActivityID - } - if mj.JobType != "" { - objectMap["jobType"] = mj.JobType - } - return json.Marshal(objectMap) -} - -// AsAzureIaaSVMJob is the BasicJob implementation for MabJob. -func (mj MabJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { - return nil, false -} - -// AsAzureStorageJob is the BasicJob implementation for MabJob. -func (mj MabJob) AsAzureStorageJob() (*AzureStorageJob, bool) { - return nil, false -} - -// AsAzureWorkloadJob is the BasicJob implementation for MabJob. -func (mj MabJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { - return nil, false -} - -// AsDpmJob is the BasicJob implementation for MabJob. -func (mj MabJob) AsDpmJob() (*DpmJob, bool) { - return nil, false -} - -// AsMabJob is the BasicJob implementation for MabJob. -func (mj MabJob) AsMabJob() (*MabJob, bool) { - return &mj, true -} - -// AsJob is the BasicJob implementation for MabJob. -func (mj MabJob) AsJob() (*Job, bool) { - return nil, false -} - -// AsBasicJob is the BasicJob implementation for MabJob. -func (mj MabJob) AsBasicJob() (BasicJob, bool) { - return &mj, true -} - -// MabJobExtendedInfo additional information for the MAB workload-specific job. -type MabJobExtendedInfo struct { - // TasksList - List of tasks for this job. - TasksList *[]MabJobTaskDetails `json:"tasksList,omitempty"` - // PropertyBag - The job properties. - PropertyBag map[string]*string `json:"propertyBag"` - // DynamicErrorMessage - Non localized error message specific to this job. - DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` -} - -// MarshalJSON is the custom marshaler for MabJobExtendedInfo. -func (mjei MabJobExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mjei.TasksList != nil { - objectMap["tasksList"] = mjei.TasksList - } - if mjei.PropertyBag != nil { - objectMap["propertyBag"] = mjei.PropertyBag - } - if mjei.DynamicErrorMessage != nil { - objectMap["dynamicErrorMessage"] = mjei.DynamicErrorMessage - } - return json.Marshal(objectMap) -} - -// MabJobTaskDetails MAB workload-specific job task details. -type MabJobTaskDetails struct { - // TaskID - The task display name. - TaskID *string `json:"taskId,omitempty"` - // StartTime - The start time. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time. - EndTime *date.Time `json:"endTime,omitempty"` - // Duration - Time elapsed for task. - Duration *string `json:"duration,omitempty"` - // Status - The status. - Status *string `json:"status,omitempty"` -} - -// MabProtectionPolicy mab container-specific backup policy. -type MabProtectionPolicy struct { - // SchedulePolicy - Backup schedule of backup policy. - SchedulePolicy BasicSchedulePolicy `json:"schedulePolicy,omitempty"` - // RetentionPolicy - Retention policy details. - RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` - // ProtectedItemsCount - Number of items associated with this policy. - ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' - BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` -} - -// MarshalJSON is the custom marshaler for MabProtectionPolicy. -func (mpp MabProtectionPolicy) MarshalJSON() ([]byte, error) { - mpp.BackupManagementType = BackupManagementTypeMAB - objectMap := make(map[string]interface{}) - objectMap["schedulePolicy"] = mpp.SchedulePolicy - objectMap["retentionPolicy"] = mpp.RetentionPolicy - if mpp.ProtectedItemsCount != nil { - objectMap["protectedItemsCount"] = mpp.ProtectedItemsCount - } - if mpp.BackupManagementType != "" { - objectMap["backupManagementType"] = mpp.BackupManagementType - } - return json.Marshal(objectMap) -} - -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { - return nil, false -} - -// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { - return nil, false -} - -// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { - return nil, false -} - -// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { - return nil, false -} - -// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { - return &mpp, true -} - -// AsProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { - return nil, false -} - -// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. -func (mpp MabProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { - return &mpp, true -} - -// UnmarshalJSON is the custom unmarshaler for MabProtectionPolicy struct. -func (mpp *MabProtectionPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "schedulePolicy": - if v != nil { - schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) - if err != nil { - return err - } - mpp.SchedulePolicy = schedulePolicy - } - case "retentionPolicy": - if v != nil { - retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) - if err != nil { - return err - } - mpp.RetentionPolicy = retentionPolicy - } - case "protectedItemsCount": - if v != nil { - var protectedItemsCount int32 - err = json.Unmarshal(*v, &protectedItemsCount) - if err != nil { - return err - } - mpp.ProtectedItemsCount = &protectedItemsCount - } - case "backupManagementType": - if v != nil { - var backupManagementType ManagementTypeBasicProtectionPolicy - err = json.Unmarshal(*v, &backupManagementType) - if err != nil { - return err - } - mpp.BackupManagementType = backupManagementType - } - } - } - - return nil -} - -// ManagementUsage backup management usages of a vault. -type ManagementUsage struct { - // Unit - Unit of the usage. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond' - Unit UsagesUnit `json:"unit,omitempty"` - // QuotaPeriod - Quota period of usage. - QuotaPeriod *string `json:"quotaPeriod,omitempty"` - // NextResetTime - Next reset time of usage. - NextResetTime *date.Time `json:"nextResetTime,omitempty"` - // CurrentValue - Current value of usage. - CurrentValue *int64 `json:"currentValue,omitempty"` - // Limit - Limit of usage. - Limit *int64 `json:"limit,omitempty"` - // Name - Name of usage. - Name *NameInfo `json:"name,omitempty"` -} - -// ManagementUsageList backup management usage for vault. -type ManagementUsageList struct { - autorest.Response `json:"-"` - // Value - The list of backup management usages for the given vault. - Value *[]ManagementUsage `json:"value,omitempty"` -} - -// MonthlyRetentionSchedule monthly retention schedule. -type MonthlyRetentionSchedule struct { - // RetentionScheduleFormatType - Retention schedule format type for monthly retention policy. Possible values include: 'RetentionScheduleFormatInvalid', 'RetentionScheduleFormatDaily', 'RetentionScheduleFormatWeekly' - RetentionScheduleFormatType RetentionScheduleFormat `json:"retentionScheduleFormatType,omitempty"` - // RetentionScheduleDaily - Daily retention format for monthly retention policy. - RetentionScheduleDaily *DailyRetentionFormat `json:"retentionScheduleDaily,omitempty"` - // RetentionScheduleWeekly - Weekly retention format for monthly retention policy. - RetentionScheduleWeekly *WeeklyRetentionFormat `json:"retentionScheduleWeekly,omitempty"` - // RetentionTimes - Retention times of retention policy. - RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` - // RetentionDuration - Retention duration of retention Policy. - RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` -} - -// NameInfo the name of usage. -type NameInfo struct { - // Value - Value of usage. - Value *string `json:"value,omitempty"` - // LocalizedValue - Localized value of usage. - LocalizedValue *string `json:"localizedValue,omitempty"` -} - -// OperationResultInfo operation result info. -type OperationResultInfo struct { - // JobList - List of jobs created by this operation. - JobList *[]string `json:"jobList,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeOperationResultInfoBase', 'ObjectTypeExportJobsOperationResultInfo', 'ObjectTypeOperationResultInfo' - ObjectType ObjectTypeBasicOperationResultInfoBase `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationResultInfo. -func (ori OperationResultInfo) MarshalJSON() ([]byte, error) { - ori.ObjectType = ObjectTypeOperationResultInfo - objectMap := make(map[string]interface{}) - if ori.JobList != nil { - objectMap["jobList"] = ori.JobList - } - if ori.ObjectType != "" { - objectMap["objectType"] = ori.ObjectType - } - return json.Marshal(objectMap) -} - -// AsExportJobsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfo. -func (ori OperationResultInfo) AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) { - return nil, false -} - -// AsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfo. -func (ori OperationResultInfo) AsOperationResultInfo() (*OperationResultInfo, bool) { - return &ori, true -} - -// AsOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfo. -func (ori OperationResultInfo) AsOperationResultInfoBase() (*OperationResultInfoBase, bool) { - return nil, false -} - -// AsBasicOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfo. -func (ori OperationResultInfo) AsBasicOperationResultInfoBase() (BasicOperationResultInfoBase, bool) { - return &ori, true -} - -// BasicOperationResultInfoBase base class for operation result info. -type BasicOperationResultInfoBase interface { - AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) - AsOperationResultInfo() (*OperationResultInfo, bool) - AsOperationResultInfoBase() (*OperationResultInfoBase, bool) -} - -// OperationResultInfoBase base class for operation result info. -type OperationResultInfoBase struct { - // ObjectType - Possible values include: 'ObjectTypeOperationResultInfoBase', 'ObjectTypeExportJobsOperationResultInfo', 'ObjectTypeOperationResultInfo' - ObjectType ObjectTypeBasicOperationResultInfoBase `json:"objectType,omitempty"` -} - -func unmarshalBasicOperationResultInfoBase(body []byte) (BasicOperationResultInfoBase, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeExportJobsOperationResultInfo): - var ejori ExportJobsOperationResultInfo - err := json.Unmarshal(body, &ejori) - return ejori, err - case string(ObjectTypeOperationResultInfo): - var ori OperationResultInfo - err := json.Unmarshal(body, &ori) - return ori, err - default: - var orib OperationResultInfoBase - err := json.Unmarshal(body, &orib) - return orib, err - } -} -func unmarshalBasicOperationResultInfoBaseArray(body []byte) ([]BasicOperationResultInfoBase, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - oribArray := make([]BasicOperationResultInfoBase, len(rawMessages)) - - for index, rawMessage := range rawMessages { - orib, err := unmarshalBasicOperationResultInfoBase(*rawMessage) - if err != nil { - return nil, err - } - oribArray[index] = orib - } - return oribArray, nil -} - -// MarshalJSON is the custom marshaler for OperationResultInfoBase. -func (orib OperationResultInfoBase) MarshalJSON() ([]byte, error) { - orib.ObjectType = ObjectTypeOperationResultInfoBase - objectMap := make(map[string]interface{}) - if orib.ObjectType != "" { - objectMap["objectType"] = orib.ObjectType - } - return json.Marshal(objectMap) -} - -// AsExportJobsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. -func (orib OperationResultInfoBase) AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) { - return nil, false -} - -// AsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. -func (orib OperationResultInfoBase) AsOperationResultInfo() (*OperationResultInfo, bool) { - return nil, false -} - -// AsOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. -func (orib OperationResultInfoBase) AsOperationResultInfoBase() (*OperationResultInfoBase, bool) { - return &orib, true -} - -// AsBasicOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. -func (orib OperationResultInfoBase) AsBasicOperationResultInfoBase() (BasicOperationResultInfoBase, bool) { - return &orib, true -} - -// OperationResultInfoBaseResource base class for operation result info. -type OperationResultInfoBaseResource struct { - autorest.Response `json:"-"` - // Operation - OperationResultInfoBaseResource operation - Operation BasicOperationResultInfoBase `json:"operation,omitempty"` - // StatusCode - 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' - StatusCode HTTPStatusCode `json:"statusCode,omitempty"` - // Headers - HTTP headers associated with this operation. - Headers map[string][]string `json:"headers"` -} - -// MarshalJSON is the custom marshaler for OperationResultInfoBaseResource. -func (oribr OperationResultInfoBaseResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["operation"] = oribr.Operation - if oribr.StatusCode != "" { - objectMap["statusCode"] = oribr.StatusCode - } - if oribr.Headers != nil { - objectMap["headers"] = oribr.Headers - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for OperationResultInfoBaseResource struct. -func (oribr *OperationResultInfoBaseResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "operation": - if v != nil { - operation, err := unmarshalBasicOperationResultInfoBase(*v) - if err != nil { - return err - } - oribr.Operation = operation - } - case "statusCode": - if v != nil { - var statusCode HTTPStatusCode - err = json.Unmarshal(*v, &statusCode) - if err != nil { - return err - } - oribr.StatusCode = statusCode - } - case "headers": - if v != nil { - var headers map[string][]string - err = json.Unmarshal(*v, &headers) - if err != nil { - return err - } - oribr.Headers = headers - } - } - } - - return nil -} - -// OperationStatus operation status. -type OperationStatus struct { - autorest.Response `json:"-"` - // ID - ID of the operation. - ID *string `json:"id,omitempty"` - // Name - Name of the operation. - Name *string `json:"name,omitempty"` - // Status - Operation status. Possible values include: 'OperationStatusValuesInvalid', 'OperationStatusValuesInProgress', 'OperationStatusValuesSucceeded', 'OperationStatusValuesFailed', 'OperationStatusValuesCanceled' - Status OperationStatusValues `json:"status,omitempty"` - // StartTime - Operation start time. Format: ISO-8601. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - Operation end time. Format: ISO-8601. - EndTime *date.Time `json:"endTime,omitempty"` - // Error - Error information related to this operation. - Error *OperationStatusError `json:"error,omitempty"` - // Properties - Additional information associated with this operation. - Properties BasicOperationStatusExtendedInfo `json:"properties,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for OperationStatus struct. -func (osVar *OperationStatus) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - osVar.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - osVar.Name = &name - } - case "status": - if v != nil { - var status OperationStatusValues - err = json.Unmarshal(*v, &status) - if err != nil { - return err - } - osVar.Status = status - } - case "startTime": - if v != nil { - var startTime date.Time - err = json.Unmarshal(*v, &startTime) - if err != nil { - return err - } - osVar.StartTime = &startTime - } - case "endTime": - if v != nil { - var endTime date.Time - err = json.Unmarshal(*v, &endTime) - if err != nil { - return err - } - osVar.EndTime = &endTime - } - case "error": - if v != nil { - var errorVar OperationStatusError - err = json.Unmarshal(*v, &errorVar) - if err != nil { - return err - } - osVar.Error = &errorVar - } - case "properties": - if v != nil { - properties, err := unmarshalBasicOperationStatusExtendedInfo(*v) - if err != nil { - return err - } - osVar.Properties = properties - } - } - } - - return nil -} - -// OperationStatusError error information associated with operation status call. -type OperationStatusError struct { - // Code - Error code of the operation failure. - Code *string `json:"code,omitempty"` - // Message - Error message displayed if the operation failure. - Message *string `json:"message,omitempty"` -} - -// BasicOperationStatusExtendedInfo base class for additional information of operation status. -type BasicOperationStatusExtendedInfo interface { - AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) - AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) - AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) - AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) -} - -// OperationStatusExtendedInfo base class for additional information of operation status. -type OperationStatusExtendedInfo struct { - // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' - ObjectType ObjectType `json:"objectType,omitempty"` -} - -func unmarshalBasicOperationStatusExtendedInfo(body []byte) (BasicOperationStatusExtendedInfo, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeOperationStatusJobExtendedInfo): - var osjei OperationStatusJobExtendedInfo - err := json.Unmarshal(body, &osjei) - return osjei, err - case string(ObjectTypeOperationStatusJobsExtendedInfo): - var osjei OperationStatusJobsExtendedInfo - err := json.Unmarshal(body, &osjei) - return osjei, err - case string(ObjectTypeOperationStatusProvisionILRExtendedInfo): - var ospiei OperationStatusProvisionILRExtendedInfo - err := json.Unmarshal(body, &ospiei) - return ospiei, err - default: - var osei OperationStatusExtendedInfo - err := json.Unmarshal(body, &osei) - return osei, err - } -} -func unmarshalBasicOperationStatusExtendedInfoArray(body []byte) ([]BasicOperationStatusExtendedInfo, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - oseiArray := make([]BasicOperationStatusExtendedInfo, len(rawMessages)) - - for index, rawMessage := range rawMessages { - osei, err := unmarshalBasicOperationStatusExtendedInfo(*rawMessage) - if err != nil { - return nil, err - } - oseiArray[index] = osei - } - return oseiArray, nil -} - -// MarshalJSON is the custom marshaler for OperationStatusExtendedInfo. -func (osei OperationStatusExtendedInfo) MarshalJSON() ([]byte, error) { - osei.ObjectType = ObjectTypeOperationStatusExtendedInfo - objectMap := make(map[string]interface{}) - if osei.ObjectType != "" { - objectMap["objectType"] = osei.ObjectType - } - return json.Marshal(objectMap) -} - -// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. -func (osei OperationStatusExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. -func (osei OperationStatusExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. -func (osei OperationStatusExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. -func (osei OperationStatusExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { - return &osei, true -} - -// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. -func (osei OperationStatusExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { - return &osei, true -} - -// OperationStatusJobExtendedInfo operation status job extended info. -type OperationStatusJobExtendedInfo struct { - // JobID - ID of the job created for this protected item. - JobID *string `json:"jobId,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' - ObjectType ObjectType `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationStatusJobExtendedInfo. -func (osjei OperationStatusJobExtendedInfo) MarshalJSON() ([]byte, error) { - osjei.ObjectType = ObjectTypeOperationStatusJobExtendedInfo - objectMap := make(map[string]interface{}) - if osjei.JobID != nil { - objectMap["jobId"] = osjei.JobID - } - if osjei.ObjectType != "" { - objectMap["objectType"] = osjei.ObjectType - } - return json.Marshal(objectMap) -} - -// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. -func (osjei OperationStatusJobExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { - return &osjei, true -} - -// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. -func (osjei OperationStatusJobExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. -func (osjei OperationStatusJobExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. -func (osjei OperationStatusJobExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { - return nil, false -} - -// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. -func (osjei OperationStatusJobExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { - return &osjei, true -} - -// OperationStatusJobsExtendedInfo operation status extended info for list of jobs. -type OperationStatusJobsExtendedInfo struct { - // JobIds - IDs of the jobs created for the protected item. - JobIds *[]string `json:"jobIds,omitempty"` - // FailedJobsError - Stores all the failed jobs along with the corresponding error codes. - FailedJobsError map[string]*string `json:"failedJobsError"` - // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' - ObjectType ObjectType `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationStatusJobsExtendedInfo. -func (osjei OperationStatusJobsExtendedInfo) MarshalJSON() ([]byte, error) { - osjei.ObjectType = ObjectTypeOperationStatusJobsExtendedInfo - objectMap := make(map[string]interface{}) - if osjei.JobIds != nil { - objectMap["jobIds"] = osjei.JobIds - } - if osjei.FailedJobsError != nil { - objectMap["failedJobsError"] = osjei.FailedJobsError - } - if osjei.ObjectType != "" { - objectMap["objectType"] = osjei.ObjectType - } - return json.Marshal(objectMap) -} - -// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. -func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. -func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { - return &osjei, true -} - -// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. -func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. -func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { - return nil, false -} - -// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. -func (osjei OperationStatusJobsExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { - return &osjei, true -} - -// OperationStatusProvisionILRExtendedInfo operation status extended info for ILR provision action. -type OperationStatusProvisionILRExtendedInfo struct { - // RecoveryTarget - Target details for file / folder restore. - RecoveryTarget *InstantItemRecoveryTarget `json:"recoveryTarget,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' - ObjectType ObjectType `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationStatusProvisionILRExtendedInfo. -func (ospiei OperationStatusProvisionILRExtendedInfo) MarshalJSON() ([]byte, error) { - ospiei.ObjectType = ObjectTypeOperationStatusProvisionILRExtendedInfo - objectMap := make(map[string]interface{}) - if ospiei.RecoveryTarget != nil { - objectMap["recoveryTarget"] = ospiei.RecoveryTarget - } - if ospiei.ObjectType != "" { - objectMap["objectType"] = ospiei.ObjectType - } - return json.Marshal(objectMap) -} - -// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. -func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. -func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. -func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { - return &ospiei, true -} - -// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. -func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { - return nil, false -} - -// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. -func (ospiei OperationStatusProvisionILRExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { - return &ospiei, true -} - -// OperationWorkerResponse this is the base class for operation result responses. -type OperationWorkerResponse struct { - // StatusCode - 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' - StatusCode HTTPStatusCode `json:"statusCode,omitempty"` - // Headers - HTTP headers associated with this operation. - Headers map[string][]string `json:"headers"` -} - -// MarshalJSON is the custom marshaler for OperationWorkerResponse. -func (owr OperationWorkerResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if owr.StatusCode != "" { - objectMap["statusCode"] = owr.StatusCode - } - if owr.Headers != nil { - objectMap["headers"] = owr.Headers - } - return json.Marshal(objectMap) -} - -// PointInTimeRange provides details for log ranges -type PointInTimeRange struct { - // StartTime - Start time of the time range for log recovery. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - End time of the time range for log recovery. - EndTime *date.Time `json:"endTime,omitempty"` -} - -// PreBackupValidation pre-backup validation for Azure VM Workload provider. -type PreBackupValidation struct { - // Status - Status of protectable item, i.e. InProgress,Succeeded,Failed. Possible values include: 'InquiryStatusInvalid', 'InquiryStatusSuccess', 'InquiryStatusFailed' - Status InquiryStatus `json:"status,omitempty"` - // Code - Error code of protectable item - Code *string `json:"code,omitempty"` - // Message - Message corresponding to the error code for the protectable item - Message *string `json:"message,omitempty"` -} - -// PreValidateEnableBackupRequest contract to validate if backup can be enabled on the given resource in a -// given vault and given configuration. -// It will validate followings -// 1. Vault capacity -// 2. VM is already protected -// 3. Any VM related configuration passed in properties. -type PreValidateEnableBackupRequest struct { - // ResourceType - ProtectedItem Type- VM, SqlDataBase, AzureFileShare etc. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - ResourceType DataSourceType `json:"resourceType,omitempty"` - // ResourceID - ARM Virtual Machine Id - ResourceID *string `json:"resourceId,omitempty"` - // VaultID - ARM id of the Recovery Services Vault - VaultID *string `json:"vaultId,omitempty"` - // Properties - Configuration of VM if any needs to be validated like OS type etc - Properties *string `json:"properties,omitempty"` -} - -// PreValidateEnableBackupResponse response contract for enable backup validation request -type PreValidateEnableBackupResponse struct { - autorest.Response `json:"-"` - // Status - Validation Status. Possible values include: 'ValidationStatusInvalid', 'ValidationStatusSucceeded', 'ValidationStatusFailed' - Status ValidationStatus `json:"status,omitempty"` - // ErrorCode - Response error code - ErrorCode *string `json:"errorCode,omitempty"` - // ErrorMessage - Response error message - ErrorMessage *string `json:"errorMessage,omitempty"` - // Recommendation - Recommended action for user - Recommendation *string `json:"recommendation,omitempty"` - // ContainerName - Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is required - // for portal - ContainerName *string `json:"containerName,omitempty"` - // ProtectedItemName - Specifies the product specific ds name. E.g. vm;iaasvmcontainer;rgname;vmname. This is required for portal - ProtectedItemName *string `json:"protectedItemName,omitempty"` -} - -// PrivateEndpoint the Private Endpoint network resource that is linked to the Private Endpoint connection -type PrivateEndpoint struct { - // ID - Gets or sets id - ID *string `json:"id,omitempty"` -} - -// PrivateEndpointConnection private Endpoint Connection Response Properties -type PrivateEndpointConnection struct { - // ProvisioningState - Gets or sets provisioning state of the private endpoint connection. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateDeleting', 'ProvisioningStateFailed', 'ProvisioningStatePending' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // PrivateEndpoint - Gets or sets private endpoint associated with the private endpoint connection - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - // PrivateLinkServiceConnectionState - Gets or sets private link service connection state - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` -} - -// PrivateEndpointConnectionDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type PrivateEndpointConnectionDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PrivateEndpointConnectionClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PrivateEndpointConnectionDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PrivateEndpointConnectionDeleteFuture.Result. -func (future *PrivateEndpointConnectionDeleteFuture) result(client PrivateEndpointConnectionClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.PrivateEndpointConnectionDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("backup.PrivateEndpointConnectionDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// PrivateEndpointConnectionPutFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type PrivateEndpointConnectionPutFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PrivateEndpointConnectionClient) (PrivateEndpointConnectionResource, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PrivateEndpointConnectionPutFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PrivateEndpointConnectionPutFuture.Result. -func (future *PrivateEndpointConnectionPutFuture) result(client PrivateEndpointConnectionClient) (pecr PrivateEndpointConnectionResource, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.PrivateEndpointConnectionPutFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pecr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("backup.PrivateEndpointConnectionPutFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pecr.Response.Response, err = future.GetResult(sender); err == nil && pecr.Response.Response.StatusCode != http.StatusNoContent { - pecr, err = client.PutResponder(pecr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.PrivateEndpointConnectionPutFuture", "Result", pecr.Response.Response, "Failure responding to request") - } - } - return -} - -// PrivateEndpointConnectionResource private Endpoint Connection Response Properties -type PrivateEndpointConnectionResource struct { - autorest.Response `json:"-"` - // Properties - PrivateEndpointConnectionResource properties - Properties *PrivateEndpointConnection `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpointConnectionResource. -func (pecr PrivateEndpointConnectionResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pecr.Properties != nil { - objectMap["properties"] = pecr.Properties - } - if pecr.Location != nil { - objectMap["location"] = pecr.Location - } - if pecr.Tags != nil { - objectMap["tags"] = pecr.Tags - } - if pecr.ETag != nil { - objectMap["eTag"] = pecr.ETag - } - return json.Marshal(objectMap) -} - -// PrivateLinkServiceConnectionState private Link Service Connection State -type PrivateLinkServiceConnectionState struct { - // Status - Gets or sets the status. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' - Status PrivateEndpointConnectionStatus `json:"status,omitempty"` - // Description - Gets or sets description - Description *string `json:"description,omitempty"` - // ActionRequired - Gets or sets actions required - ActionRequired *string `json:"actionRequired,omitempty"` -} - -// BasicProtectableContainer protectable Container Class. -type BasicProtectableContainer interface { - AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) - AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) - AsProtectableContainer() (*ProtectableContainer, bool) -} - -// ProtectableContainer protectable Container Class. -type ProtectableContainer struct { - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerID - Fabric Id of the container such as ARM Id. - ContainerID *string `json:"containerId,omitempty"` - // ProtectableContainerType - Possible values include: 'ProtectableContainerTypeProtectableContainer', 'ProtectableContainerTypeStorageContainer', 'ProtectableContainerTypeVMAppContainer' - ProtectableContainerType ProtectableContainerType `json:"protectableContainerType,omitempty"` -} - -func unmarshalBasicProtectableContainer(body []byte) (BasicProtectableContainer, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["protectableContainerType"] { - case string(ProtectableContainerTypeStorageContainer): - var aspc AzureStorageProtectableContainer - err := json.Unmarshal(body, &aspc) - return aspc, err - case string(ProtectableContainerTypeVMAppContainer): - var avacpc AzureVMAppContainerProtectableContainer - err := json.Unmarshal(body, &avacpc) - return avacpc, err - default: - var pc ProtectableContainer - err := json.Unmarshal(body, &pc) - return pc, err - } -} -func unmarshalBasicProtectableContainerArray(body []byte) ([]BasicProtectableContainer, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - pcArray := make([]BasicProtectableContainer, len(rawMessages)) - - for index, rawMessage := range rawMessages { - pc, err := unmarshalBasicProtectableContainer(*rawMessage) - if err != nil { - return nil, err - } - pcArray[index] = pc - } - return pcArray, nil -} - -// MarshalJSON is the custom marshaler for ProtectableContainer. -func (pc ProtectableContainer) MarshalJSON() ([]byte, error) { - pc.ProtectableContainerType = ProtectableContainerTypeProtectableContainer - objectMap := make(map[string]interface{}) - if pc.FriendlyName != nil { - objectMap["friendlyName"] = pc.FriendlyName - } - if pc.BackupManagementType != "" { - objectMap["backupManagementType"] = pc.BackupManagementType - } - if pc.HealthStatus != nil { - objectMap["healthStatus"] = pc.HealthStatus - } - if pc.ContainerID != nil { - objectMap["containerId"] = pc.ContainerID - } - if pc.ProtectableContainerType != "" { - objectMap["protectableContainerType"] = pc.ProtectableContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureStorageProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. -func (pc ProtectableContainer) AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. -func (pc ProtectableContainer) AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) { - return nil, false -} - -// AsProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. -func (pc ProtectableContainer) AsProtectableContainer() (*ProtectableContainer, bool) { - return &pc, true -} - -// AsBasicProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. -func (pc ProtectableContainer) AsBasicProtectableContainer() (BasicProtectableContainer, bool) { - return &pc, true -} - -// ProtectableContainerResource protectable Container Class. -type ProtectableContainerResource struct { - // Properties - ProtectableContainerResource properties - Properties BasicProtectableContainer `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProtectableContainerResource. -func (pcr ProtectableContainerResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = pcr.Properties - if pcr.Location != nil { - objectMap["location"] = pcr.Location - } - if pcr.Tags != nil { - objectMap["tags"] = pcr.Tags - } - if pcr.ETag != nil { - objectMap["eTag"] = pcr.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ProtectableContainerResource struct. -func (pcr *ProtectableContainerResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicProtectableContainer(*v) - if err != nil { - return err - } - pcr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pcr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pcr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pcr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - pcr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - pcr.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - pcr.ETag = &eTag - } - } - } - - return nil -} - -// ProtectableContainerResourceList list of ProtectableContainer resources -type ProtectableContainerResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]ProtectableContainerResource `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"` -} - -// ProtectableContainerResourceListIterator provides access to a complete listing of -// ProtectableContainerResource values. -type ProtectableContainerResourceListIterator struct { - i int - page ProtectableContainerResourceListPage -} - -// NextWithContext 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 *ProtectableContainerResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableContainerResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ProtectableContainerResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ProtectableContainerResourceListIterator) 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 ProtectableContainerResourceListIterator) Response() ProtectableContainerResourceList { - 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 ProtectableContainerResourceListIterator) Value() ProtectableContainerResource { - if !iter.page.NotDone() { - return ProtectableContainerResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ProtectableContainerResourceListIterator type. -func NewProtectableContainerResourceListIterator(page ProtectableContainerResourceListPage) ProtectableContainerResourceListIterator { - return ProtectableContainerResourceListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (pcrl ProtectableContainerResourceList) IsEmpty() bool { - return pcrl.Value == nil || len(*pcrl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (pcrl ProtectableContainerResourceList) hasNextLink() bool { - return pcrl.NextLink != nil && len(*pcrl.NextLink) != 0 -} - -// protectableContainerResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (pcrl ProtectableContainerResourceList) protectableContainerResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !pcrl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(pcrl.NextLink))) -} - -// ProtectableContainerResourceListPage contains a page of ProtectableContainerResource values. -type ProtectableContainerResourceListPage struct { - fn func(context.Context, ProtectableContainerResourceList) (ProtectableContainerResourceList, error) - pcrl ProtectableContainerResourceList -} - -// NextWithContext 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 *ProtectableContainerResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableContainerResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.pcrl) - if err != nil { - return err - } - page.pcrl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *ProtectableContainerResourceListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ProtectableContainerResourceListPage) NotDone() bool { - return !page.pcrl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ProtectableContainerResourceListPage) Response() ProtectableContainerResourceList { - return page.pcrl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ProtectableContainerResourceListPage) Values() []ProtectableContainerResource { - if page.pcrl.IsEmpty() { - return nil - } - return *page.pcrl.Value -} - -// Creates a new instance of the ProtectableContainerResourceListPage type. -func NewProtectableContainerResourceListPage(cur ProtectableContainerResourceList, getNextPage func(context.Context, ProtectableContainerResourceList) (ProtectableContainerResourceList, error)) ProtectableContainerResourceListPage { - return ProtectableContainerResourceListPage{ - fn: getNextPage, - pcrl: cur, - } -} - -// BasicProtectedItem base class for backup items. -type BasicProtectedItem interface { - AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) - AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) - AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) - AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) - AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) - AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) - AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) - AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) - AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) - AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) - AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) - AsDPMProtectedItem() (*DPMProtectedItem, bool) - AsGenericProtectedItem() (*GenericProtectedItem, bool) - AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) - AsProtectedItem() (*ProtectedItem, bool) -} - -// ProtectedItem base class for backup items. -type ProtectedItem struct { - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - WorkloadType DataSourceType `json:"workloadType,omitempty"` - // ContainerName - Unique name of container - ContainerName *string `json:"containerName,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. - LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` - // BackupSetName - Name of the backup set the backup item belongs to - 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"` - // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC - DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` - // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state - IsRehydrate *bool `json:"isRehydrate,omitempty"` - // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' - ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` -} - -func unmarshalBasicProtectedItem(body []byte) (BasicProtectedItem, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["protectedItemType"] { - case string(ProtectedItemTypeAzureFileShareProtectedItem): - var afpi AzureFileshareProtectedItem - err := json.Unmarshal(body, &afpi) - return afpi, err - case string(ProtectedItemTypeMicrosoftClassicComputevirtualMachines): - var aisccvpi AzureIaaSClassicComputeVMProtectedItem - err := json.Unmarshal(body, &aisccvpi) - return aisccvpi, err - case string(ProtectedItemTypeMicrosoftComputevirtualMachines): - var aiscvpi AzureIaaSComputeVMProtectedItem - err := json.Unmarshal(body, &aiscvpi) - return aiscvpi, err - case string(ProtectedItemTypeAzureIaaSVMProtectedItem): - var aispi AzureIaaSVMProtectedItem - err := json.Unmarshal(body, &aispi) - return aispi, err - case string(ProtectedItemTypeMicrosoftSqlserversdatabases): - var aspi AzureSQLProtectedItem - err := json.Unmarshal(body, &aspi) - return aspi, err - case string(ProtectedItemTypeAzureVMWorkloadProtectedItem): - var avwpi AzureVMWorkloadProtectedItem - err := json.Unmarshal(body, &avwpi) - return avwpi, err - case string(ProtectedItemTypeAzureVMWorkloadSAPAseDatabase): - var avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem - err := json.Unmarshal(body, &avwsadpi) - return avwsadpi, err - case string(ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase): - var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem - err := json.Unmarshal(body, &avwshdpi) - return avwshdpi, err - case string(ProtectedItemTypeAzureVMWorkloadSQLDatabase): - var avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem - err := json.Unmarshal(body, &avwsdpi) - return avwsdpi, err - case string(ProtectedItemTypeDPMProtectedItem): - var dpi DPMProtectedItem - err := json.Unmarshal(body, &dpi) - return dpi, err - case string(ProtectedItemTypeGenericProtectedItem): - var gpi GenericProtectedItem - err := json.Unmarshal(body, &gpi) - return gpi, err - case string(ProtectedItemTypeMabFileFolderProtectedItem): - var mffpi MabFileFolderProtectedItem - err := json.Unmarshal(body, &mffpi) - return mffpi, err - default: - var pi ProtectedItem - err := json.Unmarshal(body, &pi) - return pi, err - } -} -func unmarshalBasicProtectedItemArray(body []byte) ([]BasicProtectedItem, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - piArray := make([]BasicProtectedItem, len(rawMessages)) - - for index, rawMessage := range rawMessages { - pi, err := unmarshalBasicProtectedItem(*rawMessage) - if err != nil { - return nil, err - } - piArray[index] = pi - } - return piArray, nil -} - -// MarshalJSON is the custom marshaler for ProtectedItem. -func (pi ProtectedItem) MarshalJSON() ([]byte, error) { - pi.ProtectedItemType = ProtectedItemTypeProtectedItem - objectMap := make(map[string]interface{}) - if pi.BackupManagementType != "" { - objectMap["backupManagementType"] = pi.BackupManagementType - } - if pi.WorkloadType != "" { - objectMap["workloadType"] = pi.WorkloadType - } - if pi.ContainerName != nil { - objectMap["containerName"] = pi.ContainerName - } - if pi.SourceResourceID != nil { - objectMap["sourceResourceId"] = pi.SourceResourceID - } - if pi.PolicyID != nil { - objectMap["policyId"] = pi.PolicyID - } - if pi.LastRecoveryPoint != nil { - objectMap["lastRecoveryPoint"] = pi.LastRecoveryPoint - } - if pi.BackupSetName != nil { - objectMap["backupSetName"] = pi.BackupSetName - } - if pi.CreateMode != "" { - objectMap["createMode"] = pi.CreateMode - } - if pi.DeferredDeleteTimeInUTC != nil { - objectMap["deferredDeleteTimeInUTC"] = pi.DeferredDeleteTimeInUTC - } - if pi.IsScheduledForDeferredDelete != nil { - objectMap["isScheduledForDeferredDelete"] = pi.IsScheduledForDeferredDelete - } - if pi.DeferredDeleteTimeRemaining != nil { - objectMap["deferredDeleteTimeRemaining"] = pi.DeferredDeleteTimeRemaining - } - if pi.IsDeferredDeleteScheduleUpcoming != nil { - objectMap["isDeferredDeleteScheduleUpcoming"] = pi.IsDeferredDeleteScheduleUpcoming - } - if pi.IsRehydrate != nil { - objectMap["isRehydrate"] = pi.IsRehydrate - } - if pi.ProtectedItemType != "" { - objectMap["protectedItemType"] = pi.ProtectedItemType - } - return json.Marshal(objectMap) -} - -// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { - return nil, false -} - -// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { - return nil, false -} - -// AsDPMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { - return nil, false -} - -// AsGenericProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { - return nil, false -} - -// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { - return nil, false -} - -// AsProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { - return &pi, true -} - -// AsBasicProtectedItem is the BasicProtectedItem implementation for ProtectedItem. -func (pi ProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { - return &pi, true -} - -// ProtectedItemQueryObject filters to list backup items. -type ProtectedItemQueryObject struct { - // HealthState - Health State for the backed up item. Possible values include: 'HealthStatePassed', 'HealthStateActionRequired', 'HealthStateActionSuggested', 'HealthStateInvalid' - HealthState HealthState `json:"healthState,omitempty"` - // 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: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - ItemType DataSourceType `json:"itemType,omitempty"` - // PolicyName - Backup policy name associated with the backup item. - PolicyName *string `json:"policyName,omitempty"` - // ContainerName - Name of the container. - ContainerName *string `json:"containerName,omitempty"` - // BackupEngineName - Backup Engine name - BackupEngineName *string `json:"backupEngineName,omitempty"` - // FriendlyName - Friendly name of protected item - FriendlyName *string `json:"friendlyName,omitempty"` - // FabricName - Name of the fabric. - FabricName *string `json:"fabricName,omitempty"` - // BackupSetName - Name of the backup set. - BackupSetName *string `json:"backupSetName,omitempty"` -} - -// ProtectedItemResource base class for backup items. -type ProtectedItemResource struct { - autorest.Response `json:"-"` - // Properties - ProtectedItemResource properties - Properties BasicProtectedItem `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProtectedItemResource. -func (pir ProtectedItemResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = pir.Properties - if pir.Location != nil { - objectMap["location"] = pir.Location - } - if pir.Tags != nil { - objectMap["tags"] = pir.Tags - } - if pir.ETag != nil { - objectMap["eTag"] = pir.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ProtectedItemResource struct. -func (pir *ProtectedItemResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicProtectedItem(*v) - if err != nil { - return err - } - pir.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pir.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pir.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pir.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - pir.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - pir.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - pir.ETag = &eTag - } - } - } - - return nil -} - -// ProtectedItemResourceList list of ProtectedItem resources -type ProtectedItemResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]ProtectedItemResource `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"` -} - -// ProtectedItemResourceListIterator provides access to a complete listing of ProtectedItemResource values. -type ProtectedItemResourceListIterator struct { - i int - page ProtectedItemResourceListPage -} - -// NextWithContext 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 *ProtectedItemResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ProtectedItemResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ProtectedItemResourceListIterator) 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 ProtectedItemResourceListIterator) Response() ProtectedItemResourceList { - 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 ProtectedItemResourceListIterator) Value() ProtectedItemResource { - if !iter.page.NotDone() { - return ProtectedItemResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ProtectedItemResourceListIterator type. -func NewProtectedItemResourceListIterator(page ProtectedItemResourceListPage) ProtectedItemResourceListIterator { - return ProtectedItemResourceListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (pirl ProtectedItemResourceList) IsEmpty() bool { - return pirl.Value == nil || len(*pirl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (pirl ProtectedItemResourceList) hasNextLink() bool { - return pirl.NextLink != nil && len(*pirl.NextLink) != 0 -} - -// protectedItemResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (pirl ProtectedItemResourceList) protectedItemResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !pirl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(pirl.NextLink))) -} - -// ProtectedItemResourceListPage contains a page of ProtectedItemResource values. -type ProtectedItemResourceListPage struct { - fn func(context.Context, ProtectedItemResourceList) (ProtectedItemResourceList, error) - pirl ProtectedItemResourceList -} - -// NextWithContext 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 *ProtectedItemResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.pirl) - if err != nil { - return err - } - page.pirl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *ProtectedItemResourceListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ProtectedItemResourceListPage) NotDone() bool { - return !page.pirl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ProtectedItemResourceListPage) Response() ProtectedItemResourceList { - return page.pirl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ProtectedItemResourceListPage) Values() []ProtectedItemResource { - if page.pirl.IsEmpty() { - return nil - } - return *page.pirl.Value -} - -// Creates a new instance of the ProtectedItemResourceListPage type. -func NewProtectedItemResourceListPage(cur ProtectedItemResourceList, getNextPage func(context.Context, ProtectedItemResourceList) (ProtectedItemResourceList, error)) ProtectedItemResourceListPage { - return ProtectedItemResourceListPage{ - fn: getNextPage, - pirl: cur, - } -} - -// BasicProtectionContainer base class for container with backup items. Containers with specific workloads are derived -// from this class. -type BasicProtectionContainer interface { - AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) - AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) - AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) - AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) - AsAzureSQLContainer() (*AzureSQLContainer, bool) - AsAzureStorageContainer() (*AzureStorageContainer, bool) - AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) - AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) - AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) - AsDpmContainer() (*DpmContainer, bool) - AsBasicDpmContainer() (BasicDpmContainer, bool) - AsGenericContainer() (*GenericContainer, bool) - AsIaaSVMContainer() (*IaaSVMContainer, bool) - AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) - AsMabContainer() (*MabContainer, bool) - AsProtectionContainer() (*ProtectionContainer, bool) -} - -// ProtectionContainer base class for container with backup items. Containers with specific workloads are -// derived from this class. -type ProtectionContainer struct { - // FriendlyName - Friendly name of the container. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. - RegistrationStatus *string `json:"registrationStatus,omitempty"` - // HealthStatus - Status of health of the container. - HealthStatus *string `json:"healthStatus,omitempty"` - // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' - ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` -} - -func unmarshalBasicProtectionContainer(body []byte) (BasicProtectionContainer, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["containerType"] { - case string(ContainerTypeAzureBackupServerContainer1): - var absc AzureBackupServerContainer - err := json.Unmarshal(body, &absc) - return absc, err - case string(ContainerTypeMicrosoftClassicComputevirtualMachines): - var aisccvc AzureIaaSClassicComputeVMContainer - err := json.Unmarshal(body, &aisccvc) - return aisccvc, err - case string(ContainerTypeMicrosoftComputevirtualMachines): - var aiscvc AzureIaaSComputeVMContainer - err := json.Unmarshal(body, &aiscvc) - return aiscvc, err - case string(ContainerTypeSQLAGWorkLoadContainer1): - var aswcpc AzureSQLAGWorkloadContainerProtectionContainer - err := json.Unmarshal(body, &aswcpc) - return aswcpc, err - case string(ContainerTypeAzureSQLContainer1): - var asc AzureSQLContainer - err := json.Unmarshal(body, &asc) - return asc, err - case string(ContainerTypeStorageContainer1): - var asc AzureStorageContainer - err := json.Unmarshal(body, &asc) - return asc, err - case string(ContainerTypeVMAppContainer1): - var avacpc AzureVMAppContainerProtectionContainer - err := json.Unmarshal(body, &avacpc) - return avacpc, err - case string(ContainerTypeAzureWorkloadContainer): - var awc AzureWorkloadContainer - err := json.Unmarshal(body, &awc) - return awc, err - case string(ContainerTypeDPMContainer1): - var dc DpmContainer - err := json.Unmarshal(body, &dc) - return dc, err - case string(ContainerTypeGenericContainer1): - var gc GenericContainer - err := json.Unmarshal(body, &gc) - return gc, err - case string(ContainerTypeIaaSVMContainer): - var isc IaaSVMContainer - err := json.Unmarshal(body, &isc) - return isc, err - case string(ContainerTypeWindows1): - var mc MabContainer - err := json.Unmarshal(body, &mc) - return mc, err - default: - var pc ProtectionContainer - err := json.Unmarshal(body, &pc) - return pc, err - } -} -func unmarshalBasicProtectionContainerArray(body []byte) ([]BasicProtectionContainer, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - pcArray := make([]BasicProtectionContainer, len(rawMessages)) - - for index, rawMessage := range rawMessages { - pc, err := unmarshalBasicProtectionContainer(*rawMessage) - if err != nil { - return nil, err - } - pcArray[index] = pc - } - return pcArray, nil -} - -// MarshalJSON is the custom marshaler for ProtectionContainer. -func (pc ProtectionContainer) MarshalJSON() ([]byte, error) { - pc.ContainerType = ContainerTypeProtectionContainer - objectMap := make(map[string]interface{}) - if pc.FriendlyName != nil { - objectMap["friendlyName"] = pc.FriendlyName - } - if pc.BackupManagementType != "" { - objectMap["backupManagementType"] = pc.BackupManagementType - } - if pc.RegistrationStatus != nil { - objectMap["registrationStatus"] = pc.RegistrationStatus - } - if pc.HealthStatus != nil { - objectMap["healthStatus"] = pc.HealthStatus - } - if pc.ContainerType != "" { - objectMap["containerType"] = pc.ContainerType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { - return nil, false -} - -// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureSQLContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false -} - -// AsMabContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return &pc, true -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &pc, true -} - -// ProtectionContainerResource base class for container with backup items. Containers with specific -// workloads are derived from this class. -type ProtectionContainerResource struct { - autorest.Response `json:"-"` - // Properties - ProtectionContainerResource properties - Properties BasicProtectionContainer `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProtectionContainerResource. -func (pcr ProtectionContainerResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = pcr.Properties - if pcr.Location != nil { - objectMap["location"] = pcr.Location - } - if pcr.Tags != nil { - objectMap["tags"] = pcr.Tags - } - if pcr.ETag != nil { - objectMap["eTag"] = pcr.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ProtectionContainerResource struct. -func (pcr *ProtectionContainerResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicProtectionContainer(*v) - if err != nil { - return err - } - pcr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pcr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pcr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pcr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - pcr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - pcr.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - pcr.ETag = &eTag - } - } - } - - return nil -} - -// ProtectionContainerResourceList list of ProtectionContainer resources -type ProtectionContainerResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]ProtectionContainerResource `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"` -} - -// ProtectionContainerResourceListIterator provides access to a complete listing of -// ProtectionContainerResource values. -type ProtectionContainerResourceListIterator struct { - i int - page ProtectionContainerResourceListPage -} - -// NextWithContext 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 *ProtectionContainerResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ProtectionContainerResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ProtectionContainerResourceListIterator) 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 ProtectionContainerResourceListIterator) Response() ProtectionContainerResourceList { - 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 ProtectionContainerResourceListIterator) Value() ProtectionContainerResource { - if !iter.page.NotDone() { - return ProtectionContainerResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ProtectionContainerResourceListIterator type. -func NewProtectionContainerResourceListIterator(page ProtectionContainerResourceListPage) ProtectionContainerResourceListIterator { - return ProtectionContainerResourceListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (pcrl ProtectionContainerResourceList) IsEmpty() bool { - return pcrl.Value == nil || len(*pcrl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (pcrl ProtectionContainerResourceList) hasNextLink() bool { - return pcrl.NextLink != nil && len(*pcrl.NextLink) != 0 -} - -// protectionContainerResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (pcrl ProtectionContainerResourceList) protectionContainerResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !pcrl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(pcrl.NextLink))) -} - -// ProtectionContainerResourceListPage contains a page of ProtectionContainerResource values. -type ProtectionContainerResourceListPage struct { - fn func(context.Context, ProtectionContainerResourceList) (ProtectionContainerResourceList, error) - pcrl ProtectionContainerResourceList -} - -// NextWithContext 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 *ProtectionContainerResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.pcrl) - if err != nil { - return err - } - page.pcrl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *ProtectionContainerResourceListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ProtectionContainerResourceListPage) NotDone() bool { - return !page.pcrl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ProtectionContainerResourceListPage) Response() ProtectionContainerResourceList { - return page.pcrl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ProtectionContainerResourceListPage) Values() []ProtectionContainerResource { - if page.pcrl.IsEmpty() { - return nil - } - return *page.pcrl.Value -} - -// Creates a new instance of the ProtectionContainerResourceListPage type. -func NewProtectionContainerResourceListPage(cur ProtectionContainerResourceList, getNextPage func(context.Context, ProtectionContainerResourceList) (ProtectionContainerResourceList, error)) ProtectionContainerResourceListPage { - return ProtectionContainerResourceListPage{ - fn: getNextPage, - pcrl: cur, - } -} - -// BasicProtectionIntent base class for backup ProtectionIntent. -type BasicProtectionIntent interface { - AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) - AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) - AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) - AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) - AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) - AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) - AsProtectionIntent() (*ProtectionIntent, bool) -} - -// ProtectionIntent base class for backup ProtectionIntent. -type ProtectionIntent struct { - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId - ItemID *string `json:"itemId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' - ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` -} - -func unmarshalBasicProtectionIntent(body []byte) (BasicProtectionIntent, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["protectionIntentItemType"] { - case string(ProtectionIntentItemTypeRecoveryServiceVaultItem): - var arsvpi AzureRecoveryServiceVaultProtectionIntent - err := json.Unmarshal(body, &arsvpi) - return arsvpi, err - case string(ProtectionIntentItemTypeAzureResourceItem): - var arpi AzureResourceProtectionIntent - err := json.Unmarshal(body, &arpi) - return arpi, err - case string(ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent): - var awapi AzureWorkloadAutoProtectionIntent - err := json.Unmarshal(body, &awapi) - return awapi, err - case string(ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent): - var awsapi AzureWorkloadSQLAutoProtectionIntent - err := json.Unmarshal(body, &awsapi) - return awsapi, err - default: - var pi ProtectionIntent - err := json.Unmarshal(body, &pi) - return pi, err - } -} -func unmarshalBasicProtectionIntentArray(body []byte) ([]BasicProtectionIntent, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - piArray := make([]BasicProtectionIntent, len(rawMessages)) - - for index, rawMessage := range rawMessages { - pi, err := unmarshalBasicProtectionIntent(*rawMessage) - if err != nil { - return nil, err - } - piArray[index] = pi - } - return piArray, nil -} - -// MarshalJSON is the custom marshaler for ProtectionIntent. -func (pi ProtectionIntent) MarshalJSON() ([]byte, error) { - pi.ProtectionIntentItemType = ProtectionIntentItemTypeProtectionIntent - objectMap := make(map[string]interface{}) - if pi.BackupManagementType != "" { - objectMap["backupManagementType"] = pi.BackupManagementType - } - if pi.SourceResourceID != nil { - objectMap["sourceResourceId"] = pi.SourceResourceID - } - if pi.ItemID != nil { - objectMap["itemId"] = pi.ItemID - } - if pi.PolicyID != nil { - objectMap["policyId"] = pi.PolicyID - } - if pi.ProtectionState != "" { - objectMap["protectionState"] = pi.ProtectionState - } - if pi.ProtectionIntentItemType != "" { - objectMap["protectionIntentItemType"] = pi.ProtectionIntentItemType - } - return json.Marshal(objectMap) -} - -// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { - return nil, false -} - -// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { - return nil, false -} - -// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { - return nil, false -} - -// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { - return nil, false -} - -// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { - return nil, false -} - -// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { - return nil, false -} - -// AsProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { - return &pi, true -} - -// AsBasicProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { - 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:"-"` - // Properties - ProtectionIntentResource properties - Properties BasicProtectionIntent `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProtectionIntentResource. -func (pir ProtectionIntentResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = pir.Properties - if pir.Location != nil { - objectMap["location"] = pir.Location - } - if pir.Tags != nil { - objectMap["tags"] = pir.Tags - } - if pir.ETag != nil { - objectMap["eTag"] = pir.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ProtectionIntentResource struct. -func (pir *ProtectionIntentResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicProtectionIntent(*v) - if err != nil { - return err - } - pir.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pir.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pir.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pir.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - pir.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - pir.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - pir.ETag = &eTag - } - } - } - - 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 -} - -// NextWithContext 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) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionIntentResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ProtectionIntentResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// 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] -} - -// Creates a new instance of the ProtectionIntentResourceListIterator type. -func NewProtectionIntentResourceListIterator(page ProtectionIntentResourceListPage) ProtectionIntentResourceListIterator { - return ProtectionIntentResourceListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (pirl ProtectionIntentResourceList) IsEmpty() bool { - return pirl.Value == nil || len(*pirl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (pirl ProtectionIntentResourceList) hasNextLink() bool { - return pirl.NextLink != nil && len(*pirl.NextLink) != 0 -} - -// protectionIntentResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (pirl ProtectionIntentResourceList) protectionIntentResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !pirl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(pirl.NextLink))) -} - -// ProtectionIntentResourceListPage contains a page of ProtectionIntentResource values. -type ProtectionIntentResourceListPage struct { - fn func(context.Context, ProtectionIntentResourceList) (ProtectionIntentResourceList, error) - pirl ProtectionIntentResourceList -} - -// NextWithContext 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) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionIntentResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.pirl) - if err != nil { - return err - } - page.pirl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *ProtectionIntentResourceListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// 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 -} - -// Creates a new instance of the ProtectionIntentResourceListPage type. -func NewProtectionIntentResourceListPage(cur ProtectionIntentResourceList, getNextPage func(context.Context, ProtectionIntentResourceList) (ProtectionIntentResourceList, error)) ProtectionIntentResourceListPage { - return ProtectionIntentResourceListPage{ - fn: getNextPage, - pirl: cur, - } -} - -// BasicProtectionPolicy base class for backup policy. Workload-specific backup policies are derived from this class. -type BasicProtectionPolicy interface { - AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) - AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) - AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) - AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) - AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) - AsMabProtectionPolicy() (*MabProtectionPolicy, bool) - AsProtectionPolicy() (*ProtectionPolicy, bool) -} - -// ProtectionPolicy base class for backup policy. Workload-specific backup policies are derived from this -// class. -type ProtectionPolicy struct { - // ProtectedItemsCount - Number of items associated with this policy. - ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` - // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' - BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` -} - -func unmarshalBasicProtectionPolicy(body []byte) (BasicProtectionPolicy, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["backupManagementType"] { - case string(BackupManagementTypeAzureWorkload): - var avwpp AzureVMWorkloadProtectionPolicy - err := json.Unmarshal(body, &avwpp) - return avwpp, err - case string(BackupManagementTypeAzureStorage): - var afspp AzureFileShareProtectionPolicy - err := json.Unmarshal(body, &afspp) - return afspp, err - case string(BackupManagementTypeAzureIaasVM): - var aispp AzureIaaSVMProtectionPolicy - err := json.Unmarshal(body, &aispp) - return aispp, err - case string(BackupManagementTypeAzureSQL): - var aspp AzureSQLProtectionPolicy - err := json.Unmarshal(body, &aspp) - return aspp, err - case string(BackupManagementTypeGenericProtectionPolicy): - var gpp GenericProtectionPolicy - err := json.Unmarshal(body, &gpp) - return gpp, err - case string(BackupManagementTypeMAB): - var mpp MabProtectionPolicy - err := json.Unmarshal(body, &mpp) - return mpp, err - default: - var pp ProtectionPolicy - err := json.Unmarshal(body, &pp) - return pp, err - } -} -func unmarshalBasicProtectionPolicyArray(body []byte) ([]BasicProtectionPolicy, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - ppArray := make([]BasicProtectionPolicy, len(rawMessages)) - - for index, rawMessage := range rawMessages { - pp, err := unmarshalBasicProtectionPolicy(*rawMessage) - if err != nil { - return nil, err - } - ppArray[index] = pp - } - return ppArray, nil -} - -// MarshalJSON is the custom marshaler for ProtectionPolicy. -func (pp ProtectionPolicy) MarshalJSON() ([]byte, error) { - pp.BackupManagementType = BackupManagementTypeProtectionPolicy - objectMap := make(map[string]interface{}) - if pp.ProtectedItemsCount != nil { - objectMap["protectedItemsCount"] = pp.ProtectedItemsCount - } - if pp.BackupManagementType != "" { - objectMap["backupManagementType"] = pp.BackupManagementType - } - return json.Marshal(objectMap) -} - -// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { - return nil, false -} - -// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { - return nil, false -} - -// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { - return nil, false -} - -// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { - return nil, false -} - -// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { - return nil, false -} - -// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { - return nil, false -} - -// AsProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { - return &pp, true -} - -// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. -func (pp ProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { - return &pp, true -} - -// ProtectionPolicyQueryObject filters the list backup policies API. -type ProtectionPolicyQueryObject struct { - // BackupManagementType - Backup management type for the backup policy. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // FabricName - Fabric name for filter - FabricName *string `json:"fabricName,omitempty"` - // WorkloadType - Workload type for the backup policy. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' - WorkloadType WorkloadType `json:"workloadType,omitempty"` -} - -// ProtectionPolicyResource base class for backup policy. Workload-specific backup policies are derived -// from this class. -type ProtectionPolicyResource struct { - autorest.Response `json:"-"` - // Properties - ProtectionPolicyResource properties - Properties BasicProtectionPolicy `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProtectionPolicyResource. -func (ppr ProtectionPolicyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = ppr.Properties - if ppr.Location != nil { - objectMap["location"] = ppr.Location - } - if ppr.Tags != nil { - objectMap["tags"] = ppr.Tags - } - if ppr.ETag != nil { - objectMap["eTag"] = ppr.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ProtectionPolicyResource struct. -func (ppr *ProtectionPolicyResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicProtectionPolicy(*v) - if err != nil { - return err - } - ppr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ppr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ppr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ppr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ppr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ppr.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - ppr.ETag = &eTag - } - } - } - - return nil -} - -// ProtectionPolicyResourceList list of ProtectionPolicy resources -type ProtectionPolicyResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]ProtectionPolicyResource `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"` -} - -// ProtectionPolicyResourceListIterator provides access to a complete listing of ProtectionPolicyResource -// values. -type ProtectionPolicyResourceListIterator struct { - i int - page ProtectionPolicyResourceListPage -} - -// NextWithContext 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 *ProtectionPolicyResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionPolicyResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ProtectionPolicyResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ProtectionPolicyResourceListIterator) 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 ProtectionPolicyResourceListIterator) Response() ProtectionPolicyResourceList { - 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 ProtectionPolicyResourceListIterator) Value() ProtectionPolicyResource { - if !iter.page.NotDone() { - return ProtectionPolicyResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ProtectionPolicyResourceListIterator type. -func NewProtectionPolicyResourceListIterator(page ProtectionPolicyResourceListPage) ProtectionPolicyResourceListIterator { - return ProtectionPolicyResourceListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (pprl ProtectionPolicyResourceList) IsEmpty() bool { - return pprl.Value == nil || len(*pprl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (pprl ProtectionPolicyResourceList) hasNextLink() bool { - return pprl.NextLink != nil && len(*pprl.NextLink) != 0 -} - -// protectionPolicyResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (pprl ProtectionPolicyResourceList) protectionPolicyResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !pprl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(pprl.NextLink))) -} - -// ProtectionPolicyResourceListPage contains a page of ProtectionPolicyResource values. -type ProtectionPolicyResourceListPage struct { - fn func(context.Context, ProtectionPolicyResourceList) (ProtectionPolicyResourceList, error) - pprl ProtectionPolicyResourceList -} - -// NextWithContext 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 *ProtectionPolicyResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionPolicyResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.pprl) - if err != nil { - return err - } - page.pprl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *ProtectionPolicyResourceListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ProtectionPolicyResourceListPage) NotDone() bool { - return !page.pprl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ProtectionPolicyResourceListPage) Response() ProtectionPolicyResourceList { - return page.pprl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ProtectionPolicyResourceListPage) Values() []ProtectionPolicyResource { - if page.pprl.IsEmpty() { - return nil - } - return *page.pprl.Value -} - -// Creates a new instance of the ProtectionPolicyResourceListPage type. -func NewProtectionPolicyResourceListPage(cur ProtectionPolicyResourceList, getNextPage func(context.Context, ProtectionPolicyResourceList) (ProtectionPolicyResourceList, error)) ProtectionPolicyResourceListPage { - return ProtectionPolicyResourceListPage{ - fn: getNextPage, - pprl: cur, - } -} - -// BasicRecoveryPoint base class for backup copies. Workload-specific backup copies are derived from this class. -type BasicRecoveryPoint interface { - AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) - AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) - AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) - AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) - AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) - AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) - AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) - AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) - AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) - AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) - AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) - AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) - AsRecoveryPoint() (*RecoveryPoint, bool) -} - -// RecoveryPoint base class for backup copies. Workload-specific backup copies are derived from this class. -type RecoveryPoint struct { - // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' - ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` -} - -func unmarshalBasicRecoveryPoint(body []byte) (BasicRecoveryPoint, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeAzureFileShareRecoveryPoint): - var afsrp AzureFileShareRecoveryPoint - err := json.Unmarshal(body, &afsrp) - return afsrp, err - case string(ObjectTypeAzureWorkloadPointInTimeRecoveryPoint): - var awpitrp AzureWorkloadPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awpitrp) - return awpitrp, err - case string(ObjectTypeAzureWorkloadRecoveryPoint): - var awrp AzureWorkloadRecoveryPoint - err := json.Unmarshal(body, &awrp) - return awrp, err - case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): - var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awshpitrp) - return awshpitrp, err - case string(ObjectTypeAzureWorkloadSAPHanaRecoveryPoint): - var awshrp AzureWorkloadSAPHanaRecoveryPoint - err := json.Unmarshal(body, &awshrp) - return awshrp, err - case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): - var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint - err := json.Unmarshal(body, &awspitrp) - return awspitrp, err - case string(ObjectTypeAzureWorkloadSQLRecoveryPoint): - var awsrp AzureWorkloadSQLRecoveryPoint - err := json.Unmarshal(body, &awsrp) - return awsrp, err - case string(ObjectTypeGenericRecoveryPoint): - var grp GenericRecoveryPoint - err := json.Unmarshal(body, &grp) - return grp, err - case string(ObjectTypeIaasVMRecoveryPoint): - var ivrp IaasVMRecoveryPoint - err := json.Unmarshal(body, &ivrp) - return ivrp, err - default: - var rp RecoveryPoint - err := json.Unmarshal(body, &rp) - return rp, err - } -} -func unmarshalBasicRecoveryPointArray(body []byte) ([]BasicRecoveryPoint, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - rpArray := make([]BasicRecoveryPoint, len(rawMessages)) - - for index, rawMessage := range rawMessages { - rp, err := unmarshalBasicRecoveryPoint(*rawMessage) - if err != nil { - return nil, err - } - rpArray[index] = rp - } - return rpArray, nil -} - -// MarshalJSON is the custom marshaler for RecoveryPoint. -func (rp RecoveryPoint) MarshalJSON() ([]byte, error) { - rp.ObjectType = ObjectTypeRecoveryPoint - objectMap := make(map[string]interface{}) - if rp.ObjectType != "" { - objectMap["objectType"] = rp.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { - return nil, false -} - -// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { - return nil, false -} - -// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { - return nil, false -} - -// AsRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { - return &rp, true -} - -// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. -func (rp RecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { - return &rp, true -} - -// RecoveryPointDiskConfiguration disk configuration -type RecoveryPointDiskConfiguration struct { - // NumberOfDisksIncludedInBackup - Number of disks included in backup - NumberOfDisksIncludedInBackup *int32 `json:"numberOfDisksIncludedInBackup,omitempty"` - // NumberOfDisksAttachedToVM - Number of disks attached to the VM - NumberOfDisksAttachedToVM *int32 `json:"numberOfDisksAttachedToVm,omitempty"` - // IncludedDiskList - Information of disks included in backup - IncludedDiskList *[]DiskInformation `json:"includedDiskList,omitempty"` - // ExcludedDiskList - Information of disks excluded from backup - ExcludedDiskList *[]DiskInformation `json:"excludedDiskList,omitempty"` -} - -// RecoveryPointResource base class for backup copies. Workload-specific backup copies are derived from -// this class. -type RecoveryPointResource struct { - autorest.Response `json:"-"` - // Properties - RecoveryPointResource properties - Properties BasicRecoveryPoint `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for RecoveryPointResource. -func (rpr RecoveryPointResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = rpr.Properties - if rpr.Location != nil { - objectMap["location"] = rpr.Location - } - if rpr.Tags != nil { - objectMap["tags"] = rpr.Tags - } - if rpr.ETag != nil { - objectMap["eTag"] = rpr.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RecoveryPointResource struct. -func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicRecoveryPoint(*v) - if err != nil { - return err - } - rpr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - rpr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - rpr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - rpr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - rpr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - rpr.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - rpr.ETag = &eTag - } - } - } - - return nil -} - -// RecoveryPointResourceList list of RecoveryPoint resources -type RecoveryPointResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]RecoveryPointResource `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"` -} - -// RecoveryPointResourceListIterator provides access to a complete listing of RecoveryPointResource values. -type RecoveryPointResourceListIterator struct { - i int - page RecoveryPointResourceListPage -} - -// NextWithContext 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 *RecoveryPointResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *RecoveryPointResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RecoveryPointResourceListIterator) 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 RecoveryPointResourceListIterator) Response() RecoveryPointResourceList { - 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 RecoveryPointResourceListIterator) Value() RecoveryPointResource { - if !iter.page.NotDone() { - return RecoveryPointResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the RecoveryPointResourceListIterator type. -func NewRecoveryPointResourceListIterator(page RecoveryPointResourceListPage) RecoveryPointResourceListIterator { - return RecoveryPointResourceListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rprl RecoveryPointResourceList) IsEmpty() bool { - return rprl.Value == nil || len(*rprl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rprl RecoveryPointResourceList) hasNextLink() bool { - return rprl.NextLink != nil && len(*rprl.NextLink) != 0 -} - -// recoveryPointResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rprl RecoveryPointResourceList) recoveryPointResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !rprl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rprl.NextLink))) -} - -// RecoveryPointResourceListPage contains a page of RecoveryPointResource values. -type RecoveryPointResourceListPage struct { - fn func(context.Context, RecoveryPointResourceList) (RecoveryPointResourceList, error) - rprl RecoveryPointResourceList -} - -// NextWithContext 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 *RecoveryPointResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rprl) - if err != nil { - return err - } - page.rprl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *RecoveryPointResourceListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RecoveryPointResourceListPage) NotDone() bool { - return !page.rprl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page RecoveryPointResourceListPage) Response() RecoveryPointResourceList { - return page.rprl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page RecoveryPointResourceListPage) Values() []RecoveryPointResource { - if page.rprl.IsEmpty() { - return nil - } - return *page.rprl.Value -} - -// Creates a new instance of the RecoveryPointResourceListPage type. -func NewRecoveryPointResourceListPage(cur RecoveryPointResourceList, getNextPage func(context.Context, RecoveryPointResourceList) (RecoveryPointResourceList, error)) RecoveryPointResourceListPage { - return RecoveryPointResourceListPage{ - fn: getNextPage, - rprl: cur, - } -} - -// RecoveryPointTierInformation recovery point tier information. -type RecoveryPointTierInformation struct { - // Type - Recovery point tier type. Possible values include: 'RecoveryPointTierTypeInvalid', 'RecoveryPointTierTypeInstantRP', 'RecoveryPointTierTypeHardenedRP' - Type RecoveryPointTierType `json:"type,omitempty"` - // Status - Recovery point tier status. Possible values include: 'RecoveryPointTierStatusInvalid', 'RecoveryPointTierStatusValid', 'RecoveryPointTierStatusDisabled', 'RecoveryPointTierStatusDeleted' - Status RecoveryPointTierStatus `json:"status,omitempty"` -} - -// BasicRequest base class for backup request. Workload-specific backup requests are derived from this class. -type BasicRequest interface { - AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) - AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) - AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) - AsRequest() (*Request, bool) -} - -// Request base class for backup request. Workload-specific backup requests are derived from this class. -type Request struct { - // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' - ObjectType ObjectTypeBasicRequest `json:"objectType,omitempty"` -} - -func unmarshalBasicRequest(body []byte) (BasicRequest, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeAzureFileShareBackupRequest): - var afsbr AzureFileShareBackupRequest - err := json.Unmarshal(body, &afsbr) - return afsbr, err - case string(ObjectTypeAzureWorkloadBackupRequest): - var awbr AzureWorkloadBackupRequest - err := json.Unmarshal(body, &awbr) - return awbr, err - case string(ObjectTypeIaasVMBackupRequest): - var ivbr IaasVMBackupRequest - err := json.Unmarshal(body, &ivbr) - return ivbr, err - default: - var r Request - err := json.Unmarshal(body, &r) - return r, err - } -} -func unmarshalBasicRequestArray(body []byte) ([]BasicRequest, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - rArray := make([]BasicRequest, len(rawMessages)) - - for index, rawMessage := range rawMessages { - r, err := unmarshalBasicRequest(*rawMessage) - if err != nil { - return nil, err - } - rArray[index] = r - } - return rArray, nil -} - -// MarshalJSON is the custom marshaler for Request. -func (r Request) MarshalJSON() ([]byte, error) { - r.ObjectType = ObjectTypeBackupRequest - objectMap := make(map[string]interface{}) - if r.ObjectType != "" { - objectMap["objectType"] = r.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareBackupRequest is the BasicRequest implementation for Request. -func (r Request) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { - return nil, false -} - -// AsAzureWorkloadBackupRequest is the BasicRequest implementation for Request. -func (r Request) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { - return nil, false -} - -// AsIaasVMBackupRequest is the BasicRequest implementation for Request. -func (r Request) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { - return nil, false -} - -// AsRequest is the BasicRequest implementation for Request. -func (r Request) AsRequest() (*Request, bool) { - return &r, true -} - -// AsBasicRequest is the BasicRequest implementation for Request. -func (r Request) AsBasicRequest() (BasicRequest, bool) { - return &r, true -} - -// RequestResource base class for backup request. Workload-specific backup requests are derived from this -// class. -type RequestResource struct { - // Properties - BackupRequestResource properties - Properties BasicRequest `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for RequestResource. -func (rr RequestResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = rr.Properties - if rr.Location != nil { - objectMap["location"] = rr.Location - } - if rr.Tags != nil { - objectMap["tags"] = rr.Tags - } - if rr.ETag != nil { - objectMap["eTag"] = rr.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RequestResource struct. -func (rr *RequestResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicRequest(*v) - if err != nil { - return err - } - rr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - rr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - rr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - rr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - rr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - rr.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - rr.ETag = &eTag - } - } - } - - return nil -} - -// Resource ARM Resource. -type Resource struct { - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if r.Location != nil { - objectMap["location"] = r.Location - } - if r.Tags != nil { - objectMap["tags"] = r.Tags - } - if r.ETag != nil { - objectMap["eTag"] = r.ETag - } - return json.Marshal(objectMap) -} - -// ResourceConfig the resource storage details. -type ResourceConfig struct { - // StorageModelType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant' - StorageModelType StorageType `json:"storageModelType,omitempty"` - // StorageType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant' - StorageType StorageType `json:"storageType,omitempty"` - // StorageTypeState - Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. Possible values include: 'StorageTypeStateInvalid', 'StorageTypeStateLocked', 'StorageTypeStateUnlocked' - StorageTypeState StorageTypeState `json:"storageTypeState,omitempty"` -} - -// ResourceConfigResource the resource storage details. -type ResourceConfigResource struct { - autorest.Response `json:"-"` - // Properties - BackupResourceConfigResource properties - Properties *ResourceConfig `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceConfigResource. -func (rcr ResourceConfigResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rcr.Properties != nil { - objectMap["properties"] = rcr.Properties - } - if rcr.Location != nil { - objectMap["location"] = rcr.Location - } - if rcr.Tags != nil { - objectMap["tags"] = rcr.Tags - } - if rcr.ETag != nil { - objectMap["eTag"] = rcr.ETag - } - return json.Marshal(objectMap) -} - -// ResourceHealthDetails health Details for backup items. -type ResourceHealthDetails struct { - // Code - READ-ONLY; Health Code - Code *int32 `json:"code,omitempty"` - // Title - READ-ONLY; Health Title - Title *string `json:"title,omitempty"` - // Message - READ-ONLY; Health Message - Message *string `json:"message,omitempty"` - // Recommendations - READ-ONLY; Health Recommended Actions - Recommendations *[]string `json:"recommendations,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceHealthDetails. -func (rhd ResourceHealthDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceList base for all lists of resources. -type ResourceList struct { - // NextLink - The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. - NextLink *string `json:"nextLink,omitempty"` -} - -// ResourceVaultConfig backup resource vault config details. -type ResourceVaultConfig struct { - // StorageModelType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant' - StorageModelType StorageType `json:"storageModelType,omitempty"` - // StorageType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant' - StorageType StorageType `json:"storageType,omitempty"` - // StorageTypeState - Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. Possible values include: 'StorageTypeStateInvalid', 'StorageTypeStateLocked', 'StorageTypeStateUnlocked' - StorageTypeState StorageTypeState `json:"storageTypeState,omitempty"` - // EnhancedSecurityState - Enabled or Disabled. Possible values include: 'EnhancedSecurityStateInvalid', 'EnhancedSecurityStateEnabled', 'EnhancedSecurityStateDisabled' - EnhancedSecurityState EnhancedSecurityState `json:"enhancedSecurityState,omitempty"` - // SoftDeleteFeatureState - Soft Delete feature state. Possible values include: 'SoftDeleteFeatureStateInvalid', 'SoftDeleteFeatureStateEnabled', 'SoftDeleteFeatureStateDisabled' - SoftDeleteFeatureState SoftDeleteFeatureState `json:"softDeleteFeatureState,omitempty"` -} - -// ResourceVaultConfigResource backup resource vault config details. -type ResourceVaultConfigResource struct { - autorest.Response `json:"-"` - // Properties - BackupResourceVaultConfigResource properties - Properties *ResourceVaultConfig `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceVaultConfigResource. -func (rvcr ResourceVaultConfigResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rvcr.Properties != nil { - objectMap["properties"] = rvcr.Properties - } - if rvcr.Location != nil { - objectMap["location"] = rvcr.Location - } - if rvcr.Tags != nil { - objectMap["tags"] = rvcr.Tags - } - if rvcr.ETag != nil { - objectMap["eTag"] = rvcr.ETag - } - return json.Marshal(objectMap) -} - -// RestoreFileSpecs restore file specs like file path, type and target folder path info. -type RestoreFileSpecs struct { - // Path - Source File/Folder path - Path *string `json:"path,omitempty"` - // FileSpecType - Indicates what the Path variable stands for - FileSpecType *string `json:"fileSpecType,omitempty"` - // TargetFolderPath - Destination folder path in target FileShare - TargetFolderPath *string `json:"targetFolderPath,omitempty"` -} - -// BasicRestoreRequest base class for restore request. Workload-specific restore requests are derived from this class. -type BasicRestoreRequest interface { - AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) - AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) - AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) - AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) - AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) - AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) - AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) - AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) - AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) - AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) - AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) - AsRestoreRequest() (*RestoreRequest, bool) -} - -// RestoreRequest base class for restore request. Workload-specific restore requests are derived from this -// class. -type RestoreRequest struct { - // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' - ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` -} - -func unmarshalBasicRestoreRequest(body []byte) (BasicRestoreRequest, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeAzureFileShareRestoreRequest): - var afsrr AzureFileShareRestoreRequest - err := json.Unmarshal(body, &afsrr) - return afsrr, err - case string(ObjectTypeAzureWorkloadPointInTimeRestoreRequest): - var awpitrr AzureWorkloadPointInTimeRestoreRequest - err := json.Unmarshal(body, &awpitrr) - return awpitrr, err - case string(ObjectTypeAzureWorkloadRestoreRequest): - var awrr AzureWorkloadRestoreRequest - err := json.Unmarshal(body, &awrr) - return awrr, err - case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): - var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest - err := json.Unmarshal(body, &awshpitrr) - return awshpitrr, err - case string(ObjectTypeAzureWorkloadSAPHanaRestoreRequest): - var awshrr AzureWorkloadSAPHanaRestoreRequest - err := json.Unmarshal(body, &awshrr) - return awshrr, err - case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): - var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest - err := json.Unmarshal(body, &awspitrr) - return awspitrr, err - case string(ObjectTypeAzureWorkloadSQLRestoreRequest): - var awsrr AzureWorkloadSQLRestoreRequest - err := json.Unmarshal(body, &awsrr) - return awsrr, err - case string(ObjectTypeIaasVMRestoreRequest): - var ivrr IaasVMRestoreRequest - err := json.Unmarshal(body, &ivrr) - return ivrr, err - default: - var rr RestoreRequest - err := json.Unmarshal(body, &rr) - return rr, err - } -} -func unmarshalBasicRestoreRequestArray(body []byte) ([]BasicRestoreRequest, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - rrArray := make([]BasicRestoreRequest, len(rawMessages)) - - for index, rawMessage := range rawMessages { - rr, err := unmarshalBasicRestoreRequest(*rawMessage) - if err != nil { - return nil, err - } - rrArray[index] = rr - } - return rrArray, nil -} - -// MarshalJSON is the custom marshaler for RestoreRequest. -func (rr RestoreRequest) MarshalJSON() ([]byte, error) { - rr.ObjectType = ObjectTypeRestoreRequest - objectMap := make(map[string]interface{}) - if rr.ObjectType != "" { - objectMap["objectType"] = rr.ObjectType - } - return json.Marshal(objectMap) -} - -// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { - return nil, false -} - -// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { - return nil, false -} - -// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { - return nil, false -} - -// AsRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { - return &rr, true -} - -// AsBasicRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. -func (rr RestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { - return &rr, true -} - -// RestoreRequestResource base class for restore request. Workload-specific restore requests are derived -// from this class. -type RestoreRequestResource struct { - // Properties - RestoreRequestResource properties - Properties BasicRestoreRequest `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for RestoreRequestResource. -func (rrr RestoreRequestResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = rrr.Properties - if rrr.Location != nil { - objectMap["location"] = rrr.Location - } - if rrr.Tags != nil { - objectMap["tags"] = rrr.Tags - } - if rrr.ETag != nil { - objectMap["eTag"] = rrr.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RestoreRequestResource struct. -func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicRestoreRequest(*v) - if err != nil { - return err - } - rrr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - rrr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - rrr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - rrr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - rrr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - rrr.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - rrr.ETag = &eTag - } - } - } - - return nil -} - -// RetentionDuration retention duration. -type RetentionDuration struct { - // Count - Count of duration types. Retention duration is obtained by the counting the duration type Count times. - // For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks. - Count *int32 `json:"count,omitempty"` - // DurationType - Retention duration type of retention policy. Possible values include: 'RetentionDurationTypeInvalid', 'RetentionDurationTypeDays', 'RetentionDurationTypeWeeks', 'RetentionDurationTypeMonths', 'RetentionDurationTypeYears' - DurationType RetentionDurationType `json:"durationType,omitempty"` -} - -// BasicRetentionPolicy base class for retention policy. -type BasicRetentionPolicy interface { - AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) - AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) - AsRetentionPolicy() (*RetentionPolicy, bool) -} - -// RetentionPolicy base class for retention policy. -type RetentionPolicy struct { - // RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy' - RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"` -} - -func unmarshalBasicRetentionPolicy(body []byte) (BasicRetentionPolicy, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["retentionPolicyType"] { - case string(RetentionPolicyTypeLongTermRetentionPolicy): - var ltrp LongTermRetentionPolicy - err := json.Unmarshal(body, <rp) - return ltrp, err - case string(RetentionPolicyTypeSimpleRetentionPolicy): - var srp SimpleRetentionPolicy - err := json.Unmarshal(body, &srp) - return srp, err - default: - var rp RetentionPolicy - err := json.Unmarshal(body, &rp) - return rp, err - } -} -func unmarshalBasicRetentionPolicyArray(body []byte) ([]BasicRetentionPolicy, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - rpArray := make([]BasicRetentionPolicy, len(rawMessages)) - - for index, rawMessage := range rawMessages { - rp, err := unmarshalBasicRetentionPolicy(*rawMessage) - if err != nil { - return nil, err - } - rpArray[index] = rp - } - return rpArray, nil -} - -// MarshalJSON is the custom marshaler for RetentionPolicy. -func (rp RetentionPolicy) MarshalJSON() ([]byte, error) { - rp.RetentionPolicyType = RetentionPolicyTypeRetentionPolicy - objectMap := make(map[string]interface{}) - if rp.RetentionPolicyType != "" { - objectMap["retentionPolicyType"] = rp.RetentionPolicyType - } - return json.Marshal(objectMap) -} - -// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. -func (rp RetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) { - return nil, false -} - -// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. -func (rp RetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) { - return nil, false -} - -// AsRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. -func (rp RetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) { - return &rp, true -} - -// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. -func (rp RetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) { - return &rp, true -} - -// BasicSchedulePolicy base class for backup schedule. -type BasicSchedulePolicy interface { - AsLogSchedulePolicy() (*LogSchedulePolicy, bool) - AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) - AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) - AsSchedulePolicy() (*SchedulePolicy, bool) -} - -// SchedulePolicy base class for backup schedule. -type SchedulePolicy struct { - // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' - SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` -} - -func unmarshalBasicSchedulePolicy(body []byte) (BasicSchedulePolicy, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["schedulePolicyType"] { - case string(SchedulePolicyTypeLogSchedulePolicy): - var lsp LogSchedulePolicy - err := json.Unmarshal(body, &lsp) - return lsp, err - case string(SchedulePolicyTypeLongTermSchedulePolicy): - var ltsp LongTermSchedulePolicy - err := json.Unmarshal(body, <sp) - return ltsp, err - case string(SchedulePolicyTypeSimpleSchedulePolicy): - var ssp SimpleSchedulePolicy - err := json.Unmarshal(body, &ssp) - return ssp, err - default: - var sp SchedulePolicy - err := json.Unmarshal(body, &sp) - return sp, err - } -} -func unmarshalBasicSchedulePolicyArray(body []byte) ([]BasicSchedulePolicy, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - spArray := make([]BasicSchedulePolicy, len(rawMessages)) - - for index, rawMessage := range rawMessages { - sp, err := unmarshalBasicSchedulePolicy(*rawMessage) - if err != nil { - return nil, err - } - spArray[index] = sp - } - return spArray, nil -} - -// MarshalJSON is the custom marshaler for SchedulePolicy. -func (sp SchedulePolicy) MarshalJSON() ([]byte, error) { - sp.SchedulePolicyType = SchedulePolicyTypeSchedulePolicy - objectMap := make(map[string]interface{}) - if sp.SchedulePolicyType != "" { - objectMap["schedulePolicyType"] = sp.SchedulePolicyType - } - return json.Marshal(objectMap) -} - -// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. -func (sp SchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { - return nil, false -} - -// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. -func (sp SchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { - return nil, false -} - -// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. -func (sp SchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { - return nil, false -} - -// AsSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. -func (sp SchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { - return &sp, true -} - -// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. -func (sp SchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { - return &sp, true -} - -// Settings common settings field for backup management -type Settings struct { - // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". - TimeZone *string `json:"timeZone,omitempty"` - // Issqlcompression - SQL compression flag - Issqlcompression *bool `json:"issqlcompression,omitempty"` - // IsCompression - Workload compression flag. This has been added so that 'isSqlCompression' - // will be deprecated once clients upgrade to consider this flag. - IsCompression *bool `json:"isCompression,omitempty"` -} - -// SimpleRetentionPolicy simple policy retention. -type SimpleRetentionPolicy struct { - // RetentionDuration - Retention duration of the protection policy. - RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` - // RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy' - RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"` -} - -// MarshalJSON is the custom marshaler for SimpleRetentionPolicy. -func (srp SimpleRetentionPolicy) MarshalJSON() ([]byte, error) { - srp.RetentionPolicyType = RetentionPolicyTypeSimpleRetentionPolicy - objectMap := make(map[string]interface{}) - if srp.RetentionDuration != nil { - objectMap["retentionDuration"] = srp.RetentionDuration - } - if srp.RetentionPolicyType != "" { - objectMap["retentionPolicyType"] = srp.RetentionPolicyType - } - return json.Marshal(objectMap) -} - -// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. -func (srp SimpleRetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) { - return nil, false -} - -// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. -func (srp SimpleRetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) { - return &srp, true -} - -// AsRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. -func (srp SimpleRetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) { - return nil, false -} - -// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. -func (srp SimpleRetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) { - return &srp, true -} - -// SimpleSchedulePolicy simple policy schedule. -type SimpleSchedulePolicy struct { - // ScheduleRunFrequency - Frequency of the schedule operation of this policy. Possible values include: 'ScheduleRunTypeInvalid', 'ScheduleRunTypeDaily', 'ScheduleRunTypeWeekly' - ScheduleRunFrequency ScheduleRunType `json:"scheduleRunFrequency,omitempty"` - // ScheduleRunDays - List of days of week this schedule has to be run. - ScheduleRunDays *[]DayOfWeek `json:"scheduleRunDays,omitempty"` - // ScheduleRunTimes - List of times of day this schedule has to be run. - ScheduleRunTimes *[]date.Time `json:"scheduleRunTimes,omitempty"` - // ScheduleWeeklyFrequency - At every number weeks this schedule has to be run. - ScheduleWeeklyFrequency *int32 `json:"scheduleWeeklyFrequency,omitempty"` - // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' - SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` -} - -// MarshalJSON is the custom marshaler for SimpleSchedulePolicy. -func (ssp SimpleSchedulePolicy) MarshalJSON() ([]byte, error) { - ssp.SchedulePolicyType = SchedulePolicyTypeSimpleSchedulePolicy - objectMap := make(map[string]interface{}) - if ssp.ScheduleRunFrequency != "" { - objectMap["scheduleRunFrequency"] = ssp.ScheduleRunFrequency - } - if ssp.ScheduleRunDays != nil { - objectMap["scheduleRunDays"] = ssp.ScheduleRunDays - } - if ssp.ScheduleRunTimes != nil { - objectMap["scheduleRunTimes"] = ssp.ScheduleRunTimes - } - if ssp.ScheduleWeeklyFrequency != nil { - objectMap["scheduleWeeklyFrequency"] = ssp.ScheduleWeeklyFrequency - } - if ssp.SchedulePolicyType != "" { - objectMap["schedulePolicyType"] = ssp.SchedulePolicyType - } - return json.Marshal(objectMap) -} - -// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. -func (ssp SimpleSchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { - return nil, false -} - -// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. -func (ssp SimpleSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { - return nil, false -} - -// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. -func (ssp SimpleSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { - return &ssp, true -} - -// AsSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. -func (ssp SimpleSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { - return nil, false -} - -// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. -func (ssp SimpleSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { - return &ssp, true -} - -// SQLDataDirectory sQLDataDirectory info -type SQLDataDirectory struct { - // Type - Type of data directory mapping. Possible values include: 'SQLDataDirectoryTypeInvalid', 'SQLDataDirectoryTypeData', 'SQLDataDirectoryTypeLog' - Type SQLDataDirectoryType `json:"type,omitempty"` - // Path - File path - Path *string `json:"path,omitempty"` - // LogicalName - Logical name of the file - LogicalName *string `json:"logicalName,omitempty"` -} - -// SQLDataDirectoryMapping encapsulates information regarding data directory -type SQLDataDirectoryMapping struct { - // MappingType - Type of data directory mapping. Possible values include: 'SQLDataDirectoryTypeInvalid', 'SQLDataDirectoryTypeData', 'SQLDataDirectoryTypeLog' - MappingType SQLDataDirectoryType `json:"mappingType,omitempty"` - // SourceLogicalName - Restore source logical name path - SourceLogicalName *string `json:"sourceLogicalName,omitempty"` - // SourcePath - Restore source path - SourcePath *string `json:"sourcePath,omitempty"` - // TargetPath - Target path - TargetPath *string `json:"targetPath,omitempty"` -} - -// StatusRequest backupStatus request. -type StatusRequest struct { - // ResourceType - Container Type - VM, SQLPaaS, DPM, AzureFileShare. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - ResourceType DataSourceType `json:"resourceType,omitempty"` - // ResourceID - Entire ARM resource id of the resource - ResourceID *string `json:"resourceId,omitempty"` - // PoLogicalName - Protectable Item Logical Name - PoLogicalName *string `json:"poLogicalName,omitempty"` -} - -// StatusResponse backupStatus response. -type StatusResponse struct { - autorest.Response `json:"-"` - // ProtectionStatus - Specifies whether the container is registered or not. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionStatus ProtectionStatus `json:"protectionStatus,omitempty"` - // VaultID - Specifies the arm resource id of the vault - VaultID *string `json:"vaultId,omitempty"` - // FabricName - Specifies the fabric name - Azure or AD. Possible values include: 'FabricNameInvalid', 'FabricNameAzure' - FabricName FabricName `json:"fabricName,omitempty"` - // ContainerName - Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;csname;vmname. - ContainerName *string `json:"containerName,omitempty"` - // ProtectedItemName - Specifies the product specific ds name. E.g. vm;iaasvmcontainer;csname;vmname. - ProtectedItemName *string `json:"protectedItemName,omitempty"` - // ErrorCode - ErrorCode in case of intent failed - ErrorCode *string `json:"errorCode,omitempty"` - // ErrorMessage - ErrorMessage in case of intent failed. - ErrorMessage *string `json:"errorMessage,omitempty"` - // PolicyName - Specifies the policy name which is used for protection - PolicyName *string `json:"policyName,omitempty"` - // RegistrationStatus - Container registration status - RegistrationStatus *string `json:"registrationStatus,omitempty"` -} - -// SubProtectionPolicy sub-protection policy which includes schedule and retention -type SubProtectionPolicy struct { - // 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. - RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for SubProtectionPolicy struct. -func (spp *SubProtectionPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "policyType": - if v != nil { - var policyType PolicyType - err = json.Unmarshal(*v, &policyType) - if err != nil { - return err - } - spp.PolicyType = policyType - } - case "schedulePolicy": - if v != nil { - schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) - if err != nil { - return err - } - spp.SchedulePolicy = schedulePolicy - } - case "retentionPolicy": - if v != nil { - retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) - if err != nil { - return err - } - spp.RetentionPolicy = retentionPolicy - } - } - } - - return nil -} - -// TargetAFSRestoreInfo target Azure File Share Info. -type TargetAFSRestoreInfo struct { - // Name - File share name - Name *string `json:"name,omitempty"` - // TargetResourceID - Target file share resource ARM ID - TargetResourceID *string `json:"targetResourceId,omitempty"` -} - -// TargetRestoreInfo details about target workload during restore operation. -type TargetRestoreInfo struct { - // OverwriteOption - Can Overwrite if Target DataBase already exists. Possible values include: 'OverwriteOptionsInvalid', 'OverwriteOptionsFailOnConflict', 'OverwriteOptionsOverwrite' - OverwriteOption OverwriteOptions `json:"overwriteOption,omitempty"` - // ContainerID - Resource Id name of the container in which Target DataBase resides - ContainerID *string `json:"containerId,omitempty"` - // DatabaseName - Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana - DatabaseName *string `json:"databaseName,omitempty"` - // TargetDirectoryForFileRestore - Target directory location for restore as files. - TargetDirectoryForFileRestore *string `json:"targetDirectoryForFileRestore,omitempty"` -} - -// TokenInformation the token information details. -type TokenInformation struct { - autorest.Response `json:"-"` - // Token - Token value. - Token *string `json:"token,omitempty"` - // ExpiryTimeInUtcTicks - Expiry time of token. - ExpiryTimeInUtcTicks *int64 `json:"expiryTimeInUtcTicks,omitempty"` - // SecurityPIN - Security PIN - SecurityPIN *string `json:"securityPIN,omitempty"` -} - -// ValidateIaasVMRestoreOperationRequest azureRestoreValidation request. -type ValidateIaasVMRestoreOperationRequest struct { - // RestoreRequest - Sets restore request to be validated - RestoreRequest BasicRestoreRequest `json:"restoreRequest,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeValidateOperationRequest', 'ObjectTypeValidateIaasVMRestoreOperationRequest', 'ObjectTypeValidateRestoreOperationRequest' - ObjectType ObjectTypeBasicValidateOperationRequest `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for ValidateIaasVMRestoreOperationRequest. -func (vivror ValidateIaasVMRestoreOperationRequest) MarshalJSON() ([]byte, error) { - vivror.ObjectType = ObjectTypeValidateIaasVMRestoreOperationRequest - objectMap := make(map[string]interface{}) - objectMap["restoreRequest"] = vivror.RestoreRequest - if vivror.ObjectType != "" { - objectMap["objectType"] = vivror.ObjectType - } - return json.Marshal(objectMap) -} - -// AsValidateIaasVMRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. -func (vivror ValidateIaasVMRestoreOperationRequest) AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) { - return &vivror, true -} - -// AsValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. -func (vivror ValidateIaasVMRestoreOperationRequest) AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) { - return nil, false -} - -// AsBasicValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. -func (vivror ValidateIaasVMRestoreOperationRequest) AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) { - return &vivror, true -} - -// AsValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. -func (vivror ValidateIaasVMRestoreOperationRequest) AsValidateOperationRequest() (*ValidateOperationRequest, bool) { - return nil, false -} - -// AsBasicValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. -func (vivror ValidateIaasVMRestoreOperationRequest) AsBasicValidateOperationRequest() (BasicValidateOperationRequest, bool) { - return &vivror, true -} - -// UnmarshalJSON is the custom unmarshaler for ValidateIaasVMRestoreOperationRequest struct. -func (vivror *ValidateIaasVMRestoreOperationRequest) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "restoreRequest": - if v != nil { - restoreRequest, err := unmarshalBasicRestoreRequest(*v) - if err != nil { - return err - } - vivror.RestoreRequest = restoreRequest - } - case "objectType": - if v != nil { - var objectType ObjectTypeBasicValidateOperationRequest - err = json.Unmarshal(*v, &objectType) - if err != nil { - return err - } - vivror.ObjectType = objectType - } - } - } - - return nil -} - -// BasicValidateOperationRequest base class for validate operation request. -type BasicValidateOperationRequest interface { - AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) - AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) - AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) - AsValidateOperationRequest() (*ValidateOperationRequest, bool) -} - -// ValidateOperationRequest base class for validate operation request. -type ValidateOperationRequest struct { - // ObjectType - Possible values include: 'ObjectTypeValidateOperationRequest', 'ObjectTypeValidateIaasVMRestoreOperationRequest', 'ObjectTypeValidateRestoreOperationRequest' - ObjectType ObjectTypeBasicValidateOperationRequest `json:"objectType,omitempty"` -} - -func unmarshalBasicValidateOperationRequest(body []byte) (BasicValidateOperationRequest, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeValidateIaasVMRestoreOperationRequest): - var vivror ValidateIaasVMRestoreOperationRequest - err := json.Unmarshal(body, &vivror) - return vivror, err - case string(ObjectTypeValidateRestoreOperationRequest): - var vror ValidateRestoreOperationRequest - err := json.Unmarshal(body, &vror) - return vror, err - default: - var vor ValidateOperationRequest - err := json.Unmarshal(body, &vor) - return vor, err - } -} -func unmarshalBasicValidateOperationRequestArray(body []byte) ([]BasicValidateOperationRequest, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - vorArray := make([]BasicValidateOperationRequest, len(rawMessages)) - - for index, rawMessage := range rawMessages { - vor, err := unmarshalBasicValidateOperationRequest(*rawMessage) - if err != nil { - return nil, err - } - vorArray[index] = vor - } - return vorArray, nil -} - -// MarshalJSON is the custom marshaler for ValidateOperationRequest. -func (vor ValidateOperationRequest) MarshalJSON() ([]byte, error) { - vor.ObjectType = ObjectTypeValidateOperationRequest - objectMap := make(map[string]interface{}) - if vor.ObjectType != "" { - objectMap["objectType"] = vor.ObjectType - } - return json.Marshal(objectMap) -} - -// AsValidateIaasVMRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. -func (vor ValidateOperationRequest) AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) { - return nil, false -} - -// AsValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. -func (vor ValidateOperationRequest) AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) { - return nil, false -} - -// AsBasicValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. -func (vor ValidateOperationRequest) AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) { - return nil, false -} - -// AsValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. -func (vor ValidateOperationRequest) AsValidateOperationRequest() (*ValidateOperationRequest, bool) { - return &vor, true -} - -// AsBasicValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. -func (vor ValidateOperationRequest) AsBasicValidateOperationRequest() (BasicValidateOperationRequest, bool) { - return &vor, true -} - -// ValidateOperationResponse base class for validate operation response. -type ValidateOperationResponse struct { - // ValidationResults - Gets the validation result - ValidationResults *[]ErrorDetail `json:"validationResults,omitempty"` -} - -// ValidateOperationsResponse ... -type ValidateOperationsResponse struct { - autorest.Response `json:"-"` - ValidateOperationResponse *ValidateOperationResponse `json:"validateOperationResponse,omitempty"` -} - -// BasicValidateRestoreOperationRequest azureRestoreValidation request. -type BasicValidateRestoreOperationRequest interface { - AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) - AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) -} - -// ValidateRestoreOperationRequest azureRestoreValidation request. -type ValidateRestoreOperationRequest struct { - // RestoreRequest - Sets restore request to be validated - RestoreRequest BasicRestoreRequest `json:"restoreRequest,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeValidateOperationRequest', 'ObjectTypeValidateIaasVMRestoreOperationRequest', 'ObjectTypeValidateRestoreOperationRequest' - ObjectType ObjectTypeBasicValidateOperationRequest `json:"objectType,omitempty"` -} - -func unmarshalBasicValidateRestoreOperationRequest(body []byte) (BasicValidateRestoreOperationRequest, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeValidateIaasVMRestoreOperationRequest): - var vivror ValidateIaasVMRestoreOperationRequest - err := json.Unmarshal(body, &vivror) - return vivror, err - default: - var vror ValidateRestoreOperationRequest - err := json.Unmarshal(body, &vror) - return vror, err - } -} -func unmarshalBasicValidateRestoreOperationRequestArray(body []byte) ([]BasicValidateRestoreOperationRequest, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - vrorArray := make([]BasicValidateRestoreOperationRequest, len(rawMessages)) - - for index, rawMessage := range rawMessages { - vror, err := unmarshalBasicValidateRestoreOperationRequest(*rawMessage) - if err != nil { - return nil, err - } - vrorArray[index] = vror - } - return vrorArray, nil -} - -// MarshalJSON is the custom marshaler for ValidateRestoreOperationRequest. -func (vror ValidateRestoreOperationRequest) MarshalJSON() ([]byte, error) { - vror.ObjectType = ObjectTypeValidateRestoreOperationRequest - objectMap := make(map[string]interface{}) - objectMap["restoreRequest"] = vror.RestoreRequest - if vror.ObjectType != "" { - objectMap["objectType"] = vror.ObjectType - } - return json.Marshal(objectMap) -} - -// AsValidateIaasVMRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. -func (vror ValidateRestoreOperationRequest) AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) { - return nil, false -} - -// AsValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. -func (vror ValidateRestoreOperationRequest) AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) { - return &vror, true -} - -// AsBasicValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. -func (vror ValidateRestoreOperationRequest) AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) { - return &vror, true -} - -// AsValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. -func (vror ValidateRestoreOperationRequest) AsValidateOperationRequest() (*ValidateOperationRequest, bool) { - return nil, false -} - -// AsBasicValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. -func (vror ValidateRestoreOperationRequest) AsBasicValidateOperationRequest() (BasicValidateOperationRequest, bool) { - return &vror, true -} - -// UnmarshalJSON is the custom unmarshaler for ValidateRestoreOperationRequest struct. -func (vror *ValidateRestoreOperationRequest) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "restoreRequest": - if v != nil { - restoreRequest, err := unmarshalBasicRestoreRequest(*v) - if err != nil { - return err - } - vror.RestoreRequest = restoreRequest - } - case "objectType": - if v != nil { - var objectType ObjectTypeBasicValidateOperationRequest - err = json.Unmarshal(*v, &objectType) - if err != nil { - return err - } - vror.ObjectType = objectType - } - } - } - - return nil -} - -// WeeklyRetentionFormat weekly retention format. -type WeeklyRetentionFormat struct { - // DaysOfTheWeek - List of days of the week. - DaysOfTheWeek *[]DayOfWeek `json:"daysOfTheWeek,omitempty"` - // WeeksOfTheMonth - List of weeks of month. - WeeksOfTheMonth *[]WeekOfMonth `json:"weeksOfTheMonth,omitempty"` -} - -// WeeklyRetentionSchedule weekly retention schedule. -type WeeklyRetentionSchedule struct { - // DaysOfTheWeek - List of days of week for weekly retention policy. - DaysOfTheWeek *[]DayOfWeek `json:"daysOfTheWeek,omitempty"` - // RetentionTimes - Retention times of retention policy. - RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` - // RetentionDuration - Retention duration of retention Policy. - RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` -} - -// WorkloadInquiryDetails details of an inquired protectable item. -type WorkloadInquiryDetails struct { - // Type - Type of the Workload such as SQL, Oracle etc. - Type *string `json:"type,omitempty"` - // ItemCount - Contains the protectable item Count inside this Container. - ItemCount *int64 `json:"itemCount,omitempty"` - // InquiryValidation - Inquiry validation such as permissions and other backup validations. - InquiryValidation *InquiryValidation `json:"inquiryValidation,omitempty"` -} - -// BasicWorkloadItem base class for backup item. Workload-specific backup items are derived from this class. -type BasicWorkloadItem interface { - AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) - AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) - AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) - AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) - AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) - AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) - AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) - AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) - AsWorkloadItem() (*WorkloadItem, bool) -} - -// WorkloadItem base class for backup item. Workload-specific backup items are derived from this class. -type WorkloadItem struct { - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' - WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` -} - -func unmarshalBasicWorkloadItem(body []byte) (BasicWorkloadItem, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["workloadItemType"] { - case string(WorkloadItemTypeAzureVMWorkloadItem): - var avwi AzureVMWorkloadItem - err := json.Unmarshal(body, &avwi) - return avwi, err - case string(WorkloadItemTypeSAPAseDatabase1): - var avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem - err := json.Unmarshal(body, &avwsadwi) - return avwsadwi, err - case string(WorkloadItemTypeSAPAseSystem1): - var avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem - err := json.Unmarshal(body, &avwsaswi) - return avwsaswi, err - case string(WorkloadItemTypeSAPHanaDatabase1): - var avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem - err := json.Unmarshal(body, &avwshdwi) - return avwshdwi, err - case string(WorkloadItemTypeSAPHanaSystem1): - var avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem - err := json.Unmarshal(body, &avwshswi) - return avwshswi, err - case string(WorkloadItemTypeSQLDataBase1): - var avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem - err := json.Unmarshal(body, &avwsdwi) - return avwsdwi, err - case string(WorkloadItemTypeSQLInstance1): - var avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem - err := json.Unmarshal(body, &avwsiwi) - return avwsiwi, err - default: - var wi WorkloadItem - err := json.Unmarshal(body, &wi) - return wi, err - } -} -func unmarshalBasicWorkloadItemArray(body []byte) ([]BasicWorkloadItem, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - wiArray := make([]BasicWorkloadItem, len(rawMessages)) - - for index, rawMessage := range rawMessages { - wi, err := unmarshalBasicWorkloadItem(*rawMessage) - if err != nil { - return nil, err - } - wiArray[index] = wi - } - return wiArray, nil -} - -// MarshalJSON is the custom marshaler for WorkloadItem. -func (wi WorkloadItem) MarshalJSON() ([]byte, error) { - wi.WorkloadItemType = WorkloadItemTypeWorkloadItem - objectMap := make(map[string]interface{}) - if wi.BackupManagementType != nil { - objectMap["backupManagementType"] = wi.BackupManagementType - } - if wi.WorkloadType != nil { - objectMap["workloadType"] = wi.WorkloadType - } - if wi.FriendlyName != nil { - objectMap["friendlyName"] = wi.FriendlyName - } - if wi.ProtectionState != "" { - objectMap["protectionState"] = wi.ProtectionState - } - if wi.WorkloadItemType != "" { - objectMap["workloadItemType"] = wi.WorkloadItemType - } - return json.Marshal(objectMap) -} - -// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { - return nil, false -} - -// AsWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { - return &wi, true -} - -// AsBasicWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. -func (wi WorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { - return &wi, true -} - -// WorkloadItemResource base class for backup item. Workload-specific backup items are derived from this -// class. -type WorkloadItemResource struct { - // Properties - WorkloadItemResource properties - Properties BasicWorkloadItem `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... +// ErrorAdditionalInfo the resource management error additional info. +type ErrorAdditionalInfo struct { + // Type - READ-ONLY; The additional info type. Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` + // Info - READ-ONLY; The additional info. + Info interface{} `json:"info,omitempty"` } -// MarshalJSON is the custom marshaler for WorkloadItemResource. -func (wir WorkloadItemResource) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ErrorAdditionalInfo. +func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["properties"] = wir.Properties - if wir.Location != nil { - objectMap["location"] = wir.Location - } - if wir.Tags != nil { - objectMap["tags"] = wir.Tags - } - if wir.ETag != nil { - objectMap["eTag"] = wir.ETag - } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for WorkloadItemResource struct. -func (wir *WorkloadItemResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicWorkloadItem(*v) - if err != nil { - return err - } - wir.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - wir.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - wir.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - wir.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - wir.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - wir.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - wir.ETag = &eTag - } - } - } - - return nil -} - -// WorkloadItemResourceList list of WorkloadItem resources -type WorkloadItemResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]WorkloadItemResource `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"` -} - -// WorkloadItemResourceListIterator provides access to a complete listing of WorkloadItemResource values. -type WorkloadItemResourceListIterator struct { - i int - page WorkloadItemResourceListPage -} - -// NextWithContext 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 *WorkloadItemResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadItemResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *WorkloadItemResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter WorkloadItemResourceListIterator) 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 WorkloadItemResourceListIterator) Response() WorkloadItemResourceList { - return iter.page.Response() +// ErrorResponse common error response for all Azure Resource Manager APIs to return error details for +// failed operations. (This also follows the OData error response format.) +type ErrorResponse struct { + // Code - READ-ONLY; The error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; The error message. + Message *string `json:"message,omitempty"` + // Target - READ-ONLY; The error target. + Target *string `json:"target,omitempty"` + // Details - READ-ONLY; The error details. + Details *[]ErrorResponse `json:"details,omitempty"` + // AdditionalInfo - READ-ONLY; The error additional info. + AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` } -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter WorkloadItemResourceListIterator) Value() WorkloadItemResource { - if !iter.page.NotDone() { - return WorkloadItemResource{} - } - return iter.page.Values()[iter.i] +// MarshalJSON is the custom marshaler for ErrorResponse. +func (er ErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) } -// Creates a new instance of the WorkloadItemResourceListIterator type. -func NewWorkloadItemResourceListIterator(page WorkloadItemResourceListPage) WorkloadItemResourceListIterator { - return WorkloadItemResourceListIterator{page: page} +// OperationStatus operation status. +type OperationStatus struct { + autorest.Response `json:"-"` + // ID - ID of the operation. + ID *string `json:"id,omitempty"` + // Name - Name of the operation. + Name *string `json:"name,omitempty"` + // Status - Operation status. Possible values include: 'Invalid', 'InProgress', 'Succeeded', 'Failed', 'Canceled' + Status OperationStatusValues `json:"status,omitempty"` + // StartTime - Operation start time. Format: ISO-8601. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Operation end time. Format: ISO-8601. + EndTime *date.Time `json:"endTime,omitempty"` + // Error - Error information related to this operation. + Error *OperationStatusError `json:"error,omitempty"` } -// IsEmpty returns true if the ListResult contains no values. -func (wirl WorkloadItemResourceList) IsEmpty() bool { - return wirl.Value == nil || len(*wirl.Value) == 0 +// OperationStatusError error information associated with operation status call. +type OperationStatusError struct { + // Code - Error code of the operation failure. + Code *string `json:"code,omitempty"` + // Message - Error message displayed if the operation failure. + Message *string `json:"message,omitempty"` } -// hasNextLink returns true if the NextLink is not empty. -func (wirl WorkloadItemResourceList) hasNextLink() bool { - return wirl.NextLink != nil && len(*wirl.NextLink) != 0 +// PrivateEndpoint the Private Endpoint network resource that is linked to the Private Endpoint connection +type PrivateEndpoint struct { + // ID - Gets or sets id + ID *string `json:"id,omitempty"` } -// workloadItemResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (wirl WorkloadItemResourceList) workloadItemResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !wirl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(wirl.NextLink))) +// PrivateEndpointConnection private Endpoint Connection Response Properties +type PrivateEndpointConnection struct { + // ProvisioningState - Gets or sets provisioning state of the private endpoint connection. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateDeleting', 'ProvisioningStateFailed', 'ProvisioningStatePending' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // PrivateEndpoint - Gets or sets private endpoint associated with the private endpoint connection + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + // PrivateLinkServiceConnectionState - Gets or sets private link service connection state + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` } -// WorkloadItemResourceListPage contains a page of WorkloadItemResource values. -type WorkloadItemResourceListPage struct { - fn func(context.Context, WorkloadItemResourceList) (WorkloadItemResourceList, error) - wirl WorkloadItemResourceList +// PrivateEndpointConnectionDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type PrivateEndpointConnectionDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateEndpointConnectionClient) (autorest.Response, error) } -// NextWithContext 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 *WorkloadItemResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadItemResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.wirl) - if err != nil { - return err - } - page.wirl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateEndpointConnectionDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err } + future.FutureAPI = &azFuture + future.Result = future.result return nil } -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *WorkloadItemResourceListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page WorkloadItemResourceListPage) NotDone() bool { - return !page.wirl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page WorkloadItemResourceListPage) Response() WorkloadItemResourceList { - return page.wirl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page WorkloadItemResourceListPage) Values() []WorkloadItemResource { - if page.wirl.IsEmpty() { - return nil +// result is the default implementation for PrivateEndpointConnectionDeleteFuture.Result. +func (future *PrivateEndpointConnectionDeleteFuture) result(client PrivateEndpointConnectionClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.PrivateEndpointConnectionDeleteFuture", "Result", future.Response(), "Polling failure") + return } - return *page.wirl.Value -} - -// Creates a new instance of the WorkloadItemResourceListPage type. -func NewWorkloadItemResourceListPage(cur WorkloadItemResourceList, getNextPage func(context.Context, WorkloadItemResourceList) (WorkloadItemResourceList, error)) WorkloadItemResourceListPage { - return WorkloadItemResourceListPage{ - fn: getNextPage, - wirl: cur, + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("backup.PrivateEndpointConnectionDeleteFuture") + return } + ar.Response = future.Response() + return } -// BasicWorkloadProtectableItem base class for backup item. Workload-specific backup items are derived from this class. -type BasicWorkloadProtectableItem interface { - AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) - AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) - AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) - AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) - AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) - AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) - AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) - AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) - AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) - AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) - AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) - AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) - AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) - AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +// PrivateEndpointConnectionPutFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type PrivateEndpointConnectionPutFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateEndpointConnectionClient) (PrivateEndpointConnectionResource, error) } -// WorkloadProtectableItem base class for backup item. Workload-specific backup items are derived from this -// class. -type WorkloadProtectableItem struct { - // BackupManagementType - Type of backup management to backup an item. - BackupManagementType *string `json:"backupManagementType,omitempty"` - // WorkloadType - Type of workload for the backup management - WorkloadType *string `json:"workloadType,omitempty"` - // FriendlyName - Friendly name of the backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' - ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateEndpointConnectionPutFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil } -func unmarshalBasicWorkloadProtectableItem(body []byte) (BasicWorkloadProtectableItem, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) +// result is the default implementation for PrivateEndpointConnectionPutFuture.Result. +func (future *PrivateEndpointConnectionPutFuture) result(client PrivateEndpointConnectionClient) (pecr PrivateEndpointConnectionResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) if err != nil { - return nil, err - } - - switch m["protectableItemType"] { - case string(ProtectableItemTypeAzureFileShare): - var afspi AzureFileShareProtectableItem - err := json.Unmarshal(body, &afspi) - return afspi, err - case string(ProtectableItemTypeMicrosoftClassicComputevirtualMachines): - var aisccvpi AzureIaaSClassicComputeVMProtectableItem - err := json.Unmarshal(body, &aisccvpi) - return aisccvpi, err - case string(ProtectableItemTypeMicrosoftComputevirtualMachines): - var aiscvpi AzureIaaSComputeVMProtectableItem - err := json.Unmarshal(body, &aiscvpi) - return aiscvpi, err - case string(ProtectableItemTypeAzureVMWorkloadProtectableItem): - var avwpi AzureVMWorkloadProtectableItem - err := json.Unmarshal(body, &avwpi) - return avwpi, err - case string(ProtectableItemTypeSAPAseSystem): - var avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem - err := json.Unmarshal(body, &avwsaspi) - return avwsaspi, err - case string(ProtectableItemTypeSAPHanaDatabase): - var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem - err := json.Unmarshal(body, &avwshdpi) - return avwshdpi, err - case string(ProtectableItemTypeSAPHanaSystem): - var avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem - err := json.Unmarshal(body, &avwshspi) - return avwshspi, err - case string(ProtectableItemTypeSQLAvailabilityGroupContainer): - var avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem - err := json.Unmarshal(body, &avwsagpi) - return avwsagpi, err - case string(ProtectableItemTypeSQLDataBase): - var avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem - err := json.Unmarshal(body, &avwsdpi) - return avwsdpi, err - case string(ProtectableItemTypeSQLInstance): - var avwsipi AzureVMWorkloadSQLInstanceProtectableItem - err := json.Unmarshal(body, &avwsipi) - return avwsipi, err - case string(ProtectableItemTypeIaaSVMProtectableItem): - var ispi IaaSVMProtectableItem - err := json.Unmarshal(body, &ispi) - return ispi, err - default: - var wpi WorkloadProtectableItem - err := json.Unmarshal(body, &wpi) - return wpi, err + err = autorest.NewErrorWithError(err, "backup.PrivateEndpointConnectionPutFuture", "Result", future.Response(), "Polling failure") + return } -} -func unmarshalBasicWorkloadProtectableItemArray(body []byte) ([]BasicWorkloadProtectableItem, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err + if !done { + pecr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("backup.PrivateEndpointConnectionPutFuture") + return } - - wpiArray := make([]BasicWorkloadProtectableItem, len(rawMessages)) - - for index, rawMessage := range rawMessages { - wpi, err := unmarshalBasicWorkloadProtectableItem(*rawMessage) + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pecr.Response.Response, err = future.GetResult(sender); err == nil && pecr.Response.Response.StatusCode != http.StatusNoContent { + pecr, err = client.PutResponder(pecr.Response.Response) if err != nil { - return nil, err + err = autorest.NewErrorWithError(err, "backup.PrivateEndpointConnectionPutFuture", "Result", pecr.Response.Response, "Failure responding to request") } - wpiArray[index] = wpi } - return wpiArray, nil + return +} + +// PrivateEndpointConnectionResource private Endpoint Connection Response Properties +type PrivateEndpointConnectionResource struct { + autorest.Response `json:"-"` + // Properties - PrivateEndpointConnectionResource properties + Properties *PrivateEndpointConnection `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` } -// MarshalJSON is the custom marshaler for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) MarshalJSON() ([]byte, error) { - wpi.ProtectableItemType = ProtectableItemTypeWorkloadProtectableItem +// MarshalJSON is the custom marshaler for PrivateEndpointConnectionResource. +func (pecr PrivateEndpointConnectionResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if wpi.BackupManagementType != nil { - objectMap["backupManagementType"] = wpi.BackupManagementType - } - if wpi.WorkloadType != nil { - objectMap["workloadType"] = wpi.WorkloadType + if pecr.Properties != nil { + objectMap["properties"] = pecr.Properties } - if wpi.FriendlyName != nil { - objectMap["friendlyName"] = wpi.FriendlyName + if pecr.Location != nil { + objectMap["location"] = pecr.Location } - if wpi.ProtectionState != "" { - objectMap["protectionState"] = wpi.ProtectionState + if pecr.Tags != nil { + objectMap["tags"] = pecr.Tags } - if wpi.ProtectableItemType != "" { - objectMap["protectableItemType"] = wpi.ProtectableItemType + if pecr.ETag != nil { + objectMap["eTag"] = pecr.ETag } return json.Marshal(objectMap) } -// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { - return nil, false -} - -// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { - return nil, false -} - -// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { - return nil, false -} - -// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { - return nil, false -} - -// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { - return &wpi, true -} - -// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. -func (wpi WorkloadProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { - return &wpi, true +// PrivateLinkServiceConnectionState private Link Service Connection State +type PrivateLinkServiceConnectionState struct { + // Status - Gets or sets the status. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' + Status PrivateEndpointConnectionStatus `json:"status,omitempty"` + // Description - Gets or sets description + Description *string `json:"description,omitempty"` + // ActionRequired - Gets or sets actions required + ActionRequired *string `json:"actionRequired,omitempty"` } -// WorkloadProtectableItemResource base class for backup item. Workload-specific backup items are derived -// from this class. -type WorkloadProtectableItemResource struct { - // Properties - WorkloadProtectableItemResource properties - Properties BasicWorkloadProtectableItem `json:"properties,omitempty"` +// Resource ARM Resource. +type Resource struct { // ID - READ-ONLY; Resource Id represents the complete path to the resource. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name associated with the resource. @@ -19498,271 +237,17 @@ type WorkloadProtectableItemResource struct { ETag *string `json:"eTag,omitempty"` } -// MarshalJSON is the custom marshaler for WorkloadProtectableItemResource. -func (wpir WorkloadProtectableItemResource) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["properties"] = wpir.Properties - if wpir.Location != nil { - objectMap["location"] = wpir.Location + if r.Location != nil { + objectMap["location"] = r.Location } - if wpir.Tags != nil { - objectMap["tags"] = wpir.Tags + if r.Tags != nil { + objectMap["tags"] = r.Tags } - if wpir.ETag != nil { - objectMap["eTag"] = wpir.ETag + if r.ETag != nil { + objectMap["eTag"] = r.ETag } return json.Marshal(objectMap) } - -// UnmarshalJSON is the custom unmarshaler for WorkloadProtectableItemResource struct. -func (wpir *WorkloadProtectableItemResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicWorkloadProtectableItem(*v) - if err != nil { - return err - } - wpir.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - wpir.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - wpir.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - wpir.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - wpir.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - wpir.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - wpir.ETag = &eTag - } - } - } - - return nil -} - -// WorkloadProtectableItemResourceList list of WorkloadProtectableItem resources -type WorkloadProtectableItemResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]WorkloadProtectableItemResource `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"` -} - -// WorkloadProtectableItemResourceListIterator provides access to a complete listing of -// WorkloadProtectableItemResource values. -type WorkloadProtectableItemResourceListIterator struct { - i int - page WorkloadProtectableItemResourceListPage -} - -// NextWithContext 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 *WorkloadProtectableItemResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadProtectableItemResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *WorkloadProtectableItemResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter WorkloadProtectableItemResourceListIterator) 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 WorkloadProtectableItemResourceListIterator) Response() WorkloadProtectableItemResourceList { - 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 WorkloadProtectableItemResourceListIterator) Value() WorkloadProtectableItemResource { - if !iter.page.NotDone() { - return WorkloadProtectableItemResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the WorkloadProtectableItemResourceListIterator type. -func NewWorkloadProtectableItemResourceListIterator(page WorkloadProtectableItemResourceListPage) WorkloadProtectableItemResourceListIterator { - return WorkloadProtectableItemResourceListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (wpirl WorkloadProtectableItemResourceList) IsEmpty() bool { - return wpirl.Value == nil || len(*wpirl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (wpirl WorkloadProtectableItemResourceList) hasNextLink() bool { - return wpirl.NextLink != nil && len(*wpirl.NextLink) != 0 -} - -// workloadProtectableItemResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (wpirl WorkloadProtectableItemResourceList) workloadProtectableItemResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !wpirl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(wpirl.NextLink))) -} - -// WorkloadProtectableItemResourceListPage contains a page of WorkloadProtectableItemResource values. -type WorkloadProtectableItemResourceListPage struct { - fn func(context.Context, WorkloadProtectableItemResourceList) (WorkloadProtectableItemResourceList, error) - wpirl WorkloadProtectableItemResourceList -} - -// NextWithContext 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 *WorkloadProtectableItemResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadProtectableItemResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.wpirl) - if err != nil { - return err - } - page.wpirl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *WorkloadProtectableItemResourceListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page WorkloadProtectableItemResourceListPage) NotDone() bool { - return !page.wpirl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page WorkloadProtectableItemResourceListPage) Response() WorkloadProtectableItemResourceList { - return page.wpirl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page WorkloadProtectableItemResourceListPage) Values() []WorkloadProtectableItemResource { - if page.wpirl.IsEmpty() { - return nil - } - return *page.wpirl.Value -} - -// Creates a new instance of the WorkloadProtectableItemResourceListPage type. -func NewWorkloadProtectableItemResourceListPage(cur WorkloadProtectableItemResourceList, getNextPage func(context.Context, WorkloadProtectableItemResourceList) (WorkloadProtectableItemResourceList, error)) WorkloadProtectableItemResourceListPage { - return WorkloadProtectableItemResourceListPage{ - fn: getNextPage, - wpirl: cur, - } -} - -// YearlyRetentionSchedule yearly retention schedule. -type YearlyRetentionSchedule struct { - // RetentionScheduleFormatType - Retention schedule format for yearly retention policy. Possible values include: 'RetentionScheduleFormatInvalid', 'RetentionScheduleFormatDaily', 'RetentionScheduleFormatWeekly' - RetentionScheduleFormatType RetentionScheduleFormat `json:"retentionScheduleFormatType,omitempty"` - // MonthsOfYear - List of months of year of yearly retention policy. - MonthsOfYear *[]MonthOfYear `json:"monthsOfYear,omitempty"` - // RetentionScheduleDaily - Daily retention format for yearly retention policy. - RetentionScheduleDaily *DailyRetentionFormat `json:"retentionScheduleDaily,omitempty"` - // RetentionScheduleWeekly - Weekly retention format for yearly retention policy. - RetentionScheduleWeekly *WeeklyRetentionFormat `json:"retentionScheduleWeekly,omitempty"` - // RetentionTimes - Retention times of retention policy. - RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` - // RetentionDuration - Retention duration of retention Policy. - RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` -} diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/protectablecontainers.go b/services/recoveryservices/mgmt/2020-02-02/backup/protectablecontainers.go deleted file mode 100644 index 65f847abf488..000000000000 --- a/services/recoveryservices/mgmt/2020-02-02/backup/protectablecontainers.go +++ /dev/null @@ -1,155 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ProtectableContainersClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type ProtectableContainersClient struct { - BaseClient -} - -// NewProtectableContainersClient creates an instance of the ProtectableContainersClient client. -func NewProtectableContainersClient(subscriptionID string) ProtectableContainersClient { - return NewProtectableContainersClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewProtectableContainersClientWithBaseURI creates an instance of the ProtectableContainersClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewProtectableContainersClientWithBaseURI(baseURI string, subscriptionID string) ProtectableContainersClient { - return ProtectableContainersClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// 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. -// filter - oData filter options. -func (client ProtectableContainersClient) List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, filter string) (result ProtectableContainerResourceListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableContainersClient.List") - defer func() { - sc := -1 - if result.pcrl.Response.Response != nil { - sc = result.pcrl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, vaultName, resourceGroupName, fabricName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectableContainersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.pcrl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.ProtectableContainersClient", "List", resp, "Failure sending request") - return - } - - result.pcrl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectableContainersClient", "List", resp, "Failure responding to request") - return - } - if result.pcrl.hasNextLink() && result.pcrl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ProtectableContainersClient) ListPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "fabricName": autorest.Encode("path", fabricName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectableContainers", 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 ProtectableContainersClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ProtectableContainersClient) ListResponder(resp *http.Response) (result ProtectableContainerResourceList, err error) { - err = autorest.Respond( - resp, - 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 ProtectableContainersClient) listNextResults(ctx context.Context, lastResults ProtectableContainerResourceList) (result ProtectableContainerResourceList, err error) { - req, err := lastResults.protectableContainerResourceListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "backup.ProtectableContainersClient", "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.ProtectableContainersClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectableContainersClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ProtectableContainersClient) ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, filter string) (result ProtectableContainerResourceListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableContainersClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, vaultName, resourceGroupName, fabricName, filter) - return -} diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/protectableitems.go b/services/recoveryservices/mgmt/2020-02-02/backup/protectableitems.go deleted file mode 100644 index 167e39969e21..000000000000 --- a/services/recoveryservices/mgmt/2020-02-02/backup/protectableitems.go +++ /dev/null @@ -1,159 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ProtectableItemsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type ProtectableItemsClient struct { - BaseClient -} - -// NewProtectableItemsClient creates an instance of the ProtectableItemsClient client. -func NewProtectableItemsClient(subscriptionID string) ProtectableItemsClient { - return NewProtectableItemsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewProtectableItemsClientWithBaseURI creates an instance of the ProtectableItemsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewProtectableItemsClientWithBaseURI(baseURI string, subscriptionID string) ProtectableItemsClient { - return ProtectableItemsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List provides a pageable list of protectable objects within your subscription according to the query filter and the -// pagination parameters. -// 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 ProtectableItemsClient) List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result WorkloadProtectableItemResourceListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableItemsClient.List") - defer func() { - sc := -1 - if result.wpirl.Response.Response != nil { - sc = result.wpirl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, vaultName, resourceGroupName, filter, skipToken) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectableItemsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.wpirl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.ProtectableItemsClient", "List", resp, "Failure sending request") - return - } - - result.wpirl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectableItemsClient", "List", resp, "Failure responding to request") - return - } - if result.wpirl.hasNextLink() && result.wpirl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ProtectableItemsClient) 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 = "2016-12-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}/backupProtectableItems", 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 ProtectableItemsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ProtectableItemsClient) ListResponder(resp *http.Response) (result WorkloadProtectableItemResourceList, err error) { - err = autorest.Respond( - resp, - 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 ProtectableItemsClient) listNextResults(ctx context.Context, lastResults WorkloadProtectableItemResourceList) (result WorkloadProtectableItemResourceList, err error) { - req, err := lastResults.workloadProtectableItemResourceListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "backup.ProtectableItemsClient", "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.ProtectableItemsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectableItemsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ProtectableItemsClient) ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result WorkloadProtectableItemResourceListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableItemsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, vaultName, resourceGroupName, filter, skipToken) - return -} diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/protectioncontaineroperationresults.go b/services/recoveryservices/mgmt/2020-02-02/backup/protectioncontaineroperationresults.go deleted file mode 100644 index 3972ce476457..000000000000 --- a/services/recoveryservices/mgmt/2020-02-02/backup/protectioncontaineroperationresults.go +++ /dev/null @@ -1,115 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ProtectionContainerOperationResultsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type ProtectionContainerOperationResultsClient struct { - BaseClient -} - -// NewProtectionContainerOperationResultsClient creates an instance of the ProtectionContainerOperationResultsClient -// client. -func NewProtectionContainerOperationResultsClient(subscriptionID string) ProtectionContainerOperationResultsClient { - return NewProtectionContainerOperationResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewProtectionContainerOperationResultsClientWithBaseURI creates an instance of the -// ProtectionContainerOperationResultsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewProtectionContainerOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) ProtectionContainerOperationResultsClient { - return ProtectionContainerOperationResultsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get fetches the result of any operation on the container. -// 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 container. -// containerName - container name whose information should be fetched. -// operationID - operation ID which represents the operation whose result needs to be fetched. -func (client ProtectionContainerOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, operationID string) (result ProtectionContainerResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerOperationResultsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, operationID) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionContainerOperationResultsClient", "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.ProtectionContainerOperationResultsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionContainerOperationResultsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ProtectionContainerOperationResultsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, operationID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "containerName": autorest.Encode("path", containerName), - "fabricName": autorest.Encode("path", fabricName), - "operationId": autorest.Encode("path", operationID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2016-12-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}/protectionContainers/{containerName}/operationResults/{operationId}", 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 ProtectionContainerOperationResultsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ProtectionContainerOperationResultsClient) GetResponder(resp *http.Response) (result ProtectionContainerResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/protectioncontainersgroup.go b/services/recoveryservices/mgmt/2020-02-02/backup/protectioncontainersgroup.go deleted file mode 100644 index 408df75c78bd..000000000000 --- a/services/recoveryservices/mgmt/2020-02-02/backup/protectioncontainersgroup.go +++ /dev/null @@ -1,154 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ProtectionContainersGroupClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type ProtectionContainersGroupClient struct { - BaseClient -} - -// NewProtectionContainersGroupClient creates an instance of the ProtectionContainersGroupClient client. -func NewProtectionContainersGroupClient(subscriptionID string) ProtectionContainersGroupClient { - return NewProtectionContainersGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewProtectionContainersGroupClientWithBaseURI creates an instance of the ProtectionContainersGroupClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewProtectionContainersGroupClientWithBaseURI(baseURI string, subscriptionID string) ProtectionContainersGroupClient { - return ProtectionContainersGroupClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List lists the containers 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. -// filter - oData filter options. -func (client ProtectionContainersGroupClient) List(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result ProtectionContainerResourceListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainersGroupClient.List") - defer func() { - sc := -1 - if result.pcrl.Response.Response != nil { - sc = result.pcrl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, vaultName, resourceGroupName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionContainersGroupClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.pcrl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.ProtectionContainersGroupClient", "List", resp, "Failure sending request") - return - } - - result.pcrl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionContainersGroupClient", "List", resp, "Failure responding to request") - return - } - if result.pcrl.hasNextLink() && result.pcrl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ProtectionContainersGroupClient) ListPreparer(ctx context.Context, vaultName string, resourceGroupName string, filter 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 = "2016-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectionContainers", 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 ProtectionContainersGroupClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ProtectionContainersGroupClient) ListResponder(resp *http.Response) (result ProtectionContainerResourceList, err error) { - err = autorest.Respond( - resp, - 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 ProtectionContainersGroupClient) listNextResults(ctx context.Context, lastResults ProtectionContainerResourceList) (result ProtectionContainerResourceList, err error) { - req, err := lastResults.protectionContainerResourceListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "backup.ProtectionContainersGroupClient", "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.ProtectionContainersGroupClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionContainersGroupClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ProtectionContainersGroupClient) ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result ProtectionContainerResourceListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainersGroupClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, vaultName, resourceGroupName, filter) - return -} diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/protectionintentgroup.go b/services/recoveryservices/mgmt/2020-02-02/backup/protectionintentgroup.go deleted file mode 100644 index a7975f8baaec..000000000000 --- a/services/recoveryservices/mgmt/2020-02-02/backup/protectionintentgroup.go +++ /dev/null @@ -1,158 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "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 using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionIntentGroupClient.List") - defer func() { - sc := -1 - if result.pirl.Response.Response != nil { - sc = result.pirl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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 - } - if result.pirl.hasNextLink() && result.pirl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - 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 client.Send(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, - 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(ctx context.Context, lastResults ProtectionIntentResourceList) (result ProtectionIntentResourceList, err error) { - req, err := lastResults.protectionIntentResourceListPreparer(ctx) - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionIntentGroupClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, vaultName, resourceGroupName, filter, skipToken) - return -} diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/resourcestorageconfigs.go b/services/recoveryservices/mgmt/2020-02-02/backup/resourcestorageconfigs.go deleted file mode 100644 index e763809902c3..000000000000 --- a/services/recoveryservices/mgmt/2020-02-02/backup/resourcestorageconfigs.go +++ /dev/null @@ -1,265 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ResourceStorageConfigsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type ResourceStorageConfigsClient struct { - BaseClient -} - -// NewResourceStorageConfigsClient creates an instance of the ResourceStorageConfigsClient client. -func NewResourceStorageConfigsClient(subscriptionID string) ResourceStorageConfigsClient { - return NewResourceStorageConfigsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewResourceStorageConfigsClientWithBaseURI creates an instance of the ResourceStorageConfigsClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewResourceStorageConfigsClientWithBaseURI(baseURI string, subscriptionID string) ResourceStorageConfigsClient { - return ResourceStorageConfigsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get fetches resource storage config. -// Parameters: -// vaultName - the name of the recovery services vault. -// resourceGroupName - the name of the resource group where the recovery services vault is present. -func (client ResourceStorageConfigsClient) Get(ctx context.Context, vaultName string, resourceGroupName string) (result ResourceConfigResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceStorageConfigsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, vaultName, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "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.ResourceStorageConfigsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ResourceStorageConfigsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName 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 = "2016-12-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}/backupstorageconfig/vaultstorageconfig", 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 ResourceStorageConfigsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ResourceStorageConfigsClient) GetResponder(resp *http.Response) (result ResourceConfigResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Patch updates vault storage model type. -// Parameters: -// vaultName - the name of the recovery services vault. -// resourceGroupName - the name of the resource group where the recovery services vault is present. -// parameters - vault storage config request -func (client ResourceStorageConfigsClient) Patch(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceConfigResource) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceStorageConfigsClient.Patch") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PatchPreparer(ctx, vaultName, resourceGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Patch", nil, "Failure preparing request") - return - } - - resp, err := client.PatchSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Patch", resp, "Failure sending request") - return - } - - result, err = client.PatchResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Patch", resp, "Failure responding to request") - return - } - - return -} - -// PatchPreparer prepares the Patch request. -func (client ResourceStorageConfigsClient) PatchPreparer(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceConfigResource) (*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 = "2016-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PatchSender sends the Patch request. The method will close the -// http.Response Body if it receives an error. -func (client ResourceStorageConfigsClient) PatchSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// PatchResponder handles the response to the Patch request. The method always -// closes the http.Response Body. -func (client ResourceStorageConfigsClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update updates vault storage model type. -// Parameters: -// vaultName - the name of the recovery services vault. -// resourceGroupName - the name of the resource group where the recovery services vault is present. -// parameters - vault storage config request -func (client ResourceStorageConfigsClient) Update(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceConfigResource) (result ResourceConfigResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceStorageConfigsClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, vaultName, resourceGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ResourceStorageConfigsClient) UpdatePreparer(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceConfigResource) (*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 = "2016-12-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client ResourceStorageConfigsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client ResourceStorageConfigsClient) UpdateResponder(resp *http.Response) (result ResourceConfigResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/status.go b/services/recoveryservices/mgmt/2020-02-02/backup/status.go deleted file mode 100644 index 4e62c544253c..000000000000 --- a/services/recoveryservices/mgmt/2020-02-02/backup/status.go +++ /dev/null @@ -1,108 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// StatusClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type StatusClient struct { - BaseClient -} - -// NewStatusClient creates an instance of the StatusClient client. -func NewStatusClient(subscriptionID string) StatusClient { - return NewStatusClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewStatusClientWithBaseURI creates an instance of the StatusClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewStatusClientWithBaseURI(baseURI string, subscriptionID string) StatusClient { - return StatusClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get sends the get request. -// Parameters: -// azureRegion - azure region to hit Api -// parameters - container Backup Status Request -func (client StatusClient) Get(ctx context.Context, azureRegion string, parameters StatusRequest) (result StatusResponse, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/StatusClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, azureRegion, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.StatusClient", "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.StatusClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.StatusClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client StatusClient) GetPreparer(ctx context.Context, azureRegion string, parameters StatusRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "azureRegion": autorest.Encode("path", azureRegion), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupStatus", pathParameters), - autorest.WithJSON(parameters), - 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 StatusClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client StatusClient) GetResponder(resp *http.Response) (result StatusResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/recoveryservices/mgmt/2020-12-01/backup/CHANGELOG.md b/services/recoveryservices/mgmt/2020-12-01/backup/CHANGELOG.md new file mode 100644 index 000000000000..a1ecf841edb0 --- /dev/null +++ b/services/recoveryservices/mgmt/2020-12-01/backup/CHANGELOG.md @@ -0,0 +1,2 @@ +# Unreleased + diff --git a/services/recoveryservices/mgmt/2020-12-01/backup/_meta.json b/services/recoveryservices/mgmt/2020-12-01/backup/_meta.json new file mode 100644 index 000000000000..8b611d9ad91f --- /dev/null +++ b/services/recoveryservices/mgmt/2020-12-01/backup/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "4742065e8d48160292fbce6790710c6835f8dc4f", + "readme": "/_/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/readme.md", + "tag": "package-2020-12", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2020-12 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/services/recoveryservices/mgmt/2020-12-01/backup/backupapi/interfaces.go b/services/recoveryservices/mgmt/2020-12-01/backup/backupapi/interfaces.go new file mode 100644 index 000000000000..e375097ff25b --- /dev/null +++ b/services/recoveryservices/mgmt/2020-12-01/backup/backupapi/interfaces.go @@ -0,0 +1,292 @@ +package backupapi + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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/azure-sdk-for-go/services/recoveryservices/mgmt/2020-12-01/backup" + "github.com/Azure/go-autorest/autorest" +) + +// BaseClientAPI contains the set of methods on the BaseClient type. +type BaseClientAPI interface { + BMSPrepareDataMove(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.PrepareDataMoveRequest) (result autorest.Response, err error) + BMSTriggerDataMove(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.TriggerDataMoveRequest) (result backup.BMSTriggerDataMoveFuture, err error) + GetOperationStatus(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result backup.OperationStatus, err error) +} + +var _ BaseClientAPI = (*backup.BaseClient)(nil) + +// ResourceVaultConfigsClientAPI contains the set of methods on the ResourceVaultConfigsClient type. +type ResourceVaultConfigsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string) (result backup.ResourceVaultConfigResource, err error) + Put(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.ResourceVaultConfigResource) (result backup.ResourceVaultConfigResource, err error) + Update(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.ResourceVaultConfigResource) (result backup.ResourceVaultConfigResource, err error) +} + +var _ ResourceVaultConfigsClientAPI = (*backup.ResourceVaultConfigsClient)(nil) + +// ResourceEncryptionConfigsClientAPI contains the set of methods on the ResourceEncryptionConfigsClient type. +type ResourceEncryptionConfigsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string) (result backup.ResourceEncryptionConfigResource, err error) + Update(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.ResourceEncryptionConfigResource) (result autorest.Response, err error) +} + +var _ ResourceEncryptionConfigsClientAPI = (*backup.ResourceEncryptionConfigsClient)(nil) + +// PrivateEndpointConnectionClientAPI contains the set of methods on the PrivateEndpointConnectionClient type. +type PrivateEndpointConnectionClientAPI interface { + Delete(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string) (result backup.PrivateEndpointConnectionDeleteFuture, err error) + Get(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string) (result backup.PrivateEndpointConnectionResource, err error) + Put(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string, parameters backup.PrivateEndpointConnectionResource) (result backup.PrivateEndpointConnectionPutFuture, err error) +} + +var _ PrivateEndpointConnectionClientAPI = (*backup.PrivateEndpointConnectionClient)(nil) + +// PrivateEndpointClientAPI contains the set of methods on the PrivateEndpointClient type. +type PrivateEndpointClientAPI interface { + GetOperationStatus(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string, operationID string) (result backup.OperationStatus, err error) +} + +var _ PrivateEndpointClientAPI = (*backup.PrivateEndpointClient)(nil) + +// BMSPrepareDataMoveOperationResultClientAPI contains the set of methods on the BMSPrepareDataMoveOperationResultClient type. +type BMSPrepareDataMoveOperationResultClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result backup.VaultStorageConfigOperationResultResponseModel, err error) +} + +var _ BMSPrepareDataMoveOperationResultClientAPI = (*backup.BMSPrepareDataMoveOperationResultClient)(nil) + +// ProtectedItemsClientAPI contains the set of methods on the ProtectedItemsClient type. +type ProtectedItemsClientAPI interface { + CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters backup.ProtectedItemResource) (result backup.ProtectedItemResource, err error) + Delete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string) (result autorest.Response, err error) + Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result backup.ProtectedItemResource, err error) +} + +var _ ProtectedItemsClientAPI = (*backup.ProtectedItemsClient)(nil) + +// ProtectedItemOperationResultsClientAPI contains the set of methods on the ProtectedItemOperationResultsClient type. +type ProtectedItemOperationResultsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, operationID string) (result backup.ProtectedItemResource, err error) +} + +var _ ProtectedItemOperationResultsClientAPI = (*backup.ProtectedItemOperationResultsClient)(nil) + +// RecoveryPointsClientAPI contains the set of methods on the RecoveryPointsClient type. +type RecoveryPointsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string) (result backup.RecoveryPointResource, err error) + List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result backup.RecoveryPointResourceListPage, err error) + ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result backup.RecoveryPointResourceListIterator, err error) +} + +var _ RecoveryPointsClientAPI = (*backup.RecoveryPointsClient)(nil) + +// RestoresClientAPI contains the set of methods on the RestoresClient type. +type RestoresClientAPI interface { + Trigger(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters backup.RestoreRequestResource) (result autorest.Response, err error) +} + +var _ RestoresClientAPI = (*backup.RestoresClient)(nil) + +// PoliciesClientAPI contains the set of methods on the PoliciesClient type. +type PoliciesClientAPI interface { + List(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result backup.ProtectionPolicyResourceListPage, err error) + ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result backup.ProtectionPolicyResourceListIterator, err error) +} + +var _ PoliciesClientAPI = (*backup.PoliciesClient)(nil) + +// ProtectionPoliciesClientAPI contains the set of methods on the ProtectionPoliciesClient type. +type ProtectionPoliciesClientAPI interface { + CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, policyName string, parameters backup.ProtectionPolicyResource) (result backup.ProtectionPolicyResource, err error) + Delete(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (result backup.ProtectionPoliciesDeleteFuture, err error) + Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (result backup.ProtectionPolicyResource, err error) +} + +var _ ProtectionPoliciesClientAPI = (*backup.ProtectionPoliciesClient)(nil) + +// ProtectionPolicyOperationResultsClientAPI contains the set of methods on the ProtectionPolicyOperationResultsClient type. +type ProtectionPolicyOperationResultsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string) (result backup.ProtectionPolicyResource, err error) +} + +var _ ProtectionPolicyOperationResultsClientAPI = (*backup.ProtectionPolicyOperationResultsClient)(nil) + +// JobsClientAPI contains the set of methods on the JobsClient type. +type JobsClientAPI interface { + List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.JobResourceListPage, err error) + ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.JobResourceListIterator, err error) +} + +var _ JobsClientAPI = (*backup.JobsClient)(nil) + +// JobDetailsClientAPI contains the set of methods on the JobDetailsClient type. +type JobDetailsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, jobName string) (result backup.JobResource, err error) +} + +var _ JobDetailsClientAPI = (*backup.JobDetailsClient)(nil) + +// JobCancellationsClientAPI contains the set of methods on the JobCancellationsClient type. +type JobCancellationsClientAPI interface { + Trigger(ctx context.Context, vaultName string, resourceGroupName string, jobName string) (result autorest.Response, err error) +} + +var _ JobCancellationsClientAPI = (*backup.JobCancellationsClient)(nil) + +// JobOperationResultsClientAPI contains the set of methods on the JobOperationResultsClient type. +type JobOperationResultsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, jobName string, operationID string) (result autorest.Response, err error) +} + +var _ JobOperationResultsClientAPI = (*backup.JobOperationResultsClient)(nil) + +// ExportJobsOperationResultsClientAPI contains the set of methods on the ExportJobsOperationResultsClient type. +type ExportJobsOperationResultsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result backup.OperationResultInfoBaseResource, err error) +} + +var _ ExportJobsOperationResultsClientAPI = (*backup.ExportJobsOperationResultsClient)(nil) + +// JobsGroupClientAPI contains the set of methods on the JobsGroupClient type. +type JobsGroupClientAPI interface { + Export(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result autorest.Response, err error) +} + +var _ JobsGroupClientAPI = (*backup.JobsGroupClient)(nil) + +// ProtectedItemsGroupClientAPI contains the set of methods on the ProtectedItemsGroupClient type. +type ProtectedItemsGroupClientAPI interface { + List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ProtectedItemResourceListPage, err error) + ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ProtectedItemResourceListIterator, err error) +} + +var _ ProtectedItemsGroupClientAPI = (*backup.ProtectedItemsGroupClient)(nil) + +// OperationClientAPI contains the set of methods on the OperationClient type. +type OperationClientAPI interface { + Validate(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.BasicValidateOperationRequest) (result backup.ValidateOperationsResponse, err error) +} + +var _ OperationClientAPI = (*backup.OperationClient)(nil) + +// EnginesClientAPI contains the set of methods on the EnginesClient type. +type EnginesClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, backupEngineName string, filter string, skipToken string) (result backup.EngineBaseResource, err error) + List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.EngineBaseResourceListPage, err error) + ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.EngineBaseResourceListIterator, err error) +} + +var _ EnginesClientAPI = (*backup.EnginesClient)(nil) + +// ProtectionContainerRefreshOperationResultsClientAPI contains the set of methods on the ProtectionContainerRefreshOperationResultsClient type. +type ProtectionContainerRefreshOperationResultsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, operationID string) (result autorest.Response, err error) +} + +var _ ProtectionContainerRefreshOperationResultsClientAPI = (*backup.ProtectionContainerRefreshOperationResultsClient)(nil) + +// ProtectableContainersClientAPI contains the set of methods on the ProtectableContainersClient type. +type ProtectableContainersClientAPI interface { + List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, filter string) (result backup.ProtectableContainerResourceListPage, err error) + ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, filter string) (result backup.ProtectableContainerResourceListIterator, err error) +} + +var _ ProtectableContainersClientAPI = (*backup.ProtectableContainersClient)(nil) + +// ProtectionContainersClientAPI contains the set of methods on the ProtectionContainersClient type. +type ProtectionContainersClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string) (result backup.ProtectionContainerResource, err error) + Inquire(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, filter string) (result autorest.Response, err error) + Refresh(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, filter string) (result autorest.Response, err error) + Register(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, parameters backup.ProtectionContainerResource) (result backup.ProtectionContainerResource, err error) + Unregister(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string) (result autorest.Response, err error) +} + +var _ ProtectionContainersClientAPI = (*backup.ProtectionContainersClient)(nil) + +// WorkloadItemsClientAPI contains the set of methods on the WorkloadItemsClient type. +type WorkloadItemsClientAPI interface { + List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, filter string, skipToken string) (result backup.WorkloadItemResourceListPage, err error) + ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, filter string, skipToken string) (result backup.WorkloadItemResourceListIterator, err error) +} + +var _ WorkloadItemsClientAPI = (*backup.WorkloadItemsClient)(nil) + +// ProtectionContainerOperationResultsClientAPI contains the set of methods on the ProtectionContainerOperationResultsClient type. +type ProtectionContainerOperationResultsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, operationID string) (result backup.ProtectionContainerResource, err error) +} + +var _ ProtectionContainerOperationResultsClientAPI = (*backup.ProtectionContainerOperationResultsClient)(nil) + +// BackupsClientAPI contains the set of methods on the BackupsClient type. +type BackupsClientAPI interface { + Trigger(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters backup.RequestResource) (result autorest.Response, err error) +} + +var _ BackupsClientAPI = (*backup.BackupsClient)(nil) + +// ProtectedItemOperationStatusesClientAPI contains the set of methods on the ProtectedItemOperationStatusesClient type. +type ProtectedItemOperationStatusesClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, operationID string) (result backup.OperationStatus, err error) +} + +var _ ProtectedItemOperationStatusesClientAPI = (*backup.ProtectedItemOperationStatusesClient)(nil) + +// ItemLevelRecoveryConnectionsClientAPI contains the set of methods on the ItemLevelRecoveryConnectionsClient type. +type ItemLevelRecoveryConnectionsClientAPI interface { + Provision(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters backup.ILRRequestResource) (result autorest.Response, err error) + Revoke(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string) (result autorest.Response, err error) +} + +var _ ItemLevelRecoveryConnectionsClientAPI = (*backup.ItemLevelRecoveryConnectionsClient)(nil) + +// OperationResultsClientAPI contains the set of methods on the OperationResultsClient type. +type OperationResultsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result autorest.Response, err error) +} + +var _ OperationResultsClientAPI = (*backup.OperationResultsClient)(nil) + +// OperationStatusesClientAPI contains the set of methods on the OperationStatusesClient type. +type OperationStatusesClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result backup.OperationStatus, err error) +} + +var _ OperationStatusesClientAPI = (*backup.OperationStatusesClient)(nil) + +// ProtectionPolicyOperationStatusesClientAPI contains the set of methods on the ProtectionPolicyOperationStatusesClient type. +type ProtectionPolicyOperationStatusesClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string) (result backup.OperationStatus, err error) +} + +var _ ProtectionPolicyOperationStatusesClientAPI = (*backup.ProtectionPolicyOperationStatusesClient)(nil) + +// ProtectableItemsClientAPI contains the set of methods on the ProtectableItemsClient type. +type ProtectableItemsClientAPI interface { + List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.WorkloadProtectableItemResourceListPage, err error) + ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.WorkloadProtectableItemResourceListIterator, err error) +} + +var _ ProtectableItemsClientAPI = (*backup.ProtectableItemsClient)(nil) + +// ProtectionContainersGroupClientAPI contains the set of methods on the ProtectionContainersGroupClient type. +type ProtectionContainersGroupClientAPI interface { + List(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result backup.ProtectionContainerResourceListPage, err error) + ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result backup.ProtectionContainerResourceListIterator, err error) +} + +var _ ProtectionContainersGroupClientAPI = (*backup.ProtectionContainersGroupClient)(nil) + +// SecurityPINsClientAPI contains the set of methods on the SecurityPINsClient type. +type SecurityPINsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string) (result backup.TokenInformation, err error) +} + +var _ SecurityPINsClientAPI = (*backup.SecurityPINsClient)(nil) diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/backups.go b/services/recoveryservices/mgmt/2020-12-01/backup/backups.go similarity index 99% rename from services/recoveryservices/mgmt/2019-05-13/backup/backups.go rename to services/recoveryservices/mgmt/2020-12-01/backup/backups.go index 504816876e30..01d8a962f1eb 100644 --- a/services/recoveryservices/mgmt/2019-05-13/backup/backups.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/backups.go @@ -83,7 +83,7 @@ func (client BackupsClient) TriggerPreparer(ctx context.Context, vaultName strin "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2020-12-01/backup/bmspreparedatamoveoperationresult.go b/services/recoveryservices/mgmt/2020-12-01/backup/bmspreparedatamoveoperationresult.go new file mode 100644 index 000000000000..767fedef29d3 --- /dev/null +++ b/services/recoveryservices/mgmt/2020-12-01/backup/bmspreparedatamoveoperationresult.go @@ -0,0 +1,110 @@ +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// BMSPrepareDataMoveOperationResultClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type BMSPrepareDataMoveOperationResultClient struct { + BaseClient +} + +// NewBMSPrepareDataMoveOperationResultClient creates an instance of the BMSPrepareDataMoveOperationResultClient +// client. +func NewBMSPrepareDataMoveOperationResultClient(subscriptionID string) BMSPrepareDataMoveOperationResultClient { + return NewBMSPrepareDataMoveOperationResultClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewBMSPrepareDataMoveOperationResultClientWithBaseURI creates an instance of the +// BMSPrepareDataMoveOperationResultClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewBMSPrepareDataMoveOperationResultClientWithBaseURI(baseURI string, subscriptionID string) BMSPrepareDataMoveOperationResultClient { + return BMSPrepareDataMoveOperationResultClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get fetches Operation Result for Prepare Data Move +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +func (client BMSPrepareDataMoveOperationResultClient) Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result VaultStorageConfigOperationResultResponseModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BMSPrepareDataMoveOperationResultClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.BMSPrepareDataMoveOperationResultClient", "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.BMSPrepareDataMoveOperationResultClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.BMSPrepareDataMoveOperationResultClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client BMSPrepareDataMoveOperationResultClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2020-12-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}/backupstorageconfig/vaultstorageconfig/operationResults/{operationId}", 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 BMSPrepareDataMoveOperationResultClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client BMSPrepareDataMoveOperationResultClient) GetResponder(resp *http.Response) (result VaultStorageConfigOperationResultResponseModel, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2020-12-01/backup/client.go b/services/recoveryservices/mgmt/2020-12-01/backup/client.go new file mode 100644 index 000000000000..2e8c03fb121f --- /dev/null +++ b/services/recoveryservices/mgmt/2020-12-01/backup/client.go @@ -0,0 +1,297 @@ +// Package backup implements the Azure ARM Backup service API version 2020-12-01. +// +// Open API 2.0 Specs for Azure RecoveryServices Backup service +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +const ( + // DefaultBaseURI is the default URI used for the service Backup + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Backup. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} + +// BMSPrepareDataMove prepares source vault for Data Move operation +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// parameters - prepare data move request +func (client BaseClient) BMSPrepareDataMove(ctx context.Context, vaultName string, resourceGroupName string, parameters PrepareDataMoveRequest) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.BMSPrepareDataMove") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.TargetResourceID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.TargetRegion", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("backup.BaseClient", "BMSPrepareDataMove", err.Error()) + } + + req, err := client.BMSPrepareDataMovePreparer(ctx, vaultName, resourceGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.BaseClient", "BMSPrepareDataMove", nil, "Failure preparing request") + return + } + + resp, err := client.BMSPrepareDataMoveSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "backup.BaseClient", "BMSPrepareDataMove", resp, "Failure sending request") + return + } + + result, err = client.BMSPrepareDataMoveResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.BaseClient", "BMSPrepareDataMove", resp, "Failure responding to request") + return + } + + return +} + +// BMSPrepareDataMovePreparer prepares the BMSPrepareDataMove request. +func (client BaseClient) BMSPrepareDataMovePreparer(ctx context.Context, vaultName string, resourceGroupName string, parameters PrepareDataMoveRequest) (*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 = "2020-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/prepareDataMove", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// BMSPrepareDataMoveSender sends the BMSPrepareDataMove request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) BMSPrepareDataMoveSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// BMSPrepareDataMoveResponder handles the response to the BMSPrepareDataMove request. The method always +// closes the http.Response Body. +func (client BaseClient) BMSPrepareDataMoveResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// BMSTriggerDataMove triggers Data Move Operation on target vault +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// parameters - trigger data move request +func (client BaseClient) BMSTriggerDataMove(ctx context.Context, vaultName string, resourceGroupName string, parameters TriggerDataMoveRequest) (result BMSTriggerDataMoveFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.BMSTriggerDataMove") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.SourceResourceID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.SourceRegion", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.CorrelationID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("backup.BaseClient", "BMSTriggerDataMove", err.Error()) + } + + req, err := client.BMSTriggerDataMovePreparer(ctx, vaultName, resourceGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.BaseClient", "BMSTriggerDataMove", nil, "Failure preparing request") + return + } + + result, err = client.BMSTriggerDataMoveSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.BaseClient", "BMSTriggerDataMove", result.Response(), "Failure sending request") + return + } + + return +} + +// BMSTriggerDataMovePreparer prepares the BMSTriggerDataMove request. +func (client BaseClient) BMSTriggerDataMovePreparer(ctx context.Context, vaultName string, resourceGroupName string, parameters TriggerDataMoveRequest) (*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 = "2020-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/triggerDataMove", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// BMSTriggerDataMoveSender sends the BMSTriggerDataMove request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) BMSTriggerDataMoveSender(req *http.Request) (future BMSTriggerDataMoveFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// BMSTriggerDataMoveResponder handles the response to the BMSTriggerDataMove request. The method always +// closes the http.Response Body. +func (client BaseClient) BMSTriggerDataMoveResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetOperationStatus fetches operation status for data move operation on vault +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +func (client BaseClient) GetOperationStatus(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetOperationStatus") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetOperationStatusPreparer(ctx, vaultName, resourceGroupName, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.BaseClient", "GetOperationStatus", nil, "Failure preparing request") + return + } + + resp, err := client.GetOperationStatusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.BaseClient", "GetOperationStatus", resp, "Failure sending request") + return + } + + result, err = client.GetOperationStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.BaseClient", "GetOperationStatus", resp, "Failure responding to request") + return + } + + return +} + +// GetOperationStatusPreparer prepares the GetOperationStatus request. +func (client BaseClient) GetOperationStatusPreparer(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2020-12-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}/backupstorageconfig/vaultstorageconfig/operationStatus/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetOperationStatusSender sends the GetOperationStatus request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetOperationStatusSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetOperationStatusResponder handles the response to the GetOperationStatus request. The method always +// closes the http.Response Body. +func (client BaseClient) GetOperationStatusResponder(resp *http.Response) (result OperationStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/engines.go b/services/recoveryservices/mgmt/2020-12-01/backup/engines.go similarity index 99% rename from services/recoveryservices/mgmt/2019-06-15/backup/engines.go rename to services/recoveryservices/mgmt/2020-12-01/backup/engines.go index 786747fdbf96..33622138c82d 100644 --- a/services/recoveryservices/mgmt/2019-06-15/backup/engines.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/engines.go @@ -79,7 +79,7 @@ func (client EnginesClient) GetPreparer(ctx context.Context, vaultName string, r "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -168,7 +168,7 @@ func (client EnginesClient) ListPreparer(ctx context.Context, vaultName string, "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2020-12-01/backup/enums.go b/services/recoveryservices/mgmt/2020-12-01/backup/enums.go new file mode 100644 index 000000000000..8b57bd981dce --- /dev/null +++ b/services/recoveryservices/mgmt/2020-12-01/backup/enums.go @@ -0,0 +1,1692 @@ +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// AzureFileShareType enumerates the values for azure file share type. +type AzureFileShareType string + +const ( + // Invalid ... + Invalid AzureFileShareType = "Invalid" + // XSMB ... + XSMB AzureFileShareType = "XSMB" + // XSync ... + XSync AzureFileShareType = "XSync" +) + +// PossibleAzureFileShareTypeValues returns an array of possible values for the AzureFileShareType const type. +func PossibleAzureFileShareTypeValues() []AzureFileShareType { + return []AzureFileShareType{Invalid, XSMB, XSync} +} + +// ContainerType enumerates the values for container type. +type ContainerType string + +const ( + // ContainerTypeAzureBackupServerContainer ... + ContainerTypeAzureBackupServerContainer ContainerType = "AzureBackupServerContainer" + // ContainerTypeAzureSQLContainer ... + ContainerTypeAzureSQLContainer ContainerType = "AzureSqlContainer" + // ContainerTypeCluster ... + ContainerTypeCluster ContainerType = "Cluster" + // ContainerTypeDPMContainer ... + ContainerTypeDPMContainer ContainerType = "DPMContainer" + // ContainerTypeGenericContainer ... + ContainerTypeGenericContainer ContainerType = "GenericContainer" + // ContainerTypeIaasVMContainer ... + ContainerTypeIaasVMContainer ContainerType = "IaasVMContainer" + // ContainerTypeIaasVMServiceContainer ... + ContainerTypeIaasVMServiceContainer ContainerType = "IaasVMServiceContainer" + // ContainerTypeInvalid ... + ContainerTypeInvalid ContainerType = "Invalid" + // ContainerTypeMABContainer ... + ContainerTypeMABContainer ContainerType = "MABContainer" + // ContainerTypeSQLAGWorkLoadContainer ... + ContainerTypeSQLAGWorkLoadContainer ContainerType = "SQLAGWorkLoadContainer" + // ContainerTypeStorageContainer ... + ContainerTypeStorageContainer ContainerType = "StorageContainer" + // ContainerTypeUnknown ... + ContainerTypeUnknown ContainerType = "Unknown" + // ContainerTypeVCenter ... + ContainerTypeVCenter ContainerType = "VCenter" + // ContainerTypeVMAppContainer ... + ContainerTypeVMAppContainer ContainerType = "VMAppContainer" + // ContainerTypeWindows ... + ContainerTypeWindows ContainerType = "Windows" +) + +// PossibleContainerTypeValues returns an array of possible values for the ContainerType const type. +func PossibleContainerTypeValues() []ContainerType { + return []ContainerType{ContainerTypeAzureBackupServerContainer, ContainerTypeAzureSQLContainer, ContainerTypeCluster, ContainerTypeDPMContainer, ContainerTypeGenericContainer, ContainerTypeIaasVMContainer, ContainerTypeIaasVMServiceContainer, ContainerTypeInvalid, ContainerTypeMABContainer, ContainerTypeSQLAGWorkLoadContainer, ContainerTypeStorageContainer, ContainerTypeUnknown, ContainerTypeVCenter, ContainerTypeVMAppContainer, ContainerTypeWindows} +} + +// ContainerTypeBasicProtectionContainer enumerates the values for container type basic protection container. +type ContainerTypeBasicProtectionContainer string + +const ( + // ContainerTypeAzureBackupServerContainer1 ... + ContainerTypeAzureBackupServerContainer1 ContainerTypeBasicProtectionContainer = "AzureBackupServerContainer" + // ContainerTypeAzureSQLContainer1 ... + ContainerTypeAzureSQLContainer1 ContainerTypeBasicProtectionContainer = "AzureSqlContainer" + // ContainerTypeAzureWorkloadContainer ... + ContainerTypeAzureWorkloadContainer ContainerTypeBasicProtectionContainer = "AzureWorkloadContainer" + // ContainerTypeDPMContainer1 ... + ContainerTypeDPMContainer1 ContainerTypeBasicProtectionContainer = "DPMContainer" + // ContainerTypeGenericContainer1 ... + ContainerTypeGenericContainer1 ContainerTypeBasicProtectionContainer = "GenericContainer" + // ContainerTypeIaaSVMContainer ... + ContainerTypeIaaSVMContainer ContainerTypeBasicProtectionContainer = "IaaSVMContainer" + // ContainerTypeMicrosoftClassicComputevirtualMachines ... + ContainerTypeMicrosoftClassicComputevirtualMachines ContainerTypeBasicProtectionContainer = "Microsoft.ClassicCompute/virtualMachines" + // ContainerTypeMicrosoftComputevirtualMachines ... + ContainerTypeMicrosoftComputevirtualMachines ContainerTypeBasicProtectionContainer = "Microsoft.Compute/virtualMachines" + // ContainerTypeProtectionContainer ... + ContainerTypeProtectionContainer ContainerTypeBasicProtectionContainer = "ProtectionContainer" + // ContainerTypeSQLAGWorkLoadContainer1 ... + ContainerTypeSQLAGWorkLoadContainer1 ContainerTypeBasicProtectionContainer = "SQLAGWorkLoadContainer" + // ContainerTypeStorageContainer1 ... + ContainerTypeStorageContainer1 ContainerTypeBasicProtectionContainer = "StorageContainer" + // ContainerTypeVMAppContainer1 ... + ContainerTypeVMAppContainer1 ContainerTypeBasicProtectionContainer = "VMAppContainer" + // ContainerTypeWindows1 ... + ContainerTypeWindows1 ContainerTypeBasicProtectionContainer = "Windows" +) + +// PossibleContainerTypeBasicProtectionContainerValues returns an array of possible values for the ContainerTypeBasicProtectionContainer const type. +func PossibleContainerTypeBasicProtectionContainerValues() []ContainerTypeBasicProtectionContainer { + return []ContainerTypeBasicProtectionContainer{ContainerTypeAzureBackupServerContainer1, ContainerTypeAzureSQLContainer1, ContainerTypeAzureWorkloadContainer, ContainerTypeDPMContainer1, ContainerTypeGenericContainer1, ContainerTypeIaaSVMContainer, ContainerTypeMicrosoftClassicComputevirtualMachines, ContainerTypeMicrosoftComputevirtualMachines, ContainerTypeProtectionContainer, ContainerTypeSQLAGWorkLoadContainer1, ContainerTypeStorageContainer1, ContainerTypeVMAppContainer1, ContainerTypeWindows1} +} + +// CopyOptions enumerates the values for copy options. +type CopyOptions string + +const ( + // CopyOptionsCreateCopy ... + CopyOptionsCreateCopy CopyOptions = "CreateCopy" + // CopyOptionsFailOnConflict ... + CopyOptionsFailOnConflict CopyOptions = "FailOnConflict" + // CopyOptionsInvalid ... + CopyOptionsInvalid CopyOptions = "Invalid" + // CopyOptionsOverwrite ... + CopyOptionsOverwrite CopyOptions = "Overwrite" + // CopyOptionsSkip ... + CopyOptionsSkip CopyOptions = "Skip" +) + +// PossibleCopyOptionsValues returns an array of possible values for the CopyOptions const type. +func PossibleCopyOptionsValues() []CopyOptions { + return []CopyOptions{CopyOptionsCreateCopy, CopyOptionsFailOnConflict, CopyOptionsInvalid, CopyOptionsOverwrite, CopyOptionsSkip} +} + +// CreateMode enumerates the values for create mode. +type CreateMode string + +const ( + // CreateModeDefault ... + CreateModeDefault CreateMode = "Default" + // CreateModeInvalid ... + CreateModeInvalid CreateMode = "Invalid" + // CreateModeRecover ... + CreateModeRecover CreateMode = "Recover" +) + +// PossibleCreateModeValues returns an array of possible values for the CreateMode const type. +func PossibleCreateModeValues() []CreateMode { + return []CreateMode{CreateModeDefault, CreateModeInvalid, CreateModeRecover} +} + +// DataMoveLevel enumerates the values for data move level. +type DataMoveLevel string + +const ( + // DataMoveLevelContainer ... + DataMoveLevelContainer DataMoveLevel = "Container" + // DataMoveLevelInvalid ... + DataMoveLevelInvalid DataMoveLevel = "Invalid" + // DataMoveLevelVault ... + DataMoveLevelVault DataMoveLevel = "Vault" +) + +// PossibleDataMoveLevelValues returns an array of possible values for the DataMoveLevel const type. +func PossibleDataMoveLevelValues() []DataMoveLevel { + return []DataMoveLevel{DataMoveLevelContainer, DataMoveLevelInvalid, DataMoveLevelVault} +} + +// DataSourceType enumerates the values for data source type. +type DataSourceType string + +const ( + // DataSourceTypeAzureFileShare ... + DataSourceTypeAzureFileShare DataSourceType = "AzureFileShare" + // DataSourceTypeAzureSQLDb ... + DataSourceTypeAzureSQLDb DataSourceType = "AzureSqlDb" + // DataSourceTypeClient ... + DataSourceTypeClient DataSourceType = "Client" + // DataSourceTypeExchange ... + DataSourceTypeExchange DataSourceType = "Exchange" + // DataSourceTypeFileFolder ... + DataSourceTypeFileFolder DataSourceType = "FileFolder" + // DataSourceTypeGenericDataSource ... + DataSourceTypeGenericDataSource DataSourceType = "GenericDataSource" + // DataSourceTypeInvalid ... + DataSourceTypeInvalid DataSourceType = "Invalid" + // DataSourceTypeSAPAseDatabase ... + DataSourceTypeSAPAseDatabase DataSourceType = "SAPAseDatabase" + // DataSourceTypeSAPHanaDatabase ... + DataSourceTypeSAPHanaDatabase DataSourceType = "SAPHanaDatabase" + // DataSourceTypeSharepoint ... + DataSourceTypeSharepoint DataSourceType = "Sharepoint" + // DataSourceTypeSQLDataBase ... + DataSourceTypeSQLDataBase DataSourceType = "SQLDataBase" + // DataSourceTypeSQLDB ... + DataSourceTypeSQLDB DataSourceType = "SQLDB" + // DataSourceTypeSystemState ... + DataSourceTypeSystemState DataSourceType = "SystemState" + // DataSourceTypeVM ... + DataSourceTypeVM DataSourceType = "VM" + // DataSourceTypeVMwareVM ... + DataSourceTypeVMwareVM DataSourceType = "VMwareVM" +) + +// PossibleDataSourceTypeValues returns an array of possible values for the DataSourceType const type. +func PossibleDataSourceTypeValues() []DataSourceType { + return []DataSourceType{DataSourceTypeAzureFileShare, DataSourceTypeAzureSQLDb, DataSourceTypeClient, DataSourceTypeExchange, DataSourceTypeFileFolder, DataSourceTypeGenericDataSource, DataSourceTypeInvalid, DataSourceTypeSAPAseDatabase, DataSourceTypeSAPHanaDatabase, DataSourceTypeSharepoint, DataSourceTypeSQLDataBase, DataSourceTypeSQLDB, DataSourceTypeSystemState, DataSourceTypeVM, DataSourceTypeVMwareVM} +} + +// DayOfWeek enumerates the values for day of week. +type DayOfWeek string + +const ( + // Friday ... + Friday DayOfWeek = "Friday" + // Monday ... + Monday DayOfWeek = "Monday" + // Saturday ... + Saturday DayOfWeek = "Saturday" + // Sunday ... + Sunday DayOfWeek = "Sunday" + // Thursday ... + Thursday DayOfWeek = "Thursday" + // Tuesday ... + Tuesday DayOfWeek = "Tuesday" + // Wednesday ... + Wednesday DayOfWeek = "Wednesday" +) + +// PossibleDayOfWeekValues returns an array of possible values for the DayOfWeek const type. +func PossibleDayOfWeekValues() []DayOfWeek { + return []DayOfWeek{Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday} +} + +// EncryptionAtRestType enumerates the values for encryption at rest type. +type EncryptionAtRestType string + +const ( + // EncryptionAtRestTypeCustomerManaged ... + EncryptionAtRestTypeCustomerManaged EncryptionAtRestType = "CustomerManaged" + // EncryptionAtRestTypeInvalid ... + EncryptionAtRestTypeInvalid EncryptionAtRestType = "Invalid" + // EncryptionAtRestTypeMicrosoftManaged ... + EncryptionAtRestTypeMicrosoftManaged EncryptionAtRestType = "MicrosoftManaged" +) + +// PossibleEncryptionAtRestTypeValues returns an array of possible values for the EncryptionAtRestType const type. +func PossibleEncryptionAtRestTypeValues() []EncryptionAtRestType { + return []EncryptionAtRestType{EncryptionAtRestTypeCustomerManaged, EncryptionAtRestTypeInvalid, EncryptionAtRestTypeMicrosoftManaged} +} + +// EngineType enumerates the values for engine type. +type EngineType string + +const ( + // BackupEngineTypeAzureBackupServerEngine ... + BackupEngineTypeAzureBackupServerEngine EngineType = "AzureBackupServerEngine" + // BackupEngineTypeBackupEngineBase ... + BackupEngineTypeBackupEngineBase EngineType = "BackupEngineBase" + // BackupEngineTypeDpmBackupEngine ... + BackupEngineTypeDpmBackupEngine EngineType = "DpmBackupEngine" +) + +// PossibleEngineTypeValues returns an array of possible values for the EngineType const type. +func PossibleEngineTypeValues() []EngineType { + return []EngineType{BackupEngineTypeAzureBackupServerEngine, BackupEngineTypeBackupEngineBase, BackupEngineTypeDpmBackupEngine} +} + +// EnhancedSecurityState enumerates the values for enhanced security state. +type EnhancedSecurityState string + +const ( + // EnhancedSecurityStateDisabled ... + EnhancedSecurityStateDisabled EnhancedSecurityState = "Disabled" + // EnhancedSecurityStateEnabled ... + EnhancedSecurityStateEnabled EnhancedSecurityState = "Enabled" + // EnhancedSecurityStateInvalid ... + EnhancedSecurityStateInvalid EnhancedSecurityState = "Invalid" +) + +// PossibleEnhancedSecurityStateValues returns an array of possible values for the EnhancedSecurityState const type. +func PossibleEnhancedSecurityStateValues() []EnhancedSecurityState { + return []EnhancedSecurityState{EnhancedSecurityStateDisabled, EnhancedSecurityStateEnabled, EnhancedSecurityStateInvalid} +} + +// HealthState enumerates the values for health state. +type HealthState string + +const ( + // HealthStateActionRequired ... + HealthStateActionRequired HealthState = "ActionRequired" + // HealthStateActionSuggested ... + HealthStateActionSuggested HealthState = "ActionSuggested" + // HealthStateInvalid ... + HealthStateInvalid HealthState = "Invalid" + // HealthStatePassed ... + HealthStatePassed HealthState = "Passed" +) + +// PossibleHealthStateValues returns an array of possible values for the HealthState const type. +func PossibleHealthStateValues() []HealthState { + return []HealthState{HealthStateActionRequired, HealthStateActionSuggested, HealthStateInvalid, HealthStatePassed} +} + +// HealthStatus enumerates the values for health status. +type HealthStatus string + +const ( + // HealthStatusActionRequired ... + HealthStatusActionRequired HealthStatus = "ActionRequired" + // HealthStatusActionSuggested ... + HealthStatusActionSuggested HealthStatus = "ActionSuggested" + // HealthStatusInvalid ... + HealthStatusInvalid HealthStatus = "Invalid" + // HealthStatusPassed ... + HealthStatusPassed HealthStatus = "Passed" +) + +// PossibleHealthStatusValues returns an array of possible values for the HealthStatus const type. +func PossibleHealthStatusValues() []HealthStatus { + return []HealthStatus{HealthStatusActionRequired, HealthStatusActionSuggested, HealthStatusInvalid, HealthStatusPassed} +} + +// HTTPStatusCode enumerates the values for http status code. +type HTTPStatusCode string + +const ( + // Accepted ... + Accepted HTTPStatusCode = "Accepted" + // Ambiguous ... + Ambiguous HTTPStatusCode = "Ambiguous" + // BadGateway ... + BadGateway HTTPStatusCode = "BadGateway" + // BadRequest ... + BadRequest HTTPStatusCode = "BadRequest" + // Conflict ... + Conflict HTTPStatusCode = "Conflict" + // Continue ... + Continue HTTPStatusCode = "Continue" + // Created ... + Created HTTPStatusCode = "Created" + // ExpectationFailed ... + ExpectationFailed HTTPStatusCode = "ExpectationFailed" + // Forbidden ... + Forbidden HTTPStatusCode = "Forbidden" + // Found ... + Found HTTPStatusCode = "Found" + // GatewayTimeout ... + GatewayTimeout HTTPStatusCode = "GatewayTimeout" + // Gone ... + Gone HTTPStatusCode = "Gone" + // HTTPVersionNotSupported ... + HTTPVersionNotSupported HTTPStatusCode = "HttpVersionNotSupported" + // InternalServerError ... + InternalServerError HTTPStatusCode = "InternalServerError" + // LengthRequired ... + LengthRequired HTTPStatusCode = "LengthRequired" + // MethodNotAllowed ... + MethodNotAllowed HTTPStatusCode = "MethodNotAllowed" + // Moved ... + Moved HTTPStatusCode = "Moved" + // MovedPermanently ... + MovedPermanently HTTPStatusCode = "MovedPermanently" + // MultipleChoices ... + MultipleChoices HTTPStatusCode = "MultipleChoices" + // NoContent ... + NoContent HTTPStatusCode = "NoContent" + // NonAuthoritativeInformation ... + NonAuthoritativeInformation HTTPStatusCode = "NonAuthoritativeInformation" + // NotAcceptable ... + NotAcceptable HTTPStatusCode = "NotAcceptable" + // NotFound ... + NotFound HTTPStatusCode = "NotFound" + // NotImplemented ... + NotImplemented HTTPStatusCode = "NotImplemented" + // NotModified ... + NotModified HTTPStatusCode = "NotModified" + // OK ... + OK HTTPStatusCode = "OK" + // PartialContent ... + PartialContent HTTPStatusCode = "PartialContent" + // PaymentRequired ... + PaymentRequired HTTPStatusCode = "PaymentRequired" + // PreconditionFailed ... + PreconditionFailed HTTPStatusCode = "PreconditionFailed" + // ProxyAuthenticationRequired ... + ProxyAuthenticationRequired HTTPStatusCode = "ProxyAuthenticationRequired" + // Redirect ... + Redirect HTTPStatusCode = "Redirect" + // RedirectKeepVerb ... + RedirectKeepVerb HTTPStatusCode = "RedirectKeepVerb" + // RedirectMethod ... + RedirectMethod HTTPStatusCode = "RedirectMethod" + // RequestedRangeNotSatisfiable ... + RequestedRangeNotSatisfiable HTTPStatusCode = "RequestedRangeNotSatisfiable" + // RequestEntityTooLarge ... + RequestEntityTooLarge HTTPStatusCode = "RequestEntityTooLarge" + // RequestTimeout ... + RequestTimeout HTTPStatusCode = "RequestTimeout" + // RequestURITooLong ... + RequestURITooLong HTTPStatusCode = "RequestUriTooLong" + // ResetContent ... + ResetContent HTTPStatusCode = "ResetContent" + // SeeOther ... + SeeOther HTTPStatusCode = "SeeOther" + // ServiceUnavailable ... + ServiceUnavailable HTTPStatusCode = "ServiceUnavailable" + // SwitchingProtocols ... + SwitchingProtocols HTTPStatusCode = "SwitchingProtocols" + // TemporaryRedirect ... + TemporaryRedirect HTTPStatusCode = "TemporaryRedirect" + // Unauthorized ... + Unauthorized HTTPStatusCode = "Unauthorized" + // UnsupportedMediaType ... + UnsupportedMediaType HTTPStatusCode = "UnsupportedMediaType" + // Unused ... + Unused HTTPStatusCode = "Unused" + // UpgradeRequired ... + UpgradeRequired HTTPStatusCode = "UpgradeRequired" + // UseProxy ... + UseProxy HTTPStatusCode = "UseProxy" +) + +// PossibleHTTPStatusCodeValues returns an array of possible values for the HTTPStatusCode const type. +func PossibleHTTPStatusCodeValues() []HTTPStatusCode { + 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} +} + +// InfrastructureEncryptionState enumerates the values for infrastructure encryption state. +type InfrastructureEncryptionState string + +const ( + // InfrastructureEncryptionStateDisabled ... + InfrastructureEncryptionStateDisabled InfrastructureEncryptionState = "Disabled" + // InfrastructureEncryptionStateEnabled ... + InfrastructureEncryptionStateEnabled InfrastructureEncryptionState = "Enabled" + // InfrastructureEncryptionStateInvalid ... + InfrastructureEncryptionStateInvalid InfrastructureEncryptionState = "Invalid" +) + +// PossibleInfrastructureEncryptionStateValues returns an array of possible values for the InfrastructureEncryptionState const type. +func PossibleInfrastructureEncryptionStateValues() []InfrastructureEncryptionState { + return []InfrastructureEncryptionState{InfrastructureEncryptionStateDisabled, InfrastructureEncryptionStateEnabled, InfrastructureEncryptionStateInvalid} +} + +// InquiryStatus enumerates the values for inquiry status. +type InquiryStatus string + +const ( + // InquiryStatusFailed ... + InquiryStatusFailed InquiryStatus = "Failed" + // InquiryStatusInvalid ... + InquiryStatusInvalid InquiryStatus = "Invalid" + // InquiryStatusSuccess ... + InquiryStatusSuccess InquiryStatus = "Success" +) + +// PossibleInquiryStatusValues returns an array of possible values for the InquiryStatus const type. +func PossibleInquiryStatusValues() []InquiryStatus { + return []InquiryStatus{InquiryStatusFailed, InquiryStatusInvalid, InquiryStatusSuccess} +} + +// ItemType enumerates the values for item type. +type ItemType string + +const ( + // ItemTypeAzureFileShare ... + ItemTypeAzureFileShare ItemType = "AzureFileShare" + // ItemTypeAzureSQLDb ... + ItemTypeAzureSQLDb ItemType = "AzureSqlDb" + // ItemTypeClient ... + ItemTypeClient ItemType = "Client" + // ItemTypeExchange ... + ItemTypeExchange ItemType = "Exchange" + // ItemTypeFileFolder ... + ItemTypeFileFolder ItemType = "FileFolder" + // ItemTypeGenericDataSource ... + ItemTypeGenericDataSource ItemType = "GenericDataSource" + // ItemTypeInvalid ... + ItemTypeInvalid ItemType = "Invalid" + // ItemTypeSAPAseDatabase ... + ItemTypeSAPAseDatabase ItemType = "SAPAseDatabase" + // ItemTypeSAPHanaDatabase ... + ItemTypeSAPHanaDatabase ItemType = "SAPHanaDatabase" + // ItemTypeSharepoint ... + ItemTypeSharepoint ItemType = "Sharepoint" + // ItemTypeSQLDataBase ... + ItemTypeSQLDataBase ItemType = "SQLDataBase" + // ItemTypeSQLDB ... + ItemTypeSQLDB ItemType = "SQLDB" + // ItemTypeSystemState ... + ItemTypeSystemState ItemType = "SystemState" + // ItemTypeVM ... + ItemTypeVM ItemType = "VM" + // ItemTypeVMwareVM ... + ItemTypeVMwareVM ItemType = "VMwareVM" +) + +// PossibleItemTypeValues returns an array of possible values for the ItemType const type. +func PossibleItemTypeValues() []ItemType { + return []ItemType{ItemTypeAzureFileShare, ItemTypeAzureSQLDb, ItemTypeClient, ItemTypeExchange, ItemTypeFileFolder, ItemTypeGenericDataSource, ItemTypeInvalid, ItemTypeSAPAseDatabase, ItemTypeSAPHanaDatabase, ItemTypeSharepoint, ItemTypeSQLDataBase, ItemTypeSQLDB, ItemTypeSystemState, ItemTypeVM, ItemTypeVMwareVM} +} + +// JobOperationType enumerates the values for job operation type. +type JobOperationType string + +const ( + // JobOperationTypeBackup ... + JobOperationTypeBackup JobOperationType = "Backup" + // JobOperationTypeConfigureBackup ... + JobOperationTypeConfigureBackup JobOperationType = "ConfigureBackup" + // JobOperationTypeCrossRegionRestore ... + JobOperationTypeCrossRegionRestore JobOperationType = "CrossRegionRestore" + // JobOperationTypeDeleteBackupData ... + JobOperationTypeDeleteBackupData JobOperationType = "DeleteBackupData" + // JobOperationTypeDisableBackup ... + JobOperationTypeDisableBackup JobOperationType = "DisableBackup" + // JobOperationTypeInvalid ... + JobOperationTypeInvalid JobOperationType = "Invalid" + // JobOperationTypeRegister ... + JobOperationTypeRegister JobOperationType = "Register" + // JobOperationTypeRestore ... + JobOperationTypeRestore JobOperationType = "Restore" + // JobOperationTypeUndelete ... + JobOperationTypeUndelete JobOperationType = "Undelete" + // JobOperationTypeUnRegister ... + JobOperationTypeUnRegister JobOperationType = "UnRegister" + // JobOperationTypeUpdateCustomerManagedKey ... + JobOperationTypeUpdateCustomerManagedKey JobOperationType = "UpdateCustomerManagedKey" +) + +// PossibleJobOperationTypeValues returns an array of possible values for the JobOperationType const type. +func PossibleJobOperationTypeValues() []JobOperationType { + return []JobOperationType{JobOperationTypeBackup, JobOperationTypeConfigureBackup, JobOperationTypeCrossRegionRestore, JobOperationTypeDeleteBackupData, JobOperationTypeDisableBackup, JobOperationTypeInvalid, JobOperationTypeRegister, JobOperationTypeRestore, JobOperationTypeUndelete, JobOperationTypeUnRegister, JobOperationTypeUpdateCustomerManagedKey} +} + +// JobStatus enumerates the values for job status. +type JobStatus string + +const ( + // JobStatusCancelled ... + JobStatusCancelled JobStatus = "Cancelled" + // JobStatusCancelling ... + JobStatusCancelling JobStatus = "Cancelling" + // JobStatusCompleted ... + JobStatusCompleted JobStatus = "Completed" + // JobStatusCompletedWithWarnings ... + JobStatusCompletedWithWarnings JobStatus = "CompletedWithWarnings" + // JobStatusFailed ... + JobStatusFailed JobStatus = "Failed" + // JobStatusInProgress ... + JobStatusInProgress JobStatus = "InProgress" + // JobStatusInvalid ... + JobStatusInvalid JobStatus = "Invalid" +) + +// PossibleJobStatusValues returns an array of possible values for the JobStatus const type. +func PossibleJobStatusValues() []JobStatus { + return []JobStatus{JobStatusCancelled, JobStatusCancelling, JobStatusCompleted, JobStatusCompletedWithWarnings, JobStatusFailed, JobStatusInProgress, JobStatusInvalid} +} + +// JobSupportedAction enumerates the values for job supported action. +type JobSupportedAction string + +const ( + // JobSupportedActionCancellable ... + JobSupportedActionCancellable JobSupportedAction = "Cancellable" + // JobSupportedActionInvalid ... + JobSupportedActionInvalid JobSupportedAction = "Invalid" + // JobSupportedActionRetriable ... + JobSupportedActionRetriable JobSupportedAction = "Retriable" +) + +// PossibleJobSupportedActionValues returns an array of possible values for the JobSupportedAction const type. +func PossibleJobSupportedActionValues() []JobSupportedAction { + return []JobSupportedAction{JobSupportedActionCancellable, JobSupportedActionInvalid, JobSupportedActionRetriable} +} + +// JobType enumerates the values for job type. +type JobType string + +const ( + // JobTypeAzureIaaSVMJob ... + JobTypeAzureIaaSVMJob JobType = "AzureIaaSVMJob" + // JobTypeAzureStorageJob ... + JobTypeAzureStorageJob JobType = "AzureStorageJob" + // JobTypeAzureWorkloadJob ... + JobTypeAzureWorkloadJob JobType = "AzureWorkloadJob" + // JobTypeDpmJob ... + JobTypeDpmJob JobType = "DpmJob" + // JobTypeJob ... + JobTypeJob JobType = "Job" + // JobTypeMabJob ... + JobTypeMabJob JobType = "MabJob" + // JobTypeVaultJob ... + JobTypeVaultJob JobType = "VaultJob" +) + +// PossibleJobTypeValues returns an array of possible values for the JobType const type. +func PossibleJobTypeValues() []JobType { + return []JobType{JobTypeAzureIaaSVMJob, JobTypeAzureStorageJob, JobTypeAzureWorkloadJob, JobTypeDpmJob, JobTypeJob, JobTypeMabJob, JobTypeVaultJob} +} + +// LastBackupStatus enumerates the values for last backup status. +type LastBackupStatus string + +const ( + // LastBackupStatusHealthy ... + LastBackupStatusHealthy LastBackupStatus = "Healthy" + // LastBackupStatusInvalid ... + LastBackupStatusInvalid LastBackupStatus = "Invalid" + // LastBackupStatusIRPending ... + LastBackupStatusIRPending LastBackupStatus = "IRPending" + // LastBackupStatusUnhealthy ... + LastBackupStatusUnhealthy LastBackupStatus = "Unhealthy" +) + +// PossibleLastBackupStatusValues returns an array of possible values for the LastBackupStatus const type. +func PossibleLastBackupStatusValues() []LastBackupStatus { + return []LastBackupStatus{LastBackupStatusHealthy, LastBackupStatusInvalid, LastBackupStatusIRPending, LastBackupStatusUnhealthy} +} + +// LastUpdateStatus enumerates the values for last update status. +type LastUpdateStatus string + +const ( + // LastUpdateStatusFailed ... + LastUpdateStatusFailed LastUpdateStatus = "Failed" + // LastUpdateStatusInvalid ... + LastUpdateStatusInvalid LastUpdateStatus = "Invalid" + // LastUpdateStatusNotEnabled ... + LastUpdateStatusNotEnabled LastUpdateStatus = "NotEnabled" + // LastUpdateStatusPartiallyFailed ... + LastUpdateStatusPartiallyFailed LastUpdateStatus = "PartiallyFailed" + // LastUpdateStatusPartiallySucceeded ... + LastUpdateStatusPartiallySucceeded LastUpdateStatus = "PartiallySucceeded" + // LastUpdateStatusSucceeded ... + LastUpdateStatusSucceeded LastUpdateStatus = "Succeeded" +) + +// PossibleLastUpdateStatusValues returns an array of possible values for the LastUpdateStatus const type. +func PossibleLastUpdateStatusValues() []LastUpdateStatus { + return []LastUpdateStatus{LastUpdateStatusFailed, LastUpdateStatusInvalid, LastUpdateStatusNotEnabled, LastUpdateStatusPartiallyFailed, LastUpdateStatusPartiallySucceeded, LastUpdateStatusSucceeded} +} + +// MabServerType enumerates the values for mab server type. +type MabServerType string + +const ( + // MabServerTypeAzureBackupServerContainer ... + MabServerTypeAzureBackupServerContainer MabServerType = "AzureBackupServerContainer" + // MabServerTypeAzureSQLContainer ... + MabServerTypeAzureSQLContainer MabServerType = "AzureSqlContainer" + // MabServerTypeCluster ... + MabServerTypeCluster MabServerType = "Cluster" + // MabServerTypeDPMContainer ... + MabServerTypeDPMContainer MabServerType = "DPMContainer" + // MabServerTypeGenericContainer ... + MabServerTypeGenericContainer MabServerType = "GenericContainer" + // MabServerTypeIaasVMContainer ... + MabServerTypeIaasVMContainer MabServerType = "IaasVMContainer" + // MabServerTypeIaasVMServiceContainer ... + MabServerTypeIaasVMServiceContainer MabServerType = "IaasVMServiceContainer" + // MabServerTypeInvalid ... + MabServerTypeInvalid MabServerType = "Invalid" + // MabServerTypeMABContainer ... + MabServerTypeMABContainer MabServerType = "MABContainer" + // MabServerTypeSQLAGWorkLoadContainer ... + MabServerTypeSQLAGWorkLoadContainer MabServerType = "SQLAGWorkLoadContainer" + // MabServerTypeStorageContainer ... + MabServerTypeStorageContainer MabServerType = "StorageContainer" + // MabServerTypeUnknown ... + MabServerTypeUnknown MabServerType = "Unknown" + // MabServerTypeVCenter ... + MabServerTypeVCenter MabServerType = "VCenter" + // MabServerTypeVMAppContainer ... + MabServerTypeVMAppContainer MabServerType = "VMAppContainer" + // MabServerTypeWindows ... + MabServerTypeWindows MabServerType = "Windows" +) + +// PossibleMabServerTypeValues returns an array of possible values for the MabServerType const type. +func PossibleMabServerTypeValues() []MabServerType { + return []MabServerType{MabServerTypeAzureBackupServerContainer, MabServerTypeAzureSQLContainer, MabServerTypeCluster, MabServerTypeDPMContainer, MabServerTypeGenericContainer, MabServerTypeIaasVMContainer, MabServerTypeIaasVMServiceContainer, MabServerTypeInvalid, MabServerTypeMABContainer, MabServerTypeSQLAGWorkLoadContainer, MabServerTypeStorageContainer, MabServerTypeUnknown, MabServerTypeVCenter, MabServerTypeVMAppContainer, MabServerTypeWindows} +} + +// ManagementType enumerates the values for management type. +type ManagementType string + +const ( + // ManagementTypeAzureBackupServer ... + ManagementTypeAzureBackupServer ManagementType = "AzureBackupServer" + // ManagementTypeAzureIaasVM ... + ManagementTypeAzureIaasVM ManagementType = "AzureIaasVM" + // ManagementTypeAzureSQL ... + ManagementTypeAzureSQL ManagementType = "AzureSql" + // ManagementTypeAzureStorage ... + ManagementTypeAzureStorage ManagementType = "AzureStorage" + // ManagementTypeAzureWorkload ... + ManagementTypeAzureWorkload ManagementType = "AzureWorkload" + // ManagementTypeDefaultBackup ... + ManagementTypeDefaultBackup ManagementType = "DefaultBackup" + // ManagementTypeDPM ... + ManagementTypeDPM ManagementType = "DPM" + // ManagementTypeInvalid ... + ManagementTypeInvalid ManagementType = "Invalid" + // ManagementTypeMAB ... + ManagementTypeMAB ManagementType = "MAB" +) + +// PossibleManagementTypeValues returns an array of possible values for the ManagementType const type. +func PossibleManagementTypeValues() []ManagementType { + return []ManagementType{ManagementTypeAzureBackupServer, ManagementTypeAzureIaasVM, ManagementTypeAzureSQL, ManagementTypeAzureStorage, ManagementTypeAzureWorkload, ManagementTypeDefaultBackup, ManagementTypeDPM, ManagementTypeInvalid, ManagementTypeMAB} +} + +// ManagementTypeBasicProtectionPolicy enumerates the values for management type basic protection policy. +type ManagementTypeBasicProtectionPolicy string + +const ( + // BackupManagementTypeAzureIaasVM ... + BackupManagementTypeAzureIaasVM ManagementTypeBasicProtectionPolicy = "AzureIaasVM" + // BackupManagementTypeAzureSQL ... + BackupManagementTypeAzureSQL ManagementTypeBasicProtectionPolicy = "AzureSql" + // BackupManagementTypeAzureStorage ... + BackupManagementTypeAzureStorage ManagementTypeBasicProtectionPolicy = "AzureStorage" + // BackupManagementTypeAzureWorkload ... + BackupManagementTypeAzureWorkload ManagementTypeBasicProtectionPolicy = "AzureWorkload" + // BackupManagementTypeGenericProtectionPolicy ... + BackupManagementTypeGenericProtectionPolicy ManagementTypeBasicProtectionPolicy = "GenericProtectionPolicy" + // BackupManagementTypeMAB ... + BackupManagementTypeMAB ManagementTypeBasicProtectionPolicy = "MAB" + // BackupManagementTypeProtectionPolicy ... + BackupManagementTypeProtectionPolicy ManagementTypeBasicProtectionPolicy = "ProtectionPolicy" +) + +// PossibleManagementTypeBasicProtectionPolicyValues returns an array of possible values for the ManagementTypeBasicProtectionPolicy const type. +func PossibleManagementTypeBasicProtectionPolicyValues() []ManagementTypeBasicProtectionPolicy { + return []ManagementTypeBasicProtectionPolicy{BackupManagementTypeAzureIaasVM, BackupManagementTypeAzureSQL, BackupManagementTypeAzureStorage, BackupManagementTypeAzureWorkload, BackupManagementTypeGenericProtectionPolicy, BackupManagementTypeMAB, BackupManagementTypeProtectionPolicy} +} + +// MonthOfYear enumerates the values for month of year. +type MonthOfYear string + +const ( + // MonthOfYearApril ... + MonthOfYearApril MonthOfYear = "April" + // MonthOfYearAugust ... + MonthOfYearAugust MonthOfYear = "August" + // MonthOfYearDecember ... + MonthOfYearDecember MonthOfYear = "December" + // MonthOfYearFebruary ... + MonthOfYearFebruary MonthOfYear = "February" + // MonthOfYearInvalid ... + MonthOfYearInvalid MonthOfYear = "Invalid" + // MonthOfYearJanuary ... + MonthOfYearJanuary MonthOfYear = "January" + // MonthOfYearJuly ... + MonthOfYearJuly MonthOfYear = "July" + // MonthOfYearJune ... + MonthOfYearJune MonthOfYear = "June" + // MonthOfYearMarch ... + MonthOfYearMarch MonthOfYear = "March" + // MonthOfYearMay ... + MonthOfYearMay MonthOfYear = "May" + // MonthOfYearNovember ... + MonthOfYearNovember MonthOfYear = "November" + // MonthOfYearOctober ... + MonthOfYearOctober MonthOfYear = "October" + // MonthOfYearSeptember ... + MonthOfYearSeptember MonthOfYear = "September" +) + +// PossibleMonthOfYearValues returns an array of possible values for the MonthOfYear const type. +func PossibleMonthOfYearValues() []MonthOfYear { + return []MonthOfYear{MonthOfYearApril, MonthOfYearAugust, MonthOfYearDecember, MonthOfYearFebruary, MonthOfYearInvalid, MonthOfYearJanuary, MonthOfYearJuly, MonthOfYearJune, MonthOfYearMarch, MonthOfYearMay, MonthOfYearNovember, MonthOfYearOctober, MonthOfYearSeptember} +} + +// ObjectType enumerates the values for object type. +type ObjectType string + +const ( + // ObjectTypeExportJobsOperationResultInfo ... + ObjectTypeExportJobsOperationResultInfo ObjectType = "ExportJobsOperationResultInfo" + // ObjectTypeOperationResultInfo ... + ObjectTypeOperationResultInfo ObjectType = "OperationResultInfo" + // ObjectTypeOperationResultInfoBase ... + ObjectTypeOperationResultInfoBase ObjectType = "OperationResultInfoBase" +) + +// PossibleObjectTypeValues returns an array of possible values for the ObjectType const type. +func PossibleObjectTypeValues() []ObjectType { + return []ObjectType{ObjectTypeExportJobsOperationResultInfo, ObjectTypeOperationResultInfo, ObjectTypeOperationResultInfoBase} +} + +// ObjectTypeBasicILRRequest enumerates the values for object type basic ilr request. +type ObjectTypeBasicILRRequest string + +const ( + // ObjectTypeAzureFileShareProvisionILRRequest ... + ObjectTypeAzureFileShareProvisionILRRequest ObjectTypeBasicILRRequest = "AzureFileShareProvisionILRRequest" + // ObjectTypeIaasVMILRRegistrationRequest ... + ObjectTypeIaasVMILRRegistrationRequest ObjectTypeBasicILRRequest = "IaasVMILRRegistrationRequest" + // ObjectTypeILRRequest ... + ObjectTypeILRRequest ObjectTypeBasicILRRequest = "ILRRequest" +) + +// PossibleObjectTypeBasicILRRequestValues returns an array of possible values for the ObjectTypeBasicILRRequest const type. +func PossibleObjectTypeBasicILRRequestValues() []ObjectTypeBasicILRRequest { + return []ObjectTypeBasicILRRequest{ObjectTypeAzureFileShareProvisionILRRequest, ObjectTypeIaasVMILRRegistrationRequest, ObjectTypeILRRequest} +} + +// ObjectTypeBasicOperationStatusExtendedInfo enumerates the values for object type basic operation status +// extended info. +type ObjectTypeBasicOperationStatusExtendedInfo string + +const ( + // ObjectTypeOperationStatusExtendedInfo ... + ObjectTypeOperationStatusExtendedInfo ObjectTypeBasicOperationStatusExtendedInfo = "OperationStatusExtendedInfo" + // ObjectTypeOperationStatusJobExtendedInfo ... + ObjectTypeOperationStatusJobExtendedInfo ObjectTypeBasicOperationStatusExtendedInfo = "OperationStatusJobExtendedInfo" + // ObjectTypeOperationStatusJobsExtendedInfo ... + ObjectTypeOperationStatusJobsExtendedInfo ObjectTypeBasicOperationStatusExtendedInfo = "OperationStatusJobsExtendedInfo" + // ObjectTypeOperationStatusProvisionILRExtendedInfo ... + ObjectTypeOperationStatusProvisionILRExtendedInfo ObjectTypeBasicOperationStatusExtendedInfo = "OperationStatusProvisionILRExtendedInfo" +) + +// PossibleObjectTypeBasicOperationStatusExtendedInfoValues returns an array of possible values for the ObjectTypeBasicOperationStatusExtendedInfo const type. +func PossibleObjectTypeBasicOperationStatusExtendedInfoValues() []ObjectTypeBasicOperationStatusExtendedInfo { + return []ObjectTypeBasicOperationStatusExtendedInfo{ObjectTypeOperationStatusExtendedInfo, ObjectTypeOperationStatusJobExtendedInfo, ObjectTypeOperationStatusJobsExtendedInfo, ObjectTypeOperationStatusProvisionILRExtendedInfo} +} + +// ObjectTypeBasicRecoveryPoint enumerates the values for object type basic recovery point. +type ObjectTypeBasicRecoveryPoint string + +const ( + // ObjectTypeAzureFileShareRecoveryPoint ... + ObjectTypeAzureFileShareRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureFileShareRecoveryPoint" + // ObjectTypeAzureWorkloadPointInTimeRecoveryPoint ... + ObjectTypeAzureWorkloadPointInTimeRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadPointInTimeRecoveryPoint" + // ObjectTypeAzureWorkloadRecoveryPoint ... + ObjectTypeAzureWorkloadRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadRecoveryPoint" + // ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint ... + ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadSAPHanaPointInTimeRecoveryPoint" + // ObjectTypeAzureWorkloadSAPHanaRecoveryPoint ... + ObjectTypeAzureWorkloadSAPHanaRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadSAPHanaRecoveryPoint" + // ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint ... + ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadSQLPointInTimeRecoveryPoint" + // ObjectTypeAzureWorkloadSQLRecoveryPoint ... + ObjectTypeAzureWorkloadSQLRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadSQLRecoveryPoint" + // ObjectTypeGenericRecoveryPoint ... + ObjectTypeGenericRecoveryPoint ObjectTypeBasicRecoveryPoint = "GenericRecoveryPoint" + // ObjectTypeIaasVMRecoveryPoint ... + ObjectTypeIaasVMRecoveryPoint ObjectTypeBasicRecoveryPoint = "IaasVMRecoveryPoint" + // ObjectTypeRecoveryPoint ... + ObjectTypeRecoveryPoint ObjectTypeBasicRecoveryPoint = "RecoveryPoint" +) + +// PossibleObjectTypeBasicRecoveryPointValues returns an array of possible values for the ObjectTypeBasicRecoveryPoint const type. +func PossibleObjectTypeBasicRecoveryPointValues() []ObjectTypeBasicRecoveryPoint { + return []ObjectTypeBasicRecoveryPoint{ObjectTypeAzureFileShareRecoveryPoint, ObjectTypeAzureWorkloadPointInTimeRecoveryPoint, ObjectTypeAzureWorkloadRecoveryPoint, ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint, ObjectTypeAzureWorkloadSAPHanaRecoveryPoint, ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint, ObjectTypeAzureWorkloadSQLRecoveryPoint, ObjectTypeGenericRecoveryPoint, ObjectTypeIaasVMRecoveryPoint, ObjectTypeRecoveryPoint} +} + +// ObjectTypeBasicRequest enumerates the values for object type basic request. +type ObjectTypeBasicRequest string + +const ( + // ObjectTypeAzureFileShareBackupRequest ... + ObjectTypeAzureFileShareBackupRequest ObjectTypeBasicRequest = "AzureFileShareBackupRequest" + // ObjectTypeAzureWorkloadBackupRequest ... + ObjectTypeAzureWorkloadBackupRequest ObjectTypeBasicRequest = "AzureWorkloadBackupRequest" + // ObjectTypeBackupRequest ... + ObjectTypeBackupRequest ObjectTypeBasicRequest = "BackupRequest" + // ObjectTypeIaasVMBackupRequest ... + ObjectTypeIaasVMBackupRequest ObjectTypeBasicRequest = "IaasVMBackupRequest" +) + +// PossibleObjectTypeBasicRequestValues returns an array of possible values for the ObjectTypeBasicRequest const type. +func PossibleObjectTypeBasicRequestValues() []ObjectTypeBasicRequest { + return []ObjectTypeBasicRequest{ObjectTypeAzureFileShareBackupRequest, ObjectTypeAzureWorkloadBackupRequest, ObjectTypeBackupRequest, ObjectTypeIaasVMBackupRequest} +} + +// ObjectTypeBasicRestoreRequest enumerates the values for object type basic restore request. +type ObjectTypeBasicRestoreRequest string + +const ( + // ObjectTypeAzureFileShareRestoreRequest ... + ObjectTypeAzureFileShareRestoreRequest ObjectTypeBasicRestoreRequest = "AzureFileShareRestoreRequest" + // ObjectTypeAzureWorkloadPointInTimeRestoreRequest ... + ObjectTypeAzureWorkloadPointInTimeRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadPointInTimeRestoreRequest" + // ObjectTypeAzureWorkloadRestoreRequest ... + ObjectTypeAzureWorkloadRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadRestoreRequest" + // ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest ... + ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadSAPHanaPointInTimeRestoreRequest" + // ObjectTypeAzureWorkloadSAPHanaRestoreRequest ... + ObjectTypeAzureWorkloadSAPHanaRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadSAPHanaRestoreRequest" + // ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest ... + ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadSQLPointInTimeRestoreRequest" + // ObjectTypeAzureWorkloadSQLRestoreRequest ... + ObjectTypeAzureWorkloadSQLRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadSQLRestoreRequest" + // ObjectTypeIaasVMRestoreRequest ... + ObjectTypeIaasVMRestoreRequest ObjectTypeBasicRestoreRequest = "IaasVMRestoreRequest" + // ObjectTypeRestoreRequest ... + ObjectTypeRestoreRequest ObjectTypeBasicRestoreRequest = "RestoreRequest" +) + +// PossibleObjectTypeBasicRestoreRequestValues returns an array of possible values for the ObjectTypeBasicRestoreRequest const type. +func PossibleObjectTypeBasicRestoreRequestValues() []ObjectTypeBasicRestoreRequest { + return []ObjectTypeBasicRestoreRequest{ObjectTypeAzureFileShareRestoreRequest, ObjectTypeAzureWorkloadPointInTimeRestoreRequest, ObjectTypeAzureWorkloadRestoreRequest, ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest, ObjectTypeAzureWorkloadSAPHanaRestoreRequest, ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest, ObjectTypeAzureWorkloadSQLRestoreRequest, ObjectTypeIaasVMRestoreRequest, ObjectTypeRestoreRequest} +} + +// ObjectTypeBasicValidateOperationRequest enumerates the values for object type basic validate operation +// request. +type ObjectTypeBasicValidateOperationRequest string + +const ( + // ObjectTypeValidateIaasVMRestoreOperationRequest ... + ObjectTypeValidateIaasVMRestoreOperationRequest ObjectTypeBasicValidateOperationRequest = "ValidateIaasVMRestoreOperationRequest" + // ObjectTypeValidateOperationRequest ... + ObjectTypeValidateOperationRequest ObjectTypeBasicValidateOperationRequest = "ValidateOperationRequest" + // ObjectTypeValidateRestoreOperationRequest ... + ObjectTypeValidateRestoreOperationRequest ObjectTypeBasicValidateOperationRequest = "ValidateRestoreOperationRequest" +) + +// PossibleObjectTypeBasicValidateOperationRequestValues returns an array of possible values for the ObjectTypeBasicValidateOperationRequest const type. +func PossibleObjectTypeBasicValidateOperationRequestValues() []ObjectTypeBasicValidateOperationRequest { + return []ObjectTypeBasicValidateOperationRequest{ObjectTypeValidateIaasVMRestoreOperationRequest, ObjectTypeValidateOperationRequest, ObjectTypeValidateRestoreOperationRequest} +} + +// ObjectTypeBasicVaultStorageConfigOperationResultResponse enumerates the values for object type basic vault +// storage config operation result response. +type ObjectTypeBasicVaultStorageConfigOperationResultResponse string + +const ( + // ObjectTypePrepareDataMoveResponse ... + ObjectTypePrepareDataMoveResponse ObjectTypeBasicVaultStorageConfigOperationResultResponse = "PrepareDataMoveResponse" + // ObjectTypeVaultStorageConfigOperationResultResponse ... + ObjectTypeVaultStorageConfigOperationResultResponse ObjectTypeBasicVaultStorageConfigOperationResultResponse = "VaultStorageConfigOperationResultResponse" +) + +// PossibleObjectTypeBasicVaultStorageConfigOperationResultResponseValues returns an array of possible values for the ObjectTypeBasicVaultStorageConfigOperationResultResponse const type. +func PossibleObjectTypeBasicVaultStorageConfigOperationResultResponseValues() []ObjectTypeBasicVaultStorageConfigOperationResultResponse { + return []ObjectTypeBasicVaultStorageConfigOperationResultResponse{ObjectTypePrepareDataMoveResponse, ObjectTypeVaultStorageConfigOperationResultResponse} +} + +// OperationStatusValues enumerates the values for operation status values. +type OperationStatusValues string + +const ( + // OperationStatusValuesCanceled ... + OperationStatusValuesCanceled OperationStatusValues = "Canceled" + // OperationStatusValuesFailed ... + OperationStatusValuesFailed OperationStatusValues = "Failed" + // OperationStatusValuesInProgress ... + OperationStatusValuesInProgress OperationStatusValues = "InProgress" + // OperationStatusValuesInvalid ... + OperationStatusValuesInvalid OperationStatusValues = "Invalid" + // OperationStatusValuesSucceeded ... + OperationStatusValuesSucceeded OperationStatusValues = "Succeeded" +) + +// PossibleOperationStatusValuesValues returns an array of possible values for the OperationStatusValues const type. +func PossibleOperationStatusValuesValues() []OperationStatusValues { + return []OperationStatusValues{OperationStatusValuesCanceled, OperationStatusValuesFailed, OperationStatusValuesInProgress, OperationStatusValuesInvalid, OperationStatusValuesSucceeded} +} + +// OperationType enumerates the values for operation type. +type OperationType string + +const ( + // OperationTypeInvalid ... + OperationTypeInvalid OperationType = "Invalid" + // OperationTypeRegister ... + OperationTypeRegister OperationType = "Register" + // OperationTypeReregister ... + OperationTypeReregister OperationType = "Reregister" +) + +// PossibleOperationTypeValues returns an array of possible values for the OperationType const type. +func PossibleOperationTypeValues() []OperationType { + return []OperationType{OperationTypeInvalid, OperationTypeRegister, OperationTypeReregister} +} + +// OverwriteOptions enumerates the values for overwrite options. +type OverwriteOptions string + +const ( + // OverwriteOptionsFailOnConflict ... + OverwriteOptionsFailOnConflict OverwriteOptions = "FailOnConflict" + // OverwriteOptionsInvalid ... + OverwriteOptionsInvalid OverwriteOptions = "Invalid" + // OverwriteOptionsOverwrite ... + OverwriteOptionsOverwrite OverwriteOptions = "Overwrite" +) + +// PossibleOverwriteOptionsValues returns an array of possible values for the OverwriteOptions const type. +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" + // PolicyTypeIncremental ... + PolicyTypeIncremental PolicyType = "Incremental" + // 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, PolicyTypeIncremental, PolicyTypeInvalid, PolicyTypeLog} +} + +// PrivateEndpointConnectionStatus enumerates the values for private endpoint connection status. +type PrivateEndpointConnectionStatus string + +const ( + // Approved ... + Approved PrivateEndpointConnectionStatus = "Approved" + // Disconnected ... + Disconnected PrivateEndpointConnectionStatus = "Disconnected" + // Pending ... + Pending PrivateEndpointConnectionStatus = "Pending" + // Rejected ... + Rejected PrivateEndpointConnectionStatus = "Rejected" +) + +// PossiblePrivateEndpointConnectionStatusValues returns an array of possible values for the PrivateEndpointConnectionStatus const type. +func PossiblePrivateEndpointConnectionStatusValues() []PrivateEndpointConnectionStatus { + return []PrivateEndpointConnectionStatus{Approved, Disconnected, Pending, Rejected} +} + +// ProtectableContainerType enumerates the values for protectable container type. +type ProtectableContainerType string + +const ( + // ProtectableContainerTypeProtectableContainer ... + ProtectableContainerTypeProtectableContainer ProtectableContainerType = "ProtectableContainer" + // ProtectableContainerTypeStorageContainer ... + ProtectableContainerTypeStorageContainer ProtectableContainerType = "StorageContainer" + // ProtectableContainerTypeVMAppContainer ... + ProtectableContainerTypeVMAppContainer ProtectableContainerType = "VMAppContainer" +) + +// PossibleProtectableContainerTypeValues returns an array of possible values for the ProtectableContainerType const type. +func PossibleProtectableContainerTypeValues() []ProtectableContainerType { + return []ProtectableContainerType{ProtectableContainerTypeProtectableContainer, ProtectableContainerTypeStorageContainer, ProtectableContainerTypeVMAppContainer} +} + +// ProtectableItemType enumerates the values for protectable item type. +type ProtectableItemType string + +const ( + // ProtectableItemTypeAzureFileShare ... + ProtectableItemTypeAzureFileShare ProtectableItemType = "AzureFileShare" + // ProtectableItemTypeAzureVMWorkloadProtectableItem ... + ProtectableItemTypeAzureVMWorkloadProtectableItem ProtectableItemType = "AzureVmWorkloadProtectableItem" + // ProtectableItemTypeIaaSVMProtectableItem ... + ProtectableItemTypeIaaSVMProtectableItem ProtectableItemType = "IaaSVMProtectableItem" + // ProtectableItemTypeMicrosoftClassicComputevirtualMachines ... + ProtectableItemTypeMicrosoftClassicComputevirtualMachines ProtectableItemType = "Microsoft.ClassicCompute/virtualMachines" + // ProtectableItemTypeMicrosoftComputevirtualMachines ... + ProtectableItemTypeMicrosoftComputevirtualMachines ProtectableItemType = "Microsoft.Compute/virtualMachines" + // ProtectableItemTypeSAPAseSystem ... + ProtectableItemTypeSAPAseSystem ProtectableItemType = "SAPAseSystem" + // ProtectableItemTypeSAPHanaDatabase ... + ProtectableItemTypeSAPHanaDatabase ProtectableItemType = "SAPHanaDatabase" + // ProtectableItemTypeSAPHanaSystem ... + ProtectableItemTypeSAPHanaSystem ProtectableItemType = "SAPHanaSystem" + // ProtectableItemTypeSQLAvailabilityGroupContainer ... + ProtectableItemTypeSQLAvailabilityGroupContainer ProtectableItemType = "SQLAvailabilityGroupContainer" + // ProtectableItemTypeSQLDataBase ... + ProtectableItemTypeSQLDataBase ProtectableItemType = "SQLDataBase" + // ProtectableItemTypeSQLInstance ... + ProtectableItemTypeSQLInstance ProtectableItemType = "SQLInstance" + // ProtectableItemTypeWorkloadProtectableItem ... + ProtectableItemTypeWorkloadProtectableItem ProtectableItemType = "WorkloadProtectableItem" +) + +// PossibleProtectableItemTypeValues returns an array of possible values for the ProtectableItemType const type. +func PossibleProtectableItemTypeValues() []ProtectableItemType { + return []ProtectableItemType{ProtectableItemTypeAzureFileShare, ProtectableItemTypeAzureVMWorkloadProtectableItem, ProtectableItemTypeIaaSVMProtectableItem, ProtectableItemTypeMicrosoftClassicComputevirtualMachines, ProtectableItemTypeMicrosoftComputevirtualMachines, ProtectableItemTypeSAPAseSystem, ProtectableItemTypeSAPHanaDatabase, ProtectableItemTypeSAPHanaSystem, ProtectableItemTypeSQLAvailabilityGroupContainer, ProtectableItemTypeSQLDataBase, ProtectableItemTypeSQLInstance, ProtectableItemTypeWorkloadProtectableItem} +} + +// ProtectedItemHealthStatus enumerates the values for protected item health status. +type ProtectedItemHealthStatus string + +const ( + // ProtectedItemHealthStatusHealthy ... + ProtectedItemHealthStatusHealthy ProtectedItemHealthStatus = "Healthy" + // ProtectedItemHealthStatusInvalid ... + ProtectedItemHealthStatusInvalid ProtectedItemHealthStatus = "Invalid" + // ProtectedItemHealthStatusIRPending ... + ProtectedItemHealthStatusIRPending ProtectedItemHealthStatus = "IRPending" + // ProtectedItemHealthStatusNotReachable ... + ProtectedItemHealthStatusNotReachable ProtectedItemHealthStatus = "NotReachable" + // ProtectedItemHealthStatusUnhealthy ... + ProtectedItemHealthStatusUnhealthy ProtectedItemHealthStatus = "Unhealthy" +) + +// PossibleProtectedItemHealthStatusValues returns an array of possible values for the ProtectedItemHealthStatus const type. +func PossibleProtectedItemHealthStatusValues() []ProtectedItemHealthStatus { + return []ProtectedItemHealthStatus{ProtectedItemHealthStatusHealthy, ProtectedItemHealthStatusInvalid, ProtectedItemHealthStatusIRPending, ProtectedItemHealthStatusNotReachable, ProtectedItemHealthStatusUnhealthy} +} + +// ProtectedItemState enumerates the values for protected item state. +type ProtectedItemState string + +const ( + // ProtectedItemStateInvalid ... + ProtectedItemStateInvalid ProtectedItemState = "Invalid" + // ProtectedItemStateIRPending ... + ProtectedItemStateIRPending ProtectedItemState = "IRPending" + // ProtectedItemStateProtected ... + ProtectedItemStateProtected ProtectedItemState = "Protected" + // ProtectedItemStateProtectionError ... + ProtectedItemStateProtectionError ProtectedItemState = "ProtectionError" + // ProtectedItemStateProtectionPaused ... + ProtectedItemStateProtectionPaused ProtectedItemState = "ProtectionPaused" + // ProtectedItemStateProtectionStopped ... + ProtectedItemStateProtectionStopped ProtectedItemState = "ProtectionStopped" +) + +// PossibleProtectedItemStateValues returns an array of possible values for the ProtectedItemState const type. +func PossibleProtectedItemStateValues() []ProtectedItemState { + return []ProtectedItemState{ProtectedItemStateInvalid, ProtectedItemStateIRPending, ProtectedItemStateProtected, ProtectedItemStateProtectionError, ProtectedItemStateProtectionPaused, ProtectedItemStateProtectionStopped} +} + +// ProtectedItemType enumerates the values for protected item type. +type ProtectedItemType string + +const ( + // ProtectedItemTypeAzureFileShareProtectedItem ... + ProtectedItemTypeAzureFileShareProtectedItem ProtectedItemType = "AzureFileShareProtectedItem" + // ProtectedItemTypeAzureIaaSVMProtectedItem ... + ProtectedItemTypeAzureIaaSVMProtectedItem ProtectedItemType = "AzureIaaSVMProtectedItem" + // ProtectedItemTypeAzureVMWorkloadProtectedItem ... + ProtectedItemTypeAzureVMWorkloadProtectedItem ProtectedItemType = "AzureVmWorkloadProtectedItem" + // ProtectedItemTypeAzureVMWorkloadSAPAseDatabase ... + ProtectedItemTypeAzureVMWorkloadSAPAseDatabase ProtectedItemType = "AzureVmWorkloadSAPAseDatabase" + // ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase ... + ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase ProtectedItemType = "AzureVmWorkloadSAPHanaDatabase" + // ProtectedItemTypeAzureVMWorkloadSQLDatabase ... + ProtectedItemTypeAzureVMWorkloadSQLDatabase ProtectedItemType = "AzureVmWorkloadSQLDatabase" + // ProtectedItemTypeDPMProtectedItem ... + ProtectedItemTypeDPMProtectedItem ProtectedItemType = "DPMProtectedItem" + // ProtectedItemTypeGenericProtectedItem ... + ProtectedItemTypeGenericProtectedItem ProtectedItemType = "GenericProtectedItem" + // ProtectedItemTypeMabFileFolderProtectedItem ... + ProtectedItemTypeMabFileFolderProtectedItem ProtectedItemType = "MabFileFolderProtectedItem" + // ProtectedItemTypeMicrosoftClassicComputevirtualMachines ... + ProtectedItemTypeMicrosoftClassicComputevirtualMachines ProtectedItemType = "Microsoft.ClassicCompute/virtualMachines" + // ProtectedItemTypeMicrosoftComputevirtualMachines ... + ProtectedItemTypeMicrosoftComputevirtualMachines ProtectedItemType = "Microsoft.Compute/virtualMachines" + // ProtectedItemTypeMicrosoftSqlserversdatabases ... + ProtectedItemTypeMicrosoftSqlserversdatabases ProtectedItemType = "Microsoft.Sql/servers/databases" + // ProtectedItemTypeProtectedItem ... + ProtectedItemTypeProtectedItem ProtectedItemType = "ProtectedItem" +) + +// PossibleProtectedItemTypeValues returns an array of possible values for the ProtectedItemType const type. +func PossibleProtectedItemTypeValues() []ProtectedItemType { + return []ProtectedItemType{ProtectedItemTypeAzureFileShareProtectedItem, ProtectedItemTypeAzureIaaSVMProtectedItem, ProtectedItemTypeAzureVMWorkloadProtectedItem, ProtectedItemTypeAzureVMWorkloadSAPAseDatabase, ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase, ProtectedItemTypeAzureVMWorkloadSQLDatabase, ProtectedItemTypeDPMProtectedItem, ProtectedItemTypeGenericProtectedItem, ProtectedItemTypeMabFileFolderProtectedItem, ProtectedItemTypeMicrosoftClassicComputevirtualMachines, ProtectedItemTypeMicrosoftComputevirtualMachines, ProtectedItemTypeMicrosoftSqlserversdatabases, ProtectedItemTypeProtectedItem} +} + +// ProtectionState enumerates the values for protection state. +type ProtectionState string + +const ( + // ProtectionStateInvalid ... + ProtectionStateInvalid ProtectionState = "Invalid" + // ProtectionStateIRPending ... + ProtectionStateIRPending ProtectionState = "IRPending" + // ProtectionStateProtected ... + ProtectionStateProtected ProtectionState = "Protected" + // ProtectionStateProtectionError ... + ProtectionStateProtectionError ProtectionState = "ProtectionError" + // ProtectionStateProtectionPaused ... + ProtectionStateProtectionPaused ProtectionState = "ProtectionPaused" + // ProtectionStateProtectionStopped ... + ProtectionStateProtectionStopped ProtectionState = "ProtectionStopped" +) + +// PossibleProtectionStateValues returns an array of possible values for the ProtectionState const type. +func PossibleProtectionStateValues() []ProtectionState { + return []ProtectionState{ProtectionStateInvalid, ProtectionStateIRPending, ProtectionStateProtected, ProtectionStateProtectionError, ProtectionStateProtectionPaused, ProtectionStateProtectionStopped} +} + +// ProtectionStatus enumerates the values for protection status. +type ProtectionStatus string + +const ( + // ProtectionStatusInvalid ... + ProtectionStatusInvalid ProtectionStatus = "Invalid" + // ProtectionStatusNotProtected ... + ProtectionStatusNotProtected ProtectionStatus = "NotProtected" + // ProtectionStatusProtected ... + ProtectionStatusProtected ProtectionStatus = "Protected" + // ProtectionStatusProtecting ... + ProtectionStatusProtecting ProtectionStatus = "Protecting" + // ProtectionStatusProtectionFailed ... + ProtectionStatusProtectionFailed ProtectionStatus = "ProtectionFailed" +) + +// PossibleProtectionStatusValues returns an array of possible values for the ProtectionStatus const type. +func PossibleProtectionStatusValues() []ProtectionStatus { + return []ProtectionStatus{ProtectionStatusInvalid, ProtectionStatusNotProtected, ProtectionStatusProtected, ProtectionStatusProtecting, ProtectionStatusProtectionFailed} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // ProvisioningStateDeleting ... + ProvisioningStateDeleting ProvisioningState = "Deleting" + // ProvisioningStateFailed ... + ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStatePending ... + ProvisioningStatePending ProvisioningState = "Pending" + // ProvisioningStateSucceeded ... + ProvisioningStateSucceeded ProvisioningState = "Succeeded" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStatePending, ProvisioningStateSucceeded} +} + +// RecoveryMode enumerates the values for recovery mode. +type RecoveryMode string + +const ( + // RecoveryModeFileRecovery ... + RecoveryModeFileRecovery RecoveryMode = "FileRecovery" + // RecoveryModeInvalid ... + RecoveryModeInvalid RecoveryMode = "Invalid" + // RecoveryModeWorkloadRecovery ... + RecoveryModeWorkloadRecovery RecoveryMode = "WorkloadRecovery" +) + +// PossibleRecoveryModeValues returns an array of possible values for the RecoveryMode const type. +func PossibleRecoveryModeValues() []RecoveryMode { + return []RecoveryMode{RecoveryModeFileRecovery, RecoveryModeInvalid, RecoveryModeWorkloadRecovery} +} + +// RecoveryPointTierStatus enumerates the values for recovery point tier status. +type RecoveryPointTierStatus string + +const ( + // RecoveryPointTierStatusDeleted ... + RecoveryPointTierStatusDeleted RecoveryPointTierStatus = "Deleted" + // RecoveryPointTierStatusDisabled ... + RecoveryPointTierStatusDisabled RecoveryPointTierStatus = "Disabled" + // RecoveryPointTierStatusInvalid ... + RecoveryPointTierStatusInvalid RecoveryPointTierStatus = "Invalid" + // RecoveryPointTierStatusRehydrated ... + RecoveryPointTierStatusRehydrated RecoveryPointTierStatus = "Rehydrated" + // RecoveryPointTierStatusValid ... + RecoveryPointTierStatusValid RecoveryPointTierStatus = "Valid" +) + +// PossibleRecoveryPointTierStatusValues returns an array of possible values for the RecoveryPointTierStatus const type. +func PossibleRecoveryPointTierStatusValues() []RecoveryPointTierStatus { + return []RecoveryPointTierStatus{RecoveryPointTierStatusDeleted, RecoveryPointTierStatusDisabled, RecoveryPointTierStatusInvalid, RecoveryPointTierStatusRehydrated, RecoveryPointTierStatusValid} +} + +// RecoveryPointTierType enumerates the values for recovery point tier type. +type RecoveryPointTierType string + +const ( + // RecoveryPointTierTypeArchivedRP ... + RecoveryPointTierTypeArchivedRP RecoveryPointTierType = "ArchivedRP" + // RecoveryPointTierTypeHardenedRP ... + RecoveryPointTierTypeHardenedRP RecoveryPointTierType = "HardenedRP" + // RecoveryPointTierTypeInstantRP ... + RecoveryPointTierTypeInstantRP RecoveryPointTierType = "InstantRP" + // RecoveryPointTierTypeInvalid ... + RecoveryPointTierTypeInvalid RecoveryPointTierType = "Invalid" +) + +// PossibleRecoveryPointTierTypeValues returns an array of possible values for the RecoveryPointTierType const type. +func PossibleRecoveryPointTierTypeValues() []RecoveryPointTierType { + return []RecoveryPointTierType{RecoveryPointTierTypeArchivedRP, RecoveryPointTierTypeHardenedRP, RecoveryPointTierTypeInstantRP, RecoveryPointTierTypeInvalid} +} + +// RecoveryType enumerates the values for recovery type. +type RecoveryType string + +const ( + // RecoveryTypeAlternateLocation ... + RecoveryTypeAlternateLocation RecoveryType = "AlternateLocation" + // RecoveryTypeInvalid ... + RecoveryTypeInvalid RecoveryType = "Invalid" + // RecoveryTypeOffline ... + RecoveryTypeOffline RecoveryType = "Offline" + // RecoveryTypeOriginalLocation ... + RecoveryTypeOriginalLocation RecoveryType = "OriginalLocation" + // RecoveryTypeRestoreDisks ... + RecoveryTypeRestoreDisks RecoveryType = "RestoreDisks" +) + +// PossibleRecoveryTypeValues returns an array of possible values for the RecoveryType const type. +func PossibleRecoveryTypeValues() []RecoveryType { + return []RecoveryType{RecoveryTypeAlternateLocation, RecoveryTypeInvalid, RecoveryTypeOffline, RecoveryTypeOriginalLocation, RecoveryTypeRestoreDisks} +} + +// ResourceHealthStatus enumerates the values for resource health status. +type ResourceHealthStatus string + +const ( + // ResourceHealthStatusHealthy ... + ResourceHealthStatusHealthy ResourceHealthStatus = "Healthy" + // ResourceHealthStatusInvalid ... + ResourceHealthStatusInvalid ResourceHealthStatus = "Invalid" + // ResourceHealthStatusPersistentDegraded ... + ResourceHealthStatusPersistentDegraded ResourceHealthStatus = "PersistentDegraded" + // ResourceHealthStatusPersistentUnhealthy ... + ResourceHealthStatusPersistentUnhealthy ResourceHealthStatus = "PersistentUnhealthy" + // ResourceHealthStatusTransientDegraded ... + ResourceHealthStatusTransientDegraded ResourceHealthStatus = "TransientDegraded" + // ResourceHealthStatusTransientUnhealthy ... + ResourceHealthStatusTransientUnhealthy ResourceHealthStatus = "TransientUnhealthy" +) + +// PossibleResourceHealthStatusValues returns an array of possible values for the ResourceHealthStatus const type. +func PossibleResourceHealthStatusValues() []ResourceHealthStatus { + return []ResourceHealthStatus{ResourceHealthStatusHealthy, ResourceHealthStatusInvalid, ResourceHealthStatusPersistentDegraded, ResourceHealthStatusPersistentUnhealthy, ResourceHealthStatusTransientDegraded, ResourceHealthStatusTransientUnhealthy} +} + +// RestorePointQueryType enumerates the values for restore point query type. +type RestorePointQueryType string + +const ( + // RestorePointQueryTypeAll ... + RestorePointQueryTypeAll RestorePointQueryType = "All" + // RestorePointQueryTypeDifferential ... + RestorePointQueryTypeDifferential RestorePointQueryType = "Differential" + // RestorePointQueryTypeFull ... + RestorePointQueryTypeFull RestorePointQueryType = "Full" + // RestorePointQueryTypeFullAndDifferential ... + RestorePointQueryTypeFullAndDifferential RestorePointQueryType = "FullAndDifferential" + // RestorePointQueryTypeIncremental ... + RestorePointQueryTypeIncremental RestorePointQueryType = "Incremental" + // RestorePointQueryTypeInvalid ... + RestorePointQueryTypeInvalid RestorePointQueryType = "Invalid" + // RestorePointQueryTypeLog ... + RestorePointQueryTypeLog RestorePointQueryType = "Log" +) + +// PossibleRestorePointQueryTypeValues returns an array of possible values for the RestorePointQueryType const type. +func PossibleRestorePointQueryTypeValues() []RestorePointQueryType { + return []RestorePointQueryType{RestorePointQueryTypeAll, RestorePointQueryTypeDifferential, RestorePointQueryTypeFull, RestorePointQueryTypeFullAndDifferential, RestorePointQueryTypeIncremental, RestorePointQueryTypeInvalid, RestorePointQueryTypeLog} +} + +// RestorePointType enumerates the values for restore point type. +type RestorePointType string + +const ( + // RestorePointTypeDifferential ... + RestorePointTypeDifferential RestorePointType = "Differential" + // RestorePointTypeFull ... + RestorePointTypeFull RestorePointType = "Full" + // RestorePointTypeIncremental ... + RestorePointTypeIncremental RestorePointType = "Incremental" + // RestorePointTypeInvalid ... + RestorePointTypeInvalid RestorePointType = "Invalid" + // RestorePointTypeLog ... + RestorePointTypeLog RestorePointType = "Log" +) + +// PossibleRestorePointTypeValues returns an array of possible values for the RestorePointType const type. +func PossibleRestorePointTypeValues() []RestorePointType { + return []RestorePointType{RestorePointTypeDifferential, RestorePointTypeFull, RestorePointTypeIncremental, RestorePointTypeInvalid, RestorePointTypeLog} +} + +// RestoreRequestType enumerates the values for restore request type. +type RestoreRequestType string + +const ( + // RestoreRequestTypeFullShareRestore ... + RestoreRequestTypeFullShareRestore RestoreRequestType = "FullShareRestore" + // RestoreRequestTypeInvalid ... + RestoreRequestTypeInvalid RestoreRequestType = "Invalid" + // RestoreRequestTypeItemLevelRestore ... + RestoreRequestTypeItemLevelRestore RestoreRequestType = "ItemLevelRestore" +) + +// PossibleRestoreRequestTypeValues returns an array of possible values for the RestoreRequestType const type. +func PossibleRestoreRequestTypeValues() []RestoreRequestType { + return []RestoreRequestType{RestoreRequestTypeFullShareRestore, RestoreRequestTypeInvalid, RestoreRequestTypeItemLevelRestore} +} + +// RetentionDurationType enumerates the values for retention duration type. +type RetentionDurationType string + +const ( + // RetentionDurationTypeDays ... + RetentionDurationTypeDays RetentionDurationType = "Days" + // RetentionDurationTypeInvalid ... + RetentionDurationTypeInvalid RetentionDurationType = "Invalid" + // RetentionDurationTypeMonths ... + RetentionDurationTypeMonths RetentionDurationType = "Months" + // RetentionDurationTypeWeeks ... + RetentionDurationTypeWeeks RetentionDurationType = "Weeks" + // RetentionDurationTypeYears ... + RetentionDurationTypeYears RetentionDurationType = "Years" +) + +// PossibleRetentionDurationTypeValues returns an array of possible values for the RetentionDurationType const type. +func PossibleRetentionDurationTypeValues() []RetentionDurationType { + return []RetentionDurationType{RetentionDurationTypeDays, RetentionDurationTypeInvalid, RetentionDurationTypeMonths, RetentionDurationTypeWeeks, RetentionDurationTypeYears} +} + +// RetentionPolicyType enumerates the values for retention policy type. +type RetentionPolicyType string + +const ( + // RetentionPolicyTypeLongTermRetentionPolicy ... + RetentionPolicyTypeLongTermRetentionPolicy RetentionPolicyType = "LongTermRetentionPolicy" + // RetentionPolicyTypeRetentionPolicy ... + RetentionPolicyTypeRetentionPolicy RetentionPolicyType = "RetentionPolicy" + // RetentionPolicyTypeSimpleRetentionPolicy ... + RetentionPolicyTypeSimpleRetentionPolicy RetentionPolicyType = "SimpleRetentionPolicy" +) + +// PossibleRetentionPolicyTypeValues returns an array of possible values for the RetentionPolicyType const type. +func PossibleRetentionPolicyTypeValues() []RetentionPolicyType { + return []RetentionPolicyType{RetentionPolicyTypeLongTermRetentionPolicy, RetentionPolicyTypeRetentionPolicy, RetentionPolicyTypeSimpleRetentionPolicy} +} + +// RetentionScheduleFormat enumerates the values for retention schedule format. +type RetentionScheduleFormat string + +const ( + // RetentionScheduleFormatDaily ... + RetentionScheduleFormatDaily RetentionScheduleFormat = "Daily" + // RetentionScheduleFormatInvalid ... + RetentionScheduleFormatInvalid RetentionScheduleFormat = "Invalid" + // RetentionScheduleFormatWeekly ... + RetentionScheduleFormatWeekly RetentionScheduleFormat = "Weekly" +) + +// PossibleRetentionScheduleFormatValues returns an array of possible values for the RetentionScheduleFormat const type. +func PossibleRetentionScheduleFormatValues() []RetentionScheduleFormat { + return []RetentionScheduleFormat{RetentionScheduleFormatDaily, RetentionScheduleFormatInvalid, RetentionScheduleFormatWeekly} +} + +// SchedulePolicyType enumerates the values for schedule policy type. +type SchedulePolicyType string + +const ( + // SchedulePolicyTypeLogSchedulePolicy ... + SchedulePolicyTypeLogSchedulePolicy SchedulePolicyType = "LogSchedulePolicy" + // SchedulePolicyTypeLongTermSchedulePolicy ... + SchedulePolicyTypeLongTermSchedulePolicy SchedulePolicyType = "LongTermSchedulePolicy" + // SchedulePolicyTypeSchedulePolicy ... + SchedulePolicyTypeSchedulePolicy SchedulePolicyType = "SchedulePolicy" + // SchedulePolicyTypeSimpleSchedulePolicy ... + SchedulePolicyTypeSimpleSchedulePolicy SchedulePolicyType = "SimpleSchedulePolicy" +) + +// PossibleSchedulePolicyTypeValues returns an array of possible values for the SchedulePolicyType const type. +func PossibleSchedulePolicyTypeValues() []SchedulePolicyType { + return []SchedulePolicyType{SchedulePolicyTypeLogSchedulePolicy, SchedulePolicyTypeLongTermSchedulePolicy, SchedulePolicyTypeSchedulePolicy, SchedulePolicyTypeSimpleSchedulePolicy} +} + +// ScheduleRunType enumerates the values for schedule run type. +type ScheduleRunType string + +const ( + // ScheduleRunTypeDaily ... + ScheduleRunTypeDaily ScheduleRunType = "Daily" + // ScheduleRunTypeInvalid ... + ScheduleRunTypeInvalid ScheduleRunType = "Invalid" + // ScheduleRunTypeWeekly ... + ScheduleRunTypeWeekly ScheduleRunType = "Weekly" +) + +// PossibleScheduleRunTypeValues returns an array of possible values for the ScheduleRunType const type. +func PossibleScheduleRunTypeValues() []ScheduleRunType { + return []ScheduleRunType{ScheduleRunTypeDaily, ScheduleRunTypeInvalid, ScheduleRunTypeWeekly} +} + +// SoftDeleteFeatureState enumerates the values for soft delete feature state. +type SoftDeleteFeatureState string + +const ( + // SoftDeleteFeatureStateDisabled ... + SoftDeleteFeatureStateDisabled SoftDeleteFeatureState = "Disabled" + // SoftDeleteFeatureStateEnabled ... + SoftDeleteFeatureStateEnabled SoftDeleteFeatureState = "Enabled" + // SoftDeleteFeatureStateInvalid ... + SoftDeleteFeatureStateInvalid SoftDeleteFeatureState = "Invalid" +) + +// PossibleSoftDeleteFeatureStateValues returns an array of possible values for the SoftDeleteFeatureState const type. +func PossibleSoftDeleteFeatureStateValues() []SoftDeleteFeatureState { + return []SoftDeleteFeatureState{SoftDeleteFeatureStateDisabled, SoftDeleteFeatureStateEnabled, SoftDeleteFeatureStateInvalid} +} + +// SQLDataDirectoryType enumerates the values for sql data directory type. +type SQLDataDirectoryType string + +const ( + // SQLDataDirectoryTypeData ... + SQLDataDirectoryTypeData SQLDataDirectoryType = "Data" + // SQLDataDirectoryTypeInvalid ... + SQLDataDirectoryTypeInvalid SQLDataDirectoryType = "Invalid" + // SQLDataDirectoryTypeLog ... + SQLDataDirectoryTypeLog SQLDataDirectoryType = "Log" +) + +// PossibleSQLDataDirectoryTypeValues returns an array of possible values for the SQLDataDirectoryType const type. +func PossibleSQLDataDirectoryTypeValues() []SQLDataDirectoryType { + return []SQLDataDirectoryType{SQLDataDirectoryTypeData, SQLDataDirectoryTypeInvalid, SQLDataDirectoryTypeLog} +} + +// StorageType enumerates the values for storage type. +type StorageType string + +const ( + // StorageTypeGeoRedundant ... + StorageTypeGeoRedundant StorageType = "GeoRedundant" + // StorageTypeInvalid ... + StorageTypeInvalid StorageType = "Invalid" + // StorageTypeLocallyRedundant ... + StorageTypeLocallyRedundant StorageType = "LocallyRedundant" + // StorageTypeReadAccessGeoZoneRedundant ... + StorageTypeReadAccessGeoZoneRedundant StorageType = "ReadAccessGeoZoneRedundant" + // StorageTypeZoneRedundant ... + StorageTypeZoneRedundant StorageType = "ZoneRedundant" +) + +// PossibleStorageTypeValues returns an array of possible values for the StorageType const type. +func PossibleStorageTypeValues() []StorageType { + return []StorageType{StorageTypeGeoRedundant, StorageTypeInvalid, StorageTypeLocallyRedundant, StorageTypeReadAccessGeoZoneRedundant, StorageTypeZoneRedundant} +} + +// StorageTypeState enumerates the values for storage type state. +type StorageTypeState string + +const ( + // StorageTypeStateInvalid ... + StorageTypeStateInvalid StorageTypeState = "Invalid" + // StorageTypeStateLocked ... + StorageTypeStateLocked StorageTypeState = "Locked" + // StorageTypeStateUnlocked ... + StorageTypeStateUnlocked StorageTypeState = "Unlocked" +) + +// PossibleStorageTypeStateValues returns an array of possible values for the StorageTypeState const type. +func PossibleStorageTypeStateValues() []StorageTypeState { + return []StorageTypeState{StorageTypeStateInvalid, StorageTypeStateLocked, StorageTypeStateUnlocked} +} + +// Type enumerates the values for type. +type Type string + +const ( + // TypeCopyOnlyFull ... + TypeCopyOnlyFull Type = "CopyOnlyFull" + // TypeDifferential ... + TypeDifferential Type = "Differential" + // TypeFull ... + TypeFull Type = "Full" + // TypeIncremental ... + TypeIncremental Type = "Incremental" + // TypeInvalid ... + TypeInvalid Type = "Invalid" + // TypeLog ... + TypeLog Type = "Log" +) + +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{TypeCopyOnlyFull, TypeDifferential, TypeFull, TypeIncremental, TypeInvalid, TypeLog} +} + +// WeekOfMonth enumerates the values for week of month. +type WeekOfMonth string + +const ( + // WeekOfMonthFirst ... + WeekOfMonthFirst WeekOfMonth = "First" + // WeekOfMonthFourth ... + WeekOfMonthFourth WeekOfMonth = "Fourth" + // WeekOfMonthInvalid ... + WeekOfMonthInvalid WeekOfMonth = "Invalid" + // WeekOfMonthLast ... + WeekOfMonthLast WeekOfMonth = "Last" + // WeekOfMonthSecond ... + WeekOfMonthSecond WeekOfMonth = "Second" + // WeekOfMonthThird ... + WeekOfMonthThird WeekOfMonth = "Third" +) + +// PossibleWeekOfMonthValues returns an array of possible values for the WeekOfMonth const type. +func PossibleWeekOfMonthValues() []WeekOfMonth { + return []WeekOfMonth{WeekOfMonthFirst, WeekOfMonthFourth, WeekOfMonthInvalid, WeekOfMonthLast, WeekOfMonthSecond, WeekOfMonthThird} +} + +// WorkloadItemType enumerates the values for workload item type. +type WorkloadItemType string + +const ( + // WorkloadItemTypeInvalid ... + WorkloadItemTypeInvalid WorkloadItemType = "Invalid" + // WorkloadItemTypeSAPAseDatabase ... + WorkloadItemTypeSAPAseDatabase WorkloadItemType = "SAPAseDatabase" + // WorkloadItemTypeSAPAseSystem ... + WorkloadItemTypeSAPAseSystem WorkloadItemType = "SAPAseSystem" + // WorkloadItemTypeSAPHanaDatabase ... + WorkloadItemTypeSAPHanaDatabase WorkloadItemType = "SAPHanaDatabase" + // WorkloadItemTypeSAPHanaSystem ... + WorkloadItemTypeSAPHanaSystem WorkloadItemType = "SAPHanaSystem" + // WorkloadItemTypeSQLDataBase ... + WorkloadItemTypeSQLDataBase WorkloadItemType = "SQLDataBase" + // WorkloadItemTypeSQLInstance ... + WorkloadItemTypeSQLInstance WorkloadItemType = "SQLInstance" +) + +// PossibleWorkloadItemTypeValues returns an array of possible values for the WorkloadItemType const type. +func PossibleWorkloadItemTypeValues() []WorkloadItemType { + return []WorkloadItemType{WorkloadItemTypeInvalid, WorkloadItemTypeSAPAseDatabase, WorkloadItemTypeSAPAseSystem, WorkloadItemTypeSAPHanaDatabase, WorkloadItemTypeSAPHanaSystem, WorkloadItemTypeSQLDataBase, WorkloadItemTypeSQLInstance} +} + +// WorkloadItemTypeBasicWorkloadItem enumerates the values for workload item type basic workload item. +type WorkloadItemTypeBasicWorkloadItem string + +const ( + // WorkloadItemTypeAzureVMWorkloadItem ... + WorkloadItemTypeAzureVMWorkloadItem WorkloadItemTypeBasicWorkloadItem = "AzureVmWorkloadItem" + // WorkloadItemTypeSAPAseDatabase1 ... + WorkloadItemTypeSAPAseDatabase1 WorkloadItemTypeBasicWorkloadItem = "SAPAseDatabase" + // WorkloadItemTypeSAPAseSystem1 ... + WorkloadItemTypeSAPAseSystem1 WorkloadItemTypeBasicWorkloadItem = "SAPAseSystem" + // WorkloadItemTypeSAPHanaDatabase1 ... + WorkloadItemTypeSAPHanaDatabase1 WorkloadItemTypeBasicWorkloadItem = "SAPHanaDatabase" + // WorkloadItemTypeSAPHanaSystem1 ... + WorkloadItemTypeSAPHanaSystem1 WorkloadItemTypeBasicWorkloadItem = "SAPHanaSystem" + // WorkloadItemTypeSQLDataBase1 ... + WorkloadItemTypeSQLDataBase1 WorkloadItemTypeBasicWorkloadItem = "SQLDataBase" + // WorkloadItemTypeSQLInstance1 ... + WorkloadItemTypeSQLInstance1 WorkloadItemTypeBasicWorkloadItem = "SQLInstance" + // WorkloadItemTypeWorkloadItem ... + WorkloadItemTypeWorkloadItem WorkloadItemTypeBasicWorkloadItem = "WorkloadItem" +) + +// PossibleWorkloadItemTypeBasicWorkloadItemValues returns an array of possible values for the WorkloadItemTypeBasicWorkloadItem const type. +func PossibleWorkloadItemTypeBasicWorkloadItemValues() []WorkloadItemTypeBasicWorkloadItem { + return []WorkloadItemTypeBasicWorkloadItem{WorkloadItemTypeAzureVMWorkloadItem, WorkloadItemTypeSAPAseDatabase1, WorkloadItemTypeSAPAseSystem1, WorkloadItemTypeSAPHanaDatabase1, WorkloadItemTypeSAPHanaSystem1, WorkloadItemTypeSQLDataBase1, WorkloadItemTypeSQLInstance1, WorkloadItemTypeWorkloadItem} +} + +// WorkloadType enumerates the values for workload type. +type WorkloadType string + +const ( + // WorkloadTypeAzureFileShare ... + WorkloadTypeAzureFileShare WorkloadType = "AzureFileShare" + // WorkloadTypeAzureSQLDb ... + WorkloadTypeAzureSQLDb WorkloadType = "AzureSqlDb" + // WorkloadTypeClient ... + WorkloadTypeClient WorkloadType = "Client" + // WorkloadTypeExchange ... + WorkloadTypeExchange WorkloadType = "Exchange" + // WorkloadTypeFileFolder ... + WorkloadTypeFileFolder WorkloadType = "FileFolder" + // WorkloadTypeGenericDataSource ... + WorkloadTypeGenericDataSource WorkloadType = "GenericDataSource" + // WorkloadTypeInvalid ... + WorkloadTypeInvalid WorkloadType = "Invalid" + // WorkloadTypeSAPAseDatabase ... + WorkloadTypeSAPAseDatabase WorkloadType = "SAPAseDatabase" + // WorkloadTypeSAPHanaDatabase ... + WorkloadTypeSAPHanaDatabase WorkloadType = "SAPHanaDatabase" + // WorkloadTypeSharepoint ... + WorkloadTypeSharepoint WorkloadType = "Sharepoint" + // WorkloadTypeSQLDataBase ... + WorkloadTypeSQLDataBase WorkloadType = "SQLDataBase" + // WorkloadTypeSQLDB ... + WorkloadTypeSQLDB WorkloadType = "SQLDB" + // WorkloadTypeSystemState ... + WorkloadTypeSystemState WorkloadType = "SystemState" + // WorkloadTypeVM ... + WorkloadTypeVM WorkloadType = "VM" + // WorkloadTypeVMwareVM ... + WorkloadTypeVMwareVM WorkloadType = "VMwareVM" +) + +// PossibleWorkloadTypeValues returns an array of possible values for the WorkloadType const type. +func PossibleWorkloadTypeValues() []WorkloadType { + return []WorkloadType{WorkloadTypeAzureFileShare, WorkloadTypeAzureSQLDb, WorkloadTypeClient, WorkloadTypeExchange, WorkloadTypeFileFolder, WorkloadTypeGenericDataSource, WorkloadTypeInvalid, WorkloadTypeSAPAseDatabase, WorkloadTypeSAPHanaDatabase, WorkloadTypeSharepoint, WorkloadTypeSQLDataBase, WorkloadTypeSQLDB, WorkloadTypeSystemState, WorkloadTypeVM, WorkloadTypeVMwareVM} +} diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/exportjobsoperationresults.go b/services/recoveryservices/mgmt/2020-12-01/backup/exportjobsoperationresults.go similarity index 99% rename from services/recoveryservices/mgmt/2020-02-02/backup/exportjobsoperationresults.go rename to services/recoveryservices/mgmt/2020-12-01/backup/exportjobsoperationresults.go index 985bfea20278..9f19cbcd9af3 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/exportjobsoperationresults.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/exportjobsoperationresults.go @@ -80,7 +80,7 @@ func (client ExportJobsOperationResultsClient) GetPreparer(ctx context.Context, "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2019-06-15" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/itemlevelrecoveryconnections.go b/services/recoveryservices/mgmt/2020-12-01/backup/itemlevelrecoveryconnections.go similarity index 99% rename from services/recoveryservices/mgmt/2019-06-15/backup/itemlevelrecoveryconnections.go rename to services/recoveryservices/mgmt/2020-12-01/backup/itemlevelrecoveryconnections.go index 4e4704664221..75a60dfc9208 100644 --- a/services/recoveryservices/mgmt/2019-06-15/backup/itemlevelrecoveryconnections.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/itemlevelrecoveryconnections.go @@ -89,7 +89,7 @@ func (client ItemLevelRecoveryConnectionsClient) ProvisionPreparer(ctx context.C "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -177,7 +177,7 @@ func (client ItemLevelRecoveryConnectionsClient) RevokePreparer(ctx context.Cont "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/jobcancellations.go b/services/recoveryservices/mgmt/2020-12-01/backup/jobcancellations.go similarity index 99% rename from services/recoveryservices/mgmt/2020-02-02/backup/jobcancellations.go rename to services/recoveryservices/mgmt/2020-12-01/backup/jobcancellations.go index d7d92031d5d4..9d3a36be8c0c 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/jobcancellations.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/jobcancellations.go @@ -79,7 +79,7 @@ func (client JobCancellationsClient) TriggerPreparer(ctx context.Context, vaultN "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2019-06-15" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/jobdetails.go b/services/recoveryservices/mgmt/2020-12-01/backup/jobdetails.go similarity index 99% rename from services/recoveryservices/mgmt/2020-02-02/backup/jobdetails.go rename to services/recoveryservices/mgmt/2020-12-01/backup/jobdetails.go index cd70aa5959e2..a7eb8cdb623d 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/jobdetails.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/jobdetails.go @@ -77,7 +77,7 @@ func (client JobDetailsClient) GetPreparer(ctx context.Context, vaultName string "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2019-06-15" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/joboperationresults.go b/services/recoveryservices/mgmt/2020-12-01/backup/joboperationresults.go similarity index 99% rename from services/recoveryservices/mgmt/2020-02-02/backup/joboperationresults.go rename to services/recoveryservices/mgmt/2020-12-01/backup/joboperationresults.go index cc751b923ecb..4298db6d2c1d 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/joboperationresults.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/joboperationresults.go @@ -80,7 +80,7 @@ func (client JobOperationResultsClient) GetPreparer(ctx context.Context, vaultNa "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2019-06-15" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/jobs.go b/services/recoveryservices/mgmt/2020-12-01/backup/jobs.go similarity index 99% rename from services/recoveryservices/mgmt/2020-02-02/backup/jobs.go rename to services/recoveryservices/mgmt/2020-12-01/backup/jobs.go index 972b42d0e180..9edebc4dfe5f 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/jobs.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/jobs.go @@ -82,7 +82,7 @@ func (client JobsClient) ListPreparer(ctx context.Context, vaultName string, res "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2019-06-15" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/jobsgroup.go b/services/recoveryservices/mgmt/2020-12-01/backup/jobsgroup.go similarity index 99% rename from services/recoveryservices/mgmt/2020-02-02/backup/jobsgroup.go rename to services/recoveryservices/mgmt/2020-12-01/backup/jobsgroup.go index 8e1b282d2117..90107a654a98 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/jobsgroup.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/jobsgroup.go @@ -76,7 +76,7 @@ func (client JobsGroupClient) ExportPreparer(ctx context.Context, vaultName stri "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2019-06-15" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2020-12-01/backup/models.go b/services/recoveryservices/mgmt/2020-12-01/backup/models.go new file mode 100644 index 000000000000..aee152cb9371 --- /dev/null +++ b/services/recoveryservices/mgmt/2020-12-01/backup/models.go @@ -0,0 +1,18890 @@ +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2020-12-01/backup" + +// AzureBackupServerContainer azureBackupServer (DPMVenus) workload-specific protection container. +type AzureBackupServerContainer struct { + // CanReRegister - Specifies whether the container is re-registrable. + CanReRegister *bool `json:"canReRegister,omitempty"` + // ContainerID - ID of container. + ContainerID *string `json:"containerId,omitempty"` + // ProtectedItemCount - Number of protected items in the BackupEngine + ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` + // DpmAgentVersion - Backup engine Agent version + DpmAgentVersion *string `json:"dpmAgentVersion,omitempty"` + // DpmServers - List of BackupEngines protecting the container + DpmServers *[]string `json:"dpmServers,omitempty"` + // UpgradeAvailable - To check if upgrade available + UpgradeAvailable *bool `json:"upgradeAvailable,omitempty"` + // ProtectionStatus - Protection status of the container. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ExtendedInfo - Extended Info of the container. + ExtendedInfo *DPMContainerExtendedInfo `json:"extendedInfo,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) MarshalJSON() ([]byte, error) { + absc.ContainerType = ContainerTypeAzureBackupServerContainer1 + objectMap := make(map[string]interface{}) + if absc.CanReRegister != nil { + objectMap["canReRegister"] = absc.CanReRegister + } + if absc.ContainerID != nil { + objectMap["containerId"] = absc.ContainerID + } + if absc.ProtectedItemCount != nil { + objectMap["protectedItemCount"] = absc.ProtectedItemCount + } + if absc.DpmAgentVersion != nil { + objectMap["dpmAgentVersion"] = absc.DpmAgentVersion + } + if absc.DpmServers != nil { + objectMap["dpmServers"] = absc.DpmServers + } + if absc.UpgradeAvailable != nil { + objectMap["upgradeAvailable"] = absc.UpgradeAvailable + } + if absc.ProtectionStatus != nil { + objectMap["protectionStatus"] = absc.ProtectionStatus + } + if absc.ExtendedInfo != nil { + objectMap["extendedInfo"] = absc.ExtendedInfo + } + if absc.FriendlyName != nil { + objectMap["friendlyName"] = absc.FriendlyName + } + if absc.BackupManagementType != "" { + objectMap["backupManagementType"] = absc.BackupManagementType + } + if absc.RegistrationStatus != nil { + objectMap["registrationStatus"] = absc.RegistrationStatus + } + if absc.HealthStatus != nil { + objectMap["healthStatus"] = absc.HealthStatus + } + if absc.ContainerType != "" { + objectMap["containerType"] = absc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return &absc, true +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return &absc, true +} + +// AsGenericContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &absc, true +} + +// AzureBackupServerEngine backup engine type when Azure Backup Server is used to manage the backups. +type AzureBackupServerEngine struct { + // FriendlyName - Friendly name of the backup engine. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Registration status of the backup engine with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // BackupEngineState - Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} + BackupEngineState *string `json:"backupEngineState,omitempty"` + // HealthStatus - Backup status of the backup engine. + HealthStatus *string `json:"healthStatus,omitempty"` + // CanReRegister - Flag indicating if the backup engine be registered, once already registered. + CanReRegister *bool `json:"canReRegister,omitempty"` + // BackupEngineID - ID of the backup engine. + BackupEngineID *string `json:"backupEngineId,omitempty"` + // DpmVersion - Backup engine version + DpmVersion *string `json:"dpmVersion,omitempty"` + // AzureBackupAgentVersion - Backup agent version + AzureBackupAgentVersion *string `json:"azureBackupAgentVersion,omitempty"` + // IsAzureBackupAgentUpgradeAvailable - To check if backup agent upgrade available + IsAzureBackupAgentUpgradeAvailable *bool `json:"isAzureBackupAgentUpgradeAvailable,omitempty"` + // IsDpmUpgradeAvailable - To check if backup engine upgrade available + IsDpmUpgradeAvailable *bool `json:"isDpmUpgradeAvailable,omitempty"` + // ExtendedInfo - Extended info of the backupengine + ExtendedInfo *EngineExtendedInfo `json:"extendedInfo,omitempty"` + // BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine' + BackupEngineType EngineType `json:"backupEngineType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureBackupServerEngine. +func (abse AzureBackupServerEngine) MarshalJSON() ([]byte, error) { + abse.BackupEngineType = BackupEngineTypeAzureBackupServerEngine + objectMap := make(map[string]interface{}) + if abse.FriendlyName != nil { + objectMap["friendlyName"] = abse.FriendlyName + } + if abse.BackupManagementType != "" { + objectMap["backupManagementType"] = abse.BackupManagementType + } + if abse.RegistrationStatus != nil { + objectMap["registrationStatus"] = abse.RegistrationStatus + } + if abse.BackupEngineState != nil { + objectMap["backupEngineState"] = abse.BackupEngineState + } + if abse.HealthStatus != nil { + objectMap["healthStatus"] = abse.HealthStatus + } + if abse.CanReRegister != nil { + objectMap["canReRegister"] = abse.CanReRegister + } + if abse.BackupEngineID != nil { + objectMap["backupEngineId"] = abse.BackupEngineID + } + if abse.DpmVersion != nil { + objectMap["dpmVersion"] = abse.DpmVersion + } + if abse.AzureBackupAgentVersion != nil { + objectMap["azureBackupAgentVersion"] = abse.AzureBackupAgentVersion + } + if abse.IsAzureBackupAgentUpgradeAvailable != nil { + objectMap["isAzureBackupAgentUpgradeAvailable"] = abse.IsAzureBackupAgentUpgradeAvailable + } + if abse.IsDpmUpgradeAvailable != nil { + objectMap["isDpmUpgradeAvailable"] = abse.IsDpmUpgradeAvailable + } + if abse.ExtendedInfo != nil { + objectMap["extendedInfo"] = abse.ExtendedInfo + } + if abse.BackupEngineType != "" { + objectMap["backupEngineType"] = abse.BackupEngineType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerEngine is the BasicEngineBase implementation for AzureBackupServerEngine. +func (abse AzureBackupServerEngine) AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) { + return &abse, true +} + +// AsDpmBackupEngine is the BasicEngineBase implementation for AzureBackupServerEngine. +func (abse AzureBackupServerEngine) AsDpmBackupEngine() (*DpmBackupEngine, bool) { + return nil, false +} + +// AsEngineBase is the BasicEngineBase implementation for AzureBackupServerEngine. +func (abse AzureBackupServerEngine) AsEngineBase() (*EngineBase, bool) { + return nil, false +} + +// AsBasicEngineBase is the BasicEngineBase implementation for AzureBackupServerEngine. +func (abse AzureBackupServerEngine) AsBasicEngineBase() (BasicEngineBase, bool) { + return &abse, true +} + +// AzureFileShareBackupRequest azureFileShare workload-specific backup request. +type AzureFileShareBackupRequest struct { + // RecoveryPointExpiryTimeInUTC - Backup copy will expire after the time specified (UTC). + RecoveryPointExpiryTimeInUTC *date.Time `json:"recoveryPointExpiryTimeInUTC,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' + ObjectType ObjectTypeBasicRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFileShareBackupRequest. +func (afsbr AzureFileShareBackupRequest) MarshalJSON() ([]byte, error) { + afsbr.ObjectType = ObjectTypeAzureFileShareBackupRequest + objectMap := make(map[string]interface{}) + if afsbr.RecoveryPointExpiryTimeInUTC != nil { + objectMap["recoveryPointExpiryTimeInUTC"] = afsbr.RecoveryPointExpiryTimeInUTC + } + if afsbr.ObjectType != "" { + objectMap["objectType"] = afsbr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareBackupRequest is the BasicRequest implementation for AzureFileShareBackupRequest. +func (afsbr AzureFileShareBackupRequest) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { + return &afsbr, true +} + +// AsAzureWorkloadBackupRequest is the BasicRequest implementation for AzureFileShareBackupRequest. +func (afsbr AzureFileShareBackupRequest) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { + return nil, false +} + +// AsIaasVMBackupRequest is the BasicRequest implementation for AzureFileShareBackupRequest. +func (afsbr AzureFileShareBackupRequest) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { + return nil, false +} + +// AsRequest is the BasicRequest implementation for AzureFileShareBackupRequest. +func (afsbr AzureFileShareBackupRequest) AsRequest() (*Request, bool) { + return nil, false +} + +// AsBasicRequest is the BasicRequest implementation for AzureFileShareBackupRequest. +func (afsbr AzureFileShareBackupRequest) AsBasicRequest() (BasicRequest, bool) { + return &afsbr, true +} + +// AzureFileShareProtectableItem protectable item for Azure Fileshare workloads. +type AzureFileShareProtectableItem struct { + // ParentContainerFabricID - Full Fabric ID of container to which this protectable item belongs. For example, ARM ID. + ParentContainerFabricID *string `json:"parentContainerFabricId,omitempty"` + // ParentContainerFriendlyName - Friendly name of container to which this protectable item belongs. + ParentContainerFriendlyName *string `json:"parentContainerFriendlyName,omitempty"` + // AzureFileShareType - File Share type XSync or XSMB. Possible values include: 'Invalid', 'XSMB', 'XSync' + AzureFileShareType AzureFileShareType `json:"azureFileShareType,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) MarshalJSON() ([]byte, error) { + afspi.ProtectableItemType = ProtectableItemTypeAzureFileShare + objectMap := make(map[string]interface{}) + if afspi.ParentContainerFabricID != nil { + objectMap["parentContainerFabricId"] = afspi.ParentContainerFabricID + } + if afspi.ParentContainerFriendlyName != nil { + objectMap["parentContainerFriendlyName"] = afspi.ParentContainerFriendlyName + } + if afspi.AzureFileShareType != "" { + objectMap["azureFileShareType"] = afspi.AzureFileShareType + } + if afspi.BackupManagementType != nil { + objectMap["backupManagementType"] = afspi.BackupManagementType + } + if afspi.WorkloadType != nil { + objectMap["workloadType"] = afspi.WorkloadType + } + if afspi.FriendlyName != nil { + objectMap["friendlyName"] = afspi.FriendlyName + } + if afspi.ProtectionState != "" { + objectMap["protectionState"] = afspi.ProtectionState + } + if afspi.ProtectableItemType != "" { + objectMap["protectableItemType"] = afspi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return &afspi, true +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &afspi, true +} + +// AzureFileshareProtectedItem azure File Share workload-specific backup item. +type AzureFileshareProtectedItem struct { + // FriendlyName - Friendly name of the fileshare represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // KpisHealths - Health details of different KPIs + KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` + // ExtendedInfo - Additional information with this backup item. + ExtendedInfo *AzureFileshareProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) MarshalJSON() ([]byte, error) { + afpi.ProtectedItemType = ProtectedItemTypeAzureFileShareProtectedItem + objectMap := make(map[string]interface{}) + if afpi.FriendlyName != nil { + objectMap["friendlyName"] = afpi.FriendlyName + } + if afpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = afpi.ProtectionStatus + } + if afpi.ProtectionState != "" { + objectMap["protectionState"] = afpi.ProtectionState + } + if afpi.LastBackupStatus != nil { + objectMap["lastBackupStatus"] = afpi.LastBackupStatus + } + if afpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = afpi.LastBackupTime + } + if afpi.KpisHealths != nil { + objectMap["kpisHealths"] = afpi.KpisHealths + } + if afpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = afpi.ExtendedInfo + } + if afpi.BackupManagementType != "" { + objectMap["backupManagementType"] = afpi.BackupManagementType + } + if afpi.WorkloadType != "" { + objectMap["workloadType"] = afpi.WorkloadType + } + if afpi.ContainerName != nil { + objectMap["containerName"] = afpi.ContainerName + } + if afpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = afpi.SourceResourceID + } + if afpi.PolicyID != nil { + objectMap["policyId"] = afpi.PolicyID + } + if afpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = afpi.LastRecoveryPoint + } + if afpi.BackupSetName != nil { + objectMap["backupSetName"] = afpi.BackupSetName + } + if afpi.CreateMode != "" { + objectMap["createMode"] = afpi.CreateMode + } + if afpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = afpi.DeferredDeleteTimeInUTC + } + if afpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = afpi.IsScheduledForDeferredDelete + } + if afpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = afpi.DeferredDeleteTimeRemaining + } + if afpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = afpi.IsDeferredDeleteScheduleUpcoming + } + if afpi.IsRehydrate != nil { + objectMap["isRehydrate"] = afpi.IsRehydrate + } + if afpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = afpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return &afpi, true +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &afpi, true +} + +// AzureFileshareProtectedItemExtendedInfo additional information about Azure File Share backup item. +type AzureFileshareProtectedItemExtendedInfo struct { + // OldestRecoveryPoint - The oldest backup copy available for this item in the service. + OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` + // RecoveryPointCount - Number of available backup copies associated with this backup item. + RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` + // PolicyState - Indicates consistency of policy object and policy applied to this backup item. + PolicyState *string `json:"policyState,omitempty"` + // ResourceState - READ-ONLY; Indicates the state of this resource. Possible values are from enum ResourceState {Invalid, Active, SoftDeleted, Deleted} + ResourceState *string `json:"resourceState,omitempty"` + // ResourceStateSyncTime - READ-ONLY; The resource state sync time for this backup item. + ResourceStateSyncTime *date.Time `json:"resourceStateSyncTime,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFileshareProtectedItemExtendedInfo. +func (afpiei AzureFileshareProtectedItemExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if afpiei.OldestRecoveryPoint != nil { + objectMap["oldestRecoveryPoint"] = afpiei.OldestRecoveryPoint + } + if afpiei.RecoveryPointCount != nil { + objectMap["recoveryPointCount"] = afpiei.RecoveryPointCount + } + if afpiei.PolicyState != nil { + objectMap["policyState"] = afpiei.PolicyState + } + return json.Marshal(objectMap) +} + +// AzureFileShareProtectionPolicy azureStorage backup policy. +type AzureFileShareProtectionPolicy struct { + // 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', 'WorkloadTypeSAPAseDatabase' + 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. + RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` + // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + TimeZone *string `json:"timeZone,omitempty"` + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) MarshalJSON() ([]byte, error) { + afspp.BackupManagementType = BackupManagementTypeAzureStorage + objectMap := make(map[string]interface{}) + if afspp.WorkLoadType != "" { + objectMap["workLoadType"] = afspp.WorkLoadType + } + objectMap["schedulePolicy"] = afspp.SchedulePolicy + objectMap["retentionPolicy"] = afspp.RetentionPolicy + if afspp.TimeZone != nil { + objectMap["timeZone"] = afspp.TimeZone + } + if afspp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = afspp.ProtectedItemsCount + } + if afspp.BackupManagementType != "" { + objectMap["backupManagementType"] = afspp.BackupManagementType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return nil, false +} + +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { + return &afspp, true +} + +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { + return nil, false +} + +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { + return nil, false +} + +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { + return nil, false +} + +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { + return nil, false +} + +// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { + return nil, false +} + +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &afspp, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureFileShareProtectionPolicy struct. +func (afspp *AzureFileShareProtectionPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "workLoadType": + if v != nil { + var workLoadType WorkloadType + err = json.Unmarshal(*v, &workLoadType) + if err != nil { + return err + } + afspp.WorkLoadType = workLoadType + } + case "schedulePolicy": + if v != nil { + schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) + if err != nil { + return err + } + afspp.SchedulePolicy = schedulePolicy + } + case "retentionPolicy": + if v != nil { + retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) + if err != nil { + return err + } + afspp.RetentionPolicy = retentionPolicy + } + case "timeZone": + if v != nil { + var timeZone string + err = json.Unmarshal(*v, &timeZone) + if err != nil { + return err + } + afspp.TimeZone = &timeZone + } + case "protectedItemsCount": + if v != nil { + var protectedItemsCount int32 + err = json.Unmarshal(*v, &protectedItemsCount) + if err != nil { + return err + } + afspp.ProtectedItemsCount = &protectedItemsCount + } + case "backupManagementType": + if v != nil { + var backupManagementType ManagementTypeBasicProtectionPolicy + err = json.Unmarshal(*v, &backupManagementType) + if err != nil { + return err + } + afspp.BackupManagementType = backupManagementType + } + } + } + + return nil +} + +// AzureFileShareProvisionILRRequest update snapshot Uri with the correct friendly Name of the source Azure +// file share. +type AzureFileShareProvisionILRRequest struct { + // RecoveryPointID - Recovery point ID. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // SourceResourceID - Source Storage account ARM Id + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeAzureFileShareProvisionILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest' + ObjectType ObjectTypeBasicILRRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFileShareProvisionILRRequest. +func (afspir AzureFileShareProvisionILRRequest) MarshalJSON() ([]byte, error) { + afspir.ObjectType = ObjectTypeAzureFileShareProvisionILRRequest + objectMap := make(map[string]interface{}) + if afspir.RecoveryPointID != nil { + objectMap["recoveryPointId"] = afspir.RecoveryPointID + } + if afspir.SourceResourceID != nil { + objectMap["sourceResourceId"] = afspir.SourceResourceID + } + if afspir.ObjectType != "" { + objectMap["objectType"] = afspir.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProvisionILRRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. +func (afspir AzureFileShareProvisionILRRequest) AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) { + return &afspir, true +} + +// AsIaasVMILRRegistrationRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. +func (afspir AzureFileShareProvisionILRRequest) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) { + return nil, false +} + +// AsILRRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. +func (afspir AzureFileShareProvisionILRRequest) AsILRRequest() (*ILRRequest, bool) { + return nil, false +} + +// AsBasicILRRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. +func (afspir AzureFileShareProvisionILRRequest) AsBasicILRRequest() (BasicILRRequest, bool) { + return &afspir, true +} + +// AzureFileShareRecoveryPoint azure File Share workload specific backup copy. +type AzureFileShareRecoveryPoint struct { + // RecoveryPointType - READ-ONLY; Type of the backup copy. Specifies whether it is a crash consistent backup or app consistent. + RecoveryPointType *string `json:"recoveryPointType,omitempty"` + // RecoveryPointTime - READ-ONLY; Time at which this backup copy was created. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // FileShareSnapshotURI - READ-ONLY; Contains Url to the snapshot of fileshare, if applicable + FileShareSnapshotURI *string `json:"fileShareSnapshotUri,omitempty"` + // RecoveryPointSizeInGB - READ-ONLY; Contains recovery point size + RecoveryPointSizeInGB *int32 `json:"recoveryPointSizeInGB,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) MarshalJSON() ([]byte, error) { + afsrp.ObjectType = ObjectTypeAzureFileShareRecoveryPoint + objectMap := make(map[string]interface{}) + if afsrp.ObjectType != "" { + objectMap["objectType"] = afsrp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return &afsrp, true +} + +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &afsrp, true +} + +// AzureFileShareRestoreRequest azureFileShare Restore Request +type AzureFileShareRestoreRequest struct { + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Source storage account ARM Id + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // CopyOptions - Options to resolve copy conflicts. Possible values include: 'CopyOptionsInvalid', 'CopyOptionsCreateCopy', 'CopyOptionsSkip', 'CopyOptionsOverwrite', 'CopyOptionsFailOnConflict' + CopyOptions CopyOptions `json:"copyOptions,omitempty"` + // RestoreRequestType - Restore Type (FullShareRestore or ItemLevelRestore). Possible values include: 'RestoreRequestTypeInvalid', 'RestoreRequestTypeFullShareRestore', 'RestoreRequestTypeItemLevelRestore' + RestoreRequestType RestoreRequestType `json:"restoreRequestType,omitempty"` + // RestoreFileSpecs - List of Source Files/Folders(which need to recover) and TargetFolderPath details + RestoreFileSpecs *[]RestoreFileSpecs `json:"restoreFileSpecs,omitempty"` + // TargetDetails - Target File Share Details + TargetDetails *TargetAFSRestoreInfo `json:"targetDetails,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) MarshalJSON() ([]byte, error) { + afsrr.ObjectType = ObjectTypeAzureFileShareRestoreRequest + objectMap := make(map[string]interface{}) + if afsrr.RecoveryType != "" { + objectMap["recoveryType"] = afsrr.RecoveryType + } + if afsrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = afsrr.SourceResourceID + } + if afsrr.CopyOptions != "" { + objectMap["copyOptions"] = afsrr.CopyOptions + } + if afsrr.RestoreRequestType != "" { + objectMap["restoreRequestType"] = afsrr.RestoreRequestType + } + if afsrr.RestoreFileSpecs != nil { + objectMap["restoreFileSpecs"] = afsrr.RestoreFileSpecs + } + if afsrr.TargetDetails != nil { + objectMap["targetDetails"] = afsrr.TargetDetails + } + if afsrr.ObjectType != "" { + objectMap["objectType"] = afsrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return &afsrr, true +} + +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &afsrr, true +} + +// AzureIaaSClassicComputeVMContainer iaaS VM workload-specific backup item representing a classic virtual +// machine. +type AzureIaaSClassicComputeVMContainer struct { + // VirtualMachineID - Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // VirtualMachineVersion - Specifies whether the container represents a Classic or an Azure Resource Manager VM. + VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` + // ResourceGroup - Resource group name of Recovery Services Vault. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) MarshalJSON() ([]byte, error) { + aisccvc.ContainerType = ContainerTypeMicrosoftClassicComputevirtualMachines + objectMap := make(map[string]interface{}) + if aisccvc.VirtualMachineID != nil { + objectMap["virtualMachineId"] = aisccvc.VirtualMachineID + } + if aisccvc.VirtualMachineVersion != nil { + objectMap["virtualMachineVersion"] = aisccvc.VirtualMachineVersion + } + if aisccvc.ResourceGroup != nil { + objectMap["resourceGroup"] = aisccvc.ResourceGroup + } + if aisccvc.FriendlyName != nil { + objectMap["friendlyName"] = aisccvc.FriendlyName + } + if aisccvc.BackupManagementType != "" { + objectMap["backupManagementType"] = aisccvc.BackupManagementType + } + if aisccvc.RegistrationStatus != nil { + objectMap["registrationStatus"] = aisccvc.RegistrationStatus + } + if aisccvc.HealthStatus != nil { + objectMap["healthStatus"] = aisccvc.HealthStatus + } + if aisccvc.ContainerType != "" { + objectMap["containerType"] = aisccvc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return &aisccvc, true +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return &aisccvc, true +} + +// AsMabContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &aisccvc, true +} + +// AzureIaaSClassicComputeVMProtectableItem iaaS VM workload-specific backup item representing the Classic +// Compute VM. +type AzureIaaSClassicComputeVMProtectableItem struct { + // VirtualMachineID - Fully qualified ARM ID of the virtual machine. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) MarshalJSON() ([]byte, error) { + aisccvpi.ProtectableItemType = ProtectableItemTypeMicrosoftClassicComputevirtualMachines + objectMap := make(map[string]interface{}) + if aisccvpi.VirtualMachineID != nil { + objectMap["virtualMachineId"] = aisccvpi.VirtualMachineID + } + if aisccvpi.BackupManagementType != nil { + objectMap["backupManagementType"] = aisccvpi.BackupManagementType + } + if aisccvpi.WorkloadType != nil { + objectMap["workloadType"] = aisccvpi.WorkloadType + } + if aisccvpi.FriendlyName != nil { + objectMap["friendlyName"] = aisccvpi.FriendlyName + } + if aisccvpi.ProtectionState != "" { + objectMap["protectionState"] = aisccvpi.ProtectionState + } + if aisccvpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = aisccvpi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return &aisccvpi, true +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return &aisccvpi, true +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &aisccvpi, true +} + +// AzureIaaSClassicComputeVMProtectedItem iaaS VM workload-specific backup item representing the Classic +// Compute VM. +type AzureIaaSClassicComputeVMProtectedItem struct { + // FriendlyName - Friendly name of the VM represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // VirtualMachineID - Fully qualified ARM ID of the virtual machine represented by this item. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // HealthStatus - Health status of protected item. Possible values include: 'HealthStatusPassed', 'HealthStatusActionRequired', 'HealthStatusActionSuggested', 'HealthStatusInvalid' + HealthStatus HealthStatus `json:"healthStatus,omitempty"` + // HealthDetails - Health details on this backup item. + HealthDetails *[]AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` + // KpisHealths - Health details of different KPIs + KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` + // LastBackupStatus - Last backup operation status. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // ProtectedItemDataID - Data ID of the protected item. + ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) MarshalJSON() ([]byte, error) { + aisccvpi.ProtectedItemType = ProtectedItemTypeMicrosoftClassicComputevirtualMachines + objectMap := make(map[string]interface{}) + if aisccvpi.FriendlyName != nil { + objectMap["friendlyName"] = aisccvpi.FriendlyName + } + if aisccvpi.VirtualMachineID != nil { + objectMap["virtualMachineId"] = aisccvpi.VirtualMachineID + } + if aisccvpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = aisccvpi.ProtectionStatus + } + if aisccvpi.ProtectionState != "" { + objectMap["protectionState"] = aisccvpi.ProtectionState + } + if aisccvpi.HealthStatus != "" { + objectMap["healthStatus"] = aisccvpi.HealthStatus + } + if aisccvpi.HealthDetails != nil { + objectMap["healthDetails"] = aisccvpi.HealthDetails + } + if aisccvpi.KpisHealths != nil { + objectMap["kpisHealths"] = aisccvpi.KpisHealths + } + if aisccvpi.LastBackupStatus != nil { + objectMap["lastBackupStatus"] = aisccvpi.LastBackupStatus + } + if aisccvpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = aisccvpi.LastBackupTime + } + if aisccvpi.ProtectedItemDataID != nil { + objectMap["protectedItemDataId"] = aisccvpi.ProtectedItemDataID + } + if aisccvpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = aisccvpi.ExtendedInfo + } + if aisccvpi.ExtendedProperties != nil { + objectMap["extendedProperties"] = aisccvpi.ExtendedProperties + } + if aisccvpi.BackupManagementType != "" { + objectMap["backupManagementType"] = aisccvpi.BackupManagementType + } + if aisccvpi.WorkloadType != "" { + objectMap["workloadType"] = aisccvpi.WorkloadType + } + if aisccvpi.ContainerName != nil { + objectMap["containerName"] = aisccvpi.ContainerName + } + if aisccvpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = aisccvpi.SourceResourceID + } + if aisccvpi.PolicyID != nil { + objectMap["policyId"] = aisccvpi.PolicyID + } + if aisccvpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = aisccvpi.LastRecoveryPoint + } + if aisccvpi.BackupSetName != nil { + objectMap["backupSetName"] = aisccvpi.BackupSetName + } + if aisccvpi.CreateMode != "" { + objectMap["createMode"] = aisccvpi.CreateMode + } + if aisccvpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = aisccvpi.DeferredDeleteTimeInUTC + } + if aisccvpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = aisccvpi.IsScheduledForDeferredDelete + } + if aisccvpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = aisccvpi.DeferredDeleteTimeRemaining + } + if aisccvpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = aisccvpi.IsDeferredDeleteScheduleUpcoming + } + if aisccvpi.IsRehydrate != nil { + objectMap["isRehydrate"] = aisccvpi.IsRehydrate + } + if aisccvpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = aisccvpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return &aisccvpi, true +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return &aisccvpi, true +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &aisccvpi, true +} + +// AzureIaaSComputeVMContainer iaaS VM workload-specific backup item representing an Azure Resource Manager +// virtual machine. +type AzureIaaSComputeVMContainer struct { + // VirtualMachineID - Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // VirtualMachineVersion - Specifies whether the container represents a Classic or an Azure Resource Manager VM. + VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` + // ResourceGroup - Resource group name of Recovery Services Vault. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) MarshalJSON() ([]byte, error) { + aiscvc.ContainerType = ContainerTypeMicrosoftComputevirtualMachines + objectMap := make(map[string]interface{}) + if aiscvc.VirtualMachineID != nil { + objectMap["virtualMachineId"] = aiscvc.VirtualMachineID + } + if aiscvc.VirtualMachineVersion != nil { + objectMap["virtualMachineVersion"] = aiscvc.VirtualMachineVersion + } + if aiscvc.ResourceGroup != nil { + objectMap["resourceGroup"] = aiscvc.ResourceGroup + } + if aiscvc.FriendlyName != nil { + objectMap["friendlyName"] = aiscvc.FriendlyName + } + if aiscvc.BackupManagementType != "" { + objectMap["backupManagementType"] = aiscvc.BackupManagementType + } + if aiscvc.RegistrationStatus != nil { + objectMap["registrationStatus"] = aiscvc.RegistrationStatus + } + if aiscvc.HealthStatus != nil { + objectMap["healthStatus"] = aiscvc.HealthStatus + } + if aiscvc.ContainerType != "" { + objectMap["containerType"] = aiscvc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return &aiscvc, true +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return &aiscvc, true +} + +// AsMabContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &aiscvc, true +} + +// AzureIaaSComputeVMProtectableItem iaaS VM workload-specific backup item representing the Azure Resource +// Manager VM. +type AzureIaaSComputeVMProtectableItem struct { + // VirtualMachineID - Fully qualified ARM ID of the virtual machine. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) MarshalJSON() ([]byte, error) { + aiscvpi.ProtectableItemType = ProtectableItemTypeMicrosoftComputevirtualMachines + objectMap := make(map[string]interface{}) + if aiscvpi.VirtualMachineID != nil { + objectMap["virtualMachineId"] = aiscvpi.VirtualMachineID + } + if aiscvpi.BackupManagementType != nil { + objectMap["backupManagementType"] = aiscvpi.BackupManagementType + } + if aiscvpi.WorkloadType != nil { + objectMap["workloadType"] = aiscvpi.WorkloadType + } + if aiscvpi.FriendlyName != nil { + objectMap["friendlyName"] = aiscvpi.FriendlyName + } + if aiscvpi.ProtectionState != "" { + objectMap["protectionState"] = aiscvpi.ProtectionState + } + if aiscvpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = aiscvpi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return &aiscvpi, true +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return &aiscvpi, true +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &aiscvpi, true +} + +// AzureIaaSComputeVMProtectedItem iaaS VM workload-specific backup item representing the Azure Resource +// Manager VM. +type AzureIaaSComputeVMProtectedItem struct { + // FriendlyName - Friendly name of the VM represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // VirtualMachineID - Fully qualified ARM ID of the virtual machine represented by this item. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // HealthStatus - Health status of protected item. Possible values include: 'HealthStatusPassed', 'HealthStatusActionRequired', 'HealthStatusActionSuggested', 'HealthStatusInvalid' + HealthStatus HealthStatus `json:"healthStatus,omitempty"` + // HealthDetails - Health details on this backup item. + HealthDetails *[]AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` + // KpisHealths - Health details of different KPIs + KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` + // LastBackupStatus - Last backup operation status. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // ProtectedItemDataID - Data ID of the protected item. + ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) MarshalJSON() ([]byte, error) { + aiscvpi.ProtectedItemType = ProtectedItemTypeMicrosoftComputevirtualMachines + objectMap := make(map[string]interface{}) + if aiscvpi.FriendlyName != nil { + objectMap["friendlyName"] = aiscvpi.FriendlyName + } + if aiscvpi.VirtualMachineID != nil { + objectMap["virtualMachineId"] = aiscvpi.VirtualMachineID + } + if aiscvpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = aiscvpi.ProtectionStatus + } + if aiscvpi.ProtectionState != "" { + objectMap["protectionState"] = aiscvpi.ProtectionState + } + if aiscvpi.HealthStatus != "" { + objectMap["healthStatus"] = aiscvpi.HealthStatus + } + if aiscvpi.HealthDetails != nil { + objectMap["healthDetails"] = aiscvpi.HealthDetails + } + if aiscvpi.KpisHealths != nil { + objectMap["kpisHealths"] = aiscvpi.KpisHealths + } + if aiscvpi.LastBackupStatus != nil { + objectMap["lastBackupStatus"] = aiscvpi.LastBackupStatus + } + if aiscvpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = aiscvpi.LastBackupTime + } + if aiscvpi.ProtectedItemDataID != nil { + objectMap["protectedItemDataId"] = aiscvpi.ProtectedItemDataID + } + if aiscvpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = aiscvpi.ExtendedInfo + } + if aiscvpi.ExtendedProperties != nil { + objectMap["extendedProperties"] = aiscvpi.ExtendedProperties + } + if aiscvpi.BackupManagementType != "" { + objectMap["backupManagementType"] = aiscvpi.BackupManagementType + } + if aiscvpi.WorkloadType != "" { + objectMap["workloadType"] = aiscvpi.WorkloadType + } + if aiscvpi.ContainerName != nil { + objectMap["containerName"] = aiscvpi.ContainerName + } + if aiscvpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = aiscvpi.SourceResourceID + } + if aiscvpi.PolicyID != nil { + objectMap["policyId"] = aiscvpi.PolicyID + } + if aiscvpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = aiscvpi.LastRecoveryPoint + } + if aiscvpi.BackupSetName != nil { + objectMap["backupSetName"] = aiscvpi.BackupSetName + } + if aiscvpi.CreateMode != "" { + objectMap["createMode"] = aiscvpi.CreateMode + } + if aiscvpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = aiscvpi.DeferredDeleteTimeInUTC + } + if aiscvpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = aiscvpi.IsScheduledForDeferredDelete + } + if aiscvpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = aiscvpi.DeferredDeleteTimeRemaining + } + if aiscvpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = aiscvpi.IsDeferredDeleteScheduleUpcoming + } + if aiscvpi.IsRehydrate != nil { + objectMap["isRehydrate"] = aiscvpi.IsRehydrate + } + if aiscvpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = aiscvpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return &aiscvpi, true +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return &aiscvpi, true +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &aiscvpi, true +} + +// AzureIaaSVMErrorInfo azure IaaS VM workload-specific error information. +type AzureIaaSVMErrorInfo struct { + // ErrorCode - READ-ONLY; Error code. + ErrorCode *int32 `json:"errorCode,omitempty"` + // ErrorTitle - READ-ONLY; Title: Typically, the entity that the error pertains to. + ErrorTitle *string `json:"errorTitle,omitempty"` + // ErrorString - READ-ONLY; Localized error string. + ErrorString *string `json:"errorString,omitempty"` + // Recommendations - READ-ONLY; List of localized recommendations for above error code. + Recommendations *[]string `json:"recommendations,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSVMErrorInfo. +func (aisei AzureIaaSVMErrorInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// AzureIaaSVMHealthDetails azure IaaS VM workload-specific Health Details. +type AzureIaaSVMHealthDetails struct { + // Code - READ-ONLY; Health Code + Code *int32 `json:"code,omitempty"` + // Title - READ-ONLY; Health Title + Title *string `json:"title,omitempty"` + // Message - READ-ONLY; Health Message + Message *string `json:"message,omitempty"` + // Recommendations - READ-ONLY; Health Recommended Actions + Recommendations *[]string `json:"recommendations,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSVMHealthDetails. +func (aishd AzureIaaSVMHealthDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// AzureIaaSVMJob azure IaaS VM workload-specific job object. +type AzureIaaSVMJob struct { + // Duration - Time elapsed during the execution of this job. + Duration *string `json:"duration,omitempty"` + // ActionsInfo - Gets or sets the state/actions applicable on this job like cancel/retry. + ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` + // ErrorDetails - Error details on execution of this job. + ErrorDetails *[]AzureIaaSVMErrorInfo `json:"errorDetails,omitempty"` + // VirtualMachineVersion - Specifies whether the backup item is a Classic or an Azure Resource Manager VM. + VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` + // ExtendedInfo - Additional information for this job. + ExtendedInfo *AzureIaaSVMJobExtendedInfo `json:"extendedInfo,omitempty"` + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob', 'JobTypeVaultJob' + JobType JobType `json:"jobType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSVMJob. +func (aisj AzureIaaSVMJob) MarshalJSON() ([]byte, error) { + aisj.JobType = JobTypeAzureIaaSVMJob + objectMap := make(map[string]interface{}) + if aisj.Duration != nil { + objectMap["duration"] = aisj.Duration + } + if aisj.ActionsInfo != nil { + objectMap["actionsInfo"] = aisj.ActionsInfo + } + if aisj.ErrorDetails != nil { + objectMap["errorDetails"] = aisj.ErrorDetails + } + if aisj.VirtualMachineVersion != nil { + objectMap["virtualMachineVersion"] = aisj.VirtualMachineVersion + } + if aisj.ExtendedInfo != nil { + objectMap["extendedInfo"] = aisj.ExtendedInfo + } + if aisj.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = aisj.EntityFriendlyName + } + if aisj.BackupManagementType != "" { + objectMap["backupManagementType"] = aisj.BackupManagementType + } + if aisj.Operation != nil { + objectMap["operation"] = aisj.Operation + } + if aisj.Status != nil { + objectMap["status"] = aisj.Status + } + if aisj.StartTime != nil { + objectMap["startTime"] = aisj.StartTime + } + if aisj.EndTime != nil { + objectMap["endTime"] = aisj.EndTime + } + if aisj.ActivityID != nil { + objectMap["activityId"] = aisj.ActivityID + } + if aisj.JobType != "" { + objectMap["jobType"] = aisj.JobType + } + return json.Marshal(objectMap) +} + +// AsAzureIaaSVMJob is the BasicJob implementation for AzureIaaSVMJob. +func (aisj AzureIaaSVMJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { + return &aisj, true +} + +// AsAzureStorageJob is the BasicJob implementation for AzureIaaSVMJob. +func (aisj AzureIaaSVMJob) AsAzureStorageJob() (*AzureStorageJob, bool) { + return nil, false +} + +// AsAzureWorkloadJob is the BasicJob implementation for AzureIaaSVMJob. +func (aisj AzureIaaSVMJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { + return nil, false +} + +// AsDpmJob is the BasicJob implementation for AzureIaaSVMJob. +func (aisj AzureIaaSVMJob) AsDpmJob() (*DpmJob, bool) { + return nil, false +} + +// AsMabJob is the BasicJob implementation for AzureIaaSVMJob. +func (aisj AzureIaaSVMJob) AsMabJob() (*MabJob, bool) { + return nil, false +} + +// AsVaultJob is the BasicJob implementation for AzureIaaSVMJob. +func (aisj AzureIaaSVMJob) AsVaultJob() (*VaultJob, bool) { + return nil, false +} + +// AsJob is the BasicJob implementation for AzureIaaSVMJob. +func (aisj AzureIaaSVMJob) AsJob() (*Job, bool) { + return nil, false +} + +// AsBasicJob is the BasicJob implementation for AzureIaaSVMJob. +func (aisj AzureIaaSVMJob) AsBasicJob() (BasicJob, bool) { + return &aisj, true +} + +// AzureIaaSVMJobExtendedInfo azure IaaS VM workload-specific additional information for job. +type AzureIaaSVMJobExtendedInfo struct { + // TasksList - List of tasks associated with this job. + TasksList *[]AzureIaaSVMJobTaskDetails `json:"tasksList,omitempty"` + // PropertyBag - Job properties. + PropertyBag map[string]*string `json:"propertyBag"` + // InternalPropertyBag - Job internal properties. + InternalPropertyBag map[string]*string `json:"internalPropertyBag"` + // ProgressPercentage - Indicates progress of the job. Null if it has not started or completed. + ProgressPercentage *float64 `json:"progressPercentage,omitempty"` + // EstimatedRemainingDuration - Time remaining for execution of this job. + EstimatedRemainingDuration *string `json:"estimatedRemainingDuration,omitempty"` + // DynamicErrorMessage - Non localized error message on job execution. + DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSVMJobExtendedInfo. +func (aisjei AzureIaaSVMJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aisjei.TasksList != nil { + objectMap["tasksList"] = aisjei.TasksList + } + if aisjei.PropertyBag != nil { + objectMap["propertyBag"] = aisjei.PropertyBag + } + if aisjei.InternalPropertyBag != nil { + objectMap["internalPropertyBag"] = aisjei.InternalPropertyBag + } + if aisjei.ProgressPercentage != nil { + objectMap["progressPercentage"] = aisjei.ProgressPercentage + } + if aisjei.EstimatedRemainingDuration != nil { + objectMap["estimatedRemainingDuration"] = aisjei.EstimatedRemainingDuration + } + if aisjei.DynamicErrorMessage != nil { + objectMap["dynamicErrorMessage"] = aisjei.DynamicErrorMessage + } + return json.Marshal(objectMap) +} + +// AzureIaaSVMJobTaskDetails azure IaaS VM workload-specific job task details. +type AzureIaaSVMJobTaskDetails struct { + // TaskID - The task display name. + TaskID *string `json:"taskId,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // InstanceID - The instanceId. + InstanceID *string `json:"instanceId,omitempty"` + // Duration - Time elapsed for task. + Duration *string `json:"duration,omitempty"` + // Status - The status. + Status *string `json:"status,omitempty"` + // ProgressPercentage - Progress of the task. + ProgressPercentage *float64 `json:"progressPercentage,omitempty"` + // TaskExecutionDetails - Details about execution of the task. + // eg: number of bytes transferred etc + TaskExecutionDetails *string `json:"taskExecutionDetails,omitempty"` +} + +// BasicAzureIaaSVMProtectedItem iaaS VM workload-specific backup item. +type BasicAzureIaaSVMProtectedItem interface { + AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) + AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) + AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) +} + +// AzureIaaSVMProtectedItem iaaS VM workload-specific backup item. +type AzureIaaSVMProtectedItem struct { + // FriendlyName - Friendly name of the VM represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // VirtualMachineID - Fully qualified ARM ID of the virtual machine represented by this item. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // HealthStatus - Health status of protected item. Possible values include: 'HealthStatusPassed', 'HealthStatusActionRequired', 'HealthStatusActionSuggested', 'HealthStatusInvalid' + HealthStatus HealthStatus `json:"healthStatus,omitempty"` + // HealthDetails - Health details on this backup item. + HealthDetails *[]AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` + // KpisHealths - Health details of different KPIs + KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` + // LastBackupStatus - Last backup operation status. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // ProtectedItemDataID - Data ID of the protected item. + ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +func unmarshalBasicAzureIaaSVMProtectedItem(body []byte) (BasicAzureIaaSVMProtectedItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectedItemType"] { + case string(ProtectedItemTypeMicrosoftClassicComputevirtualMachines): + var aisccvpi AzureIaaSClassicComputeVMProtectedItem + err := json.Unmarshal(body, &aisccvpi) + return aisccvpi, err + case string(ProtectedItemTypeMicrosoftComputevirtualMachines): + var aiscvpi AzureIaaSComputeVMProtectedItem + err := json.Unmarshal(body, &aiscvpi) + return aiscvpi, err + default: + var aispi AzureIaaSVMProtectedItem + err := json.Unmarshal(body, &aispi) + return aispi, err + } +} +func unmarshalBasicAzureIaaSVMProtectedItemArray(body []byte) ([]BasicAzureIaaSVMProtectedItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + aispiArray := make([]BasicAzureIaaSVMProtectedItem, len(rawMessages)) + + for index, rawMessage := range rawMessages { + aispi, err := unmarshalBasicAzureIaaSVMProtectedItem(*rawMessage) + if err != nil { + return nil, err + } + aispiArray[index] = aispi + } + return aispiArray, nil +} + +// MarshalJSON is the custom marshaler for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) MarshalJSON() ([]byte, error) { + aispi.ProtectedItemType = ProtectedItemTypeAzureIaaSVMProtectedItem + objectMap := make(map[string]interface{}) + if aispi.FriendlyName != nil { + objectMap["friendlyName"] = aispi.FriendlyName + } + if aispi.VirtualMachineID != nil { + objectMap["virtualMachineId"] = aispi.VirtualMachineID + } + if aispi.ProtectionStatus != nil { + objectMap["protectionStatus"] = aispi.ProtectionStatus + } + if aispi.ProtectionState != "" { + objectMap["protectionState"] = aispi.ProtectionState + } + if aispi.HealthStatus != "" { + objectMap["healthStatus"] = aispi.HealthStatus + } + if aispi.HealthDetails != nil { + objectMap["healthDetails"] = aispi.HealthDetails + } + if aispi.KpisHealths != nil { + objectMap["kpisHealths"] = aispi.KpisHealths + } + if aispi.LastBackupStatus != nil { + objectMap["lastBackupStatus"] = aispi.LastBackupStatus + } + if aispi.LastBackupTime != nil { + objectMap["lastBackupTime"] = aispi.LastBackupTime + } + if aispi.ProtectedItemDataID != nil { + objectMap["protectedItemDataId"] = aispi.ProtectedItemDataID + } + if aispi.ExtendedInfo != nil { + objectMap["extendedInfo"] = aispi.ExtendedInfo + } + if aispi.ExtendedProperties != nil { + objectMap["extendedProperties"] = aispi.ExtendedProperties + } + if aispi.BackupManagementType != "" { + objectMap["backupManagementType"] = aispi.BackupManagementType + } + if aispi.WorkloadType != "" { + objectMap["workloadType"] = aispi.WorkloadType + } + if aispi.ContainerName != nil { + objectMap["containerName"] = aispi.ContainerName + } + if aispi.SourceResourceID != nil { + objectMap["sourceResourceId"] = aispi.SourceResourceID + } + if aispi.PolicyID != nil { + objectMap["policyId"] = aispi.PolicyID + } + if aispi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = aispi.LastRecoveryPoint + } + if aispi.BackupSetName != nil { + objectMap["backupSetName"] = aispi.BackupSetName + } + if aispi.CreateMode != "" { + objectMap["createMode"] = aispi.CreateMode + } + if aispi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = aispi.DeferredDeleteTimeInUTC + } + if aispi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = aispi.IsScheduledForDeferredDelete + } + if aispi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = aispi.DeferredDeleteTimeRemaining + } + if aispi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = aispi.IsDeferredDeleteScheduleUpcoming + } + if aispi.IsRehydrate != nil { + objectMap["isRehydrate"] = aispi.IsRehydrate + } + if aispi.ProtectedItemType != "" { + objectMap["protectedItemType"] = aispi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return &aispi, true +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return &aispi, true +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &aispi, true +} + +// AzureIaaSVMProtectedItemExtendedInfo additional information on Azure IaaS VM specific backup item. +type AzureIaaSVMProtectedItemExtendedInfo struct { + // OldestRecoveryPoint - The oldest backup copy available for this backup item. + OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` + // RecoveryPointCount - Number of backup copies available for this backup item. + RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` + // PolicyInconsistent - Specifies if backup policy associated with the backup item is inconsistent. + PolicyInconsistent *bool `json:"policyInconsistent,omitempty"` +} + +// AzureIaaSVMProtectionPolicy iaaS VM workload-specific backup policy. +type AzureIaaSVMProtectionPolicy struct { + InstantRPDetails *InstantRPAdditionalDetails `json:"instantRPDetails,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. + RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` + // InstantRpRetentionRangeInDays - Instant RP retention policy range in days + InstantRpRetentionRangeInDays *int32 `json:"instantRpRetentionRangeInDays,omitempty"` + // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + TimeZone *string `json:"timeZone,omitempty"` + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) MarshalJSON() ([]byte, error) { + aispp.BackupManagementType = BackupManagementTypeAzureIaasVM + objectMap := make(map[string]interface{}) + if aispp.InstantRPDetails != nil { + objectMap["instantRPDetails"] = aispp.InstantRPDetails + } + objectMap["schedulePolicy"] = aispp.SchedulePolicy + objectMap["retentionPolicy"] = aispp.RetentionPolicy + if aispp.InstantRpRetentionRangeInDays != nil { + objectMap["instantRpRetentionRangeInDays"] = aispp.InstantRpRetentionRangeInDays + } + if aispp.TimeZone != nil { + objectMap["timeZone"] = aispp.TimeZone + } + if aispp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = aispp.ProtectedItemsCount + } + if aispp.BackupManagementType != "" { + objectMap["backupManagementType"] = aispp.BackupManagementType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return nil, false +} + +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { + return &aispp, true +} + +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { + return nil, false +} + +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { + return nil, false +} + +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { + return nil, false +} + +// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { + return nil, false +} + +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &aispp, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureIaaSVMProtectionPolicy struct. +func (aispp *AzureIaaSVMProtectionPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "instantRPDetails": + if v != nil { + var instantRPDetails InstantRPAdditionalDetails + err = json.Unmarshal(*v, &instantRPDetails) + if err != nil { + return err + } + aispp.InstantRPDetails = &instantRPDetails + } + case "schedulePolicy": + if v != nil { + schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) + if err != nil { + return err + } + aispp.SchedulePolicy = schedulePolicy + } + case "retentionPolicy": + if v != nil { + retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) + if err != nil { + return err + } + aispp.RetentionPolicy = retentionPolicy + } + case "instantRpRetentionRangeInDays": + if v != nil { + var instantRpRetentionRangeInDays int32 + err = json.Unmarshal(*v, &instantRpRetentionRangeInDays) + if err != nil { + return err + } + aispp.InstantRpRetentionRangeInDays = &instantRpRetentionRangeInDays + } + case "timeZone": + if v != nil { + var timeZone string + err = json.Unmarshal(*v, &timeZone) + if err != nil { + return err + } + aispp.TimeZone = &timeZone + } + case "protectedItemsCount": + if v != nil { + var protectedItemsCount int32 + err = json.Unmarshal(*v, &protectedItemsCount) + if err != nil { + return err + } + aispp.ProtectedItemsCount = &protectedItemsCount + } + case "backupManagementType": + if v != nil { + var backupManagementType ManagementTypeBasicProtectionPolicy + err = json.Unmarshal(*v, &backupManagementType) + if err != nil { + return err + } + aispp.BackupManagementType = backupManagementType + } + } + } + + return nil +} + +// AzureSQLAGWorkloadContainerProtectionContainer container for SQL workloads under SQL Availability Group. +type AzureSQLAGWorkloadContainerProtectionContainer struct { + // SourceResourceID - ARM ID of the virtual machine represented by this Azure Workload Container + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // LastUpdatedTime - Time stamp when this container was updated. + LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` + // ExtendedInfo - Additional details of a workload container. + ExtendedInfo *AzureWorkloadContainerExtendedInfo `json:"extendedInfo,omitempty"` + // WorkloadType - Workload type for which registration was sent. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` + // OperationType - Re-Do Operation. Possible values include: 'OperationTypeInvalid', 'OperationTypeRegister', 'OperationTypeReregister' + OperationType OperationType `json:"operationType,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) MarshalJSON() ([]byte, error) { + aswcpc.ContainerType = ContainerTypeSQLAGWorkLoadContainer1 + objectMap := make(map[string]interface{}) + if aswcpc.SourceResourceID != nil { + objectMap["sourceResourceId"] = aswcpc.SourceResourceID + } + if aswcpc.LastUpdatedTime != nil { + objectMap["lastUpdatedTime"] = aswcpc.LastUpdatedTime + } + if aswcpc.ExtendedInfo != nil { + objectMap["extendedInfo"] = aswcpc.ExtendedInfo + } + if aswcpc.WorkloadType != "" { + objectMap["workloadType"] = aswcpc.WorkloadType + } + if aswcpc.OperationType != "" { + objectMap["operationType"] = aswcpc.OperationType + } + if aswcpc.FriendlyName != nil { + objectMap["friendlyName"] = aswcpc.FriendlyName + } + if aswcpc.BackupManagementType != "" { + objectMap["backupManagementType"] = aswcpc.BackupManagementType + } + if aswcpc.RegistrationStatus != nil { + objectMap["registrationStatus"] = aswcpc.RegistrationStatus + } + if aswcpc.HealthStatus != nil { + objectMap["healthStatus"] = aswcpc.HealthStatus + } + if aswcpc.ContainerType != "" { + objectMap["containerType"] = aswcpc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return &aswcpc, true +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return &aswcpc, true +} + +// AsDpmContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &aswcpc, true +} + +// AzureSQLContainer azure Sql workload-specific container. +type AzureSQLContainer struct { + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureSQLContainer. +func (asc AzureSQLContainer) MarshalJSON() ([]byte, error) { + asc.ContainerType = ContainerTypeAzureSQLContainer1 + objectMap := make(map[string]interface{}) + if asc.FriendlyName != nil { + objectMap["friendlyName"] = asc.FriendlyName + } + if asc.BackupManagementType != "" { + objectMap["backupManagementType"] = asc.BackupManagementType + } + if asc.RegistrationStatus != nil { + objectMap["registrationStatus"] = asc.RegistrationStatus + } + if asc.HealthStatus != nil { + objectMap["healthStatus"] = asc.HealthStatus + } + if asc.ContainerType != "" { + objectMap["containerType"] = asc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return &asc, true +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &asc, true +} + +// AzureSQLProtectedItem azure SQL workload-specific backup item. +type AzureSQLProtectedItem struct { + // ProtectedItemDataID - Internal ID of a backup item. Used by Azure SQL Backup engine to contact Recovery Services. + ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` + // ProtectionState - Backup state of the backed up item. Possible values include: 'ProtectedItemStateInvalid', 'ProtectedItemStateIRPending', 'ProtectedItemStateProtected', 'ProtectedItemStateProtectionError', 'ProtectedItemStateProtectionStopped', 'ProtectedItemStateProtectionPaused' + ProtectionState ProtectedItemState `json:"protectionState,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureSQLProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) MarshalJSON() ([]byte, error) { + aspi.ProtectedItemType = ProtectedItemTypeMicrosoftSqlserversdatabases + objectMap := make(map[string]interface{}) + if aspi.ProtectedItemDataID != nil { + objectMap["protectedItemDataId"] = aspi.ProtectedItemDataID + } + if aspi.ProtectionState != "" { + objectMap["protectionState"] = aspi.ProtectionState + } + if aspi.ExtendedInfo != nil { + objectMap["extendedInfo"] = aspi.ExtendedInfo + } + if aspi.BackupManagementType != "" { + objectMap["backupManagementType"] = aspi.BackupManagementType + } + if aspi.WorkloadType != "" { + objectMap["workloadType"] = aspi.WorkloadType + } + if aspi.ContainerName != nil { + objectMap["containerName"] = aspi.ContainerName + } + if aspi.SourceResourceID != nil { + objectMap["sourceResourceId"] = aspi.SourceResourceID + } + if aspi.PolicyID != nil { + objectMap["policyId"] = aspi.PolicyID + } + if aspi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = aspi.LastRecoveryPoint + } + if aspi.BackupSetName != nil { + objectMap["backupSetName"] = aspi.BackupSetName + } + if aspi.CreateMode != "" { + objectMap["createMode"] = aspi.CreateMode + } + if aspi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = aspi.DeferredDeleteTimeInUTC + } + if aspi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = aspi.IsScheduledForDeferredDelete + } + if aspi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = aspi.DeferredDeleteTimeRemaining + } + if aspi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = aspi.IsDeferredDeleteScheduleUpcoming + } + if aspi.IsRehydrate != nil { + objectMap["isRehydrate"] = aspi.IsRehydrate + } + if aspi.ProtectedItemType != "" { + objectMap["protectedItemType"] = aspi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return &aspi, true +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &aspi, true +} + +// AzureSQLProtectedItemExtendedInfo additional information on Azure Sql specific protected item. +type AzureSQLProtectedItemExtendedInfo struct { + // OldestRecoveryPoint - The oldest backup copy available for this item in the service. + OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` + // RecoveryPointCount - Number of available backup copies associated with this backup item. + RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` + // PolicyState - State of the backup policy associated with this backup item. + PolicyState *string `json:"policyState,omitempty"` +} + +// AzureSQLProtectionPolicy azure SQL workload-specific backup policy. +type AzureSQLProtectionPolicy struct { + // RetentionPolicy - Retention policy details. + RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) MarshalJSON() ([]byte, error) { + aspp.BackupManagementType = BackupManagementTypeAzureSQL + objectMap := make(map[string]interface{}) + objectMap["retentionPolicy"] = aspp.RetentionPolicy + if aspp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = aspp.ProtectedItemsCount + } + if aspp.BackupManagementType != "" { + objectMap["backupManagementType"] = aspp.BackupManagementType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return nil, false +} + +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { + return nil, false +} + +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { + return &aspp, true +} + +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { + return nil, false +} + +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { + return nil, false +} + +// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { + return nil, false +} + +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &aspp, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureSQLProtectionPolicy struct. +func (aspp *AzureSQLProtectionPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "retentionPolicy": + if v != nil { + retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) + if err != nil { + return err + } + aspp.RetentionPolicy = retentionPolicy + } + case "protectedItemsCount": + if v != nil { + var protectedItemsCount int32 + err = json.Unmarshal(*v, &protectedItemsCount) + if err != nil { + return err + } + aspp.ProtectedItemsCount = &protectedItemsCount + } + case "backupManagementType": + if v != nil { + var backupManagementType ManagementTypeBasicProtectionPolicy + err = json.Unmarshal(*v, &backupManagementType) + if err != nil { + return err + } + aspp.BackupManagementType = backupManagementType + } + } + } + + return nil +} + +// AzureStorageContainer azure Storage Account workload-specific container. +type AzureStorageContainer struct { + // SourceResourceID - Fully qualified ARM url. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // StorageAccountVersion - Storage account version. + StorageAccountVersion *string `json:"storageAccountVersion,omitempty"` + // ResourceGroup - Resource group name of Recovery Services Vault. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // ProtectedItemCount - Number of items backed up in this container. + ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureStorageContainer. +func (asc AzureStorageContainer) MarshalJSON() ([]byte, error) { + asc.ContainerType = ContainerTypeStorageContainer1 + objectMap := make(map[string]interface{}) + if asc.SourceResourceID != nil { + objectMap["sourceResourceId"] = asc.SourceResourceID + } + if asc.StorageAccountVersion != nil { + objectMap["storageAccountVersion"] = asc.StorageAccountVersion + } + if asc.ResourceGroup != nil { + objectMap["resourceGroup"] = asc.ResourceGroup + } + if asc.ProtectedItemCount != nil { + objectMap["protectedItemCount"] = asc.ProtectedItemCount + } + if asc.FriendlyName != nil { + objectMap["friendlyName"] = asc.FriendlyName + } + if asc.BackupManagementType != "" { + objectMap["backupManagementType"] = asc.BackupManagementType + } + if asc.RegistrationStatus != nil { + objectMap["registrationStatus"] = asc.RegistrationStatus + } + if asc.HealthStatus != nil { + objectMap["healthStatus"] = asc.HealthStatus + } + if asc.ContainerType != "" { + objectMap["containerType"] = asc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return &asc, true +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &asc, true +} + +// AzureStorageErrorInfo azure storage specific error information +type AzureStorageErrorInfo struct { + // ErrorCode - Error code. + ErrorCode *int32 `json:"errorCode,omitempty"` + // ErrorString - Localized error string. + ErrorString *string `json:"errorString,omitempty"` + // Recommendations - List of localized recommendations for above error code. + Recommendations *[]string `json:"recommendations,omitempty"` +} + +// AzureStorageJob azure storage specific job. +type AzureStorageJob struct { + // Duration - Time elapsed during the execution of this job. + Duration *string `json:"duration,omitempty"` + // ActionsInfo - Gets or sets the state/actions applicable on this job like cancel/retry. + ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` + // ErrorDetails - Error details on execution of this job. + ErrorDetails *[]AzureStorageErrorInfo `json:"errorDetails,omitempty"` + // StorageAccountName - Specifies friendly name of the storage account. + StorageAccountName *string `json:"storageAccountName,omitempty"` + // StorageAccountVersion - Specifies whether the Storage account is a Classic or an Azure Resource Manager Storage account. + StorageAccountVersion *string `json:"storageAccountVersion,omitempty"` + // ExtendedInfo - Additional information about the job. + ExtendedInfo *AzureStorageJobExtendedInfo `json:"extendedInfo,omitempty"` + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob', 'JobTypeVaultJob' + JobType JobType `json:"jobType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureStorageJob. +func (asj AzureStorageJob) MarshalJSON() ([]byte, error) { + asj.JobType = JobTypeAzureStorageJob + objectMap := make(map[string]interface{}) + if asj.Duration != nil { + objectMap["duration"] = asj.Duration + } + if asj.ActionsInfo != nil { + objectMap["actionsInfo"] = asj.ActionsInfo + } + if asj.ErrorDetails != nil { + objectMap["errorDetails"] = asj.ErrorDetails + } + if asj.StorageAccountName != nil { + objectMap["storageAccountName"] = asj.StorageAccountName + } + if asj.StorageAccountVersion != nil { + objectMap["storageAccountVersion"] = asj.StorageAccountVersion + } + if asj.ExtendedInfo != nil { + objectMap["extendedInfo"] = asj.ExtendedInfo + } + if asj.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = asj.EntityFriendlyName + } + if asj.BackupManagementType != "" { + objectMap["backupManagementType"] = asj.BackupManagementType + } + if asj.Operation != nil { + objectMap["operation"] = asj.Operation + } + if asj.Status != nil { + objectMap["status"] = asj.Status + } + if asj.StartTime != nil { + objectMap["startTime"] = asj.StartTime + } + if asj.EndTime != nil { + objectMap["endTime"] = asj.EndTime + } + if asj.ActivityID != nil { + objectMap["activityId"] = asj.ActivityID + } + if asj.JobType != "" { + objectMap["jobType"] = asj.JobType + } + return json.Marshal(objectMap) +} + +// AsAzureIaaSVMJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { + return nil, false +} + +// AsAzureStorageJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsAzureStorageJob() (*AzureStorageJob, bool) { + return &asj, true +} + +// AsAzureWorkloadJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { + return nil, false +} + +// AsDpmJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsDpmJob() (*DpmJob, bool) { + return nil, false +} + +// AsMabJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsMabJob() (*MabJob, bool) { + return nil, false +} + +// AsVaultJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsVaultJob() (*VaultJob, bool) { + return nil, false +} + +// AsJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsJob() (*Job, bool) { + return nil, false +} + +// AsBasicJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsBasicJob() (BasicJob, bool) { + return &asj, true +} + +// AzureStorageJobExtendedInfo azure Storage workload-specific additional information for job. +type AzureStorageJobExtendedInfo struct { + // TasksList - List of tasks for this job + TasksList *[]AzureStorageJobTaskDetails `json:"tasksList,omitempty"` + // PropertyBag - Job properties. + PropertyBag map[string]*string `json:"propertyBag"` + // DynamicErrorMessage - Non localized error message on job execution. + DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureStorageJobExtendedInfo. +func (asjei AzureStorageJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asjei.TasksList != nil { + objectMap["tasksList"] = asjei.TasksList + } + if asjei.PropertyBag != nil { + objectMap["propertyBag"] = asjei.PropertyBag + } + if asjei.DynamicErrorMessage != nil { + objectMap["dynamicErrorMessage"] = asjei.DynamicErrorMessage + } + return json.Marshal(objectMap) +} + +// AzureStorageJobTaskDetails azure storage workload specific job task details. +type AzureStorageJobTaskDetails struct { + // TaskID - The task display name. + TaskID *string `json:"taskId,omitempty"` + // Status - The status. + Status *string `json:"status,omitempty"` +} + +// AzureStorageProtectableContainer azure Storage-specific protectable containers +type AzureStorageProtectableContainer struct { + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerID - Fabric Id of the container such as ARM Id. + ContainerID *string `json:"containerId,omitempty"` + // ProtectableContainerType - Possible values include: 'ProtectableContainerTypeProtectableContainer', 'ProtectableContainerTypeStorageContainer', 'ProtectableContainerTypeVMAppContainer' + ProtectableContainerType ProtectableContainerType `json:"protectableContainerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureStorageProtectableContainer. +func (aspc AzureStorageProtectableContainer) MarshalJSON() ([]byte, error) { + aspc.ProtectableContainerType = ProtectableContainerTypeStorageContainer + objectMap := make(map[string]interface{}) + if aspc.FriendlyName != nil { + objectMap["friendlyName"] = aspc.FriendlyName + } + if aspc.BackupManagementType != "" { + objectMap["backupManagementType"] = aspc.BackupManagementType + } + if aspc.HealthStatus != nil { + objectMap["healthStatus"] = aspc.HealthStatus + } + if aspc.ContainerID != nil { + objectMap["containerId"] = aspc.ContainerID + } + if aspc.ProtectableContainerType != "" { + objectMap["protectableContainerType"] = aspc.ProtectableContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureStorageProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. +func (aspc AzureStorageProtectableContainer) AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) { + return &aspc, true +} + +// AsAzureVMAppContainerProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. +func (aspc AzureStorageProtectableContainer) AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) { + return nil, false +} + +// AsProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. +func (aspc AzureStorageProtectableContainer) AsProtectableContainer() (*ProtectableContainer, bool) { + return nil, false +} + +// AsBasicProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. +func (aspc AzureStorageProtectableContainer) AsBasicProtectableContainer() (BasicProtectableContainer, bool) { + return &aspc, true +} + +// AzureVMAppContainerProtectableContainer azure workload-specific container +type AzureVMAppContainerProtectableContainer struct { + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerID - Fabric Id of the container such as ARM Id. + ContainerID *string `json:"containerId,omitempty"` + // ProtectableContainerType - Possible values include: 'ProtectableContainerTypeProtectableContainer', 'ProtectableContainerTypeStorageContainer', 'ProtectableContainerTypeVMAppContainer' + ProtectableContainerType ProtectableContainerType `json:"protectableContainerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMAppContainerProtectableContainer. +func (avacpc AzureVMAppContainerProtectableContainer) MarshalJSON() ([]byte, error) { + avacpc.ProtectableContainerType = ProtectableContainerTypeVMAppContainer + objectMap := make(map[string]interface{}) + if avacpc.FriendlyName != nil { + objectMap["friendlyName"] = avacpc.FriendlyName + } + if avacpc.BackupManagementType != "" { + objectMap["backupManagementType"] = avacpc.BackupManagementType + } + if avacpc.HealthStatus != nil { + objectMap["healthStatus"] = avacpc.HealthStatus + } + if avacpc.ContainerID != nil { + objectMap["containerId"] = avacpc.ContainerID + } + if avacpc.ProtectableContainerType != "" { + objectMap["protectableContainerType"] = avacpc.ProtectableContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureStorageProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. +func (avacpc AzureVMAppContainerProtectableContainer) AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. +func (avacpc AzureVMAppContainerProtectableContainer) AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) { + return &avacpc, true +} + +// AsProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. +func (avacpc AzureVMAppContainerProtectableContainer) AsProtectableContainer() (*ProtectableContainer, bool) { + return nil, false +} + +// AsBasicProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. +func (avacpc AzureVMAppContainerProtectableContainer) AsBasicProtectableContainer() (BasicProtectableContainer, bool) { + return &avacpc, true +} + +// AzureVMAppContainerProtectionContainer container for SQL workloads under Azure Virtual Machines. +type AzureVMAppContainerProtectionContainer struct { + // SourceResourceID - ARM ID of the virtual machine represented by this Azure Workload Container + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // LastUpdatedTime - Time stamp when this container was updated. + LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` + // ExtendedInfo - Additional details of a workload container. + ExtendedInfo *AzureWorkloadContainerExtendedInfo `json:"extendedInfo,omitempty"` + // WorkloadType - Workload type for which registration was sent. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` + // OperationType - Re-Do Operation. Possible values include: 'OperationTypeInvalid', 'OperationTypeRegister', 'OperationTypeReregister' + OperationType OperationType `json:"operationType,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) MarshalJSON() ([]byte, error) { + avacpc.ContainerType = ContainerTypeVMAppContainer1 + objectMap := make(map[string]interface{}) + if avacpc.SourceResourceID != nil { + objectMap["sourceResourceId"] = avacpc.SourceResourceID + } + if avacpc.LastUpdatedTime != nil { + objectMap["lastUpdatedTime"] = avacpc.LastUpdatedTime + } + if avacpc.ExtendedInfo != nil { + objectMap["extendedInfo"] = avacpc.ExtendedInfo + } + if avacpc.WorkloadType != "" { + objectMap["workloadType"] = avacpc.WorkloadType + } + if avacpc.OperationType != "" { + objectMap["operationType"] = avacpc.OperationType + } + if avacpc.FriendlyName != nil { + objectMap["friendlyName"] = avacpc.FriendlyName + } + if avacpc.BackupManagementType != "" { + objectMap["backupManagementType"] = avacpc.BackupManagementType + } + if avacpc.RegistrationStatus != nil { + objectMap["registrationStatus"] = avacpc.RegistrationStatus + } + if avacpc.HealthStatus != nil { + objectMap["healthStatus"] = avacpc.HealthStatus + } + if avacpc.ContainerType != "" { + objectMap["containerType"] = avacpc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return &avacpc, true +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return &avacpc, true +} + +// AsDpmContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &avacpc, true +} + +// BasicAzureVMWorkloadItem azure VM workload-specific workload item. +type BasicAzureVMWorkloadItem interface { + AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) + AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) + AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) + AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) + AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) + AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) + AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +} + +// AzureVMWorkloadItem azure VM workload-specific workload item. +type AzureVMWorkloadItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if workload item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected + SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +} + +func unmarshalBasicAzureVMWorkloadItem(body []byte) (BasicAzureVMWorkloadItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["workloadItemType"] { + case string(WorkloadItemTypeSAPAseDatabase1): + var avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem + err := json.Unmarshal(body, &avwsadwi) + return avwsadwi, err + case string(WorkloadItemTypeSAPAseSystem1): + var avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem + err := json.Unmarshal(body, &avwsaswi) + return avwsaswi, err + case string(WorkloadItemTypeSAPHanaDatabase1): + var avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem + err := json.Unmarshal(body, &avwshdwi) + return avwshdwi, err + case string(WorkloadItemTypeSAPHanaSystem1): + var avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem + err := json.Unmarshal(body, &avwshswi) + return avwshswi, err + case string(WorkloadItemTypeSQLDataBase1): + var avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem + err := json.Unmarshal(body, &avwsdwi) + return avwsdwi, err + case string(WorkloadItemTypeSQLInstance1): + var avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem + err := json.Unmarshal(body, &avwsiwi) + return avwsiwi, err + default: + var avwi AzureVMWorkloadItem + err := json.Unmarshal(body, &avwi) + return avwi, err + } +} +func unmarshalBasicAzureVMWorkloadItemArray(body []byte) ([]BasicAzureVMWorkloadItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + avwiArray := make([]BasicAzureVMWorkloadItem, len(rawMessages)) + + for index, rawMessage := range rawMessages { + avwi, err := unmarshalBasicAzureVMWorkloadItem(*rawMessage) + if err != nil { + return nil, err + } + avwiArray[index] = avwi + } + return avwiArray, nil +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) MarshalJSON() ([]byte, error) { + avwi.WorkloadItemType = WorkloadItemTypeAzureVMWorkloadItem + objectMap := make(map[string]interface{}) + if avwi.ParentName != nil { + objectMap["parentName"] = avwi.ParentName + } + if avwi.ServerName != nil { + objectMap["serverName"] = avwi.ServerName + } + if avwi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwi.IsAutoProtectable + } + if avwi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwi.Subinquireditemcount + } + if avwi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwi.SubWorkloadItemCount + } + if avwi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwi.BackupManagementType + } + if avwi.WorkloadType != nil { + objectMap["workloadType"] = avwi.WorkloadType + } + if avwi.FriendlyName != nil { + objectMap["friendlyName"] = avwi.FriendlyName + } + if avwi.ProtectionState != "" { + objectMap["protectionState"] = avwi.ProtectionState + } + if avwi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwi.WorkloadItemType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { + return &avwi, true +} + +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwi, true +} + +// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { + return nil, false +} + +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { + return nil, false +} + +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwi, true +} + +// BasicAzureVMWorkloadProtectableItem azure VM workload-specific protectable item. +type BasicAzureVMWorkloadProtectableItem interface { + AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) + AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) + AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) + AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) + AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) + AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) + AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +} + +// AzureVMWorkloadProtectableItem azure VM workload-specific protectable item. +type AzureVMWorkloadProtectableItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent + // Only Applicable for data bases where the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + 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 + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + // Prebackupvalidation - Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +func unmarshalBasicAzureVMWorkloadProtectableItem(body []byte) (BasicAzureVMWorkloadProtectableItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectableItemType"] { + case string(ProtectableItemTypeSAPAseSystem): + var avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem + err := json.Unmarshal(body, &avwsaspi) + return avwsaspi, err + case string(ProtectableItemTypeSAPHanaDatabase): + var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem + err := json.Unmarshal(body, &avwshdpi) + return avwshdpi, err + case string(ProtectableItemTypeSAPHanaSystem): + var avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem + err := json.Unmarshal(body, &avwshspi) + return avwshspi, err + case string(ProtectableItemTypeSQLAvailabilityGroupContainer): + var avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem + err := json.Unmarshal(body, &avwsagpi) + return avwsagpi, err + case string(ProtectableItemTypeSQLDataBase): + var avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem + err := json.Unmarshal(body, &avwsdpi) + return avwsdpi, err + case string(ProtectableItemTypeSQLInstance): + var avwsipi AzureVMWorkloadSQLInstanceProtectableItem + err := json.Unmarshal(body, &avwsipi) + return avwsipi, err + default: + var avwpi AzureVMWorkloadProtectableItem + err := json.Unmarshal(body, &avwpi) + return avwpi, err + } +} +func unmarshalBasicAzureVMWorkloadProtectableItemArray(body []byte) ([]BasicAzureVMWorkloadProtectableItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + avwpiArray := make([]BasicAzureVMWorkloadProtectableItem, len(rawMessages)) + + for index, rawMessage := range rawMessages { + avwpi, err := unmarshalBasicAzureVMWorkloadProtectableItem(*rawMessage) + if err != nil { + return nil, err + } + avwpiArray[index] = avwpi + } + return avwpiArray, nil +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) MarshalJSON() ([]byte, error) { + avwpi.ProtectableItemType = ProtectableItemTypeAzureVMWorkloadProtectableItem + objectMap := make(map[string]interface{}) + if avwpi.ParentName != nil { + objectMap["parentName"] = avwpi.ParentName + } + if avwpi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwpi.ParentUniqueName + } + if avwpi.ServerName != nil { + objectMap["serverName"] = avwpi.ServerName + } + if avwpi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwpi.IsAutoProtectable + } + if avwpi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwpi.IsAutoProtected + } + if avwpi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwpi.Subinquireditemcount + } + if avwpi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwpi.Subprotectableitemcount + } + if avwpi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwpi.Prebackupvalidation + } + if avwpi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwpi.BackupManagementType + } + if avwpi.WorkloadType != nil { + objectMap["workloadType"] = avwpi.WorkloadType + } + if avwpi.FriendlyName != nil { + objectMap["friendlyName"] = avwpi.FriendlyName + } + if avwpi.ProtectionState != "" { + objectMap["protectionState"] = avwpi.ProtectionState + } + if avwpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwpi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return &avwpi, true +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwpi, true +} + +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwpi, true +} + +// BasicAzureVMWorkloadProtectedItem azure VM workload-specific protected item. +type BasicAzureVMWorkloadProtectedItem interface { + AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) + AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) + AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) + AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) +} + +// AzureVMWorkloadProtectedItem azure VM workload-specific protected item. +type AzureVMWorkloadProtectedItem struct { + // FriendlyName - Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // ParentName - Parent name of the DB such as Instance or Availability Group. + ParentName *string `json:"parentName,omitempty"` + // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed + ParentType *string `json:"parentType,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' + LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // LastBackupErrorDetail - Error details in last backup + LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` + // ProtectedItemDataSourceID - Data ID of the protected item. + ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` + // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' + ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // KpisHealths - Health details of different KPIs + KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +func unmarshalBasicAzureVMWorkloadProtectedItem(body []byte) (BasicAzureVMWorkloadProtectedItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectedItemType"] { + case string(ProtectedItemTypeAzureVMWorkloadSAPAseDatabase): + var avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem + err := json.Unmarshal(body, &avwsadpi) + return avwsadpi, err + case string(ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase): + var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem + err := json.Unmarshal(body, &avwshdpi) + return avwshdpi, err + case string(ProtectedItemTypeAzureVMWorkloadSQLDatabase): + var avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem + err := json.Unmarshal(body, &avwsdpi) + return avwsdpi, err + default: + var avwpi AzureVMWorkloadProtectedItem + err := json.Unmarshal(body, &avwpi) + return avwpi, err + } +} +func unmarshalBasicAzureVMWorkloadProtectedItemArray(body []byte) ([]BasicAzureVMWorkloadProtectedItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + avwpiArray := make([]BasicAzureVMWorkloadProtectedItem, len(rawMessages)) + + for index, rawMessage := range rawMessages { + avwpi, err := unmarshalBasicAzureVMWorkloadProtectedItem(*rawMessage) + if err != nil { + return nil, err + } + avwpiArray[index] = avwpi + } + return avwpiArray, nil +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) MarshalJSON() ([]byte, error) { + avwpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadProtectedItem + objectMap := make(map[string]interface{}) + if avwpi.FriendlyName != nil { + objectMap["friendlyName"] = avwpi.FriendlyName + } + if avwpi.ServerName != nil { + objectMap["serverName"] = avwpi.ServerName + } + if avwpi.ParentName != nil { + objectMap["parentName"] = avwpi.ParentName + } + if avwpi.ParentType != nil { + objectMap["parentType"] = avwpi.ParentType + } + if avwpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = avwpi.ProtectionStatus + } + if avwpi.ProtectionState != "" { + objectMap["protectionState"] = avwpi.ProtectionState + } + if avwpi.LastBackupStatus != "" { + objectMap["lastBackupStatus"] = avwpi.LastBackupStatus + } + if avwpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = avwpi.LastBackupTime + } + if avwpi.LastBackupErrorDetail != nil { + objectMap["lastBackupErrorDetail"] = avwpi.LastBackupErrorDetail + } + if avwpi.ProtectedItemDataSourceID != nil { + objectMap["protectedItemDataSourceId"] = avwpi.ProtectedItemDataSourceID + } + if avwpi.ProtectedItemHealthStatus != "" { + objectMap["protectedItemHealthStatus"] = avwpi.ProtectedItemHealthStatus + } + if avwpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = avwpi.ExtendedInfo + } + if avwpi.KpisHealths != nil { + objectMap["kpisHealths"] = avwpi.KpisHealths + } + if avwpi.BackupManagementType != "" { + objectMap["backupManagementType"] = avwpi.BackupManagementType + } + if avwpi.WorkloadType != "" { + objectMap["workloadType"] = avwpi.WorkloadType + } + if avwpi.ContainerName != nil { + objectMap["containerName"] = avwpi.ContainerName + } + if avwpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = avwpi.SourceResourceID + } + if avwpi.PolicyID != nil { + objectMap["policyId"] = avwpi.PolicyID + } + if avwpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = avwpi.LastRecoveryPoint + } + if avwpi.BackupSetName != nil { + objectMap["backupSetName"] = avwpi.BackupSetName + } + if avwpi.CreateMode != "" { + objectMap["createMode"] = avwpi.CreateMode + } + if avwpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = avwpi.DeferredDeleteTimeInUTC + } + if avwpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = avwpi.IsScheduledForDeferredDelete + } + if avwpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = avwpi.DeferredDeleteTimeRemaining + } + if avwpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = avwpi.IsDeferredDeleteScheduleUpcoming + } + if avwpi.IsRehydrate != nil { + objectMap["isRehydrate"] = avwpi.IsRehydrate + } + if avwpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = avwpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return &avwpi, true +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return &avwpi, true +} + +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &avwpi, true +} + +// AzureVMWorkloadProtectedItemExtendedInfo additional information on Azure Workload for SQL specific +// backup item. +type AzureVMWorkloadProtectedItemExtendedInfo struct { + // OldestRecoveryPoint - The oldest backup copy available for this backup item. + OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` + // RecoveryPointCount - Number of backup copies available for this backup item. + RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` + // PolicyState - Indicates consistency of policy object and policy applied to this backup item. + PolicyState *string `json:"policyState,omitempty"` +} + +// AzureVMWorkloadProtectionPolicy azure VM (Mercury) workload-specific backup policy. +type AzureVMWorkloadProtectionPolicy struct { + // 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', 'WorkloadTypeSAPAseDatabase' + 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 + SubProtectionPolicy *[]SubProtectionPolicy `json:"subProtectionPolicy,omitempty"` + // MakePolicyConsistent - Fix the policy inconsistency + MakePolicyConsistent *bool `json:"makePolicyConsistent,omitempty"` + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) MarshalJSON() ([]byte, error) { + avwpp.BackupManagementType = BackupManagementTypeAzureWorkload + objectMap := make(map[string]interface{}) + if avwpp.WorkLoadType != "" { + objectMap["workLoadType"] = avwpp.WorkLoadType + } + if avwpp.Settings != nil { + objectMap["settings"] = avwpp.Settings + } + if avwpp.SubProtectionPolicy != nil { + objectMap["subProtectionPolicy"] = avwpp.SubProtectionPolicy + } + if avwpp.MakePolicyConsistent != nil { + objectMap["makePolicyConsistent"] = avwpp.MakePolicyConsistent + } + if avwpp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = avwpp.ProtectedItemsCount + } + if avwpp.BackupManagementType != "" { + objectMap["backupManagementType"] = avwpp.BackupManagementType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return &avwpp, true +} + +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { + return nil, false +} + +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { + return nil, false +} + +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { + return nil, false +} + +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { + return nil, false +} + +// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { + return nil, false +} + +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &avwpp, true +} + +// AzureVMWorkloadSAPAseDatabaseProtectedItem azure VM workload-specific protected item representing SAP +// ASE Database. +type AzureVMWorkloadSAPAseDatabaseProtectedItem struct { + // FriendlyName - Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // ParentName - Parent name of the DB such as Instance or Availability Group. + ParentName *string `json:"parentName,omitempty"` + // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed + ParentType *string `json:"parentType,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' + LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // LastBackupErrorDetail - Error details in last backup + LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` + // ProtectedItemDataSourceID - Data ID of the protected item. + ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` + // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' + ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // KpisHealths - Health details of different KPIs + KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) MarshalJSON() ([]byte, error) { + avwsadpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadSAPAseDatabase + objectMap := make(map[string]interface{}) + if avwsadpi.FriendlyName != nil { + objectMap["friendlyName"] = avwsadpi.FriendlyName + } + if avwsadpi.ServerName != nil { + objectMap["serverName"] = avwsadpi.ServerName + } + if avwsadpi.ParentName != nil { + objectMap["parentName"] = avwsadpi.ParentName + } + if avwsadpi.ParentType != nil { + objectMap["parentType"] = avwsadpi.ParentType + } + if avwsadpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = avwsadpi.ProtectionStatus + } + if avwsadpi.ProtectionState != "" { + objectMap["protectionState"] = avwsadpi.ProtectionState + } + if avwsadpi.LastBackupStatus != "" { + objectMap["lastBackupStatus"] = avwsadpi.LastBackupStatus + } + if avwsadpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = avwsadpi.LastBackupTime + } + if avwsadpi.LastBackupErrorDetail != nil { + objectMap["lastBackupErrorDetail"] = avwsadpi.LastBackupErrorDetail + } + if avwsadpi.ProtectedItemDataSourceID != nil { + objectMap["protectedItemDataSourceId"] = avwsadpi.ProtectedItemDataSourceID + } + if avwsadpi.ProtectedItemHealthStatus != "" { + objectMap["protectedItemHealthStatus"] = avwsadpi.ProtectedItemHealthStatus + } + if avwsadpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = avwsadpi.ExtendedInfo + } + if avwsadpi.KpisHealths != nil { + objectMap["kpisHealths"] = avwsadpi.KpisHealths + } + if avwsadpi.BackupManagementType != "" { + objectMap["backupManagementType"] = avwsadpi.BackupManagementType + } + if avwsadpi.WorkloadType != "" { + objectMap["workloadType"] = avwsadpi.WorkloadType + } + if avwsadpi.ContainerName != nil { + objectMap["containerName"] = avwsadpi.ContainerName + } + if avwsadpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = avwsadpi.SourceResourceID + } + if avwsadpi.PolicyID != nil { + objectMap["policyId"] = avwsadpi.PolicyID + } + if avwsadpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = avwsadpi.LastRecoveryPoint + } + if avwsadpi.BackupSetName != nil { + objectMap["backupSetName"] = avwsadpi.BackupSetName + } + if avwsadpi.CreateMode != "" { + objectMap["createMode"] = avwsadpi.CreateMode + } + if avwsadpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = avwsadpi.DeferredDeleteTimeInUTC + } + if avwsadpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = avwsadpi.IsScheduledForDeferredDelete + } + if avwsadpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = avwsadpi.DeferredDeleteTimeRemaining + } + if avwsadpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = avwsadpi.IsDeferredDeleteScheduleUpcoming + } + if avwsadpi.IsRehydrate != nil { + objectMap["isRehydrate"] = avwsadpi.IsRehydrate + } + if avwsadpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = avwsadpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return &avwsadpi, true +} + +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return &avwsadpi, true +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &avwsadpi, true +} + +// AzureVMWorkloadSAPAseDatabaseWorkloadItem azure VM workload-specific workload item representing SAP ASE +// Database. +type AzureVMWorkloadSAPAseDatabaseWorkloadItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if workload item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected + SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { + avwsadwi.WorkloadItemType = WorkloadItemTypeSAPAseDatabase1 + objectMap := make(map[string]interface{}) + if avwsadwi.ParentName != nil { + objectMap["parentName"] = avwsadwi.ParentName + } + if avwsadwi.ServerName != nil { + objectMap["serverName"] = avwsadwi.ServerName + } + if avwsadwi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsadwi.IsAutoProtectable + } + if avwsadwi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsadwi.Subinquireditemcount + } + if avwsadwi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwsadwi.SubWorkloadItemCount + } + if avwsadwi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsadwi.BackupManagementType + } + if avwsadwi.WorkloadType != nil { + objectMap["workloadType"] = avwsadwi.WorkloadType + } + if avwsadwi.FriendlyName != nil { + objectMap["friendlyName"] = avwsadwi.FriendlyName + } + if avwsadwi.ProtectionState != "" { + objectMap["protectionState"] = avwsadwi.ProtectionState + } + if avwsadwi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwsadwi.WorkloadItemType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwsadwi, true +} + +// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { + return &avwsadwi, true +} + +// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { + return nil, false +} + +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { + return nil, false +} + +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwsadwi, true +} + +// AzureVMWorkloadSAPAseSystemProtectableItem azure VM workload-specific protectable item representing SAP +// ASE System. +type AzureVMWorkloadSAPAseSystemProtectableItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent + // Only Applicable for data bases where the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + 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 + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + // Prebackupvalidation - Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) MarshalJSON() ([]byte, error) { + avwsaspi.ProtectableItemType = ProtectableItemTypeSAPAseSystem + objectMap := make(map[string]interface{}) + if avwsaspi.ParentName != nil { + objectMap["parentName"] = avwsaspi.ParentName + } + if avwsaspi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwsaspi.ParentUniqueName + } + if avwsaspi.ServerName != nil { + objectMap["serverName"] = avwsaspi.ServerName + } + if avwsaspi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsaspi.IsAutoProtectable + } + if avwsaspi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwsaspi.IsAutoProtected + } + if avwsaspi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsaspi.Subinquireditemcount + } + if avwsaspi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwsaspi.Subprotectableitemcount + } + if avwsaspi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwsaspi.Prebackupvalidation + } + if avwsaspi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsaspi.BackupManagementType + } + if avwsaspi.WorkloadType != nil { + objectMap["workloadType"] = avwsaspi.WorkloadType + } + if avwsaspi.FriendlyName != nil { + objectMap["friendlyName"] = avwsaspi.FriendlyName + } + if avwsaspi.ProtectionState != "" { + objectMap["protectionState"] = avwsaspi.ProtectionState + } + if avwsaspi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwsaspi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwsaspi, true +} + +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { + return &avwsaspi, true +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwsaspi, true +} + +// AzureVMWorkloadSAPAseSystemWorkloadItem azure VM workload-specific workload item representing SAP ASE +// System. +type AzureVMWorkloadSAPAseSystemWorkloadItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if workload item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected + SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) MarshalJSON() ([]byte, error) { + avwsaswi.WorkloadItemType = WorkloadItemTypeSAPAseSystem1 + objectMap := make(map[string]interface{}) + if avwsaswi.ParentName != nil { + objectMap["parentName"] = avwsaswi.ParentName + } + if avwsaswi.ServerName != nil { + objectMap["serverName"] = avwsaswi.ServerName + } + if avwsaswi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsaswi.IsAutoProtectable + } + if avwsaswi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsaswi.Subinquireditemcount + } + if avwsaswi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwsaswi.SubWorkloadItemCount + } + if avwsaswi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsaswi.BackupManagementType + } + if avwsaswi.WorkloadType != nil { + objectMap["workloadType"] = avwsaswi.WorkloadType + } + if avwsaswi.FriendlyName != nil { + objectMap["friendlyName"] = avwsaswi.FriendlyName + } + if avwsaswi.ProtectionState != "" { + objectMap["protectionState"] = avwsaswi.ProtectionState + } + if avwsaswi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwsaswi.WorkloadItemType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwsaswi, true +} + +// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { + return &avwsaswi, true +} + +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { + return nil, false +} + +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { + return nil, false +} + +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwsaswi, true +} + +// AzureVMWorkloadSAPHanaDatabaseProtectableItem azure VM workload-specific protectable item representing +// SAP HANA Database. +type AzureVMWorkloadSAPHanaDatabaseProtectableItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent + // Only Applicable for data bases where the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + 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 + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + // Prebackupvalidation - Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) MarshalJSON() ([]byte, error) { + avwshdpi.ProtectableItemType = ProtectableItemTypeSAPHanaDatabase + objectMap := make(map[string]interface{}) + if avwshdpi.ParentName != nil { + objectMap["parentName"] = avwshdpi.ParentName + } + if avwshdpi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwshdpi.ParentUniqueName + } + if avwshdpi.ServerName != nil { + objectMap["serverName"] = avwshdpi.ServerName + } + if avwshdpi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwshdpi.IsAutoProtectable + } + if avwshdpi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwshdpi.IsAutoProtected + } + if avwshdpi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwshdpi.Subinquireditemcount + } + if avwshdpi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwshdpi.Subprotectableitemcount + } + if avwshdpi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwshdpi.Prebackupvalidation + } + if avwshdpi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwshdpi.BackupManagementType + } + if avwshdpi.WorkloadType != nil { + objectMap["workloadType"] = avwshdpi.WorkloadType + } + if avwshdpi.FriendlyName != nil { + objectMap["friendlyName"] = avwshdpi.FriendlyName + } + if avwshdpi.ProtectionState != "" { + objectMap["protectionState"] = avwshdpi.ProtectionState + } + if avwshdpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwshdpi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwshdpi, true +} + +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return &avwshdpi, true +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwshdpi, true +} + +// AzureVMWorkloadSAPHanaDatabaseProtectedItem azure VM workload-specific protected item representing SAP +// HANA Database. +type AzureVMWorkloadSAPHanaDatabaseProtectedItem struct { + // FriendlyName - Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // ParentName - Parent name of the DB such as Instance or Availability Group. + ParentName *string `json:"parentName,omitempty"` + // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed + ParentType *string `json:"parentType,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' + LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // LastBackupErrorDetail - Error details in last backup + LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` + // ProtectedItemDataSourceID - Data ID of the protected item. + ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` + // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' + ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // KpisHealths - Health details of different KPIs + KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) MarshalJSON() ([]byte, error) { + avwshdpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase + objectMap := make(map[string]interface{}) + if avwshdpi.FriendlyName != nil { + objectMap["friendlyName"] = avwshdpi.FriendlyName + } + if avwshdpi.ServerName != nil { + objectMap["serverName"] = avwshdpi.ServerName + } + if avwshdpi.ParentName != nil { + objectMap["parentName"] = avwshdpi.ParentName + } + if avwshdpi.ParentType != nil { + objectMap["parentType"] = avwshdpi.ParentType + } + if avwshdpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = avwshdpi.ProtectionStatus + } + if avwshdpi.ProtectionState != "" { + objectMap["protectionState"] = avwshdpi.ProtectionState + } + if avwshdpi.LastBackupStatus != "" { + objectMap["lastBackupStatus"] = avwshdpi.LastBackupStatus + } + if avwshdpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = avwshdpi.LastBackupTime + } + if avwshdpi.LastBackupErrorDetail != nil { + objectMap["lastBackupErrorDetail"] = avwshdpi.LastBackupErrorDetail + } + if avwshdpi.ProtectedItemDataSourceID != nil { + objectMap["protectedItemDataSourceId"] = avwshdpi.ProtectedItemDataSourceID + } + if avwshdpi.ProtectedItemHealthStatus != "" { + objectMap["protectedItemHealthStatus"] = avwshdpi.ProtectedItemHealthStatus + } + if avwshdpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = avwshdpi.ExtendedInfo + } + if avwshdpi.KpisHealths != nil { + objectMap["kpisHealths"] = avwshdpi.KpisHealths + } + if avwshdpi.BackupManagementType != "" { + objectMap["backupManagementType"] = avwshdpi.BackupManagementType + } + if avwshdpi.WorkloadType != "" { + objectMap["workloadType"] = avwshdpi.WorkloadType + } + if avwshdpi.ContainerName != nil { + objectMap["containerName"] = avwshdpi.ContainerName + } + if avwshdpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = avwshdpi.SourceResourceID + } + if avwshdpi.PolicyID != nil { + objectMap["policyId"] = avwshdpi.PolicyID + } + if avwshdpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = avwshdpi.LastRecoveryPoint + } + if avwshdpi.BackupSetName != nil { + objectMap["backupSetName"] = avwshdpi.BackupSetName + } + if avwshdpi.CreateMode != "" { + objectMap["createMode"] = avwshdpi.CreateMode + } + if avwshdpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = avwshdpi.DeferredDeleteTimeInUTC + } + if avwshdpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = avwshdpi.IsScheduledForDeferredDelete + } + if avwshdpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = avwshdpi.DeferredDeleteTimeRemaining + } + if avwshdpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = avwshdpi.IsDeferredDeleteScheduleUpcoming + } + if avwshdpi.IsRehydrate != nil { + objectMap["isRehydrate"] = avwshdpi.IsRehydrate + } + if avwshdpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = avwshdpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return &avwshdpi, true +} + +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return &avwshdpi, true +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &avwshdpi, true +} + +// AzureVMWorkloadSAPHanaDatabaseWorkloadItem azure VM workload-specific workload item representing SAP +// HANA Database. +type AzureVMWorkloadSAPHanaDatabaseWorkloadItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if workload item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected + SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { + avwshdwi.WorkloadItemType = WorkloadItemTypeSAPHanaDatabase1 + objectMap := make(map[string]interface{}) + if avwshdwi.ParentName != nil { + objectMap["parentName"] = avwshdwi.ParentName + } + if avwshdwi.ServerName != nil { + objectMap["serverName"] = avwshdwi.ServerName + } + if avwshdwi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwshdwi.IsAutoProtectable + } + if avwshdwi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwshdwi.Subinquireditemcount + } + if avwshdwi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwshdwi.SubWorkloadItemCount + } + if avwshdwi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwshdwi.BackupManagementType + } + if avwshdwi.WorkloadType != nil { + objectMap["workloadType"] = avwshdwi.WorkloadType + } + if avwshdwi.FriendlyName != nil { + objectMap["friendlyName"] = avwshdwi.FriendlyName + } + if avwshdwi.ProtectionState != "" { + objectMap["protectionState"] = avwshdwi.ProtectionState + } + if avwshdwi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwshdwi.WorkloadItemType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwshdwi, true +} + +// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return &avwshdwi, true +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { + return nil, false +} + +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { + return nil, false +} + +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwshdwi, true +} + +// AzureVMWorkloadSAPHanaSystemProtectableItem azure VM workload-specific protectable item representing SAP +// HANA System. +type AzureVMWorkloadSAPHanaSystemProtectableItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent + // Only Applicable for data bases where the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + 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 + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + // Prebackupvalidation - Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) MarshalJSON() ([]byte, error) { + avwshspi.ProtectableItemType = ProtectableItemTypeSAPHanaSystem + objectMap := make(map[string]interface{}) + if avwshspi.ParentName != nil { + objectMap["parentName"] = avwshspi.ParentName + } + if avwshspi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwshspi.ParentUniqueName + } + if avwshspi.ServerName != nil { + objectMap["serverName"] = avwshspi.ServerName + } + if avwshspi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwshspi.IsAutoProtectable + } + if avwshspi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwshspi.IsAutoProtected + } + if avwshspi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwshspi.Subinquireditemcount + } + if avwshspi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwshspi.Subprotectableitemcount + } + if avwshspi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwshspi.Prebackupvalidation + } + if avwshspi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwshspi.BackupManagementType + } + if avwshspi.WorkloadType != nil { + objectMap["workloadType"] = avwshspi.WorkloadType + } + if avwshspi.FriendlyName != nil { + objectMap["friendlyName"] = avwshspi.FriendlyName + } + if avwshspi.ProtectionState != "" { + objectMap["protectionState"] = avwshspi.ProtectionState + } + if avwshspi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwshspi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwshspi, true +} + +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return &avwshspi, true +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwshspi, true +} + +// AzureVMWorkloadSAPHanaSystemWorkloadItem azure VM workload-specific workload item representing SAP HANA +// System. +type AzureVMWorkloadSAPHanaSystemWorkloadItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if workload item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected + SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) MarshalJSON() ([]byte, error) { + avwshswi.WorkloadItemType = WorkloadItemTypeSAPHanaSystem1 + objectMap := make(map[string]interface{}) + if avwshswi.ParentName != nil { + objectMap["parentName"] = avwshswi.ParentName + } + if avwshswi.ServerName != nil { + objectMap["serverName"] = avwshswi.ServerName + } + if avwshswi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwshswi.IsAutoProtectable + } + if avwshswi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwshswi.Subinquireditemcount + } + if avwshswi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwshswi.SubWorkloadItemCount + } + if avwshswi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwshswi.BackupManagementType + } + if avwshswi.WorkloadType != nil { + objectMap["workloadType"] = avwshswi.WorkloadType + } + if avwshswi.FriendlyName != nil { + objectMap["friendlyName"] = avwshswi.FriendlyName + } + if avwshswi.ProtectionState != "" { + objectMap["protectionState"] = avwshswi.ProtectionState + } + if avwshswi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwshswi.WorkloadItemType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwshswi, true +} + +// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return &avwshswi, true +} + +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { + return nil, false +} + +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { + return nil, false +} + +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwshswi, true +} + +// AzureVMWorkloadSQLAvailabilityGroupProtectableItem azure VM workload-specific protectable item +// representing SQL Availability Group. +type AzureVMWorkloadSQLAvailabilityGroupProtectableItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent + // Only Applicable for data bases where the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + 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 + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + // Prebackupvalidation - Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) MarshalJSON() ([]byte, error) { + avwsagpi.ProtectableItemType = ProtectableItemTypeSQLAvailabilityGroupContainer + objectMap := make(map[string]interface{}) + if avwsagpi.ParentName != nil { + objectMap["parentName"] = avwsagpi.ParentName + } + if avwsagpi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwsagpi.ParentUniqueName + } + if avwsagpi.ServerName != nil { + objectMap["serverName"] = avwsagpi.ServerName + } + if avwsagpi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsagpi.IsAutoProtectable + } + if avwsagpi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwsagpi.IsAutoProtected + } + if avwsagpi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsagpi.Subinquireditemcount + } + if avwsagpi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwsagpi.Subprotectableitemcount + } + if avwsagpi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwsagpi.Prebackupvalidation + } + if avwsagpi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsagpi.BackupManagementType + } + if avwsagpi.WorkloadType != nil { + objectMap["workloadType"] = avwsagpi.WorkloadType + } + if avwsagpi.FriendlyName != nil { + objectMap["friendlyName"] = avwsagpi.FriendlyName + } + if avwsagpi.ProtectionState != "" { + objectMap["protectionState"] = avwsagpi.ProtectionState + } + if avwsagpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwsagpi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwsagpi, true +} + +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return &avwsagpi, true +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwsagpi, true +} + +// AzureVMWorkloadSQLDatabaseProtectableItem azure VM workload-specific protectable item representing SQL +// Database. +type AzureVMWorkloadSQLDatabaseProtectableItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent + // Only Applicable for data bases where the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + 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 + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + // Prebackupvalidation - Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) MarshalJSON() ([]byte, error) { + avwsdpi.ProtectableItemType = ProtectableItemTypeSQLDataBase + objectMap := make(map[string]interface{}) + if avwsdpi.ParentName != nil { + objectMap["parentName"] = avwsdpi.ParentName + } + if avwsdpi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwsdpi.ParentUniqueName + } + if avwsdpi.ServerName != nil { + objectMap["serverName"] = avwsdpi.ServerName + } + if avwsdpi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsdpi.IsAutoProtectable + } + if avwsdpi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwsdpi.IsAutoProtected + } + if avwsdpi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsdpi.Subinquireditemcount + } + if avwsdpi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwsdpi.Subprotectableitemcount + } + if avwsdpi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwsdpi.Prebackupvalidation + } + if avwsdpi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsdpi.BackupManagementType + } + if avwsdpi.WorkloadType != nil { + objectMap["workloadType"] = avwsdpi.WorkloadType + } + if avwsdpi.FriendlyName != nil { + objectMap["friendlyName"] = avwsdpi.FriendlyName + } + if avwsdpi.ProtectionState != "" { + objectMap["protectionState"] = avwsdpi.ProtectionState + } + if avwsdpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwsdpi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwsdpi, true +} + +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return &avwsdpi, true +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwsdpi, true +} + +// AzureVMWorkloadSQLDatabaseProtectedItem azure VM workload-specific protected item representing SQL +// Database. +type AzureVMWorkloadSQLDatabaseProtectedItem struct { + // FriendlyName - Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // ParentName - Parent name of the DB such as Instance or Availability Group. + ParentName *string `json:"parentName,omitempty"` + // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed + ParentType *string `json:"parentType,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' + LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // LastBackupErrorDetail - Error details in last backup + LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` + // ProtectedItemDataSourceID - Data ID of the protected item. + ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` + // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' + ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // KpisHealths - Health details of different KPIs + KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) MarshalJSON() ([]byte, error) { + avwsdpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadSQLDatabase + objectMap := make(map[string]interface{}) + if avwsdpi.FriendlyName != nil { + objectMap["friendlyName"] = avwsdpi.FriendlyName + } + if avwsdpi.ServerName != nil { + objectMap["serverName"] = avwsdpi.ServerName + } + if avwsdpi.ParentName != nil { + objectMap["parentName"] = avwsdpi.ParentName + } + if avwsdpi.ParentType != nil { + objectMap["parentType"] = avwsdpi.ParentType + } + if avwsdpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = avwsdpi.ProtectionStatus + } + if avwsdpi.ProtectionState != "" { + objectMap["protectionState"] = avwsdpi.ProtectionState + } + if avwsdpi.LastBackupStatus != "" { + objectMap["lastBackupStatus"] = avwsdpi.LastBackupStatus + } + if avwsdpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = avwsdpi.LastBackupTime + } + if avwsdpi.LastBackupErrorDetail != nil { + objectMap["lastBackupErrorDetail"] = avwsdpi.LastBackupErrorDetail + } + if avwsdpi.ProtectedItemDataSourceID != nil { + objectMap["protectedItemDataSourceId"] = avwsdpi.ProtectedItemDataSourceID + } + if avwsdpi.ProtectedItemHealthStatus != "" { + objectMap["protectedItemHealthStatus"] = avwsdpi.ProtectedItemHealthStatus + } + if avwsdpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = avwsdpi.ExtendedInfo + } + if avwsdpi.KpisHealths != nil { + objectMap["kpisHealths"] = avwsdpi.KpisHealths + } + if avwsdpi.BackupManagementType != "" { + objectMap["backupManagementType"] = avwsdpi.BackupManagementType + } + if avwsdpi.WorkloadType != "" { + objectMap["workloadType"] = avwsdpi.WorkloadType + } + if avwsdpi.ContainerName != nil { + objectMap["containerName"] = avwsdpi.ContainerName + } + if avwsdpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = avwsdpi.SourceResourceID + } + if avwsdpi.PolicyID != nil { + objectMap["policyId"] = avwsdpi.PolicyID + } + if avwsdpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = avwsdpi.LastRecoveryPoint + } + if avwsdpi.BackupSetName != nil { + objectMap["backupSetName"] = avwsdpi.BackupSetName + } + if avwsdpi.CreateMode != "" { + objectMap["createMode"] = avwsdpi.CreateMode + } + if avwsdpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = avwsdpi.DeferredDeleteTimeInUTC + } + if avwsdpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = avwsdpi.IsScheduledForDeferredDelete + } + if avwsdpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = avwsdpi.DeferredDeleteTimeRemaining + } + if avwsdpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = avwsdpi.IsDeferredDeleteScheduleUpcoming + } + if avwsdpi.IsRehydrate != nil { + objectMap["isRehydrate"] = avwsdpi.IsRehydrate + } + if avwsdpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = avwsdpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return &avwsdpi, true +} + +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return &avwsdpi, true +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &avwsdpi, true +} + +// AzureVMWorkloadSQLDatabaseWorkloadItem azure VM workload-specific workload item representing SQL +// Database. +type AzureVMWorkloadSQLDatabaseWorkloadItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if workload item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected + SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { + avwsdwi.WorkloadItemType = WorkloadItemTypeSQLDataBase1 + objectMap := make(map[string]interface{}) + if avwsdwi.ParentName != nil { + objectMap["parentName"] = avwsdwi.ParentName + } + if avwsdwi.ServerName != nil { + objectMap["serverName"] = avwsdwi.ServerName + } + if avwsdwi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsdwi.IsAutoProtectable + } + if avwsdwi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsdwi.Subinquireditemcount + } + if avwsdwi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwsdwi.SubWorkloadItemCount + } + if avwsdwi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsdwi.BackupManagementType + } + if avwsdwi.WorkloadType != nil { + objectMap["workloadType"] = avwsdwi.WorkloadType + } + if avwsdwi.FriendlyName != nil { + objectMap["friendlyName"] = avwsdwi.FriendlyName + } + if avwsdwi.ProtectionState != "" { + objectMap["protectionState"] = avwsdwi.ProtectionState + } + if avwsdwi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwsdwi.WorkloadItemType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwsdwi, true +} + +// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { + return &avwsdwi, true +} + +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { + return nil, false +} + +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { + return nil, false +} + +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwsdwi, true +} + +// AzureVMWorkloadSQLInstanceProtectableItem azure VM workload-specific protectable item representing SQL +// Instance. +type AzureVMWorkloadSQLInstanceProtectableItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent + // Only Applicable for data bases where the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + 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 + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + // Prebackupvalidation - Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) MarshalJSON() ([]byte, error) { + avwsipi.ProtectableItemType = ProtectableItemTypeSQLInstance + objectMap := make(map[string]interface{}) + if avwsipi.ParentName != nil { + objectMap["parentName"] = avwsipi.ParentName + } + if avwsipi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwsipi.ParentUniqueName + } + if avwsipi.ServerName != nil { + objectMap["serverName"] = avwsipi.ServerName + } + if avwsipi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsipi.IsAutoProtectable + } + if avwsipi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwsipi.IsAutoProtected + } + if avwsipi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsipi.Subinquireditemcount + } + if avwsipi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwsipi.Subprotectableitemcount + } + if avwsipi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwsipi.Prebackupvalidation + } + if avwsipi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsipi.BackupManagementType + } + if avwsipi.WorkloadType != nil { + objectMap["workloadType"] = avwsipi.WorkloadType + } + if avwsipi.FriendlyName != nil { + objectMap["friendlyName"] = avwsipi.FriendlyName + } + if avwsipi.ProtectionState != "" { + objectMap["protectionState"] = avwsipi.ProtectionState + } + if avwsipi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwsipi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwsipi, true +} + +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return &avwsipi, true +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwsipi, true +} + +// AzureVMWorkloadSQLInstanceWorkloadItem azure VM workload-specific workload item representing SQL +// Instance. +type AzureVMWorkloadSQLInstanceWorkloadItem struct { + // DataDirectoryPaths - Data Directory Paths for default directories + DataDirectoryPaths *[]SQLDataDirectory `json:"dataDirectoryPaths,omitempty"` + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if workload item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected + SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) MarshalJSON() ([]byte, error) { + avwsiwi.WorkloadItemType = WorkloadItemTypeSQLInstance1 + objectMap := make(map[string]interface{}) + if avwsiwi.DataDirectoryPaths != nil { + objectMap["dataDirectoryPaths"] = avwsiwi.DataDirectoryPaths + } + if avwsiwi.ParentName != nil { + objectMap["parentName"] = avwsiwi.ParentName + } + if avwsiwi.ServerName != nil { + objectMap["serverName"] = avwsiwi.ServerName + } + if avwsiwi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsiwi.IsAutoProtectable + } + if avwsiwi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsiwi.Subinquireditemcount + } + if avwsiwi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwsiwi.SubWorkloadItemCount + } + if avwsiwi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsiwi.BackupManagementType + } + if avwsiwi.WorkloadType != nil { + objectMap["workloadType"] = avwsiwi.WorkloadType + } + if avwsiwi.FriendlyName != nil { + objectMap["friendlyName"] = avwsiwi.FriendlyName + } + if avwsiwi.ProtectionState != "" { + objectMap["protectionState"] = avwsiwi.ProtectionState + } + if avwsiwi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwsiwi.WorkloadItemType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwsiwi, true +} + +// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { + return &avwsiwi, true +} + +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { + return nil, false +} + +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwsiwi, true +} + +// AzureWorkloadBackupRequest azureWorkload workload-specific backup request. +type AzureWorkloadBackupRequest struct { + // BackupType - Type of backup, viz. Full, Differential, Log or CopyOnlyFull. Possible values include: 'TypeInvalid', 'TypeFull', 'TypeDifferential', 'TypeLog', 'TypeCopyOnlyFull', 'TypeIncremental' + BackupType Type `json:"backupType,omitempty"` + // EnableCompression - Bool for Compression setting + EnableCompression *bool `json:"enableCompression,omitempty"` + // RecoveryPointExpiryTimeInUTC - Backup copy will expire after the time specified (UTC). + RecoveryPointExpiryTimeInUTC *date.Time `json:"recoveryPointExpiryTimeInUTC,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' + ObjectType ObjectTypeBasicRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadBackupRequest. +func (awbr AzureWorkloadBackupRequest) MarshalJSON() ([]byte, error) { + awbr.ObjectType = ObjectTypeAzureWorkloadBackupRequest + objectMap := make(map[string]interface{}) + if awbr.BackupType != "" { + objectMap["backupType"] = awbr.BackupType + } + if awbr.EnableCompression != nil { + objectMap["enableCompression"] = awbr.EnableCompression + } + if awbr.RecoveryPointExpiryTimeInUTC != nil { + objectMap["recoveryPointExpiryTimeInUTC"] = awbr.RecoveryPointExpiryTimeInUTC + } + if awbr.ObjectType != "" { + objectMap["objectType"] = awbr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareBackupRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. +func (awbr AzureWorkloadBackupRequest) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { + return nil, false +} + +// AsAzureWorkloadBackupRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. +func (awbr AzureWorkloadBackupRequest) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { + return &awbr, true +} + +// AsIaasVMBackupRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. +func (awbr AzureWorkloadBackupRequest) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { + return nil, false +} + +// AsRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. +func (awbr AzureWorkloadBackupRequest) AsRequest() (*Request, bool) { + return nil, false +} + +// AsBasicRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. +func (awbr AzureWorkloadBackupRequest) AsBasicRequest() (BasicRequest, bool) { + return &awbr, true +} + +// BasicAzureWorkloadContainer container for the workloads running inside Azure Compute or Classic Compute. +type BasicAzureWorkloadContainer interface { + AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) + AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) + AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +} + +// AzureWorkloadContainer container for the workloads running inside Azure Compute or Classic Compute. +type AzureWorkloadContainer struct { + // SourceResourceID - ARM ID of the virtual machine represented by this Azure Workload Container + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // LastUpdatedTime - Time stamp when this container was updated. + LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` + // ExtendedInfo - Additional details of a workload container. + ExtendedInfo *AzureWorkloadContainerExtendedInfo `json:"extendedInfo,omitempty"` + // WorkloadType - Workload type for which registration was sent. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` + // OperationType - Re-Do Operation. Possible values include: 'OperationTypeInvalid', 'OperationTypeRegister', 'OperationTypeReregister' + OperationType OperationType `json:"operationType,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +func unmarshalBasicAzureWorkloadContainer(body []byte) (BasicAzureWorkloadContainer, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["containerType"] { + case string(ContainerTypeSQLAGWorkLoadContainer1): + var aswcpc AzureSQLAGWorkloadContainerProtectionContainer + err := json.Unmarshal(body, &aswcpc) + return aswcpc, err + case string(ContainerTypeVMAppContainer1): + var avacpc AzureVMAppContainerProtectionContainer + err := json.Unmarshal(body, &avacpc) + return avacpc, err + default: + var awc AzureWorkloadContainer + err := json.Unmarshal(body, &awc) + return awc, err + } +} +func unmarshalBasicAzureWorkloadContainerArray(body []byte) ([]BasicAzureWorkloadContainer, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awcArray := make([]BasicAzureWorkloadContainer, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awc, err := unmarshalBasicAzureWorkloadContainer(*rawMessage) + if err != nil { + return nil, err + } + awcArray[index] = awc + } + return awcArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) MarshalJSON() ([]byte, error) { + awc.ContainerType = ContainerTypeAzureWorkloadContainer + objectMap := make(map[string]interface{}) + if awc.SourceResourceID != nil { + objectMap["sourceResourceId"] = awc.SourceResourceID + } + if awc.LastUpdatedTime != nil { + objectMap["lastUpdatedTime"] = awc.LastUpdatedTime + } + if awc.ExtendedInfo != nil { + objectMap["extendedInfo"] = awc.ExtendedInfo + } + if awc.WorkloadType != "" { + objectMap["workloadType"] = awc.WorkloadType + } + if awc.OperationType != "" { + objectMap["operationType"] = awc.OperationType + } + if awc.FriendlyName != nil { + objectMap["friendlyName"] = awc.FriendlyName + } + if awc.BackupManagementType != "" { + objectMap["backupManagementType"] = awc.BackupManagementType + } + if awc.RegistrationStatus != nil { + objectMap["registrationStatus"] = awc.RegistrationStatus + } + if awc.HealthStatus != nil { + objectMap["healthStatus"] = awc.HealthStatus + } + if awc.ContainerType != "" { + objectMap["containerType"] = awc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return &awc, true +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return &awc, true +} + +// AsDpmContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &awc, true +} + +// AzureWorkloadContainerExtendedInfo extended information of the container. +type AzureWorkloadContainerExtendedInfo struct { + // HostServerName - Host Os Name in case of Stand Alone and Cluster Name in case of distributed container. + HostServerName *string `json:"hostServerName,omitempty"` + // InquiryInfo - Inquiry Status for the container. + InquiryInfo *InquiryInfo `json:"inquiryInfo,omitempty"` + // NodesList - List of the nodes in case of distributed container. + NodesList *[]DistributedNodesInfo `json:"nodesList,omitempty"` +} + +// AzureWorkloadErrorInfo azure storage specific error information +type AzureWorkloadErrorInfo struct { + // ErrorCode - Error code. + ErrorCode *int32 `json:"errorCode,omitempty"` + // ErrorString - Localized error string. + ErrorString *string `json:"errorString,omitempty"` + // ErrorTitle - Title: Typically, the entity that the error pertains to. + ErrorTitle *string `json:"errorTitle,omitempty"` + // Recommendations - List of localized recommendations for above error code. + Recommendations *[]string `json:"recommendations,omitempty"` + // AdditionalDetails - Additional details for above error code. + AdditionalDetails *string `json:"additionalDetails,omitempty"` +} + +// AzureWorkloadJob azure storage specific job. +type AzureWorkloadJob struct { + // WorkloadType - Workload type of the job + WorkloadType *string `json:"workloadType,omitempty"` + // Duration - Time elapsed during the execution of this job. + Duration *string `json:"duration,omitempty"` + // ActionsInfo - Gets or sets the state/actions applicable on this job like cancel/retry. + ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` + // ErrorDetails - Error details on execution of this job. + ErrorDetails *[]AzureWorkloadErrorInfo `json:"errorDetails,omitempty"` + // ExtendedInfo - Additional information about the job. + ExtendedInfo *AzureWorkloadJobExtendedInfo `json:"extendedInfo,omitempty"` + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob', 'JobTypeVaultJob' + JobType JobType `json:"jobType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadJob. +func (awj AzureWorkloadJob) MarshalJSON() ([]byte, error) { + awj.JobType = JobTypeAzureWorkloadJob + objectMap := make(map[string]interface{}) + if awj.WorkloadType != nil { + objectMap["workloadType"] = awj.WorkloadType + } + if awj.Duration != nil { + objectMap["duration"] = awj.Duration + } + if awj.ActionsInfo != nil { + objectMap["actionsInfo"] = awj.ActionsInfo + } + if awj.ErrorDetails != nil { + objectMap["errorDetails"] = awj.ErrorDetails + } + if awj.ExtendedInfo != nil { + objectMap["extendedInfo"] = awj.ExtendedInfo + } + if awj.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = awj.EntityFriendlyName + } + if awj.BackupManagementType != "" { + objectMap["backupManagementType"] = awj.BackupManagementType + } + if awj.Operation != nil { + objectMap["operation"] = awj.Operation + } + if awj.Status != nil { + objectMap["status"] = awj.Status + } + if awj.StartTime != nil { + objectMap["startTime"] = awj.StartTime + } + if awj.EndTime != nil { + objectMap["endTime"] = awj.EndTime + } + if awj.ActivityID != nil { + objectMap["activityId"] = awj.ActivityID + } + if awj.JobType != "" { + objectMap["jobType"] = awj.JobType + } + return json.Marshal(objectMap) +} + +// AsAzureIaaSVMJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { + return nil, false +} + +// AsAzureStorageJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsAzureStorageJob() (*AzureStorageJob, bool) { + return nil, false +} + +// AsAzureWorkloadJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { + return &awj, true +} + +// AsDpmJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsDpmJob() (*DpmJob, bool) { + return nil, false +} + +// AsMabJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsMabJob() (*MabJob, bool) { + return nil, false +} + +// AsVaultJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsVaultJob() (*VaultJob, bool) { + return nil, false +} + +// AsJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsJob() (*Job, bool) { + return nil, false +} + +// AsBasicJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsBasicJob() (BasicJob, bool) { + return &awj, true +} + +// AzureWorkloadJobExtendedInfo azure VM workload-specific additional information for job. +type AzureWorkloadJobExtendedInfo struct { + // TasksList - List of tasks for this job + TasksList *[]AzureWorkloadJobTaskDetails `json:"tasksList,omitempty"` + // PropertyBag - Job properties. + PropertyBag map[string]*string `json:"propertyBag"` + // DynamicErrorMessage - Non localized error message on job execution. + DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadJobExtendedInfo. +func (awjei AzureWorkloadJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if awjei.TasksList != nil { + objectMap["tasksList"] = awjei.TasksList + } + if awjei.PropertyBag != nil { + objectMap["propertyBag"] = awjei.PropertyBag + } + if awjei.DynamicErrorMessage != nil { + objectMap["dynamicErrorMessage"] = awjei.DynamicErrorMessage + } + return json.Marshal(objectMap) +} + +// AzureWorkloadJobTaskDetails azure VM workload specific job task details. +type AzureWorkloadJobTaskDetails struct { + // TaskID - The task display name. + TaskID *string `json:"taskId,omitempty"` + // Status - The status. + Status *string `json:"status,omitempty"` +} + +// BasicAzureWorkloadPointInTimeRecoveryPoint recovery point specific to PointInTime +type BasicAzureWorkloadPointInTimeRecoveryPoint interface { + AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) + AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) +} + +// AzureWorkloadPointInTimeRecoveryPoint recovery point specific to PointInTime +type AzureWorkloadPointInTimeRecoveryPoint struct { + // TimeRanges - List of log ranges + TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` + // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' + Type RestorePointType `json:"type,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +func unmarshalBasicAzureWorkloadPointInTimeRecoveryPoint(body []byte) (BasicAzureWorkloadPointInTimeRecoveryPoint, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): + var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awshpitrp) + return awshpitrp, err + default: + var awpitrp AzureWorkloadPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awpitrp) + return awpitrp, err + } +} +func unmarshalBasicAzureWorkloadPointInTimeRecoveryPointArray(body []byte) ([]BasicAzureWorkloadPointInTimeRecoveryPoint, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awpitrpArray := make([]BasicAzureWorkloadPointInTimeRecoveryPoint, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awpitrp, err := unmarshalBasicAzureWorkloadPointInTimeRecoveryPoint(*rawMessage) + if err != nil { + return nil, err + } + awpitrpArray[index] = awpitrp + } + return awpitrpArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { + awpitrp.ObjectType = ObjectTypeAzureWorkloadPointInTimeRecoveryPoint + objectMap := make(map[string]interface{}) + if awpitrp.TimeRanges != nil { + objectMap["timeRanges"] = awpitrp.TimeRanges + } + if awpitrp.ObjectType != "" { + objectMap["objectType"] = awpitrp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { + return &awpitrp, true +} + +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { + return &awpitrp, true +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return &awpitrp, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awpitrp, true +} + +// AzureWorkloadPointInTimeRestoreRequest azureWorkload SAP Hana -specific restore. Specifically for +// PointInTime/Log restore +type AzureWorkloadPointInTimeRestoreRequest struct { + // PointInTime - PointInTime value + PointInTime *date.Time `json:"pointInTime,omitempty"` + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { + awpitrr.ObjectType = ObjectTypeAzureWorkloadPointInTimeRestoreRequest + objectMap := make(map[string]interface{}) + if awpitrr.PointInTime != nil { + objectMap["pointInTime"] = awpitrr.PointInTime + } + if awpitrr.RecoveryType != "" { + objectMap["recoveryType"] = awpitrr.RecoveryType + } + if awpitrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awpitrr.SourceResourceID + } + if awpitrr.PropertyBag != nil { + objectMap["propertyBag"] = awpitrr.PropertyBag + } + if awpitrr.TargetInfo != nil { + objectMap["targetInfo"] = awpitrr.TargetInfo + } + if awpitrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awpitrr.RecoveryMode + } + if awpitrr.ObjectType != "" { + objectMap["objectType"] = awpitrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return &awpitrr, true +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awpitrr, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awpitrr, true +} + +// BasicAzureWorkloadRecoveryPoint workload specific recovery point, specifically encapsulates full/diff recovery point +type BasicAzureWorkloadRecoveryPoint interface { + AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) + AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) + AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) + AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) + AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) +} + +// AzureWorkloadRecoveryPoint workload specific recovery point, specifically encapsulates full/diff recovery +// point +type AzureWorkloadRecoveryPoint struct { + // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' + Type RestorePointType `json:"type,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +func unmarshalBasicAzureWorkloadRecoveryPoint(body []byte) (BasicAzureWorkloadRecoveryPoint, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadPointInTimeRecoveryPoint): + var awpitrp AzureWorkloadPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awpitrp) + return awpitrp, err + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): + var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awshpitrp) + return awshpitrp, err + case string(ObjectTypeAzureWorkloadSAPHanaRecoveryPoint): + var awshrp AzureWorkloadSAPHanaRecoveryPoint + err := json.Unmarshal(body, &awshrp) + return awshrp, err + case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): + var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awspitrp) + return awspitrp, err + case string(ObjectTypeAzureWorkloadSQLRecoveryPoint): + var awsrp AzureWorkloadSQLRecoveryPoint + err := json.Unmarshal(body, &awsrp) + return awsrp, err + default: + var awrp AzureWorkloadRecoveryPoint + err := json.Unmarshal(body, &awrp) + return awrp, err + } +} +func unmarshalBasicAzureWorkloadRecoveryPointArray(body []byte) ([]BasicAzureWorkloadRecoveryPoint, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awrpArray := make([]BasicAzureWorkloadRecoveryPoint, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awrp, err := unmarshalBasicAzureWorkloadRecoveryPoint(*rawMessage) + if err != nil { + return nil, err + } + awrpArray[index] = awrp + } + return awrpArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) MarshalJSON() ([]byte, error) { + awrp.ObjectType = ObjectTypeAzureWorkloadRecoveryPoint + objectMap := make(map[string]interface{}) + if awrp.ObjectType != "" { + objectMap["objectType"] = awrp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return &awrp, true +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return &awrp, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awrp, true +} + +// BasicAzureWorkloadRestoreRequest azureWorkload-specific restore. +type BasicAzureWorkloadRestoreRequest interface { + AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) + AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) + AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) + AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) + AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) + AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) + AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) + AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) +} + +// AzureWorkloadRestoreRequest azureWorkload-specific restore. +type AzureWorkloadRestoreRequest struct { + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicAzureWorkloadRestoreRequest(body []byte) (BasicAzureWorkloadRestoreRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadPointInTimeRestoreRequest): + var awpitrr AzureWorkloadPointInTimeRestoreRequest + err := json.Unmarshal(body, &awpitrr) + return awpitrr, err + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): + var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest + err := json.Unmarshal(body, &awshpitrr) + return awshpitrr, err + case string(ObjectTypeAzureWorkloadSAPHanaRestoreRequest): + var awshrr AzureWorkloadSAPHanaRestoreRequest + err := json.Unmarshal(body, &awshrr) + return awshrr, err + case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): + var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest + err := json.Unmarshal(body, &awspitrr) + return awspitrr, err + case string(ObjectTypeAzureWorkloadSQLRestoreRequest): + var awsrr AzureWorkloadSQLRestoreRequest + err := json.Unmarshal(body, &awsrr) + return awsrr, err + default: + var awrr AzureWorkloadRestoreRequest + err := json.Unmarshal(body, &awrr) + return awrr, err + } +} +func unmarshalBasicAzureWorkloadRestoreRequestArray(body []byte) ([]BasicAzureWorkloadRestoreRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awrrArray := make([]BasicAzureWorkloadRestoreRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awrr, err := unmarshalBasicAzureWorkloadRestoreRequest(*rawMessage) + if err != nil { + return nil, err + } + awrrArray[index] = awrr + } + return awrrArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) MarshalJSON() ([]byte, error) { + awrr.ObjectType = ObjectTypeAzureWorkloadRestoreRequest + objectMap := make(map[string]interface{}) + if awrr.RecoveryType != "" { + objectMap["recoveryType"] = awrr.RecoveryType + } + if awrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awrr.SourceResourceID + } + if awrr.PropertyBag != nil { + objectMap["propertyBag"] = awrr.PropertyBag + } + if awrr.TargetInfo != nil { + objectMap["targetInfo"] = awrr.TargetInfo + } + if awrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awrr.RecoveryMode + } + if awrr.ObjectType != "" { + objectMap["objectType"] = awrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return &awrr, true +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awrr, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awrr, true +} + +// AzureWorkloadSAPHanaPointInTimeRecoveryPoint recovery point specific to PointInTime in SAPHana +type AzureWorkloadSAPHanaPointInTimeRecoveryPoint struct { + // TimeRanges - List of log ranges + TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` + // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' + Type RestorePointType `json:"type,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { + awshpitrp.ObjectType = ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint + objectMap := make(map[string]interface{}) + if awshpitrp.TimeRanges != nil { + objectMap["timeRanges"] = awshpitrp.TimeRanges + } + if awshpitrp.ObjectType != "" { + objectMap["objectType"] = awshpitrp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { + return &awshpitrp, true +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return &awshpitrp, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return &awshpitrp, true +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awshpitrp, true +} + +// AzureWorkloadSAPHanaPointInTimeRestoreRequest azureWorkload SAP Hana -specific restore. Specifically for +// PointInTime/Log restore +type AzureWorkloadSAPHanaPointInTimeRestoreRequest struct { + // PointInTime - PointInTime value + PointInTime *date.Time `json:"pointInTime,omitempty"` + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { + awshpitrr.ObjectType = ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest + objectMap := make(map[string]interface{}) + if awshpitrr.PointInTime != nil { + objectMap["pointInTime"] = awshpitrr.PointInTime + } + if awshpitrr.RecoveryType != "" { + objectMap["recoveryType"] = awshpitrr.RecoveryType + } + if awshpitrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awshpitrr.SourceResourceID + } + if awshpitrr.PropertyBag != nil { + objectMap["propertyBag"] = awshpitrr.PropertyBag + } + if awshpitrr.TargetInfo != nil { + objectMap["targetInfo"] = awshpitrr.TargetInfo + } + if awshpitrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awshpitrr.RecoveryMode + } + if awshpitrr.ObjectType != "" { + objectMap["objectType"] = awshpitrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awshpitrr, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return &awshpitrr, true +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return &awshpitrr, true +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awshpitrr, true +} + +// AzureWorkloadSAPHanaRecoveryPoint sAPHana specific recoverypoint, specifically encapsulates full/diff +// recoverypoints +type AzureWorkloadSAPHanaRecoveryPoint struct { + // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' + Type RestorePointType `json:"type,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) MarshalJSON() ([]byte, error) { + awshrp.ObjectType = ObjectTypeAzureWorkloadSAPHanaRecoveryPoint + objectMap := make(map[string]interface{}) + if awshrp.ObjectType != "" { + objectMap["objectType"] = awshrp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return &awshrp, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return &awshrp, true +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awshrp, true +} + +// BasicAzureWorkloadSAPHanaRestoreRequest azureWorkload SAP Hana-specific restore. +type BasicAzureWorkloadSAPHanaRestoreRequest interface { + AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) + AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) +} + +// AzureWorkloadSAPHanaRestoreRequest azureWorkload SAP Hana-specific restore. +type AzureWorkloadSAPHanaRestoreRequest struct { + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicAzureWorkloadSAPHanaRestoreRequest(body []byte) (BasicAzureWorkloadSAPHanaRestoreRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): + var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest + err := json.Unmarshal(body, &awshpitrr) + return awshpitrr, err + default: + var awshrr AzureWorkloadSAPHanaRestoreRequest + err := json.Unmarshal(body, &awshrr) + return awshrr, err + } +} +func unmarshalBasicAzureWorkloadSAPHanaRestoreRequestArray(body []byte) ([]BasicAzureWorkloadSAPHanaRestoreRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awshrrArray := make([]BasicAzureWorkloadSAPHanaRestoreRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awshrr, err := unmarshalBasicAzureWorkloadSAPHanaRestoreRequest(*rawMessage) + if err != nil { + return nil, err + } + awshrrArray[index] = awshrr + } + return awshrrArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) MarshalJSON() ([]byte, error) { + awshrr.ObjectType = ObjectTypeAzureWorkloadSAPHanaRestoreRequest + objectMap := make(map[string]interface{}) + if awshrr.RecoveryType != "" { + objectMap["recoveryType"] = awshrr.RecoveryType + } + if awshrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awshrr.SourceResourceID + } + if awshrr.PropertyBag != nil { + objectMap["propertyBag"] = awshrr.PropertyBag + } + if awshrr.TargetInfo != nil { + objectMap["targetInfo"] = awshrr.TargetInfo + } + if awshrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awshrr.RecoveryMode + } + if awshrr.ObjectType != "" { + objectMap["objectType"] = awshrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awshrr, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return &awshrr, true +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return &awshrr, true +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awshrr, true +} + +// AzureWorkloadSQLPointInTimeRecoveryPoint recovery point specific to PointInTime +type AzureWorkloadSQLPointInTimeRecoveryPoint struct { + // TimeRanges - List of log ranges + TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` + // ExtendedInfo - Extended Info that provides data directory details. Will be populated in two cases: + // When a specific recovery point is accessed using GetRecoveryPoint + // Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter + ExtendedInfo *AzureWorkloadSQLRecoveryPointExtendedInfo `json:"extendedInfo,omitempty"` + // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' + Type RestorePointType `json:"type,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { + awspitrp.ObjectType = ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint + objectMap := make(map[string]interface{}) + if awspitrp.TimeRanges != nil { + objectMap["timeRanges"] = awspitrp.TimeRanges + } + if awspitrp.ExtendedInfo != nil { + objectMap["extendedInfo"] = awspitrp.ExtendedInfo + } + if awspitrp.ObjectType != "" { + objectMap["objectType"] = awspitrp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return &awspitrp, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return &awspitrp, true +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return &awspitrp, true +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awspitrp, true +} + +// AzureWorkloadSQLPointInTimeRestoreRequest azureWorkload SQL -specific restore. Specifically for +// PointInTime/Log restore +type AzureWorkloadSQLPointInTimeRestoreRequest struct { + // PointInTime - PointInTime value + PointInTime *date.Time `json:"pointInTime,omitempty"` + // ShouldUseAlternateTargetLocation - Default option set to true. If this is set to false, alternate data directory must be provided + ShouldUseAlternateTargetLocation *bool `json:"shouldUseAlternateTargetLocation,omitempty"` + // IsNonRecoverable - SQL specific property where user can chose to set no-recovery when restore operation is tried + IsNonRecoverable *bool `json:"isNonRecoverable,omitempty"` + // AlternateDirectoryPaths - Data directory details + AlternateDirectoryPaths *[]SQLDataDirectoryMapping `json:"alternateDirectoryPaths,omitempty"` + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { + awspitrr.ObjectType = ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest + objectMap := make(map[string]interface{}) + if awspitrr.PointInTime != nil { + objectMap["pointInTime"] = awspitrr.PointInTime + } + if awspitrr.ShouldUseAlternateTargetLocation != nil { + objectMap["shouldUseAlternateTargetLocation"] = awspitrr.ShouldUseAlternateTargetLocation + } + if awspitrr.IsNonRecoverable != nil { + objectMap["isNonRecoverable"] = awspitrr.IsNonRecoverable + } + if awspitrr.AlternateDirectoryPaths != nil { + objectMap["alternateDirectoryPaths"] = awspitrr.AlternateDirectoryPaths + } + if awspitrr.RecoveryType != "" { + objectMap["recoveryType"] = awspitrr.RecoveryType + } + if awspitrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awspitrr.SourceResourceID + } + if awspitrr.PropertyBag != nil { + objectMap["propertyBag"] = awspitrr.PropertyBag + } + if awspitrr.TargetInfo != nil { + objectMap["targetInfo"] = awspitrr.TargetInfo + } + if awspitrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awspitrr.RecoveryMode + } + if awspitrr.ObjectType != "" { + objectMap["objectType"] = awspitrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awspitrr, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return &awspitrr, true +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return &awspitrr, true +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awspitrr, true +} + +// BasicAzureWorkloadSQLRecoveryPoint SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint +// along with extended info +type BasicAzureWorkloadSQLRecoveryPoint interface { + AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) +} + +// AzureWorkloadSQLRecoveryPoint SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint +// along with extended info +type AzureWorkloadSQLRecoveryPoint struct { + // ExtendedInfo - Extended Info that provides data directory details. Will be populated in two cases: + // When a specific recovery point is accessed using GetRecoveryPoint + // Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter + ExtendedInfo *AzureWorkloadSQLRecoveryPointExtendedInfo `json:"extendedInfo,omitempty"` + // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' + Type RestorePointType `json:"type,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +func unmarshalBasicAzureWorkloadSQLRecoveryPoint(body []byte) (BasicAzureWorkloadSQLRecoveryPoint, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): + var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awspitrp) + return awspitrp, err + default: + var awsrp AzureWorkloadSQLRecoveryPoint + err := json.Unmarshal(body, &awsrp) + return awsrp, err + } +} +func unmarshalBasicAzureWorkloadSQLRecoveryPointArray(body []byte) ([]BasicAzureWorkloadSQLRecoveryPoint, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awsrpArray := make([]BasicAzureWorkloadSQLRecoveryPoint, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awsrp, err := unmarshalBasicAzureWorkloadSQLRecoveryPoint(*rawMessage) + if err != nil { + return nil, err + } + awsrpArray[index] = awsrp + } + return awsrpArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) MarshalJSON() ([]byte, error) { + awsrp.ObjectType = ObjectTypeAzureWorkloadSQLRecoveryPoint + objectMap := make(map[string]interface{}) + if awsrp.ExtendedInfo != nil { + objectMap["extendedInfo"] = awsrp.ExtendedInfo + } + if awsrp.ObjectType != "" { + objectMap["objectType"] = awsrp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return &awsrp, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return &awsrp, true +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return &awsrp, true +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awsrp, true +} + +// AzureWorkloadSQLRecoveryPointExtendedInfo extended info class details +type AzureWorkloadSQLRecoveryPointExtendedInfo struct { + // DataDirectoryTimeInUTC - READ-ONLY; UTC time at which data directory info was captured + DataDirectoryTimeInUTC *date.Time `json:"dataDirectoryTimeInUTC,omitempty"` + // DataDirectoryPaths - READ-ONLY; List of data directory paths during restore operation. + DataDirectoryPaths *[]SQLDataDirectory `json:"dataDirectoryPaths,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSQLRecoveryPointExtendedInfo. +func (awsrpei AzureWorkloadSQLRecoveryPointExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// BasicAzureWorkloadSQLRestoreRequest azureWorkload SQL -specific restore. Specifically for full/diff restore +type BasicAzureWorkloadSQLRestoreRequest interface { + AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) + AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) +} + +// AzureWorkloadSQLRestoreRequest azureWorkload SQL -specific restore. Specifically for full/diff restore +type AzureWorkloadSQLRestoreRequest struct { + // ShouldUseAlternateTargetLocation - Default option set to true. If this is set to false, alternate data directory must be provided + ShouldUseAlternateTargetLocation *bool `json:"shouldUseAlternateTargetLocation,omitempty"` + // IsNonRecoverable - SQL specific property where user can chose to set no-recovery when restore operation is tried + IsNonRecoverable *bool `json:"isNonRecoverable,omitempty"` + // AlternateDirectoryPaths - Data directory details + AlternateDirectoryPaths *[]SQLDataDirectoryMapping `json:"alternateDirectoryPaths,omitempty"` + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicAzureWorkloadSQLRestoreRequest(body []byte) (BasicAzureWorkloadSQLRestoreRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): + var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest + err := json.Unmarshal(body, &awspitrr) + return awspitrr, err + default: + var awsrr AzureWorkloadSQLRestoreRequest + err := json.Unmarshal(body, &awsrr) + return awsrr, err + } +} +func unmarshalBasicAzureWorkloadSQLRestoreRequestArray(body []byte) ([]BasicAzureWorkloadSQLRestoreRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awsrrArray := make([]BasicAzureWorkloadSQLRestoreRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awsrr, err := unmarshalBasicAzureWorkloadSQLRestoreRequest(*rawMessage) + if err != nil { + return nil, err + } + awsrrArray[index] = awsrr + } + return awsrrArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) MarshalJSON() ([]byte, error) { + awsrr.ObjectType = ObjectTypeAzureWorkloadSQLRestoreRequest + objectMap := make(map[string]interface{}) + if awsrr.ShouldUseAlternateTargetLocation != nil { + objectMap["shouldUseAlternateTargetLocation"] = awsrr.ShouldUseAlternateTargetLocation + } + if awsrr.IsNonRecoverable != nil { + objectMap["isNonRecoverable"] = awsrr.IsNonRecoverable + } + if awsrr.AlternateDirectoryPaths != nil { + objectMap["alternateDirectoryPaths"] = awsrr.AlternateDirectoryPaths + } + if awsrr.RecoveryType != "" { + objectMap["recoveryType"] = awsrr.RecoveryType + } + if awsrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awsrr.SourceResourceID + } + if awsrr.PropertyBag != nil { + objectMap["propertyBag"] = awsrr.PropertyBag + } + if awsrr.TargetInfo != nil { + objectMap["targetInfo"] = awsrr.TargetInfo + } + if awsrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awsrr.RecoveryMode + } + if awsrr.ObjectType != "" { + objectMap["objectType"] = awsrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awsrr, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return &awsrr, true +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return &awsrr, true +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awsrr, true +} + +// BEKDetails BEK is bitlocker encryption key. +type BEKDetails struct { + // SecretURL - Secret is BEK. + SecretURL *string `json:"secretUrl,omitempty"` + // SecretVaultID - ID of the Key Vault where this Secret is stored. + SecretVaultID *string `json:"secretVaultId,omitempty"` + // SecretData - BEK data. + SecretData *string `json:"secretData,omitempty"` +} + +// BMSBackupEngineQueryObject query parameters to fetch list of backup engines. +type BMSBackupEngineQueryObject struct { + // Expand - attribute to add extended info + Expand *string `json:"expand,omitempty"` +} + +// BMSBackupEnginesQueryObject query parameters to fetch list of backup engines. +type BMSBackupEnginesQueryObject struct { + // BackupManagementType - Backup management type for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // FriendlyName - Friendly name of the backup engine. + FriendlyName *string `json:"friendlyName,omitempty"` + // Expand - Attribute to add extended info. + Expand *string `json:"expand,omitempty"` +} + +// BMSContainerQueryObject the query filters that can be used with the list containers API. +type BMSContainerQueryObject struct { + // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // ContainerType - Type of container for filter. Possible values include: 'ContainerTypeInvalid', 'ContainerTypeUnknown', 'ContainerTypeIaasVMContainer', 'ContainerTypeIaasVMServiceContainer', 'ContainerTypeDPMContainer', 'ContainerTypeAzureBackupServerContainer', 'ContainerTypeMABContainer', 'ContainerTypeCluster', 'ContainerTypeAzureSQLContainer', 'ContainerTypeWindows', 'ContainerTypeVCenter', 'ContainerTypeVMAppContainer', 'ContainerTypeSQLAGWorkLoadContainer', 'ContainerTypeStorageContainer', 'ContainerTypeGenericContainer' + ContainerType ContainerType `json:"containerType,omitempty"` + // BackupEngineName - Backup engine name + BackupEngineName *string `json:"backupEngineName,omitempty"` + // FabricName - Fabric name for filter + FabricName *string `json:"fabricName,omitempty"` + // Status - Status of registration of this container with the Recovery Services Vault. + Status *string `json:"status,omitempty"` + // FriendlyName - Friendly name of this container. + FriendlyName *string `json:"friendlyName,omitempty"` +} + +// BMSContainersInquiryQueryObject the query filters that can be used with the inquire container API. +type BMSContainersInquiryQueryObject struct { + // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Workload type for this container. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` +} + +// BMSPOQueryObject filters to list items that can be backed up. +type BMSPOQueryObject struct { + // BackupManagementType - Backup management type. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Workload type. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` + // ContainerName - Full name of the container whose Protectable Objects should be returned. + ContainerName *string `json:"containerName,omitempty"` + // Status - Backup status query parameter. + Status *string `json:"status,omitempty"` + // FriendlyName - Friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` +} + +// BMSRefreshContainersQueryObject the query filters that can be used with the refresh container API. +type BMSRefreshContainersQueryObject struct { + // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` +} + +// BMSRPQueryObject filters to list backup copies. +type BMSRPQueryObject struct { + // StartDate - Backup copies created after this time. + StartDate *date.Time `json:"startDate,omitempty"` + // EndDate - Backup copies created before this time. + EndDate *date.Time `json:"endDate,omitempty"` + // RestorePointQueryType - RestorePoint type. Possible values include: 'RestorePointQueryTypeInvalid', 'RestorePointQueryTypeFull', 'RestorePointQueryTypeLog', 'RestorePointQueryTypeDifferential', 'RestorePointQueryTypeFullAndDifferential', 'RestorePointQueryTypeAll', 'RestorePointQueryTypeIncremental' + RestorePointQueryType RestorePointQueryType `json:"restorePointQueryType,omitempty"` + // ExtendedInfo - In Get Recovery Point, it tells whether extended information about recovery point is asked. + ExtendedInfo *bool `json:"extendedInfo,omitempty"` +} + +// BMSTriggerDataMoveFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type BMSTriggerDataMoveFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(BaseClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *BMSTriggerDataMoveFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for BMSTriggerDataMoveFuture.Result. +func (future *BMSTriggerDataMoveFuture) result(client BaseClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.BMSTriggerDataMoveFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("backup.BMSTriggerDataMoveFuture") + return + } + ar.Response = future.Response() + return +} + +// BMSWorkloadItemQueryObject filters to list items that can be backed up. +type BMSWorkloadItemQueryObject struct { + // BackupManagementType - Backup management type. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadItemType - Workload Item type. Possible values include: 'WorkloadItemTypeInvalid', 'WorkloadItemTypeSQLInstance', 'WorkloadItemTypeSQLDataBase', 'WorkloadItemTypeSAPHanaSystem', 'WorkloadItemTypeSAPHanaDatabase', 'WorkloadItemTypeSAPAseSystem', 'WorkloadItemTypeSAPAseDatabase' + WorkloadItemType WorkloadItemType `json:"workloadItemType,omitempty"` + // WorkloadType - Workload type. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` + // ProtectionStatus - Backup status query parameter. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionStatus ProtectionStatus `json:"protectionStatus,omitempty"` +} + +// ClientScriptForConnect client script details for file / folder restore. +type ClientScriptForConnect struct { + // ScriptContent - File content of the client script for file / folder restore. + ScriptContent *string `json:"scriptContent,omitempty"` + // ScriptExtension - File extension of the client script for file / folder restore - .ps1 , .sh , etc. + ScriptExtension *string `json:"scriptExtension,omitempty"` + // OsType - OS type - Windows, Linux etc. for which this file / folder restore client script works. + OsType *string `json:"osType,omitempty"` + // URL - URL of Executable from where to source the content. If this is not null then ScriptContent should not be used + URL *string `json:"url,omitempty"` + // ScriptNameSuffix - Mandatory suffix that should be added to the name of script that is given for download to user. + // If its null or empty then , ignore it. + ScriptNameSuffix *string `json:"scriptNameSuffix,omitempty"` +} + +// ContainerIdentityInfo container identity information +type ContainerIdentityInfo struct { + // UniqueName - Unique name of the container + UniqueName *string `json:"uniqueName,omitempty"` + // AadTenantID - Protection container identity - AAD Tenant + AadTenantID *string `json:"aadTenantId,omitempty"` + // ServicePrincipalClientID - Protection container identity - AAD Service Principal + ServicePrincipalClientID *string `json:"servicePrincipalClientId,omitempty"` + // Audience - Protection container identity - Audience + Audience *string `json:"audience,omitempty"` +} + +// DailyRetentionFormat daily retention format. +type DailyRetentionFormat struct { + // DaysOfTheMonth - List of days of the month. + DaysOfTheMonth *[]Day `json:"daysOfTheMonth,omitempty"` +} + +// DailyRetentionSchedule daily retention schedule. +type DailyRetentionSchedule struct { + // RetentionTimes - Retention times of retention policy. + RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` + // RetentionDuration - Retention duration of retention Policy. + RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` +} + +// Day day of the week. +type Day struct { + // Date - Date of the month + Date *int32 `json:"date,omitempty"` + // IsLast - Whether Date is last date of month + IsLast *bool `json:"isLast,omitempty"` +} + +// DiskExclusionProperties ... +type DiskExclusionProperties struct { + // DiskLunList - List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. + DiskLunList *[]int32 `json:"diskLunList,omitempty"` + // IsInclusionList - Flag to indicate whether DiskLunList is to be included/ excluded from backup. + IsInclusionList *bool `json:"isInclusionList,omitempty"` +} + +// DiskInformation disk information +type DiskInformation struct { + Lun *int32 `json:"lun,omitempty"` + Name *string `json:"name,omitempty"` +} + +// DistributedNodesInfo this is used to represent the various nodes of the distributed container. +type DistributedNodesInfo struct { + // NodeName - Name of the node under a distributed container. + NodeName *string `json:"nodeName,omitempty"` + // Status - Status of this Node. + // Failed | Succeeded + Status *string `json:"status,omitempty"` + // ErrorDetail - Error Details if the Status is non-success. + ErrorDetail *ErrorDetail `json:"errorDetail,omitempty"` +} + +// DpmBackupEngine data Protection Manager (DPM) specific backup engine. +type DpmBackupEngine struct { + // FriendlyName - Friendly name of the backup engine. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Registration status of the backup engine with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // BackupEngineState - Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} + BackupEngineState *string `json:"backupEngineState,omitempty"` + // HealthStatus - Backup status of the backup engine. + HealthStatus *string `json:"healthStatus,omitempty"` + // CanReRegister - Flag indicating if the backup engine be registered, once already registered. + CanReRegister *bool `json:"canReRegister,omitempty"` + // BackupEngineID - ID of the backup engine. + BackupEngineID *string `json:"backupEngineId,omitempty"` + // DpmVersion - Backup engine version + DpmVersion *string `json:"dpmVersion,omitempty"` + // AzureBackupAgentVersion - Backup agent version + AzureBackupAgentVersion *string `json:"azureBackupAgentVersion,omitempty"` + // IsAzureBackupAgentUpgradeAvailable - To check if backup agent upgrade available + IsAzureBackupAgentUpgradeAvailable *bool `json:"isAzureBackupAgentUpgradeAvailable,omitempty"` + // IsDpmUpgradeAvailable - To check if backup engine upgrade available + IsDpmUpgradeAvailable *bool `json:"isDpmUpgradeAvailable,omitempty"` + // ExtendedInfo - Extended info of the backupengine + ExtendedInfo *EngineExtendedInfo `json:"extendedInfo,omitempty"` + // BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine' + BackupEngineType EngineType `json:"backupEngineType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DpmBackupEngine. +func (dbe DpmBackupEngine) MarshalJSON() ([]byte, error) { + dbe.BackupEngineType = BackupEngineTypeDpmBackupEngine + objectMap := make(map[string]interface{}) + if dbe.FriendlyName != nil { + objectMap["friendlyName"] = dbe.FriendlyName + } + if dbe.BackupManagementType != "" { + objectMap["backupManagementType"] = dbe.BackupManagementType + } + if dbe.RegistrationStatus != nil { + objectMap["registrationStatus"] = dbe.RegistrationStatus + } + if dbe.BackupEngineState != nil { + objectMap["backupEngineState"] = dbe.BackupEngineState + } + if dbe.HealthStatus != nil { + objectMap["healthStatus"] = dbe.HealthStatus + } + if dbe.CanReRegister != nil { + objectMap["canReRegister"] = dbe.CanReRegister + } + if dbe.BackupEngineID != nil { + objectMap["backupEngineId"] = dbe.BackupEngineID + } + if dbe.DpmVersion != nil { + objectMap["dpmVersion"] = dbe.DpmVersion + } + if dbe.AzureBackupAgentVersion != nil { + objectMap["azureBackupAgentVersion"] = dbe.AzureBackupAgentVersion + } + if dbe.IsAzureBackupAgentUpgradeAvailable != nil { + objectMap["isAzureBackupAgentUpgradeAvailable"] = dbe.IsAzureBackupAgentUpgradeAvailable + } + if dbe.IsDpmUpgradeAvailable != nil { + objectMap["isDpmUpgradeAvailable"] = dbe.IsDpmUpgradeAvailable + } + if dbe.ExtendedInfo != nil { + objectMap["extendedInfo"] = dbe.ExtendedInfo + } + if dbe.BackupEngineType != "" { + objectMap["backupEngineType"] = dbe.BackupEngineType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerEngine is the BasicEngineBase implementation for DpmBackupEngine. +func (dbe DpmBackupEngine) AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) { + return nil, false +} + +// AsDpmBackupEngine is the BasicEngineBase implementation for DpmBackupEngine. +func (dbe DpmBackupEngine) AsDpmBackupEngine() (*DpmBackupEngine, bool) { + return &dbe, true +} + +// AsEngineBase is the BasicEngineBase implementation for DpmBackupEngine. +func (dbe DpmBackupEngine) AsEngineBase() (*EngineBase, bool) { + return nil, false +} + +// AsBasicEngineBase is the BasicEngineBase implementation for DpmBackupEngine. +func (dbe DpmBackupEngine) AsBasicEngineBase() (BasicEngineBase, bool) { + return &dbe, true +} + +// BasicDpmContainer DPM workload-specific protection container. +type BasicDpmContainer interface { + AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) + AsDpmContainer() (*DpmContainer, bool) +} + +// DpmContainer DPM workload-specific protection container. +type DpmContainer struct { + // CanReRegister - Specifies whether the container is re-registrable. + CanReRegister *bool `json:"canReRegister,omitempty"` + // ContainerID - ID of container. + ContainerID *string `json:"containerId,omitempty"` + // ProtectedItemCount - Number of protected items in the BackupEngine + ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` + // DpmAgentVersion - Backup engine Agent version + DpmAgentVersion *string `json:"dpmAgentVersion,omitempty"` + // DpmServers - List of BackupEngines protecting the container + DpmServers *[]string `json:"dpmServers,omitempty"` + // UpgradeAvailable - To check if upgrade available + UpgradeAvailable *bool `json:"upgradeAvailable,omitempty"` + // ProtectionStatus - Protection status of the container. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ExtendedInfo - Extended Info of the container. + ExtendedInfo *DPMContainerExtendedInfo `json:"extendedInfo,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +func unmarshalBasicDpmContainer(body []byte) (BasicDpmContainer, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["containerType"] { + case string(ContainerTypeAzureBackupServerContainer1): + var absc AzureBackupServerContainer + err := json.Unmarshal(body, &absc) + return absc, err + default: + var dc DpmContainer + err := json.Unmarshal(body, &dc) + return dc, err + } +} +func unmarshalBasicDpmContainerArray(body []byte) ([]BasicDpmContainer, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + dcArray := make([]BasicDpmContainer, len(rawMessages)) + + for index, rawMessage := range rawMessages { + dc, err := unmarshalBasicDpmContainer(*rawMessage) + if err != nil { + return nil, err + } + dcArray[index] = dc + } + return dcArray, nil +} + +// MarshalJSON is the custom marshaler for DpmContainer. +func (dc DpmContainer) MarshalJSON() ([]byte, error) { + dc.ContainerType = ContainerTypeDPMContainer1 + objectMap := make(map[string]interface{}) + if dc.CanReRegister != nil { + objectMap["canReRegister"] = dc.CanReRegister + } + if dc.ContainerID != nil { + objectMap["containerId"] = dc.ContainerID + } + if dc.ProtectedItemCount != nil { + objectMap["protectedItemCount"] = dc.ProtectedItemCount + } + if dc.DpmAgentVersion != nil { + objectMap["dpmAgentVersion"] = dc.DpmAgentVersion + } + if dc.DpmServers != nil { + objectMap["dpmServers"] = dc.DpmServers + } + if dc.UpgradeAvailable != nil { + objectMap["upgradeAvailable"] = dc.UpgradeAvailable + } + if dc.ProtectionStatus != nil { + objectMap["protectionStatus"] = dc.ProtectionStatus + } + if dc.ExtendedInfo != nil { + objectMap["extendedInfo"] = dc.ExtendedInfo + } + if dc.FriendlyName != nil { + objectMap["friendlyName"] = dc.FriendlyName + } + if dc.BackupManagementType != "" { + objectMap["backupManagementType"] = dc.BackupManagementType + } + if dc.RegistrationStatus != nil { + objectMap["registrationStatus"] = dc.RegistrationStatus + } + if dc.HealthStatus != nil { + objectMap["healthStatus"] = dc.HealthStatus + } + if dc.ContainerType != "" { + objectMap["containerType"] = dc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsDpmContainer() (*DpmContainer, bool) { + return &dc, true +} + +// AsBasicDpmContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return &dc, true +} + +// AsGenericContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &dc, true +} + +// DPMContainerExtendedInfo additional information of the DPMContainer. +type DPMContainerExtendedInfo struct { + // LastRefreshedAt - Last refresh time of the DPMContainer. + LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` +} + +// DpmErrorInfo DPM workload-specific error information. +type DpmErrorInfo struct { + // ErrorString - Localized error string. + ErrorString *string `json:"errorString,omitempty"` + // Recommendations - List of localized recommendations for above error code. + Recommendations *[]string `json:"recommendations,omitempty"` +} + +// DpmJob DPM workload-specific job object. +type DpmJob struct { + // Duration - Time elapsed for job. + Duration *string `json:"duration,omitempty"` + // DpmServerName - DPM server name managing the backup item or backup job. + DpmServerName *string `json:"dpmServerName,omitempty"` + // ContainerName - Name of cluster/server protecting current backup item, if any. + ContainerName *string `json:"containerName,omitempty"` + // ContainerType - Type of container. + ContainerType *string `json:"containerType,omitempty"` + // WorkloadType - Type of backup item. + WorkloadType *string `json:"workloadType,omitempty"` + // ActionsInfo - The state/actions applicable on this job like cancel/retry. + ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` + // ErrorDetails - The errors. + ErrorDetails *[]DpmErrorInfo `json:"errorDetails,omitempty"` + // ExtendedInfo - Additional information for this job. + ExtendedInfo *DpmJobExtendedInfo `json:"extendedInfo,omitempty"` + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob', 'JobTypeVaultJob' + JobType JobType `json:"jobType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DpmJob. +func (dj DpmJob) MarshalJSON() ([]byte, error) { + dj.JobType = JobTypeDpmJob + objectMap := make(map[string]interface{}) + if dj.Duration != nil { + objectMap["duration"] = dj.Duration + } + if dj.DpmServerName != nil { + objectMap["dpmServerName"] = dj.DpmServerName + } + if dj.ContainerName != nil { + objectMap["containerName"] = dj.ContainerName + } + if dj.ContainerType != nil { + objectMap["containerType"] = dj.ContainerType + } + if dj.WorkloadType != nil { + objectMap["workloadType"] = dj.WorkloadType + } + if dj.ActionsInfo != nil { + objectMap["actionsInfo"] = dj.ActionsInfo + } + if dj.ErrorDetails != nil { + objectMap["errorDetails"] = dj.ErrorDetails + } + if dj.ExtendedInfo != nil { + objectMap["extendedInfo"] = dj.ExtendedInfo + } + if dj.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = dj.EntityFriendlyName + } + if dj.BackupManagementType != "" { + objectMap["backupManagementType"] = dj.BackupManagementType + } + if dj.Operation != nil { + objectMap["operation"] = dj.Operation + } + if dj.Status != nil { + objectMap["status"] = dj.Status + } + if dj.StartTime != nil { + objectMap["startTime"] = dj.StartTime + } + if dj.EndTime != nil { + objectMap["endTime"] = dj.EndTime + } + if dj.ActivityID != nil { + objectMap["activityId"] = dj.ActivityID + } + if dj.JobType != "" { + objectMap["jobType"] = dj.JobType + } + return json.Marshal(objectMap) +} + +// AsAzureIaaSVMJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { + return nil, false +} + +// AsAzureStorageJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsAzureStorageJob() (*AzureStorageJob, bool) { + return nil, false +} + +// AsAzureWorkloadJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { + return nil, false +} + +// AsDpmJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsDpmJob() (*DpmJob, bool) { + return &dj, true +} + +// AsMabJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsMabJob() (*MabJob, bool) { + return nil, false +} + +// AsVaultJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsVaultJob() (*VaultJob, bool) { + return nil, false +} + +// AsJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsJob() (*Job, bool) { + return nil, false +} + +// AsBasicJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsBasicJob() (BasicJob, bool) { + return &dj, true +} + +// DpmJobExtendedInfo additional information on the DPM workload-specific job. +type DpmJobExtendedInfo struct { + // TasksList - List of tasks associated with this job. + TasksList *[]DpmJobTaskDetails `json:"tasksList,omitempty"` + // PropertyBag - The job properties. + PropertyBag map[string]*string `json:"propertyBag"` + // DynamicErrorMessage - Non localized error message on job execution. + DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` +} + +// MarshalJSON is the custom marshaler for DpmJobExtendedInfo. +func (djei DpmJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if djei.TasksList != nil { + objectMap["tasksList"] = djei.TasksList + } + if djei.PropertyBag != nil { + objectMap["propertyBag"] = djei.PropertyBag + } + if djei.DynamicErrorMessage != nil { + objectMap["dynamicErrorMessage"] = djei.DynamicErrorMessage + } + return json.Marshal(objectMap) +} + +// DpmJobTaskDetails DPM workload-specific job task details. +type DpmJobTaskDetails struct { + // TaskID - The task display name. + TaskID *string `json:"taskId,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // Duration - Time elapsed for task. + Duration *string `json:"duration,omitempty"` + // Status - The status. + Status *string `json:"status,omitempty"` +} + +// DPMProtectedItem additional information on Backup engine specific backup item. +type DPMProtectedItem struct { + // FriendlyName - Friendly name of the managed item + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupEngineName - Backup Management server protecting this backup item + BackupEngineName *string `json:"backupEngineName,omitempty"` + // ProtectionState - Protection state of the backup engine. Possible values include: 'ProtectedItemStateInvalid', 'ProtectedItemStateIRPending', 'ProtectedItemStateProtected', 'ProtectedItemStateProtectionError', 'ProtectedItemStateProtectionStopped', 'ProtectedItemStateProtectionPaused' + ProtectionState ProtectedItemState `json:"protectionState,omitempty"` + // ExtendedInfo - Extended info of the backup item. + ExtendedInfo *DPMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DPMProtectedItem. +func (dpi DPMProtectedItem) MarshalJSON() ([]byte, error) { + dpi.ProtectedItemType = ProtectedItemTypeDPMProtectedItem + objectMap := make(map[string]interface{}) + if dpi.FriendlyName != nil { + objectMap["friendlyName"] = dpi.FriendlyName + } + if dpi.BackupEngineName != nil { + objectMap["backupEngineName"] = dpi.BackupEngineName + } + if dpi.ProtectionState != "" { + objectMap["protectionState"] = dpi.ProtectionState + } + if dpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = dpi.ExtendedInfo + } + if dpi.BackupManagementType != "" { + objectMap["backupManagementType"] = dpi.BackupManagementType + } + if dpi.WorkloadType != "" { + objectMap["workloadType"] = dpi.WorkloadType + } + if dpi.ContainerName != nil { + objectMap["containerName"] = dpi.ContainerName + } + if dpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = dpi.SourceResourceID + } + if dpi.PolicyID != nil { + objectMap["policyId"] = dpi.PolicyID + } + if dpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = dpi.LastRecoveryPoint + } + if dpi.BackupSetName != nil { + objectMap["backupSetName"] = dpi.BackupSetName + } + if dpi.CreateMode != "" { + objectMap["createMode"] = dpi.CreateMode + } + if dpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = dpi.DeferredDeleteTimeInUTC + } + if dpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = dpi.IsScheduledForDeferredDelete + } + if dpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = dpi.DeferredDeleteTimeRemaining + } + if dpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = dpi.IsDeferredDeleteScheduleUpcoming + } + if dpi.IsRehydrate != nil { + objectMap["isRehydrate"] = dpi.IsRehydrate + } + if dpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = dpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return &dpi, true +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &dpi, true +} + +// DPMProtectedItemExtendedInfo additional information of DPM Protected item. +type DPMProtectedItemExtendedInfo struct { + // ProtectableObjectLoadPath - Attribute to provide information on various DBs. + ProtectableObjectLoadPath map[string]*string `json:"protectableObjectLoadPath"` + // Protected - To check if backup item is disk protected. + Protected *bool `json:"protected,omitempty"` + // IsPresentOnCloud - To check if backup item is cloud protected. + IsPresentOnCloud *bool `json:"isPresentOnCloud,omitempty"` + // LastBackupStatus - Last backup status information on backup item. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` + // LastRefreshedAt - Last refresh time on backup item. + LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` + // OldestRecoveryPoint - Oldest cloud recovery point time. + OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` + // RecoveryPointCount - cloud recovery point count. + RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` + // OnPremiseOldestRecoveryPoint - Oldest disk recovery point time. + OnPremiseOldestRecoveryPoint *date.Time `json:"onPremiseOldestRecoveryPoint,omitempty"` + // OnPremiseLatestRecoveryPoint - latest disk recovery point time. + OnPremiseLatestRecoveryPoint *date.Time `json:"onPremiseLatestRecoveryPoint,omitempty"` + // OnPremiseRecoveryPointCount - disk recovery point count. + OnPremiseRecoveryPointCount *int32 `json:"onPremiseRecoveryPointCount,omitempty"` + // IsCollocated - To check if backup item is collocated. + IsCollocated *bool `json:"isCollocated,omitempty"` + // ProtectionGroupName - Protection group name of the backup item. + ProtectionGroupName *string `json:"protectionGroupName,omitempty"` + // DiskStorageUsedInBytes - Used Disk storage in bytes. + DiskStorageUsedInBytes *string `json:"diskStorageUsedInBytes,omitempty"` + // TotalDiskStorageSizeInBytes - total Disk storage in bytes. + TotalDiskStorageSizeInBytes *string `json:"totalDiskStorageSizeInBytes,omitempty"` +} + +// MarshalJSON is the custom marshaler for DPMProtectedItemExtendedInfo. +func (dpiei DPMProtectedItemExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dpiei.ProtectableObjectLoadPath != nil { + objectMap["protectableObjectLoadPath"] = dpiei.ProtectableObjectLoadPath + } + if dpiei.Protected != nil { + objectMap["protected"] = dpiei.Protected + } + if dpiei.IsPresentOnCloud != nil { + objectMap["isPresentOnCloud"] = dpiei.IsPresentOnCloud + } + if dpiei.LastBackupStatus != nil { + objectMap["lastBackupStatus"] = dpiei.LastBackupStatus + } + if dpiei.LastRefreshedAt != nil { + objectMap["lastRefreshedAt"] = dpiei.LastRefreshedAt + } + if dpiei.OldestRecoveryPoint != nil { + objectMap["oldestRecoveryPoint"] = dpiei.OldestRecoveryPoint + } + if dpiei.RecoveryPointCount != nil { + objectMap["recoveryPointCount"] = dpiei.RecoveryPointCount + } + if dpiei.OnPremiseOldestRecoveryPoint != nil { + objectMap["onPremiseOldestRecoveryPoint"] = dpiei.OnPremiseOldestRecoveryPoint + } + if dpiei.OnPremiseLatestRecoveryPoint != nil { + objectMap["onPremiseLatestRecoveryPoint"] = dpiei.OnPremiseLatestRecoveryPoint + } + if dpiei.OnPremiseRecoveryPointCount != nil { + objectMap["onPremiseRecoveryPointCount"] = dpiei.OnPremiseRecoveryPointCount + } + if dpiei.IsCollocated != nil { + objectMap["isCollocated"] = dpiei.IsCollocated + } + if dpiei.ProtectionGroupName != nil { + objectMap["protectionGroupName"] = dpiei.ProtectionGroupName + } + if dpiei.DiskStorageUsedInBytes != nil { + objectMap["diskStorageUsedInBytes"] = dpiei.DiskStorageUsedInBytes + } + if dpiei.TotalDiskStorageSizeInBytes != nil { + objectMap["totalDiskStorageSizeInBytes"] = dpiei.TotalDiskStorageSizeInBytes + } + return json.Marshal(objectMap) +} + +// EncryptionDetails details needed if the VM was encrypted at the time of backup. +type EncryptionDetails struct { + // EncryptionEnabled - Identifies whether this backup copy represents an encrypted VM at the time of backup. + EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` + // KekURL - Key Url. + KekURL *string `json:"kekUrl,omitempty"` + // SecretKeyURL - Secret Url. + SecretKeyURL *string `json:"secretKeyUrl,omitempty"` + // KekVaultID - ID of Key Vault where KEK is stored. + KekVaultID *string `json:"kekVaultId,omitempty"` + // SecretKeyVaultID - ID of Key Vault where Secret is stored. + SecretKeyVaultID *string `json:"secretKeyVaultId,omitempty"` +} + +// BasicEngineBase the base backup engine class. All workload specific backup engines derive from this class. +type BasicEngineBase interface { + AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) + AsDpmBackupEngine() (*DpmBackupEngine, bool) + AsEngineBase() (*EngineBase, bool) +} + +// EngineBase the base backup engine class. All workload specific backup engines derive from this class. +type EngineBase struct { + // FriendlyName - Friendly name of the backup engine. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Registration status of the backup engine with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // BackupEngineState - Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} + BackupEngineState *string `json:"backupEngineState,omitempty"` + // HealthStatus - Backup status of the backup engine. + HealthStatus *string `json:"healthStatus,omitempty"` + // CanReRegister - Flag indicating if the backup engine be registered, once already registered. + CanReRegister *bool `json:"canReRegister,omitempty"` + // BackupEngineID - ID of the backup engine. + BackupEngineID *string `json:"backupEngineId,omitempty"` + // DpmVersion - Backup engine version + DpmVersion *string `json:"dpmVersion,omitempty"` + // AzureBackupAgentVersion - Backup agent version + AzureBackupAgentVersion *string `json:"azureBackupAgentVersion,omitempty"` + // IsAzureBackupAgentUpgradeAvailable - To check if backup agent upgrade available + IsAzureBackupAgentUpgradeAvailable *bool `json:"isAzureBackupAgentUpgradeAvailable,omitempty"` + // IsDpmUpgradeAvailable - To check if backup engine upgrade available + IsDpmUpgradeAvailable *bool `json:"isDpmUpgradeAvailable,omitempty"` + // ExtendedInfo - Extended info of the backupengine + ExtendedInfo *EngineExtendedInfo `json:"extendedInfo,omitempty"` + // BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine' + BackupEngineType EngineType `json:"backupEngineType,omitempty"` +} + +func unmarshalBasicEngineBase(body []byte) (BasicEngineBase, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["backupEngineType"] { + case string(BackupEngineTypeAzureBackupServerEngine): + var abse AzureBackupServerEngine + err := json.Unmarshal(body, &abse) + return abse, err + case string(BackupEngineTypeDpmBackupEngine): + var dbe DpmBackupEngine + err := json.Unmarshal(body, &dbe) + return dbe, err + default: + var eb EngineBase + err := json.Unmarshal(body, &eb) + return eb, err + } +} +func unmarshalBasicEngineBaseArray(body []byte) ([]BasicEngineBase, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ebArray := make([]BasicEngineBase, len(rawMessages)) + + for index, rawMessage := range rawMessages { + eb, err := unmarshalBasicEngineBase(*rawMessage) + if err != nil { + return nil, err + } + ebArray[index] = eb + } + return ebArray, nil +} + +// MarshalJSON is the custom marshaler for EngineBase. +func (eb EngineBase) MarshalJSON() ([]byte, error) { + eb.BackupEngineType = BackupEngineTypeBackupEngineBase + objectMap := make(map[string]interface{}) + if eb.FriendlyName != nil { + objectMap["friendlyName"] = eb.FriendlyName + } + if eb.BackupManagementType != "" { + objectMap["backupManagementType"] = eb.BackupManagementType + } + if eb.RegistrationStatus != nil { + objectMap["registrationStatus"] = eb.RegistrationStatus + } + if eb.BackupEngineState != nil { + objectMap["backupEngineState"] = eb.BackupEngineState + } + if eb.HealthStatus != nil { + objectMap["healthStatus"] = eb.HealthStatus + } + if eb.CanReRegister != nil { + objectMap["canReRegister"] = eb.CanReRegister + } + if eb.BackupEngineID != nil { + objectMap["backupEngineId"] = eb.BackupEngineID + } + if eb.DpmVersion != nil { + objectMap["dpmVersion"] = eb.DpmVersion + } + if eb.AzureBackupAgentVersion != nil { + objectMap["azureBackupAgentVersion"] = eb.AzureBackupAgentVersion + } + if eb.IsAzureBackupAgentUpgradeAvailable != nil { + objectMap["isAzureBackupAgentUpgradeAvailable"] = eb.IsAzureBackupAgentUpgradeAvailable + } + if eb.IsDpmUpgradeAvailable != nil { + objectMap["isDpmUpgradeAvailable"] = eb.IsDpmUpgradeAvailable + } + if eb.ExtendedInfo != nil { + objectMap["extendedInfo"] = eb.ExtendedInfo + } + if eb.BackupEngineType != "" { + objectMap["backupEngineType"] = eb.BackupEngineType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerEngine is the BasicEngineBase implementation for EngineBase. +func (eb EngineBase) AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) { + return nil, false +} + +// AsDpmBackupEngine is the BasicEngineBase implementation for EngineBase. +func (eb EngineBase) AsDpmBackupEngine() (*DpmBackupEngine, bool) { + return nil, false +} + +// AsEngineBase is the BasicEngineBase implementation for EngineBase. +func (eb EngineBase) AsEngineBase() (*EngineBase, bool) { + return &eb, true +} + +// AsBasicEngineBase is the BasicEngineBase implementation for EngineBase. +func (eb EngineBase) AsBasicEngineBase() (BasicEngineBase, bool) { + return &eb, true +} + +// EngineBaseResource the base backup engine class. All workload specific backup engines derive from this +// class. +type EngineBaseResource struct { + autorest.Response `json:"-"` + // Properties - BackupEngineBaseResource properties + Properties BasicEngineBase `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for EngineBaseResource. +func (ebr EngineBaseResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = ebr.Properties + if ebr.Location != nil { + objectMap["location"] = ebr.Location + } + if ebr.Tags != nil { + objectMap["tags"] = ebr.Tags + } + if ebr.ETag != nil { + objectMap["eTag"] = ebr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for EngineBaseResource struct. +func (ebr *EngineBaseResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicEngineBase(*v) + if err != nil { + return err + } + ebr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ebr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ebr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ebr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ebr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ebr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + ebr.ETag = &eTag + } + } + } + + return nil +} + +// EngineBaseResourceList list of BackupEngineBase resources +type EngineBaseResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]EngineBaseResource `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"` +} + +// EngineBaseResourceListIterator provides access to a complete listing of EngineBaseResource values. +type EngineBaseResourceListIterator struct { + i int + page EngineBaseResourceListPage +} + +// NextWithContext 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 *EngineBaseResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EngineBaseResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *EngineBaseResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter EngineBaseResourceListIterator) 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 EngineBaseResourceListIterator) Response() EngineBaseResourceList { + 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 EngineBaseResourceListIterator) Value() EngineBaseResource { + if !iter.page.NotDone() { + return EngineBaseResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the EngineBaseResourceListIterator type. +func NewEngineBaseResourceListIterator(page EngineBaseResourceListPage) EngineBaseResourceListIterator { + return EngineBaseResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ebrl EngineBaseResourceList) IsEmpty() bool { + return ebrl.Value == nil || len(*ebrl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ebrl EngineBaseResourceList) hasNextLink() bool { + return ebrl.NextLink != nil && len(*ebrl.NextLink) != 0 +} + +// engineBaseResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ebrl EngineBaseResourceList) engineBaseResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !ebrl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ebrl.NextLink))) +} + +// EngineBaseResourceListPage contains a page of EngineBaseResource values. +type EngineBaseResourceListPage struct { + fn func(context.Context, EngineBaseResourceList) (EngineBaseResourceList, error) + ebrl EngineBaseResourceList +} + +// NextWithContext 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 *EngineBaseResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EngineBaseResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ebrl) + if err != nil { + return err + } + page.ebrl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *EngineBaseResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page EngineBaseResourceListPage) NotDone() bool { + return !page.ebrl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page EngineBaseResourceListPage) Response() EngineBaseResourceList { + return page.ebrl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page EngineBaseResourceListPage) Values() []EngineBaseResource { + if page.ebrl.IsEmpty() { + return nil + } + return *page.ebrl.Value +} + +// Creates a new instance of the EngineBaseResourceListPage type. +func NewEngineBaseResourceListPage(cur EngineBaseResourceList, getNextPage func(context.Context, EngineBaseResourceList) (EngineBaseResourceList, error)) EngineBaseResourceListPage { + return EngineBaseResourceListPage{ + fn: getNextPage, + ebrl: cur, + } +} + +// EngineExtendedInfo additional information on backup engine. +type EngineExtendedInfo struct { + // DatabaseName - Database name of backup engine. + DatabaseName *string `json:"databaseName,omitempty"` + // ProtectedItemsCount - Number of protected items in the backup engine. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // ProtectedServersCount - Number of protected servers in the backup engine. + ProtectedServersCount *int32 `json:"protectedServersCount,omitempty"` + // DiskCount - Number of disks in the backup engine. + DiskCount *int32 `json:"diskCount,omitempty"` + // UsedDiskSpace - Disk space used in the backup engine. + UsedDiskSpace *float64 `json:"usedDiskSpace,omitempty"` + // AvailableDiskSpace - Disk space currently available in the backup engine. + AvailableDiskSpace *float64 `json:"availableDiskSpace,omitempty"` + // RefreshedAt - Last refresh time in the backup engine. + RefreshedAt *date.Time `json:"refreshedAt,omitempty"` + // AzureProtectedInstances - Protected instances in the backup engine. + AzureProtectedInstances *int32 `json:"azureProtectedInstances,omitempty"` +} + +// ErrorAdditionalInfo the resource management error additional info. +type ErrorAdditionalInfo struct { + // Type - READ-ONLY; The additional info type. + Type *string `json:"type,omitempty"` + // Info - READ-ONLY; The additional info. + Info interface{} `json:"info,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorAdditionalInfo. +func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ErrorDetail error Detail class which encapsulates Code, Message and Recommendations. +type ErrorDetail struct { + // Code - READ-ONLY; Error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; Error Message related to the Code. + Message *string `json:"message,omitempty"` + // Recommendations - READ-ONLY; List of recommendation strings. + Recommendations *[]string `json:"recommendations,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorDetail. +func (ed ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ErrorResponse common error response for all Azure Resource Manager APIs to return error details for +// failed operations. (This also follows the OData error response format.) +type ErrorResponse struct { + // Code - READ-ONLY; The error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; The error message. + Message *string `json:"message,omitempty"` + // Target - READ-ONLY; The error target. + Target *string `json:"target,omitempty"` + // Details - READ-ONLY; The error details. + Details *[]ErrorResponse `json:"details,omitempty"` + // AdditionalInfo - READ-ONLY; The error additional info. + AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorResponse. +func (er ErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ExportJobsOperationResultInfo this class is used to send blob details after exporting jobs. +type ExportJobsOperationResultInfo struct { + // BlobURL - URL of the blob into which the serialized string of list of jobs is exported. + BlobURL *string `json:"blobUrl,omitempty"` + // BlobSasKey - SAS key to access the blob. It expires in 15 mins. + BlobSasKey *string `json:"blobSasKey,omitempty"` + // ExcelFileBlobURL - URL of the blob into which the ExcelFile is uploaded. + ExcelFileBlobURL *string `json:"excelFileBlobUrl,omitempty"` + // ExcelFileBlobSasKey - SAS key to access the blob. It expires in 15 mins. + ExcelFileBlobSasKey *string `json:"excelFileBlobSasKey,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeOperationResultInfoBase', 'ObjectTypeExportJobsOperationResultInfo', 'ObjectTypeOperationResultInfo' + ObjectType ObjectType `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExportJobsOperationResultInfo. +func (ejori ExportJobsOperationResultInfo) MarshalJSON() ([]byte, error) { + ejori.ObjectType = ObjectTypeExportJobsOperationResultInfo + objectMap := make(map[string]interface{}) + if ejori.BlobURL != nil { + objectMap["blobUrl"] = ejori.BlobURL + } + if ejori.BlobSasKey != nil { + objectMap["blobSasKey"] = ejori.BlobSasKey + } + if ejori.ExcelFileBlobURL != nil { + objectMap["excelFileBlobUrl"] = ejori.ExcelFileBlobURL + } + if ejori.ExcelFileBlobSasKey != nil { + objectMap["excelFileBlobSasKey"] = ejori.ExcelFileBlobSasKey + } + if ejori.ObjectType != "" { + objectMap["objectType"] = ejori.ObjectType + } + return json.Marshal(objectMap) +} + +// AsExportJobsOperationResultInfo is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. +func (ejori ExportJobsOperationResultInfo) AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) { + return &ejori, true +} + +// AsOperationResultInfo is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. +func (ejori ExportJobsOperationResultInfo) AsOperationResultInfo() (*OperationResultInfo, bool) { + return nil, false +} + +// AsOperationResultInfoBase is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. +func (ejori ExportJobsOperationResultInfo) AsOperationResultInfoBase() (*OperationResultInfoBase, bool) { + return nil, false +} + +// AsBasicOperationResultInfoBase is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. +func (ejori ExportJobsOperationResultInfo) AsBasicOperationResultInfoBase() (BasicOperationResultInfoBase, bool) { + return &ejori, true +} + +// ExtendedProperties extended Properties for Azure IaasVM Backup. +type ExtendedProperties struct { + // DiskExclusionProperties - Extended Properties for Disk Exclusion. + DiskExclusionProperties *DiskExclusionProperties `json:"diskExclusionProperties,omitempty"` +} + +// GenericContainer base class for generic container of backup items +type GenericContainer struct { + // FabricName - Name of the container's fabric + FabricName *string `json:"fabricName,omitempty"` + // ExtendedInformation - Extended information (not returned in List container API calls) + ExtendedInformation *GenericContainerExtendedInfo `json:"extendedInformation,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for GenericContainer. +func (gc GenericContainer) MarshalJSON() ([]byte, error) { + gc.ContainerType = ContainerTypeGenericContainer1 + objectMap := make(map[string]interface{}) + if gc.FabricName != nil { + objectMap["fabricName"] = gc.FabricName + } + if gc.ExtendedInformation != nil { + objectMap["extendedInformation"] = gc.ExtendedInformation + } + if gc.FriendlyName != nil { + objectMap["friendlyName"] = gc.FriendlyName + } + if gc.BackupManagementType != "" { + objectMap["backupManagementType"] = gc.BackupManagementType + } + if gc.RegistrationStatus != nil { + objectMap["registrationStatus"] = gc.RegistrationStatus + } + if gc.HealthStatus != nil { + objectMap["healthStatus"] = gc.HealthStatus + } + if gc.ContainerType != "" { + objectMap["containerType"] = gc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsBasicDpmContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsGenericContainer() (*GenericContainer, bool) { + return &gc, true +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &gc, true +} + +// GenericContainerExtendedInfo container extended information +type GenericContainerExtendedInfo struct { + // RawCertData - Public key of container cert + RawCertData *string `json:"rawCertData,omitempty"` + // ContainerIdentityInfo - Container identity information + ContainerIdentityInfo *ContainerIdentityInfo `json:"containerIdentityInfo,omitempty"` + // ServiceEndpoints - Azure Backup Service Endpoints for the container + ServiceEndpoints map[string]*string `json:"serviceEndpoints"` +} + +// MarshalJSON is the custom marshaler for GenericContainerExtendedInfo. +func (gcei GenericContainerExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gcei.RawCertData != nil { + objectMap["rawCertData"] = gcei.RawCertData + } + if gcei.ContainerIdentityInfo != nil { + objectMap["containerIdentityInfo"] = gcei.ContainerIdentityInfo + } + if gcei.ServiceEndpoints != nil { + objectMap["serviceEndpoints"] = gcei.ServiceEndpoints + } + return json.Marshal(objectMap) +} + +// GenericProtectedItem base class for backup items. +type GenericProtectedItem struct { + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // PolicyState - Indicates consistency of policy object and policy applied to this backup item. + PolicyState *string `json:"policyState,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // ProtectedItemID - Data Plane Service ID of the protected item. + ProtectedItemID *int64 `json:"protectedItemId,omitempty"` + // SourceAssociations - Loosely coupled (type, value) associations (example - parent of a protected item) + SourceAssociations map[string]*string `json:"sourceAssociations"` + // FabricName - Name of this backup item's fabric. + FabricName *string `json:"fabricName,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for GenericProtectedItem. +func (gpi GenericProtectedItem) MarshalJSON() ([]byte, error) { + gpi.ProtectedItemType = ProtectedItemTypeGenericProtectedItem + objectMap := make(map[string]interface{}) + if gpi.FriendlyName != nil { + objectMap["friendlyName"] = gpi.FriendlyName + } + if gpi.PolicyState != nil { + objectMap["policyState"] = gpi.PolicyState + } + if gpi.ProtectionState != "" { + objectMap["protectionState"] = gpi.ProtectionState + } + if gpi.ProtectedItemID != nil { + objectMap["protectedItemId"] = gpi.ProtectedItemID + } + if gpi.SourceAssociations != nil { + objectMap["sourceAssociations"] = gpi.SourceAssociations + } + if gpi.FabricName != nil { + objectMap["fabricName"] = gpi.FabricName + } + if gpi.BackupManagementType != "" { + objectMap["backupManagementType"] = gpi.BackupManagementType + } + if gpi.WorkloadType != "" { + objectMap["workloadType"] = gpi.WorkloadType + } + if gpi.ContainerName != nil { + objectMap["containerName"] = gpi.ContainerName + } + if gpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = gpi.SourceResourceID + } + if gpi.PolicyID != nil { + objectMap["policyId"] = gpi.PolicyID + } + if gpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = gpi.LastRecoveryPoint + } + if gpi.BackupSetName != nil { + objectMap["backupSetName"] = gpi.BackupSetName + } + if gpi.CreateMode != "" { + objectMap["createMode"] = gpi.CreateMode + } + if gpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = gpi.DeferredDeleteTimeInUTC + } + if gpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = gpi.IsScheduledForDeferredDelete + } + if gpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = gpi.DeferredDeleteTimeRemaining + } + if gpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = gpi.IsDeferredDeleteScheduleUpcoming + } + if gpi.IsRehydrate != nil { + objectMap["isRehydrate"] = gpi.IsRehydrate + } + if gpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = gpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return &gpi, true +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &gpi, true +} + +// GenericProtectionPolicy azure VM (Mercury) workload-specific backup policy. +type GenericProtectionPolicy struct { + // SubProtectionPolicy - List of sub-protection policies which includes schedule and retention + SubProtectionPolicy *[]SubProtectionPolicy `json:"subProtectionPolicy,omitempty"` + // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + TimeZone *string `json:"timeZone,omitempty"` + // FabricName - Name of this policy's fabric. + FabricName *string `json:"fabricName,omitempty"` + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` +} + +// MarshalJSON is the custom marshaler for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) MarshalJSON() ([]byte, error) { + gpp.BackupManagementType = BackupManagementTypeGenericProtectionPolicy + objectMap := make(map[string]interface{}) + if gpp.SubProtectionPolicy != nil { + objectMap["subProtectionPolicy"] = gpp.SubProtectionPolicy + } + if gpp.TimeZone != nil { + objectMap["timeZone"] = gpp.TimeZone + } + if gpp.FabricName != nil { + objectMap["fabricName"] = gpp.FabricName + } + if gpp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = gpp.ProtectedItemsCount + } + if gpp.BackupManagementType != "" { + objectMap["backupManagementType"] = gpp.BackupManagementType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return nil, false +} + +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { + return nil, false +} + +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { + return nil, false +} + +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { + return &gpp, true +} + +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { + return nil, false +} + +// AsProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { + return nil, false +} + +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &gpp, true +} + +// GenericRecoveryPoint generic backup copy. +type GenericRecoveryPoint struct { + // FriendlyName - Friendly name of the backup copy. + FriendlyName *string `json:"friendlyName,omitempty"` + // RecoveryPointType - Type of the backup copy. + RecoveryPointType *string `json:"recoveryPointType,omitempty"` + // RecoveryPointTime - Time at which this backup copy was created. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // RecoveryPointAdditionalInfo - Additional information associated with this backup copy. + RecoveryPointAdditionalInfo *string `json:"recoveryPointAdditionalInfo,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) MarshalJSON() ([]byte, error) { + grp.ObjectType = ObjectTypeGenericRecoveryPoint + objectMap := make(map[string]interface{}) + if grp.FriendlyName != nil { + objectMap["friendlyName"] = grp.FriendlyName + } + if grp.RecoveryPointType != nil { + objectMap["recoveryPointType"] = grp.RecoveryPointType + } + if grp.RecoveryPointTime != nil { + objectMap["recoveryPointTime"] = grp.RecoveryPointTime + } + if grp.RecoveryPointAdditionalInfo != nil { + objectMap["recoveryPointAdditionalInfo"] = grp.RecoveryPointAdditionalInfo + } + if grp.ObjectType != "" { + objectMap["objectType"] = grp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return &grp, true +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &grp, true +} + +// GetProtectedItemQueryObject filters to list backup items. +type GetProtectedItemQueryObject struct { + // Expand - Specifies if the additional information should be provided for this item. + Expand *string `json:"expand,omitempty"` +} + +// IaasVMBackupRequest iaaS VM workload-specific backup request. +type IaasVMBackupRequest struct { + // RecoveryPointExpiryTimeInUTC - Backup copy will expire after the time specified (UTC). + RecoveryPointExpiryTimeInUTC *date.Time `json:"recoveryPointExpiryTimeInUTC,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' + ObjectType ObjectTypeBasicRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for IaasVMBackupRequest. +func (ivbr IaasVMBackupRequest) MarshalJSON() ([]byte, error) { + ivbr.ObjectType = ObjectTypeIaasVMBackupRequest + objectMap := make(map[string]interface{}) + if ivbr.RecoveryPointExpiryTimeInUTC != nil { + objectMap["recoveryPointExpiryTimeInUTC"] = ivbr.RecoveryPointExpiryTimeInUTC + } + if ivbr.ObjectType != "" { + objectMap["objectType"] = ivbr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareBackupRequest is the BasicRequest implementation for IaasVMBackupRequest. +func (ivbr IaasVMBackupRequest) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { + return nil, false +} + +// AsAzureWorkloadBackupRequest is the BasicRequest implementation for IaasVMBackupRequest. +func (ivbr IaasVMBackupRequest) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { + return nil, false +} + +// AsIaasVMBackupRequest is the BasicRequest implementation for IaasVMBackupRequest. +func (ivbr IaasVMBackupRequest) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { + return &ivbr, true +} + +// AsRequest is the BasicRequest implementation for IaasVMBackupRequest. +func (ivbr IaasVMBackupRequest) AsRequest() (*Request, bool) { + return nil, false +} + +// AsBasicRequest is the BasicRequest implementation for IaasVMBackupRequest. +func (ivbr IaasVMBackupRequest) AsBasicRequest() (BasicRequest, bool) { + return &ivbr, true +} + +// BasicIaaSVMContainer iaaS VM workload-specific container. +type BasicIaaSVMContainer interface { + AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) + AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) + AsIaaSVMContainer() (*IaaSVMContainer, bool) +} + +// IaaSVMContainer iaaS VM workload-specific container. +type IaaSVMContainer struct { + // VirtualMachineID - Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // VirtualMachineVersion - Specifies whether the container represents a Classic or an Azure Resource Manager VM. + VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` + // ResourceGroup - Resource group name of Recovery Services Vault. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +func unmarshalBasicIaaSVMContainer(body []byte) (BasicIaaSVMContainer, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["containerType"] { + case string(ContainerTypeMicrosoftClassicComputevirtualMachines): + var aisccvc AzureIaaSClassicComputeVMContainer + err := json.Unmarshal(body, &aisccvc) + return aisccvc, err + case string(ContainerTypeMicrosoftComputevirtualMachines): + var aiscvc AzureIaaSComputeVMContainer + err := json.Unmarshal(body, &aiscvc) + return aiscvc, err + default: + var isc IaaSVMContainer + err := json.Unmarshal(body, &isc) + return isc, err + } +} +func unmarshalBasicIaaSVMContainerArray(body []byte) ([]BasicIaaSVMContainer, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + iscArray := make([]BasicIaaSVMContainer, len(rawMessages)) + + for index, rawMessage := range rawMessages { + isc, err := unmarshalBasicIaaSVMContainer(*rawMessage) + if err != nil { + return nil, err + } + iscArray[index] = isc + } + return iscArray, nil +} + +// MarshalJSON is the custom marshaler for IaaSVMContainer. +func (isc IaaSVMContainer) MarshalJSON() ([]byte, error) { + isc.ContainerType = ContainerTypeIaaSVMContainer + objectMap := make(map[string]interface{}) + if isc.VirtualMachineID != nil { + objectMap["virtualMachineId"] = isc.VirtualMachineID + } + if isc.VirtualMachineVersion != nil { + objectMap["virtualMachineVersion"] = isc.VirtualMachineVersion + } + if isc.ResourceGroup != nil { + objectMap["resourceGroup"] = isc.ResourceGroup + } + if isc.FriendlyName != nil { + objectMap["friendlyName"] = isc.FriendlyName + } + if isc.BackupManagementType != "" { + objectMap["backupManagementType"] = isc.BackupManagementType + } + if isc.RegistrationStatus != nil { + objectMap["registrationStatus"] = isc.RegistrationStatus + } + if isc.HealthStatus != nil { + objectMap["healthStatus"] = isc.HealthStatus + } + if isc.ContainerType != "" { + objectMap["containerType"] = isc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsBasicDpmContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return &isc, true +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return &isc, true +} + +// AsMabContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &isc, true +} + +// IaasVMILRRegistrationRequest restore files/folders from a backup copy of IaaS VM. +type IaasVMILRRegistrationRequest struct { + // RecoveryPointID - ID of the IaaS VM backup copy from where the files/folders have to be restored. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // VirtualMachineID - Fully qualified ARM ID of the virtual machine whose the files / folders have to be restored. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // InitiatorName - iSCSI initiator name. + InitiatorName *string `json:"initiatorName,omitempty"` + // RenewExistingRegistration - Whether to renew existing registration with the iSCSI server. + RenewExistingRegistration *bool `json:"renewExistingRegistration,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeAzureFileShareProvisionILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest' + ObjectType ObjectTypeBasicILRRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for IaasVMILRRegistrationRequest. +func (ivrr IaasVMILRRegistrationRequest) MarshalJSON() ([]byte, error) { + ivrr.ObjectType = ObjectTypeIaasVMILRRegistrationRequest + objectMap := make(map[string]interface{}) + if ivrr.RecoveryPointID != nil { + objectMap["recoveryPointId"] = ivrr.RecoveryPointID + } + if ivrr.VirtualMachineID != nil { + objectMap["virtualMachineId"] = ivrr.VirtualMachineID + } + if ivrr.InitiatorName != nil { + objectMap["initiatorName"] = ivrr.InitiatorName + } + if ivrr.RenewExistingRegistration != nil { + objectMap["renewExistingRegistration"] = ivrr.RenewExistingRegistration + } + if ivrr.ObjectType != "" { + objectMap["objectType"] = ivrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProvisionILRRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. +func (ivrr IaasVMILRRegistrationRequest) AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) { + return nil, false +} + +// AsIaasVMILRRegistrationRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. +func (ivrr IaasVMILRRegistrationRequest) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) { + return &ivrr, true +} + +// AsILRRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. +func (ivrr IaasVMILRRegistrationRequest) AsILRRequest() (*ILRRequest, bool) { + return nil, false +} + +// AsBasicILRRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. +func (ivrr IaasVMILRRegistrationRequest) AsBasicILRRequest() (BasicILRRequest, bool) { + return &ivrr, true +} + +// BasicIaaSVMProtectableItem iaaS VM workload-specific backup item. +type BasicIaaSVMProtectableItem interface { + AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) + AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) + AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +} + +// IaaSVMProtectableItem iaaS VM workload-specific backup item. +type IaaSVMProtectableItem struct { + // VirtualMachineID - Fully qualified ARM ID of the virtual machine. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +func unmarshalBasicIaaSVMProtectableItem(body []byte) (BasicIaaSVMProtectableItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectableItemType"] { + case string(ProtectableItemTypeMicrosoftClassicComputevirtualMachines): + var aisccvpi AzureIaaSClassicComputeVMProtectableItem + err := json.Unmarshal(body, &aisccvpi) + return aisccvpi, err + case string(ProtectableItemTypeMicrosoftComputevirtualMachines): + var aiscvpi AzureIaaSComputeVMProtectableItem + err := json.Unmarshal(body, &aiscvpi) + return aiscvpi, err + default: + var ispi IaaSVMProtectableItem + err := json.Unmarshal(body, &ispi) + return ispi, err + } +} +func unmarshalBasicIaaSVMProtectableItemArray(body []byte) ([]BasicIaaSVMProtectableItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ispiArray := make([]BasicIaaSVMProtectableItem, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ispi, err := unmarshalBasicIaaSVMProtectableItem(*rawMessage) + if err != nil { + return nil, err + } + ispiArray[index] = ispi + } + return ispiArray, nil +} + +// MarshalJSON is the custom marshaler for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) MarshalJSON() ([]byte, error) { + ispi.ProtectableItemType = ProtectableItemTypeIaaSVMProtectableItem + objectMap := make(map[string]interface{}) + if ispi.VirtualMachineID != nil { + objectMap["virtualMachineId"] = ispi.VirtualMachineID + } + if ispi.BackupManagementType != nil { + objectMap["backupManagementType"] = ispi.BackupManagementType + } + if ispi.WorkloadType != nil { + objectMap["workloadType"] = ispi.WorkloadType + } + if ispi.FriendlyName != nil { + objectMap["friendlyName"] = ispi.FriendlyName + } + if ispi.ProtectionState != "" { + objectMap["protectionState"] = ispi.ProtectionState + } + if ispi.ProtectableItemType != "" { + objectMap["protectableItemType"] = ispi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return &ispi, true +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return &ispi, true +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &ispi, true +} + +// IaasVMRecoveryPoint iaaS VM workload specific backup copy. +type IaasVMRecoveryPoint struct { + // RecoveryPointType - READ-ONLY; Type of the backup copy. + RecoveryPointType *string `json:"recoveryPointType,omitempty"` + // RecoveryPointTime - READ-ONLY; Time at which this backup copy was created. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // RecoveryPointAdditionalInfo - READ-ONLY; Additional information associated with this backup copy. + RecoveryPointAdditionalInfo *string `json:"recoveryPointAdditionalInfo,omitempty"` + // SourceVMStorageType - READ-ONLY; Storage type of the VM whose backup copy is created. + SourceVMStorageType *string `json:"sourceVMStorageType,omitempty"` + // IsSourceVMEncrypted - READ-ONLY; Identifies whether the VM was encrypted when the backup copy is created. + IsSourceVMEncrypted *bool `json:"isSourceVMEncrypted,omitempty"` + // KeyAndSecret - Required details for recovering an encrypted VM. Applicable only when IsSourceVMEncrypted is true. + KeyAndSecret *KeyAndSecretDetails `json:"keyAndSecret,omitempty"` + // IsInstantIlrSessionActive - Is the session to recover items from this backup copy still active. + IsInstantIlrSessionActive *bool `json:"isInstantIlrSessionActive,omitempty"` + // RecoveryPointTierDetails - Recovery point tier information. + RecoveryPointTierDetails *[]RecoveryPointTierInformation `json:"recoveryPointTierDetails,omitempty"` + // IsManagedVirtualMachine - Whether VM is with Managed Disks + IsManagedVirtualMachine *bool `json:"isManagedVirtualMachine,omitempty"` + // VirtualMachineSize - Virtual Machine Size + VirtualMachineSize *string `json:"virtualMachineSize,omitempty"` + // OriginalStorageAccountOption - Original Storage Account Option + OriginalStorageAccountOption *bool `json:"originalStorageAccountOption,omitempty"` + // OsType - OS type + OsType *string `json:"osType,omitempty"` + // RecoveryPointDiskConfiguration - Disk configuration + RecoveryPointDiskConfiguration *RecoveryPointDiskConfiguration `json:"recoveryPointDiskConfiguration,omitempty"` + // Zones - Identifies the zone of the VM at the time of backup. Applicable only for zone-pinned Vms + Zones *[]string `json:"zones,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) MarshalJSON() ([]byte, error) { + ivrp.ObjectType = ObjectTypeIaasVMRecoveryPoint + objectMap := make(map[string]interface{}) + if ivrp.KeyAndSecret != nil { + objectMap["keyAndSecret"] = ivrp.KeyAndSecret + } + if ivrp.IsInstantIlrSessionActive != nil { + objectMap["isInstantIlrSessionActive"] = ivrp.IsInstantIlrSessionActive + } + if ivrp.RecoveryPointTierDetails != nil { + objectMap["recoveryPointTierDetails"] = ivrp.RecoveryPointTierDetails + } + if ivrp.IsManagedVirtualMachine != nil { + objectMap["isManagedVirtualMachine"] = ivrp.IsManagedVirtualMachine + } + if ivrp.VirtualMachineSize != nil { + objectMap["virtualMachineSize"] = ivrp.VirtualMachineSize + } + if ivrp.OriginalStorageAccountOption != nil { + objectMap["originalStorageAccountOption"] = ivrp.OriginalStorageAccountOption + } + if ivrp.OsType != nil { + objectMap["osType"] = ivrp.OsType + } + if ivrp.RecoveryPointDiskConfiguration != nil { + objectMap["recoveryPointDiskConfiguration"] = ivrp.RecoveryPointDiskConfiguration + } + if ivrp.Zones != nil { + objectMap["zones"] = ivrp.Zones + } + if ivrp.ObjectType != "" { + objectMap["objectType"] = ivrp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return &ivrp, true +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &ivrp, true +} + +// IaasVMRestoreRequest iaaS VM workload-specific restore. +type IaasVMRestoreRequest struct { + // RecoveryPointID - ID of the backup copy to be recovered. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM which is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // TargetVirtualMachineID - This is the complete ARM Id of the VM that will be created. + // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` + // TargetResourceGroupID - This is the ARM Id of the resource group that you want to create for this Virtual machine and other artifacts. + // For e.g. /subscriptions/{subId}/resourcegroups/{rg} + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // StorageAccountID - Fully qualified ARM ID of the storage account to which the VM has to be restored. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // VirtualNetworkID - This is the virtual network Id of the vnet that will be attached to the virtual machine. + // User will be validated for join action permissions in the linked access. + VirtualNetworkID *string `json:"virtualNetworkId,omitempty"` + // SubnetID - Subnet ID, is the subnet ID associated with the to be restored VM. For Classic VMs it would be + // {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager VMs it would be ARM resource ID used to represent + // the subnet. + SubnetID *string `json:"subnetId,omitempty"` + // TargetDomainNameID - Fully qualified ARM ID of the domain name to be associated to the VM being restored. This applies only to Classic + // Virtual Machines. + TargetDomainNameID *string `json:"targetDomainNameId,omitempty"` + // Region - Region in which the virtual machine is restored. + Region *string `json:"region,omitempty"` + // AffinityGroup - Affinity group associated to VM to be restored. Used only for Classic Compute Virtual Machines. + AffinityGroup *string `json:"affinityGroup,omitempty"` + // CreateNewCloudService - Should a new cloud service be created while restoring the VM. If this is false, VM will be restored to the same + // cloud service as it was at the time of backup. + CreateNewCloudService *bool `json:"createNewCloudService,omitempty"` + // OriginalStorageAccountOption - Original Storage Account Option + OriginalStorageAccountOption *bool `json:"originalStorageAccountOption,omitempty"` + // EncryptionDetails - Details needed if the VM was encrypted at the time of backup. + EncryptionDetails *EncryptionDetails `json:"encryptionDetails,omitempty"` + // RestoreDiskLunList - List of Disk LUNs for partial restore + RestoreDiskLunList *[]int32 `json:"restoreDiskLunList,omitempty"` + // RestoreWithManagedDisks - Flag to denote of an Unmanaged disk VM should be restored with Managed disks. + RestoreWithManagedDisks *bool `json:"restoreWithManagedDisks,omitempty"` + // DiskEncryptionSetID - DiskEncryptionSet's ID - needed if the VM needs to be encrypted at rest during restore with customer managed key. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // Zones - Target zone where the VM and its disks should be restored. + Zones *[]string `json:"zones,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) MarshalJSON() ([]byte, error) { + ivrr.ObjectType = ObjectTypeIaasVMRestoreRequest + objectMap := make(map[string]interface{}) + if ivrr.RecoveryPointID != nil { + objectMap["recoveryPointId"] = ivrr.RecoveryPointID + } + if ivrr.RecoveryType != "" { + objectMap["recoveryType"] = ivrr.RecoveryType + } + if ivrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = ivrr.SourceResourceID + } + if ivrr.TargetVirtualMachineID != nil { + objectMap["targetVirtualMachineId"] = ivrr.TargetVirtualMachineID + } + if ivrr.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = ivrr.TargetResourceGroupID + } + if ivrr.StorageAccountID != nil { + objectMap["storageAccountId"] = ivrr.StorageAccountID + } + if ivrr.VirtualNetworkID != nil { + objectMap["virtualNetworkId"] = ivrr.VirtualNetworkID + } + if ivrr.SubnetID != nil { + objectMap["subnetId"] = ivrr.SubnetID + } + if ivrr.TargetDomainNameID != nil { + objectMap["targetDomainNameId"] = ivrr.TargetDomainNameID + } + if ivrr.Region != nil { + objectMap["region"] = ivrr.Region + } + if ivrr.AffinityGroup != nil { + objectMap["affinityGroup"] = ivrr.AffinityGroup + } + if ivrr.CreateNewCloudService != nil { + objectMap["createNewCloudService"] = ivrr.CreateNewCloudService + } + if ivrr.OriginalStorageAccountOption != nil { + objectMap["originalStorageAccountOption"] = ivrr.OriginalStorageAccountOption + } + if ivrr.EncryptionDetails != nil { + objectMap["encryptionDetails"] = ivrr.EncryptionDetails + } + if ivrr.RestoreDiskLunList != nil { + objectMap["restoreDiskLunList"] = ivrr.RestoreDiskLunList + } + if ivrr.RestoreWithManagedDisks != nil { + objectMap["restoreWithManagedDisks"] = ivrr.RestoreWithManagedDisks + } + if ivrr.DiskEncryptionSetID != nil { + objectMap["diskEncryptionSetId"] = ivrr.DiskEncryptionSetID + } + if ivrr.Zones != nil { + objectMap["zones"] = ivrr.Zones + } + if ivrr.ObjectType != "" { + objectMap["objectType"] = ivrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return &ivrr, true +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &ivrr, true +} + +// BasicILRRequest parameters to Provision ILR API. +type BasicILRRequest interface { + AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) + AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) + AsILRRequest() (*ILRRequest, bool) +} + +// ILRRequest parameters to Provision ILR API. +type ILRRequest struct { + // ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeAzureFileShareProvisionILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest' + ObjectType ObjectTypeBasicILRRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicILRRequest(body []byte) (BasicILRRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureFileShareProvisionILRRequest): + var afspir AzureFileShareProvisionILRRequest + err := json.Unmarshal(body, &afspir) + return afspir, err + case string(ObjectTypeIaasVMILRRegistrationRequest): + var ivrr IaasVMILRRegistrationRequest + err := json.Unmarshal(body, &ivrr) + return ivrr, err + default: + var ir ILRRequest + err := json.Unmarshal(body, &ir) + return ir, err + } +} +func unmarshalBasicILRRequestArray(body []byte) ([]BasicILRRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + irArray := make([]BasicILRRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ir, err := unmarshalBasicILRRequest(*rawMessage) + if err != nil { + return nil, err + } + irArray[index] = ir + } + return irArray, nil +} + +// MarshalJSON is the custom marshaler for ILRRequest. +func (ir ILRRequest) MarshalJSON() ([]byte, error) { + ir.ObjectType = ObjectTypeILRRequest + objectMap := make(map[string]interface{}) + if ir.ObjectType != "" { + objectMap["objectType"] = ir.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProvisionILRRequest is the BasicILRRequest implementation for ILRRequest. +func (ir ILRRequest) AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) { + return nil, false +} + +// AsIaasVMILRRegistrationRequest is the BasicILRRequest implementation for ILRRequest. +func (ir ILRRequest) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) { + return nil, false +} + +// AsILRRequest is the BasicILRRequest implementation for ILRRequest. +func (ir ILRRequest) AsILRRequest() (*ILRRequest, bool) { + return &ir, true +} + +// AsBasicILRRequest is the BasicILRRequest implementation for ILRRequest. +func (ir ILRRequest) AsBasicILRRequest() (BasicILRRequest, bool) { + return &ir, true +} + +// ILRRequestResource parameters to Provision ILR API. +type ILRRequestResource struct { + // Properties - ILRRequestResource properties + Properties BasicILRRequest `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ILRRequestResource. +func (irr ILRRequestResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = irr.Properties + if irr.Location != nil { + objectMap["location"] = irr.Location + } + if irr.Tags != nil { + objectMap["tags"] = irr.Tags + } + if irr.ETag != nil { + objectMap["eTag"] = irr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ILRRequestResource struct. +func (irr *ILRRequestResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicILRRequest(*v) + if err != nil { + return err + } + irr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + irr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + irr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + irr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + irr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + irr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + irr.ETag = &eTag + } + } + } + + return nil +} + +// InquiryInfo details about inquired protectable items under a given container. +type InquiryInfo struct { + // Status - Inquiry Status for this container such as + // InProgress | Failed | Succeeded + Status *string `json:"status,omitempty"` + // ErrorDetail - Error Details if the Status is non-success. + ErrorDetail *ErrorDetail `json:"errorDetail,omitempty"` + // InquiryDetails - Inquiry Details which will have workload specific details. + // For e.g. - For SQL and oracle this will contain different details. + InquiryDetails *[]WorkloadInquiryDetails `json:"inquiryDetails,omitempty"` +} + +// InquiryValidation validation for inquired protectable items under a given container. +type InquiryValidation struct { + // Status - Status for the Inquiry Validation. + Status *string `json:"status,omitempty"` + // ErrorDetail - Error Detail in case the status is non-success. + ErrorDetail *ErrorDetail `json:"errorDetail,omitempty"` + // AdditionalDetail - READ-ONLY; Error Additional Detail in case the status is non-success. + AdditionalDetail *string `json:"additionalDetail,omitempty"` +} + +// MarshalJSON is the custom marshaler for InquiryValidation. +func (iv InquiryValidation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if iv.Status != nil { + objectMap["status"] = iv.Status + } + if iv.ErrorDetail != nil { + objectMap["errorDetail"] = iv.ErrorDetail + } + return json.Marshal(objectMap) +} + +// InstantItemRecoveryTarget target details for file / folder restore. +type InstantItemRecoveryTarget struct { + // ClientScripts - List of client scripts. + ClientScripts *[]ClientScriptForConnect `json:"clientScripts,omitempty"` +} + +// InstantRPAdditionalDetails ... +type InstantRPAdditionalDetails struct { + AzureBackupRGNamePrefix *string `json:"azureBackupRGNamePrefix,omitempty"` + AzureBackupRGNameSuffix *string `json:"azureBackupRGNameSuffix,omitempty"` +} + +// BasicJob defines workload agnostic properties for a job. +type BasicJob interface { + AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) + AsAzureStorageJob() (*AzureStorageJob, bool) + AsAzureWorkloadJob() (*AzureWorkloadJob, bool) + AsDpmJob() (*DpmJob, bool) + AsMabJob() (*MabJob, bool) + AsVaultJob() (*VaultJob, bool) + AsJob() (*Job, bool) +} + +// Job defines workload agnostic properties for a job. +type Job struct { + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob', 'JobTypeVaultJob' + JobType JobType `json:"jobType,omitempty"` +} + +func unmarshalBasicJob(body []byte) (BasicJob, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["jobType"] { + case string(JobTypeAzureIaaSVMJob): + var aisj AzureIaaSVMJob + err := json.Unmarshal(body, &aisj) + return aisj, err + case string(JobTypeAzureStorageJob): + var asj AzureStorageJob + err := json.Unmarshal(body, &asj) + return asj, err + case string(JobTypeAzureWorkloadJob): + var awj AzureWorkloadJob + err := json.Unmarshal(body, &awj) + return awj, err + case string(JobTypeDpmJob): + var dj DpmJob + err := json.Unmarshal(body, &dj) + return dj, err + case string(JobTypeMabJob): + var mj MabJob + err := json.Unmarshal(body, &mj) + return mj, err + case string(JobTypeVaultJob): + var vj VaultJob + err := json.Unmarshal(body, &vj) + return vj, err + default: + var j Job + err := json.Unmarshal(body, &j) + return j, err + } +} +func unmarshalBasicJobArray(body []byte) ([]BasicJob, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + jArray := make([]BasicJob, len(rawMessages)) + + for index, rawMessage := range rawMessages { + j, err := unmarshalBasicJob(*rawMessage) + if err != nil { + return nil, err + } + jArray[index] = j + } + return jArray, nil +} + +// MarshalJSON is the custom marshaler for Job. +func (j Job) MarshalJSON() ([]byte, error) { + j.JobType = JobTypeJob + objectMap := make(map[string]interface{}) + if j.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = j.EntityFriendlyName + } + if j.BackupManagementType != "" { + objectMap["backupManagementType"] = j.BackupManagementType + } + if j.Operation != nil { + objectMap["operation"] = j.Operation + } + if j.Status != nil { + objectMap["status"] = j.Status + } + if j.StartTime != nil { + objectMap["startTime"] = j.StartTime + } + if j.EndTime != nil { + objectMap["endTime"] = j.EndTime + } + if j.ActivityID != nil { + objectMap["activityId"] = j.ActivityID + } + if j.JobType != "" { + objectMap["jobType"] = j.JobType + } + return json.Marshal(objectMap) +} + +// AsAzureIaaSVMJob is the BasicJob implementation for Job. +func (j Job) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { + return nil, false +} + +// AsAzureStorageJob is the BasicJob implementation for Job. +func (j Job) AsAzureStorageJob() (*AzureStorageJob, bool) { + return nil, false +} + +// AsAzureWorkloadJob is the BasicJob implementation for Job. +func (j Job) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { + return nil, false +} + +// AsDpmJob is the BasicJob implementation for Job. +func (j Job) AsDpmJob() (*DpmJob, bool) { + return nil, false +} + +// AsMabJob is the BasicJob implementation for Job. +func (j Job) AsMabJob() (*MabJob, bool) { + return nil, false +} + +// AsVaultJob is the BasicJob implementation for Job. +func (j Job) AsVaultJob() (*VaultJob, bool) { + return nil, false +} + +// AsJob is the BasicJob implementation for Job. +func (j Job) AsJob() (*Job, bool) { + return &j, true +} + +// AsBasicJob is the BasicJob implementation for Job. +func (j Job) AsBasicJob() (BasicJob, bool) { + return &j, true +} + +// JobQueryObject filters to list the jobs. +type JobQueryObject struct { + // Status - Status of the job. Possible values include: 'JobStatusInvalid', 'JobStatusInProgress', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusCompletedWithWarnings', 'JobStatusCancelled', 'JobStatusCancelling' + Status JobStatus `json:"status,omitempty"` + // BackupManagementType - Type of backup management for the job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - Type of operation. Possible values include: 'JobOperationTypeInvalid', 'JobOperationTypeRegister', 'JobOperationTypeUnRegister', 'JobOperationTypeConfigureBackup', 'JobOperationTypeBackup', 'JobOperationTypeRestore', 'JobOperationTypeDisableBackup', 'JobOperationTypeDeleteBackupData', 'JobOperationTypeCrossRegionRestore', 'JobOperationTypeUndelete', 'JobOperationTypeUpdateCustomerManagedKey' + Operation JobOperationType `json:"operation,omitempty"` + // JobID - JobID represents the job uniquely. + JobID *string `json:"jobId,omitempty"` + // StartTime - Job has started at this time. Value is in UTC. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Job has ended at this time. Value is in UTC. + EndTime *date.Time `json:"endTime,omitempty"` +} + +// JobResource defines workload agnostic properties for a job. +type JobResource struct { + autorest.Response `json:"-"` + // Properties - JobResource properties + Properties BasicJob `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobResource. +func (jr JobResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = jr.Properties + if jr.Location != nil { + objectMap["location"] = jr.Location + } + if jr.Tags != nil { + objectMap["tags"] = jr.Tags + } + if jr.ETag != nil { + objectMap["eTag"] = jr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for JobResource struct. +func (jr *JobResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicJob(*v) + if err != nil { + return err + } + jr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + jr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + jr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + jr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + jr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + jr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + jr.ETag = &eTag + } + } + } + + return nil +} + +// JobResourceList list of Job resources +type JobResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]JobResource `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"` +} + +// JobResourceListIterator provides access to a complete listing of JobResource values. +type JobResourceListIterator struct { + i int + page JobResourceListPage +} + +// NextWithContext 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 *JobResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *JobResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter JobResourceListIterator) 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 JobResourceListIterator) Response() JobResourceList { + 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 JobResourceListIterator) Value() JobResource { + if !iter.page.NotDone() { + return JobResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the JobResourceListIterator type. +func NewJobResourceListIterator(page JobResourceListPage) JobResourceListIterator { + return JobResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (jrl JobResourceList) IsEmpty() bool { + return jrl.Value == nil || len(*jrl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (jrl JobResourceList) hasNextLink() bool { + return jrl.NextLink != nil && len(*jrl.NextLink) != 0 +} + +// jobResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (jrl JobResourceList) jobResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !jrl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(jrl.NextLink))) +} + +// JobResourceListPage contains a page of JobResource values. +type JobResourceListPage struct { + fn func(context.Context, JobResourceList) (JobResourceList, error) + jrl JobResourceList +} + +// NextWithContext 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 *JobResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.jrl) + if err != nil { + return err + } + page.jrl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *JobResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page JobResourceListPage) NotDone() bool { + return !page.jrl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page JobResourceListPage) Response() JobResourceList { + return page.jrl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page JobResourceListPage) Values() []JobResource { + if page.jrl.IsEmpty() { + return nil + } + return *page.jrl.Value +} + +// Creates a new instance of the JobResourceListPage type. +func NewJobResourceListPage(cur JobResourceList, getNextPage func(context.Context, JobResourceList) (JobResourceList, error)) JobResourceListPage { + return JobResourceListPage{ + fn: getNextPage, + jrl: cur, + } +} + +// KEKDetails KEK is encryption key for BEK. +type KEKDetails struct { + // KeyURL - Key is KEK. + KeyURL *string `json:"keyUrl,omitempty"` + // KeyVaultID - Key Vault ID where this Key is stored. + KeyVaultID *string `json:"keyVaultId,omitempty"` + // KeyBackupData - KEK data. + KeyBackupData *string `json:"keyBackupData,omitempty"` +} + +// KeyAndSecretDetails BEK is bitlocker key. +// KEK is encryption key for BEK +// If the VM was encrypted then we will store following details : +// 1. Secret(BEK) - Url + Backup Data + vaultId. +// 2. Key(KEK) - Url + Backup Data + vaultId. +// 3. EncryptionMechanism +// BEK and KEK can potentially have different vault ids. +type KeyAndSecretDetails struct { + // KekDetails - KEK is encryption key for BEK. + KekDetails *KEKDetails `json:"kekDetails,omitempty"` + // BekDetails - BEK is bitlocker encryption key. + BekDetails *BEKDetails `json:"bekDetails,omitempty"` + // EncryptionMechanism - Encryption mechanism: None/ SinglePass/ DoublePass + EncryptionMechanism *string `json:"encryptionMechanism,omitempty"` +} + +// KPIResourceHealthDetails KPI Resource Health Details +type KPIResourceHealthDetails struct { + // ResourceHealthStatus - Resource Health Status. Possible values include: 'ResourceHealthStatusHealthy', 'ResourceHealthStatusTransientDegraded', 'ResourceHealthStatusPersistentDegraded', 'ResourceHealthStatusTransientUnhealthy', 'ResourceHealthStatusPersistentUnhealthy', 'ResourceHealthStatusInvalid' + ResourceHealthStatus ResourceHealthStatus `json:"resourceHealthStatus,omitempty"` + // ResourceHealthDetails - Resource Health Status + ResourceHealthDetails *[]ResourceHealthDetails `json:"resourceHealthDetails,omitempty"` +} + +// LogSchedulePolicy log policy schedule. +type LogSchedulePolicy struct { + // ScheduleFrequencyInMins - Frequency of the log schedule operation of this policy in minutes. + ScheduleFrequencyInMins *int32 `json:"scheduleFrequencyInMins,omitempty"` + // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' + SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` +} + +// MarshalJSON is the custom marshaler for LogSchedulePolicy. +func (lsp LogSchedulePolicy) MarshalJSON() ([]byte, error) { + lsp.SchedulePolicyType = SchedulePolicyTypeLogSchedulePolicy + objectMap := make(map[string]interface{}) + if lsp.ScheduleFrequencyInMins != nil { + objectMap["scheduleFrequencyInMins"] = lsp.ScheduleFrequencyInMins + } + if lsp.SchedulePolicyType != "" { + objectMap["schedulePolicyType"] = lsp.SchedulePolicyType + } + return json.Marshal(objectMap) +} + +// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. +func (lsp LogSchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { + return &lsp, true +} + +// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. +func (lsp LogSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { + return nil, false +} + +// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. +func (lsp LogSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { + return nil, false +} + +// AsSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. +func (lsp LogSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { + return nil, false +} + +// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. +func (lsp LogSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { + return &lsp, true +} + +// LongTermRetentionPolicy long term retention policy. +type LongTermRetentionPolicy struct { + // DailySchedule - Daily retention schedule of the protection policy. + DailySchedule *DailyRetentionSchedule `json:"dailySchedule,omitempty"` + // WeeklySchedule - Weekly retention schedule of the protection policy. + WeeklySchedule *WeeklyRetentionSchedule `json:"weeklySchedule,omitempty"` + // MonthlySchedule - Monthly retention schedule of the protection policy. + MonthlySchedule *MonthlyRetentionSchedule `json:"monthlySchedule,omitempty"` + // YearlySchedule - Yearly retention schedule of the protection policy. + YearlySchedule *YearlyRetentionSchedule `json:"yearlySchedule,omitempty"` + // RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy' + RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"` +} + +// MarshalJSON is the custom marshaler for LongTermRetentionPolicy. +func (ltrp LongTermRetentionPolicy) MarshalJSON() ([]byte, error) { + ltrp.RetentionPolicyType = RetentionPolicyTypeLongTermRetentionPolicy + objectMap := make(map[string]interface{}) + if ltrp.DailySchedule != nil { + objectMap["dailySchedule"] = ltrp.DailySchedule + } + if ltrp.WeeklySchedule != nil { + objectMap["weeklySchedule"] = ltrp.WeeklySchedule + } + if ltrp.MonthlySchedule != nil { + objectMap["monthlySchedule"] = ltrp.MonthlySchedule + } + if ltrp.YearlySchedule != nil { + objectMap["yearlySchedule"] = ltrp.YearlySchedule + } + if ltrp.RetentionPolicyType != "" { + objectMap["retentionPolicyType"] = ltrp.RetentionPolicyType + } + return json.Marshal(objectMap) +} + +// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. +func (ltrp LongTermRetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) { + return <rp, true +} + +// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. +func (ltrp LongTermRetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) { + return nil, false +} + +// AsRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. +func (ltrp LongTermRetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) { + return nil, false +} + +// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. +func (ltrp LongTermRetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) { + return <rp, true +} + +// LongTermSchedulePolicy long term policy schedule. +type LongTermSchedulePolicy struct { + // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' + SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` +} + +// MarshalJSON is the custom marshaler for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) MarshalJSON() ([]byte, error) { + ltsp.SchedulePolicyType = SchedulePolicyTypeLongTermSchedulePolicy + objectMap := make(map[string]interface{}) + if ltsp.SchedulePolicyType != "" { + objectMap["schedulePolicyType"] = ltsp.SchedulePolicyType + } + return json.Marshal(objectMap) +} + +// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { + return nil, false +} + +// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { + return <sp, true +} + +// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { + return nil, false +} + +// AsSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { + return nil, false +} + +// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { + return <sp, true +} + +// MabContainer container with items backed up using MAB backup engine. +type MabContainer struct { + // CanReRegister - Can the container be registered one more time. + CanReRegister *bool `json:"canReRegister,omitempty"` + // ContainerID - ContainerID represents the container. + ContainerID *int64 `json:"containerId,omitempty"` + // ProtectedItemCount - Number of items backed up in this container. + ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` + // AgentVersion - Agent version of this container. + AgentVersion *string `json:"agentVersion,omitempty"` + // ExtendedInfo - Additional information for this container + ExtendedInfo *MabContainerExtendedInfo `json:"extendedInfo,omitempty"` + // MabContainerHealthDetails - Health details on this mab container. + MabContainerHealthDetails *[]MABContainerHealthDetails `json:"mabContainerHealthDetails,omitempty"` + // ContainerHealthState - Health state of mab container. + ContainerHealthState *string `json:"containerHealthState,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for MabContainer. +func (mc MabContainer) MarshalJSON() ([]byte, error) { + mc.ContainerType = ContainerTypeWindows1 + objectMap := make(map[string]interface{}) + if mc.CanReRegister != nil { + objectMap["canReRegister"] = mc.CanReRegister + } + if mc.ContainerID != nil { + objectMap["containerId"] = mc.ContainerID + } + if mc.ProtectedItemCount != nil { + objectMap["protectedItemCount"] = mc.ProtectedItemCount + } + if mc.AgentVersion != nil { + objectMap["agentVersion"] = mc.AgentVersion + } + if mc.ExtendedInfo != nil { + objectMap["extendedInfo"] = mc.ExtendedInfo + } + if mc.MabContainerHealthDetails != nil { + objectMap["mabContainerHealthDetails"] = mc.MabContainerHealthDetails + } + if mc.ContainerHealthState != nil { + objectMap["containerHealthState"] = mc.ContainerHealthState + } + if mc.FriendlyName != nil { + objectMap["friendlyName"] = mc.FriendlyName + } + if mc.BackupManagementType != "" { + objectMap["backupManagementType"] = mc.BackupManagementType + } + if mc.RegistrationStatus != nil { + objectMap["registrationStatus"] = mc.RegistrationStatus + } + if mc.HealthStatus != nil { + objectMap["healthStatus"] = mc.HealthStatus + } + if mc.ContainerType != "" { + objectMap["containerType"] = mc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsBasicDpmContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsMabContainer() (*MabContainer, bool) { + return &mc, true +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &mc, true +} + +// MabContainerExtendedInfo additional information of the container. +type MabContainerExtendedInfo struct { + // LastRefreshedAt - Time stamp when this container was refreshed. + LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` + // BackupItemType - Type of backup items associated with this container. Possible values include: 'ItemTypeInvalid', 'ItemTypeVM', 'ItemTypeFileFolder', 'ItemTypeAzureSQLDb', 'ItemTypeSQLDB', 'ItemTypeExchange', 'ItemTypeSharepoint', 'ItemTypeVMwareVM', 'ItemTypeSystemState', 'ItemTypeClient', 'ItemTypeGenericDataSource', 'ItemTypeSQLDataBase', 'ItemTypeAzureFileShare', 'ItemTypeSAPHanaDatabase', 'ItemTypeSAPAseDatabase' + BackupItemType ItemType `json:"backupItemType,omitempty"` + // BackupItems - List of backup items associated with this container. + BackupItems *[]string `json:"backupItems,omitempty"` + // PolicyName - Backup policy associated with this container. + PolicyName *string `json:"policyName,omitempty"` + // LastBackupStatus - Latest backup status of this container. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` +} + +// MABContainerHealthDetails MAB workload-specific Health Details. +type MABContainerHealthDetails struct { + // Code - Health Code + Code *int32 `json:"code,omitempty"` + // Title - Health Title + Title *string `json:"title,omitempty"` + // Message - Health Message + Message *string `json:"message,omitempty"` + // Recommendations - Health Recommended Actions + Recommendations *[]string `json:"recommendations,omitempty"` +} + +// MabErrorInfo MAB workload-specific error information. +type MabErrorInfo struct { + // ErrorString - READ-ONLY; Localized error string. + ErrorString *string `json:"errorString,omitempty"` + // Recommendations - READ-ONLY; List of localized recommendations. + Recommendations *[]string `json:"recommendations,omitempty"` +} + +// MarshalJSON is the custom marshaler for MabErrorInfo. +func (mei MabErrorInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MabFileFolderProtectedItem MAB workload-specific backup item. +type MabFileFolderProtectedItem struct { + // FriendlyName - Friendly name of this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ComputerName - Name of the computer associated with this backup item. + ComputerName *string `json:"computerName,omitempty"` + // LastBackupStatus - Status of last backup operation. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // ProtectionState - Protected, ProtectionStopped, IRPending or ProtectionError + ProtectionState *string `json:"protectionState,omitempty"` + // DeferredDeleteSyncTimeInUTC - Sync time for deferred deletion in UTC + DeferredDeleteSyncTimeInUTC *int64 `json:"deferredDeleteSyncTimeInUTC,omitempty"` + // ExtendedInfo - Additional information with this backup item. + ExtendedInfo *MabFileFolderProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) MarshalJSON() ([]byte, error) { + mffpi.ProtectedItemType = ProtectedItemTypeMabFileFolderProtectedItem + objectMap := make(map[string]interface{}) + if mffpi.FriendlyName != nil { + objectMap["friendlyName"] = mffpi.FriendlyName + } + if mffpi.ComputerName != nil { + objectMap["computerName"] = mffpi.ComputerName + } + if mffpi.LastBackupStatus != nil { + objectMap["lastBackupStatus"] = mffpi.LastBackupStatus + } + if mffpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = mffpi.LastBackupTime + } + if mffpi.ProtectionState != nil { + objectMap["protectionState"] = mffpi.ProtectionState + } + if mffpi.DeferredDeleteSyncTimeInUTC != nil { + objectMap["deferredDeleteSyncTimeInUTC"] = mffpi.DeferredDeleteSyncTimeInUTC + } + if mffpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = mffpi.ExtendedInfo + } + if mffpi.BackupManagementType != "" { + objectMap["backupManagementType"] = mffpi.BackupManagementType + } + if mffpi.WorkloadType != "" { + objectMap["workloadType"] = mffpi.WorkloadType + } + if mffpi.ContainerName != nil { + objectMap["containerName"] = mffpi.ContainerName + } + if mffpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = mffpi.SourceResourceID + } + if mffpi.PolicyID != nil { + objectMap["policyId"] = mffpi.PolicyID + } + if mffpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = mffpi.LastRecoveryPoint + } + if mffpi.BackupSetName != nil { + objectMap["backupSetName"] = mffpi.BackupSetName + } + if mffpi.CreateMode != "" { + objectMap["createMode"] = mffpi.CreateMode + } + if mffpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = mffpi.DeferredDeleteTimeInUTC + } + if mffpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = mffpi.IsScheduledForDeferredDelete + } + if mffpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = mffpi.DeferredDeleteTimeRemaining + } + if mffpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = mffpi.IsDeferredDeleteScheduleUpcoming + } + if mffpi.IsRehydrate != nil { + objectMap["isRehydrate"] = mffpi.IsRehydrate + } + if mffpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = mffpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return &mffpi, true +} + +// AsProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &mffpi, true +} + +// MabFileFolderProtectedItemExtendedInfo additional information on the backed up item. +type MabFileFolderProtectedItemExtendedInfo struct { + // LastRefreshedAt - Last time when the agent data synced to service. + LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` + // OldestRecoveryPoint - The oldest backup copy available. + OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` + // RecoveryPointCount - Number of backup copies associated with the backup item. + RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` +} + +// MabJob MAB workload-specific job. +type MabJob struct { + // Duration - Time taken by job to run. + Duration *string `json:"duration,omitempty"` + // ActionsInfo - The state/actions applicable on jobs like cancel/retry. + ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` + // MabServerName - Name of server protecting the DS. + MabServerName *string `json:"mabServerName,omitempty"` + // MabServerType - Server type of MAB container. Possible values include: 'MabServerTypeInvalid', 'MabServerTypeUnknown', 'MabServerTypeIaasVMContainer', 'MabServerTypeIaasVMServiceContainer', 'MabServerTypeDPMContainer', 'MabServerTypeAzureBackupServerContainer', 'MabServerTypeMABContainer', 'MabServerTypeCluster', 'MabServerTypeAzureSQLContainer', 'MabServerTypeWindows', 'MabServerTypeVCenter', 'MabServerTypeVMAppContainer', 'MabServerTypeSQLAGWorkLoadContainer', 'MabServerTypeStorageContainer', 'MabServerTypeGenericContainer' + MabServerType MabServerType `json:"mabServerType,omitempty"` + // WorkloadType - Workload type of backup item. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` + // ErrorDetails - The errors. + ErrorDetails *[]MabErrorInfo `json:"errorDetails,omitempty"` + // ExtendedInfo - Additional information on the job. + ExtendedInfo *MabJobExtendedInfo `json:"extendedInfo,omitempty"` + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob', 'JobTypeVaultJob' + JobType JobType `json:"jobType,omitempty"` +} + +// MarshalJSON is the custom marshaler for MabJob. +func (mj MabJob) MarshalJSON() ([]byte, error) { + mj.JobType = JobTypeMabJob + objectMap := make(map[string]interface{}) + if mj.Duration != nil { + objectMap["duration"] = mj.Duration + } + if mj.ActionsInfo != nil { + objectMap["actionsInfo"] = mj.ActionsInfo + } + if mj.MabServerName != nil { + objectMap["mabServerName"] = mj.MabServerName + } + if mj.MabServerType != "" { + objectMap["mabServerType"] = mj.MabServerType + } + if mj.WorkloadType != "" { + objectMap["workloadType"] = mj.WorkloadType + } + if mj.ErrorDetails != nil { + objectMap["errorDetails"] = mj.ErrorDetails + } + if mj.ExtendedInfo != nil { + objectMap["extendedInfo"] = mj.ExtendedInfo + } + if mj.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = mj.EntityFriendlyName + } + if mj.BackupManagementType != "" { + objectMap["backupManagementType"] = mj.BackupManagementType + } + if mj.Operation != nil { + objectMap["operation"] = mj.Operation + } + if mj.Status != nil { + objectMap["status"] = mj.Status + } + if mj.StartTime != nil { + objectMap["startTime"] = mj.StartTime + } + if mj.EndTime != nil { + objectMap["endTime"] = mj.EndTime + } + if mj.ActivityID != nil { + objectMap["activityId"] = mj.ActivityID + } + if mj.JobType != "" { + objectMap["jobType"] = mj.JobType + } + return json.Marshal(objectMap) +} + +// AsAzureIaaSVMJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { + return nil, false +} + +// AsAzureStorageJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsAzureStorageJob() (*AzureStorageJob, bool) { + return nil, false +} + +// AsAzureWorkloadJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { + return nil, false +} + +// AsDpmJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsDpmJob() (*DpmJob, bool) { + return nil, false +} + +// AsMabJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsMabJob() (*MabJob, bool) { + return &mj, true +} + +// AsVaultJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsVaultJob() (*VaultJob, bool) { + return nil, false +} + +// AsJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsJob() (*Job, bool) { + return nil, false +} + +// AsBasicJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsBasicJob() (BasicJob, bool) { + return &mj, true +} + +// MabJobExtendedInfo additional information for the MAB workload-specific job. +type MabJobExtendedInfo struct { + // TasksList - List of tasks for this job. + TasksList *[]MabJobTaskDetails `json:"tasksList,omitempty"` + // PropertyBag - The job properties. + PropertyBag map[string]*string `json:"propertyBag"` + // DynamicErrorMessage - Non localized error message specific to this job. + DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` +} + +// MarshalJSON is the custom marshaler for MabJobExtendedInfo. +func (mjei MabJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mjei.TasksList != nil { + objectMap["tasksList"] = mjei.TasksList + } + if mjei.PropertyBag != nil { + objectMap["propertyBag"] = mjei.PropertyBag + } + if mjei.DynamicErrorMessage != nil { + objectMap["dynamicErrorMessage"] = mjei.DynamicErrorMessage + } + return json.Marshal(objectMap) +} + +// MabJobTaskDetails MAB workload-specific job task details. +type MabJobTaskDetails struct { + // TaskID - The task display name. + TaskID *string `json:"taskId,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // Duration - Time elapsed for task. + Duration *string `json:"duration,omitempty"` + // Status - The status. + Status *string `json:"status,omitempty"` +} + +// MabProtectionPolicy mab container-specific backup policy. +type MabProtectionPolicy struct { + // SchedulePolicy - Backup schedule of backup policy. + SchedulePolicy BasicSchedulePolicy `json:"schedulePolicy,omitempty"` + // RetentionPolicy - Retention policy details. + RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` +} + +// MarshalJSON is the custom marshaler for MabProtectionPolicy. +func (mpp MabProtectionPolicy) MarshalJSON() ([]byte, error) { + mpp.BackupManagementType = BackupManagementTypeMAB + objectMap := make(map[string]interface{}) + objectMap["schedulePolicy"] = mpp.SchedulePolicy + objectMap["retentionPolicy"] = mpp.RetentionPolicy + if mpp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = mpp.ProtectedItemsCount + } + if mpp.BackupManagementType != "" { + objectMap["backupManagementType"] = mpp.BackupManagementType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return nil, false +} + +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { + return nil, false +} + +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { + return nil, false +} + +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { + return nil, false +} + +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { + return &mpp, true +} + +// AsProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { + return nil, false +} + +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &mpp, true +} + +// UnmarshalJSON is the custom unmarshaler for MabProtectionPolicy struct. +func (mpp *MabProtectionPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "schedulePolicy": + if v != nil { + schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) + if err != nil { + return err + } + mpp.SchedulePolicy = schedulePolicy + } + case "retentionPolicy": + if v != nil { + retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) + if err != nil { + return err + } + mpp.RetentionPolicy = retentionPolicy + } + case "protectedItemsCount": + if v != nil { + var protectedItemsCount int32 + err = json.Unmarshal(*v, &protectedItemsCount) + if err != nil { + return err + } + mpp.ProtectedItemsCount = &protectedItemsCount + } + case "backupManagementType": + if v != nil { + var backupManagementType ManagementTypeBasicProtectionPolicy + err = json.Unmarshal(*v, &backupManagementType) + if err != nil { + return err + } + mpp.BackupManagementType = backupManagementType + } + } + } + + return nil +} + +// MonthlyRetentionSchedule monthly retention schedule. +type MonthlyRetentionSchedule struct { + // RetentionScheduleFormatType - Retention schedule format type for monthly retention policy. Possible values include: 'RetentionScheduleFormatInvalid', 'RetentionScheduleFormatDaily', 'RetentionScheduleFormatWeekly' + RetentionScheduleFormatType RetentionScheduleFormat `json:"retentionScheduleFormatType,omitempty"` + // RetentionScheduleDaily - Daily retention format for monthly retention policy. + RetentionScheduleDaily *DailyRetentionFormat `json:"retentionScheduleDaily,omitempty"` + // RetentionScheduleWeekly - Weekly retention format for monthly retention policy. + RetentionScheduleWeekly *WeeklyRetentionFormat `json:"retentionScheduleWeekly,omitempty"` + // RetentionTimes - Retention times of retention policy. + RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` + // RetentionDuration - Retention duration of retention Policy. + RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` +} + +// NewErrorResponse the resource management error response. +type NewErrorResponse struct { + // Error - The error object. + Error *NewErrorResponseError `json:"error,omitempty"` +} + +// NewErrorResponseError the error object. +type NewErrorResponseError struct { + // Code - READ-ONLY; The error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; The error message. + Message *string `json:"message,omitempty"` + // Target - READ-ONLY; The error target. + Target *string `json:"target,omitempty"` + // Details - READ-ONLY; The error details. + Details *[]NewErrorResponse `json:"details,omitempty"` + // AdditionalInfo - READ-ONLY; The error additional info. + AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` +} + +// MarshalJSON is the custom marshaler for NewErrorResponseError. +func (ner NewErrorResponseError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// OperationResultInfo operation result info. +type OperationResultInfo struct { + // JobList - List of jobs created by this operation. + JobList *[]string `json:"jobList,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeOperationResultInfoBase', 'ObjectTypeExportJobsOperationResultInfo', 'ObjectTypeOperationResultInfo' + ObjectType ObjectType `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationResultInfo. +func (ori OperationResultInfo) MarshalJSON() ([]byte, error) { + ori.ObjectType = ObjectTypeOperationResultInfo + objectMap := make(map[string]interface{}) + if ori.JobList != nil { + objectMap["jobList"] = ori.JobList + } + if ori.ObjectType != "" { + objectMap["objectType"] = ori.ObjectType + } + return json.Marshal(objectMap) +} + +// AsExportJobsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfo. +func (ori OperationResultInfo) AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) { + return nil, false +} + +// AsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfo. +func (ori OperationResultInfo) AsOperationResultInfo() (*OperationResultInfo, bool) { + return &ori, true +} + +// AsOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfo. +func (ori OperationResultInfo) AsOperationResultInfoBase() (*OperationResultInfoBase, bool) { + return nil, false +} + +// AsBasicOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfo. +func (ori OperationResultInfo) AsBasicOperationResultInfoBase() (BasicOperationResultInfoBase, bool) { + return &ori, true +} + +// BasicOperationResultInfoBase base class for operation result info. +type BasicOperationResultInfoBase interface { + AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) + AsOperationResultInfo() (*OperationResultInfo, bool) + AsOperationResultInfoBase() (*OperationResultInfoBase, bool) +} + +// OperationResultInfoBase base class for operation result info. +type OperationResultInfoBase struct { + // ObjectType - Possible values include: 'ObjectTypeOperationResultInfoBase', 'ObjectTypeExportJobsOperationResultInfo', 'ObjectTypeOperationResultInfo' + ObjectType ObjectType `json:"objectType,omitempty"` +} + +func unmarshalBasicOperationResultInfoBase(body []byte) (BasicOperationResultInfoBase, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeExportJobsOperationResultInfo): + var ejori ExportJobsOperationResultInfo + err := json.Unmarshal(body, &ejori) + return ejori, err + case string(ObjectTypeOperationResultInfo): + var ori OperationResultInfo + err := json.Unmarshal(body, &ori) + return ori, err + default: + var orib OperationResultInfoBase + err := json.Unmarshal(body, &orib) + return orib, err + } +} +func unmarshalBasicOperationResultInfoBaseArray(body []byte) ([]BasicOperationResultInfoBase, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + oribArray := make([]BasicOperationResultInfoBase, len(rawMessages)) + + for index, rawMessage := range rawMessages { + orib, err := unmarshalBasicOperationResultInfoBase(*rawMessage) + if err != nil { + return nil, err + } + oribArray[index] = orib + } + return oribArray, nil +} + +// MarshalJSON is the custom marshaler for OperationResultInfoBase. +func (orib OperationResultInfoBase) MarshalJSON() ([]byte, error) { + orib.ObjectType = ObjectTypeOperationResultInfoBase + objectMap := make(map[string]interface{}) + if orib.ObjectType != "" { + objectMap["objectType"] = orib.ObjectType + } + return json.Marshal(objectMap) +} + +// AsExportJobsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. +func (orib OperationResultInfoBase) AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) { + return nil, false +} + +// AsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. +func (orib OperationResultInfoBase) AsOperationResultInfo() (*OperationResultInfo, bool) { + return nil, false +} + +// AsOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. +func (orib OperationResultInfoBase) AsOperationResultInfoBase() (*OperationResultInfoBase, bool) { + return &orib, true +} + +// AsBasicOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. +func (orib OperationResultInfoBase) AsBasicOperationResultInfoBase() (BasicOperationResultInfoBase, bool) { + return &orib, true +} + +// OperationResultInfoBaseResource base class for operation result info. +type OperationResultInfoBaseResource struct { + autorest.Response `json:"-"` + // Operation - OperationResultInfoBaseResource operation + Operation BasicOperationResultInfoBase `json:"operation,omitempty"` + // StatusCode - 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' + StatusCode HTTPStatusCode `json:"statusCode,omitempty"` + // Headers - HTTP headers associated with this operation. + Headers map[string][]string `json:"headers"` +} + +// MarshalJSON is the custom marshaler for OperationResultInfoBaseResource. +func (oribr OperationResultInfoBaseResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["operation"] = oribr.Operation + if oribr.StatusCode != "" { + objectMap["statusCode"] = oribr.StatusCode + } + if oribr.Headers != nil { + objectMap["headers"] = oribr.Headers + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OperationResultInfoBaseResource struct. +func (oribr *OperationResultInfoBaseResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "operation": + if v != nil { + operation, err := unmarshalBasicOperationResultInfoBase(*v) + if err != nil { + return err + } + oribr.Operation = operation + } + case "statusCode": + if v != nil { + var statusCode HTTPStatusCode + err = json.Unmarshal(*v, &statusCode) + if err != nil { + return err + } + oribr.StatusCode = statusCode + } + case "headers": + if v != nil { + var headers map[string][]string + err = json.Unmarshal(*v, &headers) + if err != nil { + return err + } + oribr.Headers = headers + } + } + } + + return nil +} + +// OperationStatus operation status. +type OperationStatus struct { + autorest.Response `json:"-"` + // ID - ID of the operation. + ID *string `json:"id,omitempty"` + // Name - Name of the operation. + Name *string `json:"name,omitempty"` + // Status - Operation status. Possible values include: 'OperationStatusValuesInvalid', 'OperationStatusValuesInProgress', 'OperationStatusValuesSucceeded', 'OperationStatusValuesFailed', 'OperationStatusValuesCanceled' + Status OperationStatusValues `json:"status,omitempty"` + // StartTime - Operation start time. Format: ISO-8601. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Operation end time. Format: ISO-8601. + EndTime *date.Time `json:"endTime,omitempty"` + // Error - Error information related to this operation. + Error *OperationStatusError `json:"error,omitempty"` + // Properties - Additional information associated with this operation. + Properties BasicOperationStatusExtendedInfo `json:"properties,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for OperationStatus struct. +func (osVar *OperationStatus) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + osVar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + osVar.Name = &name + } + case "status": + if v != nil { + var status OperationStatusValues + err = json.Unmarshal(*v, &status) + if err != nil { + return err + } + osVar.Status = status + } + case "startTime": + if v != nil { + var startTime date.Time + err = json.Unmarshal(*v, &startTime) + if err != nil { + return err + } + osVar.StartTime = &startTime + } + case "endTime": + if v != nil { + var endTime date.Time + err = json.Unmarshal(*v, &endTime) + if err != nil { + return err + } + osVar.EndTime = &endTime + } + case "error": + if v != nil { + var errorVar OperationStatusError + err = json.Unmarshal(*v, &errorVar) + if err != nil { + return err + } + osVar.Error = &errorVar + } + case "properties": + if v != nil { + properties, err := unmarshalBasicOperationStatusExtendedInfo(*v) + if err != nil { + return err + } + osVar.Properties = properties + } + } + } + + return nil +} + +// OperationStatusError error information associated with operation status call. +type OperationStatusError struct { + // Code - Error code of the operation failure. + Code *string `json:"code,omitempty"` + // Message - Error message displayed if the operation failure. + Message *string `json:"message,omitempty"` +} + +// BasicOperationStatusExtendedInfo base class for additional information of operation status. +type BasicOperationStatusExtendedInfo interface { + AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) + AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) + AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) + AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) +} + +// OperationStatusExtendedInfo base class for additional information of operation status. +type OperationStatusExtendedInfo struct { + // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' + ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` +} + +func unmarshalBasicOperationStatusExtendedInfo(body []byte) (BasicOperationStatusExtendedInfo, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeOperationStatusJobExtendedInfo): + var osjei OperationStatusJobExtendedInfo + err := json.Unmarshal(body, &osjei) + return osjei, err + case string(ObjectTypeOperationStatusJobsExtendedInfo): + var osjei OperationStatusJobsExtendedInfo + err := json.Unmarshal(body, &osjei) + return osjei, err + case string(ObjectTypeOperationStatusProvisionILRExtendedInfo): + var ospiei OperationStatusProvisionILRExtendedInfo + err := json.Unmarshal(body, &ospiei) + return ospiei, err + default: + var osei OperationStatusExtendedInfo + err := json.Unmarshal(body, &osei) + return osei, err + } +} +func unmarshalBasicOperationStatusExtendedInfoArray(body []byte) ([]BasicOperationStatusExtendedInfo, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + oseiArray := make([]BasicOperationStatusExtendedInfo, len(rawMessages)) + + for index, rawMessage := range rawMessages { + osei, err := unmarshalBasicOperationStatusExtendedInfo(*rawMessage) + if err != nil { + return nil, err + } + oseiArray[index] = osei + } + return oseiArray, nil +} + +// MarshalJSON is the custom marshaler for OperationStatusExtendedInfo. +func (osei OperationStatusExtendedInfo) MarshalJSON() ([]byte, error) { + osei.ObjectType = ObjectTypeOperationStatusExtendedInfo + objectMap := make(map[string]interface{}) + if osei.ObjectType != "" { + objectMap["objectType"] = osei.ObjectType + } + return json.Marshal(objectMap) +} + +// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. +func (osei OperationStatusExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. +func (osei OperationStatusExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. +func (osei OperationStatusExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. +func (osei OperationStatusExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { + return &osei, true +} + +// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. +func (osei OperationStatusExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { + return &osei, true +} + +// OperationStatusJobExtendedInfo operation status job extended info. +type OperationStatusJobExtendedInfo struct { + // JobID - ID of the job created for this protected item. + JobID *string `json:"jobId,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' + ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationStatusJobExtendedInfo. +func (osjei OperationStatusJobExtendedInfo) MarshalJSON() ([]byte, error) { + osjei.ObjectType = ObjectTypeOperationStatusJobExtendedInfo + objectMap := make(map[string]interface{}) + if osjei.JobID != nil { + objectMap["jobId"] = osjei.JobID + } + if osjei.ObjectType != "" { + objectMap["objectType"] = osjei.ObjectType + } + return json.Marshal(objectMap) +} + +// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. +func (osjei OperationStatusJobExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { + return &osjei, true +} + +// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. +func (osjei OperationStatusJobExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. +func (osjei OperationStatusJobExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. +func (osjei OperationStatusJobExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { + return nil, false +} + +// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. +func (osjei OperationStatusJobExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { + return &osjei, true +} + +// OperationStatusJobsExtendedInfo operation status extended info for list of jobs. +type OperationStatusJobsExtendedInfo struct { + // JobIds - IDs of the jobs created for the protected item. + JobIds *[]string `json:"jobIds,omitempty"` + // FailedJobsError - Stores all the failed jobs along with the corresponding error codes. + FailedJobsError map[string]*string `json:"failedJobsError"` + // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' + ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationStatusJobsExtendedInfo. +func (osjei OperationStatusJobsExtendedInfo) MarshalJSON() ([]byte, error) { + osjei.ObjectType = ObjectTypeOperationStatusJobsExtendedInfo + objectMap := make(map[string]interface{}) + if osjei.JobIds != nil { + objectMap["jobIds"] = osjei.JobIds + } + if osjei.FailedJobsError != nil { + objectMap["failedJobsError"] = osjei.FailedJobsError + } + if osjei.ObjectType != "" { + objectMap["objectType"] = osjei.ObjectType + } + return json.Marshal(objectMap) +} + +// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. +func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. +func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { + return &osjei, true +} + +// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. +func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. +func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { + return nil, false +} + +// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. +func (osjei OperationStatusJobsExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { + return &osjei, true +} + +// OperationStatusProvisionILRExtendedInfo operation status extended info for ILR provision action. +type OperationStatusProvisionILRExtendedInfo struct { + // RecoveryTarget - Target details for file / folder restore. + RecoveryTarget *InstantItemRecoveryTarget `json:"recoveryTarget,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo' + ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationStatusProvisionILRExtendedInfo. +func (ospiei OperationStatusProvisionILRExtendedInfo) MarshalJSON() ([]byte, error) { + ospiei.ObjectType = ObjectTypeOperationStatusProvisionILRExtendedInfo + objectMap := make(map[string]interface{}) + if ospiei.RecoveryTarget != nil { + objectMap["recoveryTarget"] = ospiei.RecoveryTarget + } + if ospiei.ObjectType != "" { + objectMap["objectType"] = ospiei.ObjectType + } + return json.Marshal(objectMap) +} + +// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. +func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. +func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. +func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { + return &ospiei, true +} + +// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. +func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { + return nil, false +} + +// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. +func (ospiei OperationStatusProvisionILRExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { + return &ospiei, true +} + +// OperationWorkerResponse this is the base class for operation result responses. +type OperationWorkerResponse struct { + // StatusCode - 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' + StatusCode HTTPStatusCode `json:"statusCode,omitempty"` + // Headers - HTTP headers associated with this operation. + Headers map[string][]string `json:"headers"` +} + +// MarshalJSON is the custom marshaler for OperationWorkerResponse. +func (owr OperationWorkerResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if owr.StatusCode != "" { + objectMap["statusCode"] = owr.StatusCode + } + if owr.Headers != nil { + objectMap["headers"] = owr.Headers + } + return json.Marshal(objectMap) +} + +// PointInTimeRange provides details for log ranges +type PointInTimeRange struct { + // StartTime - Start time of the time range for log recovery. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - End time of the time range for log recovery. + EndTime *date.Time `json:"endTime,omitempty"` +} + +// PreBackupValidation pre-backup validation for Azure VM Workload provider. +type PreBackupValidation struct { + // Status - Status of protectable item, i.e. InProgress,Succeeded,Failed. Possible values include: 'InquiryStatusInvalid', 'InquiryStatusSuccess', 'InquiryStatusFailed' + Status InquiryStatus `json:"status,omitempty"` + // Code - Error code of protectable item + Code *string `json:"code,omitempty"` + // Message - Message corresponding to the error code for the protectable item + Message *string `json:"message,omitempty"` +} + +// PrepareDataMoveRequest prepare DataMove Request +type PrepareDataMoveRequest struct { + // TargetResourceID - ARM Id of target vault + TargetResourceID *string `json:"targetResourceId,omitempty"` + // TargetRegion - Target Region + TargetRegion *string `json:"targetRegion,omitempty"` + // DataMoveLevel - DataMove Level. Possible values include: 'DataMoveLevelInvalid', 'DataMoveLevelVault', 'DataMoveLevelContainer' + DataMoveLevel DataMoveLevel `json:"dataMoveLevel,omitempty"` + // SourceContainerArmIds - Source Container ArmIds + // This needs to be populated only if DataMoveLevel is set to container + SourceContainerArmIds *[]string `json:"sourceContainerArmIds,omitempty"` + // IgnoreMoved - Ignore the artifacts which are already moved. + IgnoreMoved *bool `json:"ignoreMoved,omitempty"` +} + +// PrepareDataMoveResponse prepare DataMove Response +type PrepareDataMoveResponse struct { + // CorrelationID - Co-relationId for move operation + CorrelationID *string `json:"correlationId,omitempty"` + // SourceVaultProperties - Source Vault Properties + SourceVaultProperties map[string]*string `json:"sourceVaultProperties"` + // ObjectType - Possible values include: 'ObjectTypeVaultStorageConfigOperationResultResponse', 'ObjectTypePrepareDataMoveResponse' + ObjectType ObjectTypeBasicVaultStorageConfigOperationResultResponse `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrepareDataMoveResponse. +func (pdmr PrepareDataMoveResponse) MarshalJSON() ([]byte, error) { + pdmr.ObjectType = ObjectTypePrepareDataMoveResponse + objectMap := make(map[string]interface{}) + if pdmr.CorrelationID != nil { + objectMap["correlationId"] = pdmr.CorrelationID + } + if pdmr.SourceVaultProperties != nil { + objectMap["sourceVaultProperties"] = pdmr.SourceVaultProperties + } + if pdmr.ObjectType != "" { + objectMap["objectType"] = pdmr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsPrepareDataMoveResponse is the BasicVaultStorageConfigOperationResultResponse implementation for PrepareDataMoveResponse. +func (pdmr PrepareDataMoveResponse) AsPrepareDataMoveResponse() (*PrepareDataMoveResponse, bool) { + return &pdmr, true +} + +// AsVaultStorageConfigOperationResultResponse is the BasicVaultStorageConfigOperationResultResponse implementation for PrepareDataMoveResponse. +func (pdmr PrepareDataMoveResponse) AsVaultStorageConfigOperationResultResponse() (*VaultStorageConfigOperationResultResponse, bool) { + return nil, false +} + +// AsBasicVaultStorageConfigOperationResultResponse is the BasicVaultStorageConfigOperationResultResponse implementation for PrepareDataMoveResponse. +func (pdmr PrepareDataMoveResponse) AsBasicVaultStorageConfigOperationResultResponse() (BasicVaultStorageConfigOperationResultResponse, bool) { + return &pdmr, true +} + +// PrivateEndpoint the Private Endpoint network resource that is linked to the Private Endpoint connection +type PrivateEndpoint struct { + // ID - Gets or sets id + ID *string `json:"id,omitempty"` +} + +// PrivateEndpointConnection private Endpoint Connection Response Properties +type PrivateEndpointConnection struct { + // ProvisioningState - Gets or sets provisioning state of the private endpoint connection. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateDeleting', 'ProvisioningStateFailed', 'ProvisioningStatePending' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // PrivateEndpoint - Gets or sets private endpoint associated with the private endpoint connection + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + // PrivateLinkServiceConnectionState - Gets or sets private link service connection state + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` +} + +// PrivateEndpointConnectionDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type PrivateEndpointConnectionDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateEndpointConnectionClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateEndpointConnectionDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PrivateEndpointConnectionDeleteFuture.Result. +func (future *PrivateEndpointConnectionDeleteFuture) result(client PrivateEndpointConnectionClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.PrivateEndpointConnectionDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("backup.PrivateEndpointConnectionDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// PrivateEndpointConnectionPutFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type PrivateEndpointConnectionPutFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateEndpointConnectionClient) (PrivateEndpointConnectionResource, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateEndpointConnectionPutFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PrivateEndpointConnectionPutFuture.Result. +func (future *PrivateEndpointConnectionPutFuture) result(client PrivateEndpointConnectionClient) (pecr PrivateEndpointConnectionResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.PrivateEndpointConnectionPutFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pecr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("backup.PrivateEndpointConnectionPutFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pecr.Response.Response, err = future.GetResult(sender); err == nil && pecr.Response.Response.StatusCode != http.StatusNoContent { + pecr, err = client.PutResponder(pecr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.PrivateEndpointConnectionPutFuture", "Result", pecr.Response.Response, "Failure responding to request") + } + } + return +} + +// PrivateEndpointConnectionResource private Endpoint Connection Response Properties +type PrivateEndpointConnectionResource struct { + autorest.Response `json:"-"` + // Properties - PrivateEndpointConnectionResource properties + Properties *PrivateEndpointConnection `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnectionResource. +func (pecr PrivateEndpointConnectionResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pecr.Properties != nil { + objectMap["properties"] = pecr.Properties + } + if pecr.Location != nil { + objectMap["location"] = pecr.Location + } + if pecr.Tags != nil { + objectMap["tags"] = pecr.Tags + } + if pecr.ETag != nil { + objectMap["eTag"] = pecr.ETag + } + return json.Marshal(objectMap) +} + +// PrivateLinkServiceConnectionState private Link Service Connection State +type PrivateLinkServiceConnectionState struct { + // Status - Gets or sets the status. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' + Status PrivateEndpointConnectionStatus `json:"status,omitempty"` + // Description - Gets or sets description + Description *string `json:"description,omitempty"` + // ActionRequired - Gets or sets actions required + ActionRequired *string `json:"actionRequired,omitempty"` +} + +// BasicProtectableContainer protectable Container Class. +type BasicProtectableContainer interface { + AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) + AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) + AsProtectableContainer() (*ProtectableContainer, bool) +} + +// ProtectableContainer protectable Container Class. +type ProtectableContainer struct { + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerID - Fabric Id of the container such as ARM Id. + ContainerID *string `json:"containerId,omitempty"` + // ProtectableContainerType - Possible values include: 'ProtectableContainerTypeProtectableContainer', 'ProtectableContainerTypeStorageContainer', 'ProtectableContainerTypeVMAppContainer' + ProtectableContainerType ProtectableContainerType `json:"protectableContainerType,omitempty"` +} + +func unmarshalBasicProtectableContainer(body []byte) (BasicProtectableContainer, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectableContainerType"] { + case string(ProtectableContainerTypeStorageContainer): + var aspc AzureStorageProtectableContainer + err := json.Unmarshal(body, &aspc) + return aspc, err + case string(ProtectableContainerTypeVMAppContainer): + var avacpc AzureVMAppContainerProtectableContainer + err := json.Unmarshal(body, &avacpc) + return avacpc, err + default: + var pc ProtectableContainer + err := json.Unmarshal(body, &pc) + return pc, err + } +} +func unmarshalBasicProtectableContainerArray(body []byte) ([]BasicProtectableContainer, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + pcArray := make([]BasicProtectableContainer, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pc, err := unmarshalBasicProtectableContainer(*rawMessage) + if err != nil { + return nil, err + } + pcArray[index] = pc + } + return pcArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectableContainer. +func (pc ProtectableContainer) MarshalJSON() ([]byte, error) { + pc.ProtectableContainerType = ProtectableContainerTypeProtectableContainer + objectMap := make(map[string]interface{}) + if pc.FriendlyName != nil { + objectMap["friendlyName"] = pc.FriendlyName + } + if pc.BackupManagementType != "" { + objectMap["backupManagementType"] = pc.BackupManagementType + } + if pc.HealthStatus != nil { + objectMap["healthStatus"] = pc.HealthStatus + } + if pc.ContainerID != nil { + objectMap["containerId"] = pc.ContainerID + } + if pc.ProtectableContainerType != "" { + objectMap["protectableContainerType"] = pc.ProtectableContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureStorageProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. +func (pc ProtectableContainer) AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. +func (pc ProtectableContainer) AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) { + return nil, false +} + +// AsProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. +func (pc ProtectableContainer) AsProtectableContainer() (*ProtectableContainer, bool) { + return &pc, true +} + +// AsBasicProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. +func (pc ProtectableContainer) AsBasicProtectableContainer() (BasicProtectableContainer, bool) { + return &pc, true +} + +// ProtectableContainerResource protectable Container Class. +type ProtectableContainerResource struct { + // Properties - ProtectableContainerResource properties + Properties BasicProtectableContainer `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectableContainerResource. +func (pcr ProtectableContainerResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = pcr.Properties + if pcr.Location != nil { + objectMap["location"] = pcr.Location + } + if pcr.Tags != nil { + objectMap["tags"] = pcr.Tags + } + if pcr.ETag != nil { + objectMap["eTag"] = pcr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ProtectableContainerResource struct. +func (pcr *ProtectableContainerResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicProtectableContainer(*v) + if err != nil { + return err + } + pcr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pcr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pcr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pcr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + pcr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + pcr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + pcr.ETag = &eTag + } + } + } + + return nil +} + +// ProtectableContainerResourceList list of ProtectableContainer resources +type ProtectableContainerResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]ProtectableContainerResource `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"` +} + +// ProtectableContainerResourceListIterator provides access to a complete listing of +// ProtectableContainerResource values. +type ProtectableContainerResourceListIterator struct { + i int + page ProtectableContainerResourceListPage +} + +// NextWithContext 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 *ProtectableContainerResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableContainerResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectableContainerResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectableContainerResourceListIterator) 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 ProtectableContainerResourceListIterator) Response() ProtectableContainerResourceList { + 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 ProtectableContainerResourceListIterator) Value() ProtectableContainerResource { + if !iter.page.NotDone() { + return ProtectableContainerResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectableContainerResourceListIterator type. +func NewProtectableContainerResourceListIterator(page ProtectableContainerResourceListPage) ProtectableContainerResourceListIterator { + return ProtectableContainerResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pcrl ProtectableContainerResourceList) IsEmpty() bool { + return pcrl.Value == nil || len(*pcrl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pcrl ProtectableContainerResourceList) hasNextLink() bool { + return pcrl.NextLink != nil && len(*pcrl.NextLink) != 0 +} + +// protectableContainerResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pcrl ProtectableContainerResourceList) protectableContainerResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !pcrl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pcrl.NextLink))) +} + +// ProtectableContainerResourceListPage contains a page of ProtectableContainerResource values. +type ProtectableContainerResourceListPage struct { + fn func(context.Context, ProtectableContainerResourceList) (ProtectableContainerResourceList, error) + pcrl ProtectableContainerResourceList +} + +// NextWithContext 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 *ProtectableContainerResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableContainerResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pcrl) + if err != nil { + return err + } + page.pcrl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectableContainerResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectableContainerResourceListPage) NotDone() bool { + return !page.pcrl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectableContainerResourceListPage) Response() ProtectableContainerResourceList { + return page.pcrl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectableContainerResourceListPage) Values() []ProtectableContainerResource { + if page.pcrl.IsEmpty() { + return nil + } + return *page.pcrl.Value +} + +// Creates a new instance of the ProtectableContainerResourceListPage type. +func NewProtectableContainerResourceListPage(cur ProtectableContainerResourceList, getNextPage func(context.Context, ProtectableContainerResourceList) (ProtectableContainerResourceList, error)) ProtectableContainerResourceListPage { + return ProtectableContainerResourceListPage{ + fn: getNextPage, + pcrl: cur, + } +} + +// BasicProtectedItem base class for backup items. +type BasicProtectedItem interface { + AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) + AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) + AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) + AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) + AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) + AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) + AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) + AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) + AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) + AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) + AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) + AsDPMProtectedItem() (*DPMProtectedItem, bool) + AsGenericProtectedItem() (*GenericProtectedItem, bool) + AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) + AsProtectedItem() (*ProtectedItem, bool) +} + +// ProtectedItem base class for backup items. +type ProtectedItem struct { + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +func unmarshalBasicProtectedItem(body []byte) (BasicProtectedItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectedItemType"] { + case string(ProtectedItemTypeAzureFileShareProtectedItem): + var afpi AzureFileshareProtectedItem + err := json.Unmarshal(body, &afpi) + return afpi, err + case string(ProtectedItemTypeMicrosoftClassicComputevirtualMachines): + var aisccvpi AzureIaaSClassicComputeVMProtectedItem + err := json.Unmarshal(body, &aisccvpi) + return aisccvpi, err + case string(ProtectedItemTypeMicrosoftComputevirtualMachines): + var aiscvpi AzureIaaSComputeVMProtectedItem + err := json.Unmarshal(body, &aiscvpi) + return aiscvpi, err + case string(ProtectedItemTypeAzureIaaSVMProtectedItem): + var aispi AzureIaaSVMProtectedItem + err := json.Unmarshal(body, &aispi) + return aispi, err + case string(ProtectedItemTypeMicrosoftSqlserversdatabases): + var aspi AzureSQLProtectedItem + err := json.Unmarshal(body, &aspi) + return aspi, err + case string(ProtectedItemTypeAzureVMWorkloadProtectedItem): + var avwpi AzureVMWorkloadProtectedItem + err := json.Unmarshal(body, &avwpi) + return avwpi, err + case string(ProtectedItemTypeAzureVMWorkloadSAPAseDatabase): + var avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem + err := json.Unmarshal(body, &avwsadpi) + return avwsadpi, err + case string(ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase): + var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem + err := json.Unmarshal(body, &avwshdpi) + return avwshdpi, err + case string(ProtectedItemTypeAzureVMWorkloadSQLDatabase): + var avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem + err := json.Unmarshal(body, &avwsdpi) + return avwsdpi, err + case string(ProtectedItemTypeDPMProtectedItem): + var dpi DPMProtectedItem + err := json.Unmarshal(body, &dpi) + return dpi, err + case string(ProtectedItemTypeGenericProtectedItem): + var gpi GenericProtectedItem + err := json.Unmarshal(body, &gpi) + return gpi, err + case string(ProtectedItemTypeMabFileFolderProtectedItem): + var mffpi MabFileFolderProtectedItem + err := json.Unmarshal(body, &mffpi) + return mffpi, err + default: + var pi ProtectedItem + err := json.Unmarshal(body, &pi) + return pi, err + } +} +func unmarshalBasicProtectedItemArray(body []byte) ([]BasicProtectedItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + piArray := make([]BasicProtectedItem, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pi, err := unmarshalBasicProtectedItem(*rawMessage) + if err != nil { + return nil, err + } + piArray[index] = pi + } + return piArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectedItem. +func (pi ProtectedItem) MarshalJSON() ([]byte, error) { + pi.ProtectedItemType = ProtectedItemTypeProtectedItem + objectMap := make(map[string]interface{}) + if pi.BackupManagementType != "" { + objectMap["backupManagementType"] = pi.BackupManagementType + } + if pi.WorkloadType != "" { + objectMap["workloadType"] = pi.WorkloadType + } + if pi.ContainerName != nil { + objectMap["containerName"] = pi.ContainerName + } + if pi.SourceResourceID != nil { + objectMap["sourceResourceId"] = pi.SourceResourceID + } + if pi.PolicyID != nil { + objectMap["policyId"] = pi.PolicyID + } + if pi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = pi.LastRecoveryPoint + } + if pi.BackupSetName != nil { + objectMap["backupSetName"] = pi.BackupSetName + } + if pi.CreateMode != "" { + objectMap["createMode"] = pi.CreateMode + } + if pi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = pi.DeferredDeleteTimeInUTC + } + if pi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = pi.IsScheduledForDeferredDelete + } + if pi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = pi.DeferredDeleteTimeRemaining + } + if pi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = pi.IsDeferredDeleteScheduleUpcoming + } + if pi.IsRehydrate != nil { + objectMap["isRehydrate"] = pi.IsRehydrate + } + if pi.ProtectedItemType != "" { + objectMap["protectedItemType"] = pi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return &pi, true +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &pi, true +} + +// ProtectedItemQueryObject filters to list backup items. +type ProtectedItemQueryObject struct { + // HealthState - Health State for the backed up item. Possible values include: 'HealthStatePassed', 'HealthStateActionRequired', 'HealthStateActionSuggested', 'HealthStateInvalid' + HealthState HealthState `json:"healthState,omitempty"` + // 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: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + ItemType DataSourceType `json:"itemType,omitempty"` + // PolicyName - Backup policy name associated with the backup item. + PolicyName *string `json:"policyName,omitempty"` + // ContainerName - Name of the container. + ContainerName *string `json:"containerName,omitempty"` + // BackupEngineName - Backup Engine name + BackupEngineName *string `json:"backupEngineName,omitempty"` + // FriendlyName - Friendly name of protected item + FriendlyName *string `json:"friendlyName,omitempty"` + // FabricName - Name of the fabric. + FabricName *string `json:"fabricName,omitempty"` + // BackupSetName - Name of the backup set. + BackupSetName *string `json:"backupSetName,omitempty"` +} + +// ProtectedItemResource base class for backup items. +type ProtectedItemResource struct { + autorest.Response `json:"-"` + // Properties - ProtectedItemResource properties + Properties BasicProtectedItem `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectedItemResource. +func (pir ProtectedItemResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = pir.Properties + if pir.Location != nil { + objectMap["location"] = pir.Location + } + if pir.Tags != nil { + objectMap["tags"] = pir.Tags + } + if pir.ETag != nil { + objectMap["eTag"] = pir.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ProtectedItemResource struct. +func (pir *ProtectedItemResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicProtectedItem(*v) + if err != nil { + return err + } + pir.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pir.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pir.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pir.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + pir.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + pir.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + pir.ETag = &eTag + } + } + } + + return nil +} + +// ProtectedItemResourceList list of ProtectedItem resources +type ProtectedItemResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]ProtectedItemResource `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"` +} + +// ProtectedItemResourceListIterator provides access to a complete listing of ProtectedItemResource values. +type ProtectedItemResourceListIterator struct { + i int + page ProtectedItemResourceListPage +} + +// NextWithContext 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 *ProtectedItemResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectedItemResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectedItemResourceListIterator) 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 ProtectedItemResourceListIterator) Response() ProtectedItemResourceList { + 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 ProtectedItemResourceListIterator) Value() ProtectedItemResource { + if !iter.page.NotDone() { + return ProtectedItemResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectedItemResourceListIterator type. +func NewProtectedItemResourceListIterator(page ProtectedItemResourceListPage) ProtectedItemResourceListIterator { + return ProtectedItemResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pirl ProtectedItemResourceList) IsEmpty() bool { + return pirl.Value == nil || len(*pirl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pirl ProtectedItemResourceList) hasNextLink() bool { + return pirl.NextLink != nil && len(*pirl.NextLink) != 0 +} + +// protectedItemResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pirl ProtectedItemResourceList) protectedItemResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !pirl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pirl.NextLink))) +} + +// ProtectedItemResourceListPage contains a page of ProtectedItemResource values. +type ProtectedItemResourceListPage struct { + fn func(context.Context, ProtectedItemResourceList) (ProtectedItemResourceList, error) + pirl ProtectedItemResourceList +} + +// NextWithContext 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 *ProtectedItemResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pirl) + if err != nil { + return err + } + page.pirl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectedItemResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectedItemResourceListPage) NotDone() bool { + return !page.pirl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectedItemResourceListPage) Response() ProtectedItemResourceList { + return page.pirl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectedItemResourceListPage) Values() []ProtectedItemResource { + if page.pirl.IsEmpty() { + return nil + } + return *page.pirl.Value +} + +// Creates a new instance of the ProtectedItemResourceListPage type. +func NewProtectedItemResourceListPage(cur ProtectedItemResourceList, getNextPage func(context.Context, ProtectedItemResourceList) (ProtectedItemResourceList, error)) ProtectedItemResourceListPage { + return ProtectedItemResourceListPage{ + fn: getNextPage, + pirl: cur, + } +} + +// BasicProtectionContainer base class for container with backup items. Containers with specific workloads are derived +// from this class. +type BasicProtectionContainer interface { + AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) + AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) + AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) + AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) + AsAzureSQLContainer() (*AzureSQLContainer, bool) + AsAzureStorageContainer() (*AzureStorageContainer, bool) + AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) + AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) + AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) + AsDpmContainer() (*DpmContainer, bool) + AsBasicDpmContainer() (BasicDpmContainer, bool) + AsGenericContainer() (*GenericContainer, bool) + AsIaaSVMContainer() (*IaaSVMContainer, bool) + AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) + AsMabContainer() (*MabContainer, bool) + AsProtectionContainer() (*ProtectionContainer, bool) +} + +// ProtectionContainer base class for container with backup items. Containers with specific workloads are +// derived from this class. +type ProtectionContainer struct { + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaaSVMContainer', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +func unmarshalBasicProtectionContainer(body []byte) (BasicProtectionContainer, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["containerType"] { + case string(ContainerTypeAzureBackupServerContainer1): + var absc AzureBackupServerContainer + err := json.Unmarshal(body, &absc) + return absc, err + case string(ContainerTypeMicrosoftClassicComputevirtualMachines): + var aisccvc AzureIaaSClassicComputeVMContainer + err := json.Unmarshal(body, &aisccvc) + return aisccvc, err + case string(ContainerTypeMicrosoftComputevirtualMachines): + var aiscvc AzureIaaSComputeVMContainer + err := json.Unmarshal(body, &aiscvc) + return aiscvc, err + case string(ContainerTypeSQLAGWorkLoadContainer1): + var aswcpc AzureSQLAGWorkloadContainerProtectionContainer + err := json.Unmarshal(body, &aswcpc) + return aswcpc, err + case string(ContainerTypeAzureSQLContainer1): + var asc AzureSQLContainer + err := json.Unmarshal(body, &asc) + return asc, err + case string(ContainerTypeStorageContainer1): + var asc AzureStorageContainer + err := json.Unmarshal(body, &asc) + return asc, err + case string(ContainerTypeVMAppContainer1): + var avacpc AzureVMAppContainerProtectionContainer + err := json.Unmarshal(body, &avacpc) + return avacpc, err + case string(ContainerTypeAzureWorkloadContainer): + var awc AzureWorkloadContainer + err := json.Unmarshal(body, &awc) + return awc, err + case string(ContainerTypeDPMContainer1): + var dc DpmContainer + err := json.Unmarshal(body, &dc) + return dc, err + case string(ContainerTypeGenericContainer1): + var gc GenericContainer + err := json.Unmarshal(body, &gc) + return gc, err + case string(ContainerTypeIaaSVMContainer): + var isc IaaSVMContainer + err := json.Unmarshal(body, &isc) + return isc, err + case string(ContainerTypeWindows1): + var mc MabContainer + err := json.Unmarshal(body, &mc) + return mc, err + default: + var pc ProtectionContainer + err := json.Unmarshal(body, &pc) + return pc, err + } +} +func unmarshalBasicProtectionContainerArray(body []byte) ([]BasicProtectionContainer, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + pcArray := make([]BasicProtectionContainer, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pc, err := unmarshalBasicProtectionContainer(*rawMessage) + if err != nil { + return nil, err + } + pcArray[index] = pc + } + return pcArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectionContainer. +func (pc ProtectionContainer) MarshalJSON() ([]byte, error) { + pc.ContainerType = ContainerTypeProtectionContainer + objectMap := make(map[string]interface{}) + if pc.FriendlyName != nil { + objectMap["friendlyName"] = pc.FriendlyName + } + if pc.BackupManagementType != "" { + objectMap["backupManagementType"] = pc.BackupManagementType + } + if pc.RegistrationStatus != nil { + objectMap["registrationStatus"] = pc.RegistrationStatus + } + if pc.HealthStatus != nil { + objectMap["healthStatus"] = pc.HealthStatus + } + if pc.ContainerType != "" { + objectMap["containerType"] = pc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsBasicDpmContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return &pc, true +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &pc, true +} + +// ProtectionContainerResource base class for container with backup items. Containers with specific +// workloads are derived from this class. +type ProtectionContainerResource struct { + autorest.Response `json:"-"` + // Properties - ProtectionContainerResource properties + Properties BasicProtectionContainer `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionContainerResource. +func (pcr ProtectionContainerResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = pcr.Properties + if pcr.Location != nil { + objectMap["location"] = pcr.Location + } + if pcr.Tags != nil { + objectMap["tags"] = pcr.Tags + } + if pcr.ETag != nil { + objectMap["eTag"] = pcr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ProtectionContainerResource struct. +func (pcr *ProtectionContainerResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicProtectionContainer(*v) + if err != nil { + return err + } + pcr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pcr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pcr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pcr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + pcr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + pcr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + pcr.ETag = &eTag + } + } + } + + return nil +} + +// ProtectionContainerResourceList list of ProtectionContainer resources +type ProtectionContainerResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]ProtectionContainerResource `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"` +} + +// ProtectionContainerResourceListIterator provides access to a complete listing of +// ProtectionContainerResource values. +type ProtectionContainerResourceListIterator struct { + i int + page ProtectionContainerResourceListPage +} + +// NextWithContext 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 *ProtectionContainerResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectionContainerResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectionContainerResourceListIterator) 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 ProtectionContainerResourceListIterator) Response() ProtectionContainerResourceList { + 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 ProtectionContainerResourceListIterator) Value() ProtectionContainerResource { + if !iter.page.NotDone() { + return ProtectionContainerResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectionContainerResourceListIterator type. +func NewProtectionContainerResourceListIterator(page ProtectionContainerResourceListPage) ProtectionContainerResourceListIterator { + return ProtectionContainerResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pcrl ProtectionContainerResourceList) IsEmpty() bool { + return pcrl.Value == nil || len(*pcrl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pcrl ProtectionContainerResourceList) hasNextLink() bool { + return pcrl.NextLink != nil && len(*pcrl.NextLink) != 0 +} + +// protectionContainerResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pcrl ProtectionContainerResourceList) protectionContainerResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !pcrl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pcrl.NextLink))) +} + +// ProtectionContainerResourceListPage contains a page of ProtectionContainerResource values. +type ProtectionContainerResourceListPage struct { + fn func(context.Context, ProtectionContainerResourceList) (ProtectionContainerResourceList, error) + pcrl ProtectionContainerResourceList +} + +// NextWithContext 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 *ProtectionContainerResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pcrl) + if err != nil { + return err + } + page.pcrl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectionContainerResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectionContainerResourceListPage) NotDone() bool { + return !page.pcrl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectionContainerResourceListPage) Response() ProtectionContainerResourceList { + return page.pcrl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectionContainerResourceListPage) Values() []ProtectionContainerResource { + if page.pcrl.IsEmpty() { + return nil + } + return *page.pcrl.Value +} + +// Creates a new instance of the ProtectionContainerResourceListPage type. +func NewProtectionContainerResourceListPage(cur ProtectionContainerResourceList, getNextPage func(context.Context, ProtectionContainerResourceList) (ProtectionContainerResourceList, error)) ProtectionContainerResourceListPage { + return ProtectionContainerResourceListPage{ + fn: getNextPage, + pcrl: cur, + } +} + +// ProtectionPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ProtectionPoliciesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ProtectionPoliciesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ProtectionPoliciesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ProtectionPoliciesDeleteFuture.Result. +func (future *ProtectionPoliciesDeleteFuture) result(client ProtectionPoliciesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("backup.ProtectionPoliciesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// BasicProtectionPolicy base class for backup policy. Workload-specific backup policies are derived from this class. +type BasicProtectionPolicy interface { + AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) + AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) + AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) + AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) + AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) + AsMabProtectionPolicy() (*MabProtectionPolicy, bool) + AsProtectionPolicy() (*ProtectionPolicy, bool) +} + +// ProtectionPolicy base class for backup policy. Workload-specific backup policies are derived from this +// class. +type ProtectionPolicy struct { + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` +} + +func unmarshalBasicProtectionPolicy(body []byte) (BasicProtectionPolicy, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["backupManagementType"] { + case string(BackupManagementTypeAzureWorkload): + var avwpp AzureVMWorkloadProtectionPolicy + err := json.Unmarshal(body, &avwpp) + return avwpp, err + case string(BackupManagementTypeAzureStorage): + var afspp AzureFileShareProtectionPolicy + err := json.Unmarshal(body, &afspp) + return afspp, err + case string(BackupManagementTypeAzureIaasVM): + var aispp AzureIaaSVMProtectionPolicy + err := json.Unmarshal(body, &aispp) + return aispp, err + case string(BackupManagementTypeAzureSQL): + var aspp AzureSQLProtectionPolicy + err := json.Unmarshal(body, &aspp) + return aspp, err + case string(BackupManagementTypeGenericProtectionPolicy): + var gpp GenericProtectionPolicy + err := json.Unmarshal(body, &gpp) + return gpp, err + case string(BackupManagementTypeMAB): + var mpp MabProtectionPolicy + err := json.Unmarshal(body, &mpp) + return mpp, err + default: + var pp ProtectionPolicy + err := json.Unmarshal(body, &pp) + return pp, err + } +} +func unmarshalBasicProtectionPolicyArray(body []byte) ([]BasicProtectionPolicy, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ppArray := make([]BasicProtectionPolicy, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pp, err := unmarshalBasicProtectionPolicy(*rawMessage) + if err != nil { + return nil, err + } + ppArray[index] = pp + } + return ppArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectionPolicy. +func (pp ProtectionPolicy) MarshalJSON() ([]byte, error) { + pp.BackupManagementType = BackupManagementTypeProtectionPolicy + objectMap := make(map[string]interface{}) + if pp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = pp.ProtectedItemsCount + } + if pp.BackupManagementType != "" { + objectMap["backupManagementType"] = pp.BackupManagementType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return nil, false +} + +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { + return nil, false +} + +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { + return nil, false +} + +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { + return nil, false +} + +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { + return nil, false +} + +// AsProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { + return &pp, true +} + +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &pp, true +} + +// ProtectionPolicyQueryObject filters the list backup policies API. +type ProtectionPolicyQueryObject struct { + // BackupManagementType - Backup management type for the backup policy. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // FabricName - Fabric name for filter + FabricName *string `json:"fabricName,omitempty"` + // WorkloadType - Workload type for the backup policy. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` +} + +// ProtectionPolicyResource base class for backup policy. Workload-specific backup policies are derived +// from this class. +type ProtectionPolicyResource struct { + autorest.Response `json:"-"` + // Properties - ProtectionPolicyResource properties + Properties BasicProtectionPolicy `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionPolicyResource. +func (ppr ProtectionPolicyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = ppr.Properties + if ppr.Location != nil { + objectMap["location"] = ppr.Location + } + if ppr.Tags != nil { + objectMap["tags"] = ppr.Tags + } + if ppr.ETag != nil { + objectMap["eTag"] = ppr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ProtectionPolicyResource struct. +func (ppr *ProtectionPolicyResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicProtectionPolicy(*v) + if err != nil { + return err + } + ppr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ppr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ppr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ppr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ppr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ppr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + ppr.ETag = &eTag + } + } + } + + return nil +} + +// ProtectionPolicyResourceList list of ProtectionPolicy resources +type ProtectionPolicyResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]ProtectionPolicyResource `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"` +} + +// ProtectionPolicyResourceListIterator provides access to a complete listing of ProtectionPolicyResource +// values. +type ProtectionPolicyResourceListIterator struct { + i int + page ProtectionPolicyResourceListPage +} + +// NextWithContext 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 *ProtectionPolicyResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionPolicyResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectionPolicyResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectionPolicyResourceListIterator) 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 ProtectionPolicyResourceListIterator) Response() ProtectionPolicyResourceList { + 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 ProtectionPolicyResourceListIterator) Value() ProtectionPolicyResource { + if !iter.page.NotDone() { + return ProtectionPolicyResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectionPolicyResourceListIterator type. +func NewProtectionPolicyResourceListIterator(page ProtectionPolicyResourceListPage) ProtectionPolicyResourceListIterator { + return ProtectionPolicyResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pprl ProtectionPolicyResourceList) IsEmpty() bool { + return pprl.Value == nil || len(*pprl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pprl ProtectionPolicyResourceList) hasNextLink() bool { + return pprl.NextLink != nil && len(*pprl.NextLink) != 0 +} + +// protectionPolicyResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pprl ProtectionPolicyResourceList) protectionPolicyResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !pprl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pprl.NextLink))) +} + +// ProtectionPolicyResourceListPage contains a page of ProtectionPolicyResource values. +type ProtectionPolicyResourceListPage struct { + fn func(context.Context, ProtectionPolicyResourceList) (ProtectionPolicyResourceList, error) + pprl ProtectionPolicyResourceList +} + +// NextWithContext 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 *ProtectionPolicyResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionPolicyResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pprl) + if err != nil { + return err + } + page.pprl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectionPolicyResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectionPolicyResourceListPage) NotDone() bool { + return !page.pprl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectionPolicyResourceListPage) Response() ProtectionPolicyResourceList { + return page.pprl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectionPolicyResourceListPage) Values() []ProtectionPolicyResource { + if page.pprl.IsEmpty() { + return nil + } + return *page.pprl.Value +} + +// Creates a new instance of the ProtectionPolicyResourceListPage type. +func NewProtectionPolicyResourceListPage(cur ProtectionPolicyResourceList, getNextPage func(context.Context, ProtectionPolicyResourceList) (ProtectionPolicyResourceList, error)) ProtectionPolicyResourceListPage { + return ProtectionPolicyResourceListPage{ + fn: getNextPage, + pprl: cur, + } +} + +// BasicRecoveryPoint base class for backup copies. Workload-specific backup copies are derived from this class. +type BasicRecoveryPoint interface { + AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) + AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) + AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) + AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) + AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) + AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) + AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) + AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) + AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) + AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) + AsRecoveryPoint() (*RecoveryPoint, bool) +} + +// RecoveryPoint base class for backup copies. Workload-specific backup copies are derived from this class. +type RecoveryPoint struct { + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +func unmarshalBasicRecoveryPoint(body []byte) (BasicRecoveryPoint, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureFileShareRecoveryPoint): + var afsrp AzureFileShareRecoveryPoint + err := json.Unmarshal(body, &afsrp) + return afsrp, err + case string(ObjectTypeAzureWorkloadPointInTimeRecoveryPoint): + var awpitrp AzureWorkloadPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awpitrp) + return awpitrp, err + case string(ObjectTypeAzureWorkloadRecoveryPoint): + var awrp AzureWorkloadRecoveryPoint + err := json.Unmarshal(body, &awrp) + return awrp, err + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): + var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awshpitrp) + return awshpitrp, err + case string(ObjectTypeAzureWorkloadSAPHanaRecoveryPoint): + var awshrp AzureWorkloadSAPHanaRecoveryPoint + err := json.Unmarshal(body, &awshrp) + return awshrp, err + case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): + var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awspitrp) + return awspitrp, err + case string(ObjectTypeAzureWorkloadSQLRecoveryPoint): + var awsrp AzureWorkloadSQLRecoveryPoint + err := json.Unmarshal(body, &awsrp) + return awsrp, err + case string(ObjectTypeGenericRecoveryPoint): + var grp GenericRecoveryPoint + err := json.Unmarshal(body, &grp) + return grp, err + case string(ObjectTypeIaasVMRecoveryPoint): + var ivrp IaasVMRecoveryPoint + err := json.Unmarshal(body, &ivrp) + return ivrp, err + default: + var rp RecoveryPoint + err := json.Unmarshal(body, &rp) + return rp, err + } +} +func unmarshalBasicRecoveryPointArray(body []byte) ([]BasicRecoveryPoint, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpArray := make([]BasicRecoveryPoint, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rp, err := unmarshalBasicRecoveryPoint(*rawMessage) + if err != nil { + return nil, err + } + rpArray[index] = rp + } + return rpArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPoint. +func (rp RecoveryPoint) MarshalJSON() ([]byte, error) { + rp.ObjectType = ObjectTypeRecoveryPoint + objectMap := make(map[string]interface{}) + if rp.ObjectType != "" { + objectMap["objectType"] = rp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return &rp, true +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &rp, true +} + +// RecoveryPointDiskConfiguration disk configuration +type RecoveryPointDiskConfiguration struct { + // NumberOfDisksIncludedInBackup - Number of disks included in backup + NumberOfDisksIncludedInBackup *int32 `json:"numberOfDisksIncludedInBackup,omitempty"` + // NumberOfDisksAttachedToVM - Number of disks attached to the VM + NumberOfDisksAttachedToVM *int32 `json:"numberOfDisksAttachedToVm,omitempty"` + // IncludedDiskList - Information of disks included in backup + IncludedDiskList *[]DiskInformation `json:"includedDiskList,omitempty"` + // ExcludedDiskList - Information of disks excluded from backup + ExcludedDiskList *[]DiskInformation `json:"excludedDiskList,omitempty"` +} + +// RecoveryPointResource base class for backup copies. Workload-specific backup copies are derived from +// this class. +type RecoveryPointResource struct { + autorest.Response `json:"-"` + // Properties - RecoveryPointResource properties + Properties BasicRecoveryPoint `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPointResource. +func (rpr RecoveryPointResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = rpr.Properties + if rpr.Location != nil { + objectMap["location"] = rpr.Location + } + if rpr.Tags != nil { + objectMap["tags"] = rpr.Tags + } + if rpr.ETag != nil { + objectMap["eTag"] = rpr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPointResource struct. +func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicRecoveryPoint(*v) + if err != nil { + return err + } + rpr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rpr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rpr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rpr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rpr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rpr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + rpr.ETag = &eTag + } + } + } + + return nil +} + +// RecoveryPointResourceList list of RecoveryPoint resources +type RecoveryPointResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]RecoveryPointResource `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"` +} + +// RecoveryPointResourceListIterator provides access to a complete listing of RecoveryPointResource values. +type RecoveryPointResourceListIterator struct { + i int + page RecoveryPointResourceListPage +} + +// NextWithContext 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 *RecoveryPointResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryPointResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryPointResourceListIterator) 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 RecoveryPointResourceListIterator) Response() RecoveryPointResourceList { + 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 RecoveryPointResourceListIterator) Value() RecoveryPointResource { + if !iter.page.NotDone() { + return RecoveryPointResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecoveryPointResourceListIterator type. +func NewRecoveryPointResourceListIterator(page RecoveryPointResourceListPage) RecoveryPointResourceListIterator { + return RecoveryPointResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rprl RecoveryPointResourceList) IsEmpty() bool { + return rprl.Value == nil || len(*rprl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rprl RecoveryPointResourceList) hasNextLink() bool { + return rprl.NextLink != nil && len(*rprl.NextLink) != 0 +} + +// recoveryPointResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rprl RecoveryPointResourceList) recoveryPointResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !rprl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rprl.NextLink))) +} + +// RecoveryPointResourceListPage contains a page of RecoveryPointResource values. +type RecoveryPointResourceListPage struct { + fn func(context.Context, RecoveryPointResourceList) (RecoveryPointResourceList, error) + rprl RecoveryPointResourceList +} + +// NextWithContext 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 *RecoveryPointResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rprl) + if err != nil { + return err + } + page.rprl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryPointResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryPointResourceListPage) NotDone() bool { + return !page.rprl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryPointResourceListPage) Response() RecoveryPointResourceList { + return page.rprl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryPointResourceListPage) Values() []RecoveryPointResource { + if page.rprl.IsEmpty() { + return nil + } + return *page.rprl.Value +} + +// Creates a new instance of the RecoveryPointResourceListPage type. +func NewRecoveryPointResourceListPage(cur RecoveryPointResourceList, getNextPage func(context.Context, RecoveryPointResourceList) (RecoveryPointResourceList, error)) RecoveryPointResourceListPage { + return RecoveryPointResourceListPage{ + fn: getNextPage, + rprl: cur, + } +} + +// RecoveryPointTierInformation recovery point tier information. +type RecoveryPointTierInformation struct { + // Type - Recovery point tier type. Possible values include: 'RecoveryPointTierTypeInvalid', 'RecoveryPointTierTypeInstantRP', 'RecoveryPointTierTypeHardenedRP', 'RecoveryPointTierTypeArchivedRP' + Type RecoveryPointTierType `json:"type,omitempty"` + // Status - Recovery point tier status. Possible values include: 'RecoveryPointTierStatusInvalid', 'RecoveryPointTierStatusValid', 'RecoveryPointTierStatusDisabled', 'RecoveryPointTierStatusDeleted', 'RecoveryPointTierStatusRehydrated' + Status RecoveryPointTierStatus `json:"status,omitempty"` +} + +// BasicRequest base class for backup request. Workload-specific backup requests are derived from this class. +type BasicRequest interface { + AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) + AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) + AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) + AsRequest() (*Request, bool) +} + +// Request base class for backup request. Workload-specific backup requests are derived from this class. +type Request struct { + // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' + ObjectType ObjectTypeBasicRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicRequest(body []byte) (BasicRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureFileShareBackupRequest): + var afsbr AzureFileShareBackupRequest + err := json.Unmarshal(body, &afsbr) + return afsbr, err + case string(ObjectTypeAzureWorkloadBackupRequest): + var awbr AzureWorkloadBackupRequest + err := json.Unmarshal(body, &awbr) + return awbr, err + case string(ObjectTypeIaasVMBackupRequest): + var ivbr IaasVMBackupRequest + err := json.Unmarshal(body, &ivbr) + return ivbr, err + default: + var r Request + err := json.Unmarshal(body, &r) + return r, err + } +} +func unmarshalBasicRequestArray(body []byte) ([]BasicRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rArray := make([]BasicRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + r, err := unmarshalBasicRequest(*rawMessage) + if err != nil { + return nil, err + } + rArray[index] = r + } + return rArray, nil +} + +// MarshalJSON is the custom marshaler for Request. +func (r Request) MarshalJSON() ([]byte, error) { + r.ObjectType = ObjectTypeBackupRequest + objectMap := make(map[string]interface{}) + if r.ObjectType != "" { + objectMap["objectType"] = r.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareBackupRequest is the BasicRequest implementation for Request. +func (r Request) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { + return nil, false +} + +// AsAzureWorkloadBackupRequest is the BasicRequest implementation for Request. +func (r Request) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { + return nil, false +} + +// AsIaasVMBackupRequest is the BasicRequest implementation for Request. +func (r Request) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { + return nil, false +} + +// AsRequest is the BasicRequest implementation for Request. +func (r Request) AsRequest() (*Request, bool) { + return &r, true +} + +// AsBasicRequest is the BasicRequest implementation for Request. +func (r Request) AsBasicRequest() (BasicRequest, bool) { + return &r, true +} + +// RequestResource base class for backup request. Workload-specific backup requests are derived from this +// class. +type RequestResource struct { + // Properties - BackupRequestResource properties + Properties BasicRequest `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for RequestResource. +func (rr RequestResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = rr.Properties + if rr.Location != nil { + objectMap["location"] = rr.Location + } + if rr.Tags != nil { + objectMap["tags"] = rr.Tags + } + if rr.ETag != nil { + objectMap["eTag"] = rr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RequestResource struct. +func (rr *RequestResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicRequest(*v) + if err != nil { + return err + } + rr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + rr.ETag = &eTag + } + } + } + + return nil +} + +// Resource ARM Resource. +type Resource struct { + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + if r.ETag != nil { + objectMap["eTag"] = r.ETag + } + return json.Marshal(objectMap) +} + +// ResourceEncryptionConfig ... +type ResourceEncryptionConfig struct { + // EncryptionAtRestType - Encryption At Rest Type. Possible values include: 'EncryptionAtRestTypeInvalid', 'EncryptionAtRestTypeMicrosoftManaged', 'EncryptionAtRestTypeCustomerManaged' + EncryptionAtRestType EncryptionAtRestType `json:"encryptionAtRestType,omitempty"` + // KeyURI - Key Vault Key URI + KeyURI *string `json:"keyUri,omitempty"` + // SubscriptionID - Key Vault Subscription Id + SubscriptionID *string `json:"subscriptionId,omitempty"` + // LastUpdateStatus - Possible values include: 'LastUpdateStatusInvalid', 'LastUpdateStatusNotEnabled', 'LastUpdateStatusPartiallySucceeded', 'LastUpdateStatusPartiallyFailed', 'LastUpdateStatusFailed', 'LastUpdateStatusSucceeded' + LastUpdateStatus LastUpdateStatus `json:"lastUpdateStatus,omitempty"` + // InfrastructureEncryptionState - Possible values include: 'InfrastructureEncryptionStateInvalid', 'InfrastructureEncryptionStateDisabled', 'InfrastructureEncryptionStateEnabled' + InfrastructureEncryptionState InfrastructureEncryptionState `json:"infrastructureEncryptionState,omitempty"` +} + +// ResourceEncryptionConfigResource ... +type ResourceEncryptionConfigResource struct { + autorest.Response `json:"-"` + // Properties - BackupResourceEncryptionConfigResource properties + Properties *ResourceEncryptionConfig `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceEncryptionConfigResource. +func (recr ResourceEncryptionConfigResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if recr.Properties != nil { + objectMap["properties"] = recr.Properties + } + if recr.Location != nil { + objectMap["location"] = recr.Location + } + if recr.Tags != nil { + objectMap["tags"] = recr.Tags + } + if recr.ETag != nil { + objectMap["eTag"] = recr.ETag + } + return json.Marshal(objectMap) +} + +// ResourceHealthDetails health Details for backup items. +type ResourceHealthDetails struct { + // Code - READ-ONLY; Health Code + Code *int32 `json:"code,omitempty"` + // Title - READ-ONLY; Health Title + Title *string `json:"title,omitempty"` + // Message - READ-ONLY; Health Message + Message *string `json:"message,omitempty"` + // Recommendations - READ-ONLY; Health Recommended Actions + Recommendations *[]string `json:"recommendations,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceHealthDetails. +func (rhd ResourceHealthDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResourceList base for all lists of resources. +type ResourceList struct { + // NextLink - The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// ResourceVaultConfig backup resource vault config details. +type ResourceVaultConfig struct { + // StorageModelType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant', 'StorageTypeZoneRedundant', 'StorageTypeReadAccessGeoZoneRedundant' + StorageModelType StorageType `json:"storageModelType,omitempty"` + // StorageType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant', 'StorageTypeZoneRedundant', 'StorageTypeReadAccessGeoZoneRedundant' + StorageType StorageType `json:"storageType,omitempty"` + // StorageTypeState - Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. Possible values include: 'StorageTypeStateInvalid', 'StorageTypeStateLocked', 'StorageTypeStateUnlocked' + StorageTypeState StorageTypeState `json:"storageTypeState,omitempty"` + // EnhancedSecurityState - Enabled or Disabled. Possible values include: 'EnhancedSecurityStateInvalid', 'EnhancedSecurityStateEnabled', 'EnhancedSecurityStateDisabled' + EnhancedSecurityState EnhancedSecurityState `json:"enhancedSecurityState,omitempty"` + // SoftDeleteFeatureState - Soft Delete feature state. Possible values include: 'SoftDeleteFeatureStateInvalid', 'SoftDeleteFeatureStateEnabled', 'SoftDeleteFeatureStateDisabled' + SoftDeleteFeatureState SoftDeleteFeatureState `json:"softDeleteFeatureState,omitempty"` +} + +// ResourceVaultConfigResource backup resource vault config details. +type ResourceVaultConfigResource struct { + autorest.Response `json:"-"` + // Properties - BackupResourceVaultConfigResource properties + Properties *ResourceVaultConfig `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceVaultConfigResource. +func (rvcr ResourceVaultConfigResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rvcr.Properties != nil { + objectMap["properties"] = rvcr.Properties + } + if rvcr.Location != nil { + objectMap["location"] = rvcr.Location + } + if rvcr.Tags != nil { + objectMap["tags"] = rvcr.Tags + } + if rvcr.ETag != nil { + objectMap["eTag"] = rvcr.ETag + } + return json.Marshal(objectMap) +} + +// RestoreFileSpecs restore file specs like file path, type and target folder path info. +type RestoreFileSpecs struct { + // Path - Source File/Folder path + Path *string `json:"path,omitempty"` + // FileSpecType - Indicates what the Path variable stands for + FileSpecType *string `json:"fileSpecType,omitempty"` + // TargetFolderPath - Destination folder path in target FileShare + TargetFolderPath *string `json:"targetFolderPath,omitempty"` +} + +// BasicRestoreRequest base class for restore request. Workload-specific restore requests are derived from this class. +type BasicRestoreRequest interface { + AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) + AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) + AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) + AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) + AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) + AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) + AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) + AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) + AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) + AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) + AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) + AsRestoreRequest() (*RestoreRequest, bool) +} + +// RestoreRequest base class for restore request. Workload-specific restore requests are derived from this +// class. +type RestoreRequest struct { + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicRestoreRequest(body []byte) (BasicRestoreRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureFileShareRestoreRequest): + var afsrr AzureFileShareRestoreRequest + err := json.Unmarshal(body, &afsrr) + return afsrr, err + case string(ObjectTypeAzureWorkloadPointInTimeRestoreRequest): + var awpitrr AzureWorkloadPointInTimeRestoreRequest + err := json.Unmarshal(body, &awpitrr) + return awpitrr, err + case string(ObjectTypeAzureWorkloadRestoreRequest): + var awrr AzureWorkloadRestoreRequest + err := json.Unmarshal(body, &awrr) + return awrr, err + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): + var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest + err := json.Unmarshal(body, &awshpitrr) + return awshpitrr, err + case string(ObjectTypeAzureWorkloadSAPHanaRestoreRequest): + var awshrr AzureWorkloadSAPHanaRestoreRequest + err := json.Unmarshal(body, &awshrr) + return awshrr, err + case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): + var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest + err := json.Unmarshal(body, &awspitrr) + return awspitrr, err + case string(ObjectTypeAzureWorkloadSQLRestoreRequest): + var awsrr AzureWorkloadSQLRestoreRequest + err := json.Unmarshal(body, &awsrr) + return awsrr, err + case string(ObjectTypeIaasVMRestoreRequest): + var ivrr IaasVMRestoreRequest + err := json.Unmarshal(body, &ivrr) + return ivrr, err + default: + var rr RestoreRequest + err := json.Unmarshal(body, &rr) + return rr, err + } +} +func unmarshalBasicRestoreRequestArray(body []byte) ([]BasicRestoreRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rrArray := make([]BasicRestoreRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rr, err := unmarshalBasicRestoreRequest(*rawMessage) + if err != nil { + return nil, err + } + rrArray[index] = rr + } + return rrArray, nil +} + +// MarshalJSON is the custom marshaler for RestoreRequest. +func (rr RestoreRequest) MarshalJSON() ([]byte, error) { + rr.ObjectType = ObjectTypeRestoreRequest + objectMap := make(map[string]interface{}) + if rr.ObjectType != "" { + objectMap["objectType"] = rr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return &rr, true +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &rr, true +} + +// RestoreRequestResource base class for restore request. Workload-specific restore requests are derived +// from this class. +type RestoreRequestResource struct { + // Properties - RestoreRequestResource properties + Properties BasicRestoreRequest `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestoreRequestResource. +func (rrr RestoreRequestResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = rrr.Properties + if rrr.Location != nil { + objectMap["location"] = rrr.Location + } + if rrr.Tags != nil { + objectMap["tags"] = rrr.Tags + } + if rrr.ETag != nil { + objectMap["eTag"] = rrr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RestoreRequestResource struct. +func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicRestoreRequest(*v) + if err != nil { + return err + } + rrr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rrr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rrr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rrr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rrr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rrr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + rrr.ETag = &eTag + } + } + } + + return nil +} + +// RetentionDuration retention duration. +type RetentionDuration struct { + // Count - Count of duration types. Retention duration is obtained by the counting the duration type Count times. + // For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks. + Count *int32 `json:"count,omitempty"` + // DurationType - Retention duration type of retention policy. Possible values include: 'RetentionDurationTypeInvalid', 'RetentionDurationTypeDays', 'RetentionDurationTypeWeeks', 'RetentionDurationTypeMonths', 'RetentionDurationTypeYears' + DurationType RetentionDurationType `json:"durationType,omitempty"` +} + +// BasicRetentionPolicy base class for retention policy. +type BasicRetentionPolicy interface { + AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) + AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) + AsRetentionPolicy() (*RetentionPolicy, bool) +} + +// RetentionPolicy base class for retention policy. +type RetentionPolicy struct { + // RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy' + RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"` +} + +func unmarshalBasicRetentionPolicy(body []byte) (BasicRetentionPolicy, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["retentionPolicyType"] { + case string(RetentionPolicyTypeLongTermRetentionPolicy): + var ltrp LongTermRetentionPolicy + err := json.Unmarshal(body, <rp) + return ltrp, err + case string(RetentionPolicyTypeSimpleRetentionPolicy): + var srp SimpleRetentionPolicy + err := json.Unmarshal(body, &srp) + return srp, err + default: + var rp RetentionPolicy + err := json.Unmarshal(body, &rp) + return rp, err + } +} +func unmarshalBasicRetentionPolicyArray(body []byte) ([]BasicRetentionPolicy, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpArray := make([]BasicRetentionPolicy, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rp, err := unmarshalBasicRetentionPolicy(*rawMessage) + if err != nil { + return nil, err + } + rpArray[index] = rp + } + return rpArray, nil +} + +// MarshalJSON is the custom marshaler for RetentionPolicy. +func (rp RetentionPolicy) MarshalJSON() ([]byte, error) { + rp.RetentionPolicyType = RetentionPolicyTypeRetentionPolicy + objectMap := make(map[string]interface{}) + if rp.RetentionPolicyType != "" { + objectMap["retentionPolicyType"] = rp.RetentionPolicyType + } + return json.Marshal(objectMap) +} + +// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. +func (rp RetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) { + return nil, false +} + +// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. +func (rp RetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) { + return nil, false +} + +// AsRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. +func (rp RetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) { + return &rp, true +} + +// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. +func (rp RetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) { + return &rp, true +} + +// BasicSchedulePolicy base class for backup schedule. +type BasicSchedulePolicy interface { + AsLogSchedulePolicy() (*LogSchedulePolicy, bool) + AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) + AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) + AsSchedulePolicy() (*SchedulePolicy, bool) +} + +// SchedulePolicy base class for backup schedule. +type SchedulePolicy struct { + // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' + SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` +} + +func unmarshalBasicSchedulePolicy(body []byte) (BasicSchedulePolicy, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["schedulePolicyType"] { + case string(SchedulePolicyTypeLogSchedulePolicy): + var lsp LogSchedulePolicy + err := json.Unmarshal(body, &lsp) + return lsp, err + case string(SchedulePolicyTypeLongTermSchedulePolicy): + var ltsp LongTermSchedulePolicy + err := json.Unmarshal(body, <sp) + return ltsp, err + case string(SchedulePolicyTypeSimpleSchedulePolicy): + var ssp SimpleSchedulePolicy + err := json.Unmarshal(body, &ssp) + return ssp, err + default: + var sp SchedulePolicy + err := json.Unmarshal(body, &sp) + return sp, err + } +} +func unmarshalBasicSchedulePolicyArray(body []byte) ([]BasicSchedulePolicy, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + spArray := make([]BasicSchedulePolicy, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sp, err := unmarshalBasicSchedulePolicy(*rawMessage) + if err != nil { + return nil, err + } + spArray[index] = sp + } + return spArray, nil +} + +// MarshalJSON is the custom marshaler for SchedulePolicy. +func (sp SchedulePolicy) MarshalJSON() ([]byte, error) { + sp.SchedulePolicyType = SchedulePolicyTypeSchedulePolicy + objectMap := make(map[string]interface{}) + if sp.SchedulePolicyType != "" { + objectMap["schedulePolicyType"] = sp.SchedulePolicyType + } + return json.Marshal(objectMap) +} + +// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. +func (sp SchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { + return nil, false +} + +// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. +func (sp SchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { + return nil, false +} + +// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. +func (sp SchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { + return nil, false +} + +// AsSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. +func (sp SchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { + return &sp, true +} + +// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. +func (sp SchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { + return &sp, true +} + +// Settings common settings field for backup management +type Settings struct { + // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + TimeZone *string `json:"timeZone,omitempty"` + // Issqlcompression - SQL compression flag + Issqlcompression *bool `json:"issqlcompression,omitempty"` + // IsCompression - Workload compression flag. This has been added so that 'isSqlCompression' + // will be deprecated once clients upgrade to consider this flag. + IsCompression *bool `json:"isCompression,omitempty"` +} + +// SimpleRetentionPolicy simple policy retention. +type SimpleRetentionPolicy struct { + // RetentionDuration - Retention duration of the protection policy. + RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` + // RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy' + RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SimpleRetentionPolicy. +func (srp SimpleRetentionPolicy) MarshalJSON() ([]byte, error) { + srp.RetentionPolicyType = RetentionPolicyTypeSimpleRetentionPolicy + objectMap := make(map[string]interface{}) + if srp.RetentionDuration != nil { + objectMap["retentionDuration"] = srp.RetentionDuration + } + if srp.RetentionPolicyType != "" { + objectMap["retentionPolicyType"] = srp.RetentionPolicyType + } + return json.Marshal(objectMap) +} + +// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. +func (srp SimpleRetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) { + return nil, false +} + +// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. +func (srp SimpleRetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) { + return &srp, true +} + +// AsRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. +func (srp SimpleRetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) { + return nil, false +} + +// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. +func (srp SimpleRetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) { + return &srp, true +} + +// SimpleSchedulePolicy simple policy schedule. +type SimpleSchedulePolicy struct { + // ScheduleRunFrequency - Frequency of the schedule operation of this policy. Possible values include: 'ScheduleRunTypeInvalid', 'ScheduleRunTypeDaily', 'ScheduleRunTypeWeekly' + ScheduleRunFrequency ScheduleRunType `json:"scheduleRunFrequency,omitempty"` + // ScheduleRunDays - List of days of week this schedule has to be run. + ScheduleRunDays *[]DayOfWeek `json:"scheduleRunDays,omitempty"` + // ScheduleRunTimes - List of times of day this schedule has to be run. + ScheduleRunTimes *[]date.Time `json:"scheduleRunTimes,omitempty"` + // ScheduleWeeklyFrequency - At every number weeks this schedule has to be run. + ScheduleWeeklyFrequency *int32 `json:"scheduleWeeklyFrequency,omitempty"` + // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy' + SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) MarshalJSON() ([]byte, error) { + ssp.SchedulePolicyType = SchedulePolicyTypeSimpleSchedulePolicy + objectMap := make(map[string]interface{}) + if ssp.ScheduleRunFrequency != "" { + objectMap["scheduleRunFrequency"] = ssp.ScheduleRunFrequency + } + if ssp.ScheduleRunDays != nil { + objectMap["scheduleRunDays"] = ssp.ScheduleRunDays + } + if ssp.ScheduleRunTimes != nil { + objectMap["scheduleRunTimes"] = ssp.ScheduleRunTimes + } + if ssp.ScheduleWeeklyFrequency != nil { + objectMap["scheduleWeeklyFrequency"] = ssp.ScheduleWeeklyFrequency + } + if ssp.SchedulePolicyType != "" { + objectMap["schedulePolicyType"] = ssp.SchedulePolicyType + } + return json.Marshal(objectMap) +} + +// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { + return nil, false +} + +// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { + return nil, false +} + +// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { + return &ssp, true +} + +// AsSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { + return nil, false +} + +// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { + return &ssp, true +} + +// SQLDataDirectory sQLDataDirectory info +type SQLDataDirectory struct { + // Type - Type of data directory mapping. Possible values include: 'SQLDataDirectoryTypeInvalid', 'SQLDataDirectoryTypeData', 'SQLDataDirectoryTypeLog' + Type SQLDataDirectoryType `json:"type,omitempty"` + // Path - File path + Path *string `json:"path,omitempty"` + // LogicalName - Logical name of the file + LogicalName *string `json:"logicalName,omitempty"` +} + +// SQLDataDirectoryMapping encapsulates information regarding data directory +type SQLDataDirectoryMapping struct { + // MappingType - Type of data directory mapping. Possible values include: 'SQLDataDirectoryTypeInvalid', 'SQLDataDirectoryTypeData', 'SQLDataDirectoryTypeLog' + MappingType SQLDataDirectoryType `json:"mappingType,omitempty"` + // SourceLogicalName - Restore source logical name path + SourceLogicalName *string `json:"sourceLogicalName,omitempty"` + // SourcePath - Restore source path + SourcePath *string `json:"sourcePath,omitempty"` + // TargetPath - Target path + TargetPath *string `json:"targetPath,omitempty"` +} + +// SubProtectionPolicy sub-protection policy which includes schedule and retention +type SubProtectionPolicy struct { + // PolicyType - Type of backup policy type. Possible values include: 'PolicyTypeInvalid', 'PolicyTypeFull', 'PolicyTypeDifferential', 'PolicyTypeLog', 'PolicyTypeCopyOnlyFull', 'PolicyTypeIncremental' + 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. + RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SubProtectionPolicy struct. +func (spp *SubProtectionPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "policyType": + if v != nil { + var policyType PolicyType + err = json.Unmarshal(*v, &policyType) + if err != nil { + return err + } + spp.PolicyType = policyType + } + case "schedulePolicy": + if v != nil { + schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) + if err != nil { + return err + } + spp.SchedulePolicy = schedulePolicy + } + case "retentionPolicy": + if v != nil { + retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) + if err != nil { + return err + } + spp.RetentionPolicy = retentionPolicy + } + } + } + + return nil +} + +// TargetAFSRestoreInfo target Azure File Share Info. +type TargetAFSRestoreInfo struct { + // Name - File share name + Name *string `json:"name,omitempty"` + // TargetResourceID - Target file share resource ARM ID + TargetResourceID *string `json:"targetResourceId,omitempty"` +} + +// TargetRestoreInfo details about target workload during restore operation. +type TargetRestoreInfo struct { + // OverwriteOption - Can Overwrite if Target DataBase already exists. Possible values include: 'OverwriteOptionsInvalid', 'OverwriteOptionsFailOnConflict', 'OverwriteOptionsOverwrite' + OverwriteOption OverwriteOptions `json:"overwriteOption,omitempty"` + // ContainerID - Resource Id name of the container in which Target DataBase resides + ContainerID *string `json:"containerId,omitempty"` + // DatabaseName - Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana + DatabaseName *string `json:"databaseName,omitempty"` + // TargetDirectoryForFileRestore - Target directory location for restore as files. + TargetDirectoryForFileRestore *string `json:"targetDirectoryForFileRestore,omitempty"` +} + +// TokenInformation the token information details. +type TokenInformation struct { + autorest.Response `json:"-"` + // Token - Token value. + Token *string `json:"token,omitempty"` + // ExpiryTimeInUtcTicks - Expiry time of token. + ExpiryTimeInUtcTicks *int64 `json:"expiryTimeInUtcTicks,omitempty"` + // SecurityPIN - Security PIN + SecurityPIN *string `json:"securityPIN,omitempty"` +} + +// TriggerDataMoveRequest trigger DataMove Request +type TriggerDataMoveRequest struct { + // SourceResourceID - ARM Id of source vault + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // SourceRegion - Source Region + SourceRegion *string `json:"sourceRegion,omitempty"` + // DataMoveLevel - DataMove Level. Possible values include: 'DataMoveLevelInvalid', 'DataMoveLevelVault', 'DataMoveLevelContainer' + DataMoveLevel DataMoveLevel `json:"dataMoveLevel,omitempty"` + // CorrelationID - Correlation Id + CorrelationID *string `json:"correlationId,omitempty"` + // SourceContainerArmIds - Source Container ArmIds + SourceContainerArmIds *[]string `json:"sourceContainerArmIds,omitempty"` + // PauseGC - Pause GC + PauseGC *bool `json:"pauseGC,omitempty"` +} + +// ValidateIaasVMRestoreOperationRequest azureRestoreValidation request. +type ValidateIaasVMRestoreOperationRequest struct { + // RestoreRequest - Sets restore request to be validated + RestoreRequest BasicRestoreRequest `json:"restoreRequest,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeValidateOperationRequest', 'ObjectTypeValidateIaasVMRestoreOperationRequest', 'ObjectTypeValidateRestoreOperationRequest' + ObjectType ObjectTypeBasicValidateOperationRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ValidateIaasVMRestoreOperationRequest. +func (vivror ValidateIaasVMRestoreOperationRequest) MarshalJSON() ([]byte, error) { + vivror.ObjectType = ObjectTypeValidateIaasVMRestoreOperationRequest + objectMap := make(map[string]interface{}) + objectMap["restoreRequest"] = vivror.RestoreRequest + if vivror.ObjectType != "" { + objectMap["objectType"] = vivror.ObjectType + } + return json.Marshal(objectMap) +} + +// AsValidateIaasVMRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. +func (vivror ValidateIaasVMRestoreOperationRequest) AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) { + return &vivror, true +} + +// AsValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. +func (vivror ValidateIaasVMRestoreOperationRequest) AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) { + return nil, false +} + +// AsBasicValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. +func (vivror ValidateIaasVMRestoreOperationRequest) AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) { + return &vivror, true +} + +// AsValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. +func (vivror ValidateIaasVMRestoreOperationRequest) AsValidateOperationRequest() (*ValidateOperationRequest, bool) { + return nil, false +} + +// AsBasicValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. +func (vivror ValidateIaasVMRestoreOperationRequest) AsBasicValidateOperationRequest() (BasicValidateOperationRequest, bool) { + return &vivror, true +} + +// UnmarshalJSON is the custom unmarshaler for ValidateIaasVMRestoreOperationRequest struct. +func (vivror *ValidateIaasVMRestoreOperationRequest) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "restoreRequest": + if v != nil { + restoreRequest, err := unmarshalBasicRestoreRequest(*v) + if err != nil { + return err + } + vivror.RestoreRequest = restoreRequest + } + case "objectType": + if v != nil { + var objectType ObjectTypeBasicValidateOperationRequest + err = json.Unmarshal(*v, &objectType) + if err != nil { + return err + } + vivror.ObjectType = objectType + } + } + } + + return nil +} + +// BasicValidateOperationRequest base class for validate operation request. +type BasicValidateOperationRequest interface { + AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) + AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) + AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) + AsValidateOperationRequest() (*ValidateOperationRequest, bool) +} + +// ValidateOperationRequest base class for validate operation request. +type ValidateOperationRequest struct { + // ObjectType - Possible values include: 'ObjectTypeValidateOperationRequest', 'ObjectTypeValidateIaasVMRestoreOperationRequest', 'ObjectTypeValidateRestoreOperationRequest' + ObjectType ObjectTypeBasicValidateOperationRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicValidateOperationRequest(body []byte) (BasicValidateOperationRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeValidateIaasVMRestoreOperationRequest): + var vivror ValidateIaasVMRestoreOperationRequest + err := json.Unmarshal(body, &vivror) + return vivror, err + case string(ObjectTypeValidateRestoreOperationRequest): + var vror ValidateRestoreOperationRequest + err := json.Unmarshal(body, &vror) + return vror, err + default: + var vor ValidateOperationRequest + err := json.Unmarshal(body, &vor) + return vor, err + } +} +func unmarshalBasicValidateOperationRequestArray(body []byte) ([]BasicValidateOperationRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + vorArray := make([]BasicValidateOperationRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + vor, err := unmarshalBasicValidateOperationRequest(*rawMessage) + if err != nil { + return nil, err + } + vorArray[index] = vor + } + return vorArray, nil +} + +// MarshalJSON is the custom marshaler for ValidateOperationRequest. +func (vor ValidateOperationRequest) MarshalJSON() ([]byte, error) { + vor.ObjectType = ObjectTypeValidateOperationRequest + objectMap := make(map[string]interface{}) + if vor.ObjectType != "" { + objectMap["objectType"] = vor.ObjectType + } + return json.Marshal(objectMap) +} + +// AsValidateIaasVMRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. +func (vor ValidateOperationRequest) AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) { + return nil, false +} + +// AsValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. +func (vor ValidateOperationRequest) AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) { + return nil, false +} + +// AsBasicValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. +func (vor ValidateOperationRequest) AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) { + return nil, false +} + +// AsValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. +func (vor ValidateOperationRequest) AsValidateOperationRequest() (*ValidateOperationRequest, bool) { + return &vor, true +} + +// AsBasicValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. +func (vor ValidateOperationRequest) AsBasicValidateOperationRequest() (BasicValidateOperationRequest, bool) { + return &vor, true +} + +// ValidateOperationResponse base class for validate operation response. +type ValidateOperationResponse struct { + // ValidationResults - Gets the validation result + ValidationResults *[]ErrorDetail `json:"validationResults,omitempty"` +} + +// ValidateOperationsResponse ... +type ValidateOperationsResponse struct { + autorest.Response `json:"-"` + ValidateOperationResponse *ValidateOperationResponse `json:"validateOperationResponse,omitempty"` +} + +// BasicValidateRestoreOperationRequest azureRestoreValidation request. +type BasicValidateRestoreOperationRequest interface { + AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) + AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) +} + +// ValidateRestoreOperationRequest azureRestoreValidation request. +type ValidateRestoreOperationRequest struct { + // RestoreRequest - Sets restore request to be validated + RestoreRequest BasicRestoreRequest `json:"restoreRequest,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeValidateOperationRequest', 'ObjectTypeValidateIaasVMRestoreOperationRequest', 'ObjectTypeValidateRestoreOperationRequest' + ObjectType ObjectTypeBasicValidateOperationRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicValidateRestoreOperationRequest(body []byte) (BasicValidateRestoreOperationRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeValidateIaasVMRestoreOperationRequest): + var vivror ValidateIaasVMRestoreOperationRequest + err := json.Unmarshal(body, &vivror) + return vivror, err + default: + var vror ValidateRestoreOperationRequest + err := json.Unmarshal(body, &vror) + return vror, err + } +} +func unmarshalBasicValidateRestoreOperationRequestArray(body []byte) ([]BasicValidateRestoreOperationRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + vrorArray := make([]BasicValidateRestoreOperationRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + vror, err := unmarshalBasicValidateRestoreOperationRequest(*rawMessage) + if err != nil { + return nil, err + } + vrorArray[index] = vror + } + return vrorArray, nil +} + +// MarshalJSON is the custom marshaler for ValidateRestoreOperationRequest. +func (vror ValidateRestoreOperationRequest) MarshalJSON() ([]byte, error) { + vror.ObjectType = ObjectTypeValidateRestoreOperationRequest + objectMap := make(map[string]interface{}) + objectMap["restoreRequest"] = vror.RestoreRequest + if vror.ObjectType != "" { + objectMap["objectType"] = vror.ObjectType + } + return json.Marshal(objectMap) +} + +// AsValidateIaasVMRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. +func (vror ValidateRestoreOperationRequest) AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) { + return nil, false +} + +// AsValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. +func (vror ValidateRestoreOperationRequest) AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) { + return &vror, true +} + +// AsBasicValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. +func (vror ValidateRestoreOperationRequest) AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) { + return &vror, true +} + +// AsValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. +func (vror ValidateRestoreOperationRequest) AsValidateOperationRequest() (*ValidateOperationRequest, bool) { + return nil, false +} + +// AsBasicValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. +func (vror ValidateRestoreOperationRequest) AsBasicValidateOperationRequest() (BasicValidateOperationRequest, bool) { + return &vror, true +} + +// UnmarshalJSON is the custom unmarshaler for ValidateRestoreOperationRequest struct. +func (vror *ValidateRestoreOperationRequest) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "restoreRequest": + if v != nil { + restoreRequest, err := unmarshalBasicRestoreRequest(*v) + if err != nil { + return err + } + vror.RestoreRequest = restoreRequest + } + case "objectType": + if v != nil { + var objectType ObjectTypeBasicValidateOperationRequest + err = json.Unmarshal(*v, &objectType) + if err != nil { + return err + } + vror.ObjectType = objectType + } + } + } + + return nil +} + +// VaultJob vault level Job +type VaultJob struct { + // Duration - Time elapsed during the execution of this job. + Duration *string `json:"duration,omitempty"` + // ActionsInfo - Gets or sets the state/actions applicable on this job like cancel/retry. + ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` + // ErrorDetails - Error details on execution of this job. + ErrorDetails *[]VaultJobErrorInfo `json:"errorDetails,omitempty"` + // ExtendedInfo - Additional information about the job. + ExtendedInfo *VaultJobExtendedInfo `json:"extendedInfo,omitempty"` + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob', 'JobTypeVaultJob' + JobType JobType `json:"jobType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VaultJob. +func (vj VaultJob) MarshalJSON() ([]byte, error) { + vj.JobType = JobTypeVaultJob + objectMap := make(map[string]interface{}) + if vj.Duration != nil { + objectMap["duration"] = vj.Duration + } + if vj.ActionsInfo != nil { + objectMap["actionsInfo"] = vj.ActionsInfo + } + if vj.ErrorDetails != nil { + objectMap["errorDetails"] = vj.ErrorDetails + } + if vj.ExtendedInfo != nil { + objectMap["extendedInfo"] = vj.ExtendedInfo + } + if vj.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = vj.EntityFriendlyName + } + if vj.BackupManagementType != "" { + objectMap["backupManagementType"] = vj.BackupManagementType + } + if vj.Operation != nil { + objectMap["operation"] = vj.Operation + } + if vj.Status != nil { + objectMap["status"] = vj.Status + } + if vj.StartTime != nil { + objectMap["startTime"] = vj.StartTime + } + if vj.EndTime != nil { + objectMap["endTime"] = vj.EndTime + } + if vj.ActivityID != nil { + objectMap["activityId"] = vj.ActivityID + } + if vj.JobType != "" { + objectMap["jobType"] = vj.JobType + } + return json.Marshal(objectMap) +} + +// AsAzureIaaSVMJob is the BasicJob implementation for VaultJob. +func (vj VaultJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { + return nil, false +} + +// AsAzureStorageJob is the BasicJob implementation for VaultJob. +func (vj VaultJob) AsAzureStorageJob() (*AzureStorageJob, bool) { + return nil, false +} + +// AsAzureWorkloadJob is the BasicJob implementation for VaultJob. +func (vj VaultJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { + return nil, false +} + +// AsDpmJob is the BasicJob implementation for VaultJob. +func (vj VaultJob) AsDpmJob() (*DpmJob, bool) { + return nil, false +} + +// AsMabJob is the BasicJob implementation for VaultJob. +func (vj VaultJob) AsMabJob() (*MabJob, bool) { + return nil, false +} + +// AsVaultJob is the BasicJob implementation for VaultJob. +func (vj VaultJob) AsVaultJob() (*VaultJob, bool) { + return &vj, true +} + +// AsJob is the BasicJob implementation for VaultJob. +func (vj VaultJob) AsJob() (*Job, bool) { + return nil, false +} + +// AsBasicJob is the BasicJob implementation for VaultJob. +func (vj VaultJob) AsBasicJob() (BasicJob, bool) { + return &vj, true +} + +// VaultJobErrorInfo vault Job specific error information +type VaultJobErrorInfo struct { + // ErrorCode - Error code. + ErrorCode *int32 `json:"errorCode,omitempty"` + // ErrorString - Localized error string. + ErrorString *string `json:"errorString,omitempty"` + // Recommendations - List of localized recommendations for above error code. + Recommendations *[]string `json:"recommendations,omitempty"` +} + +// VaultJobExtendedInfo vault Job for CMK - has CMK specific info. +type VaultJobExtendedInfo struct { + // PropertyBag - Job properties. + PropertyBag map[string]*string `json:"propertyBag"` +} + +// MarshalJSON is the custom marshaler for VaultJobExtendedInfo. +func (vjei VaultJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vjei.PropertyBag != nil { + objectMap["propertyBag"] = vjei.PropertyBag + } + return json.Marshal(objectMap) +} + +// BasicVaultStorageConfigOperationResultResponse operation result response for Vault Storage Config +type BasicVaultStorageConfigOperationResultResponse interface { + AsPrepareDataMoveResponse() (*PrepareDataMoveResponse, bool) + AsVaultStorageConfigOperationResultResponse() (*VaultStorageConfigOperationResultResponse, bool) +} + +// VaultStorageConfigOperationResultResponse operation result response for Vault Storage Config +type VaultStorageConfigOperationResultResponse struct { + autorest.Response `json:"-"` + // ObjectType - Possible values include: 'ObjectTypeVaultStorageConfigOperationResultResponse', 'ObjectTypePrepareDataMoveResponse' + ObjectType ObjectTypeBasicVaultStorageConfigOperationResultResponse `json:"objectType,omitempty"` +} + +func unmarshalBasicVaultStorageConfigOperationResultResponse(body []byte) (BasicVaultStorageConfigOperationResultResponse, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypePrepareDataMoveResponse): + var pdmr PrepareDataMoveResponse + err := json.Unmarshal(body, &pdmr) + return pdmr, err + default: + var vscorr VaultStorageConfigOperationResultResponse + err := json.Unmarshal(body, &vscorr) + return vscorr, err + } +} +func unmarshalBasicVaultStorageConfigOperationResultResponseArray(body []byte) ([]BasicVaultStorageConfigOperationResultResponse, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + vscorrArray := make([]BasicVaultStorageConfigOperationResultResponse, len(rawMessages)) + + for index, rawMessage := range rawMessages { + vscorr, err := unmarshalBasicVaultStorageConfigOperationResultResponse(*rawMessage) + if err != nil { + return nil, err + } + vscorrArray[index] = vscorr + } + return vscorrArray, nil +} + +// MarshalJSON is the custom marshaler for VaultStorageConfigOperationResultResponse. +func (vscorr VaultStorageConfigOperationResultResponse) MarshalJSON() ([]byte, error) { + vscorr.ObjectType = ObjectTypeVaultStorageConfigOperationResultResponse + objectMap := make(map[string]interface{}) + if vscorr.ObjectType != "" { + objectMap["objectType"] = vscorr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsPrepareDataMoveResponse is the BasicVaultStorageConfigOperationResultResponse implementation for VaultStorageConfigOperationResultResponse. +func (vscorr VaultStorageConfigOperationResultResponse) AsPrepareDataMoveResponse() (*PrepareDataMoveResponse, bool) { + return nil, false +} + +// AsVaultStorageConfigOperationResultResponse is the BasicVaultStorageConfigOperationResultResponse implementation for VaultStorageConfigOperationResultResponse. +func (vscorr VaultStorageConfigOperationResultResponse) AsVaultStorageConfigOperationResultResponse() (*VaultStorageConfigOperationResultResponse, bool) { + return &vscorr, true +} + +// AsBasicVaultStorageConfigOperationResultResponse is the BasicVaultStorageConfigOperationResultResponse implementation for VaultStorageConfigOperationResultResponse. +func (vscorr VaultStorageConfigOperationResultResponse) AsBasicVaultStorageConfigOperationResultResponse() (BasicVaultStorageConfigOperationResultResponse, bool) { + return &vscorr, true +} + +// VaultStorageConfigOperationResultResponseModel ... +type VaultStorageConfigOperationResultResponseModel struct { + autorest.Response `json:"-"` + Value BasicVaultStorageConfigOperationResultResponse `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for VaultStorageConfigOperationResultResponseModel struct. +func (vscorrm *VaultStorageConfigOperationResultResponseModel) UnmarshalJSON(body []byte) error { + vscorr, err := unmarshalBasicVaultStorageConfigOperationResultResponse(body) + if err != nil { + return err + } + vscorrm.Value = vscorr + + return nil +} + +// WeeklyRetentionFormat weekly retention format. +type WeeklyRetentionFormat struct { + // DaysOfTheWeek - List of days of the week. + DaysOfTheWeek *[]DayOfWeek `json:"daysOfTheWeek,omitempty"` + // WeeksOfTheMonth - List of weeks of month. + WeeksOfTheMonth *[]WeekOfMonth `json:"weeksOfTheMonth,omitempty"` +} + +// WeeklyRetentionSchedule weekly retention schedule. +type WeeklyRetentionSchedule struct { + // DaysOfTheWeek - List of days of week for weekly retention policy. + DaysOfTheWeek *[]DayOfWeek `json:"daysOfTheWeek,omitempty"` + // RetentionTimes - Retention times of retention policy. + RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` + // RetentionDuration - Retention duration of retention Policy. + RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` +} + +// WorkloadInquiryDetails details of an inquired protectable item. +type WorkloadInquiryDetails struct { + // Type - Type of the Workload such as SQL, Oracle etc. + Type *string `json:"type,omitempty"` + // ItemCount - Contains the protectable item Count inside this Container. + ItemCount *int64 `json:"itemCount,omitempty"` + // InquiryValidation - Inquiry validation such as permissions and other backup validations. + InquiryValidation *InquiryValidation `json:"inquiryValidation,omitempty"` +} + +// BasicWorkloadItem base class for backup item. Workload-specific backup items are derived from this class. +type BasicWorkloadItem interface { + AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) + AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) + AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) + AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) + AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) + AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) + AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) + AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) + AsWorkloadItem() (*WorkloadItem, bool) +} + +// WorkloadItem base class for backup item. Workload-specific backup items are derived from this class. +type WorkloadItem struct { + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +} + +func unmarshalBasicWorkloadItem(body []byte) (BasicWorkloadItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["workloadItemType"] { + case string(WorkloadItemTypeAzureVMWorkloadItem): + var avwi AzureVMWorkloadItem + err := json.Unmarshal(body, &avwi) + return avwi, err + case string(WorkloadItemTypeSAPAseDatabase1): + var avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem + err := json.Unmarshal(body, &avwsadwi) + return avwsadwi, err + case string(WorkloadItemTypeSAPAseSystem1): + var avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem + err := json.Unmarshal(body, &avwsaswi) + return avwsaswi, err + case string(WorkloadItemTypeSAPHanaDatabase1): + var avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem + err := json.Unmarshal(body, &avwshdwi) + return avwshdwi, err + case string(WorkloadItemTypeSAPHanaSystem1): + var avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem + err := json.Unmarshal(body, &avwshswi) + return avwshswi, err + case string(WorkloadItemTypeSQLDataBase1): + var avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem + err := json.Unmarshal(body, &avwsdwi) + return avwsdwi, err + case string(WorkloadItemTypeSQLInstance1): + var avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem + err := json.Unmarshal(body, &avwsiwi) + return avwsiwi, err + default: + var wi WorkloadItem + err := json.Unmarshal(body, &wi) + return wi, err + } +} +func unmarshalBasicWorkloadItemArray(body []byte) ([]BasicWorkloadItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + wiArray := make([]BasicWorkloadItem, len(rawMessages)) + + for index, rawMessage := range rawMessages { + wi, err := unmarshalBasicWorkloadItem(*rawMessage) + if err != nil { + return nil, err + } + wiArray[index] = wi + } + return wiArray, nil +} + +// MarshalJSON is the custom marshaler for WorkloadItem. +func (wi WorkloadItem) MarshalJSON() ([]byte, error) { + wi.WorkloadItemType = WorkloadItemTypeWorkloadItem + objectMap := make(map[string]interface{}) + if wi.BackupManagementType != nil { + objectMap["backupManagementType"] = wi.BackupManagementType + } + if wi.WorkloadType != nil { + objectMap["workloadType"] = wi.WorkloadType + } + if wi.FriendlyName != nil { + objectMap["friendlyName"] = wi.FriendlyName + } + if wi.ProtectionState != "" { + objectMap["protectionState"] = wi.ProtectionState + } + if wi.WorkloadItemType != "" { + objectMap["workloadItemType"] = wi.WorkloadItemType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { + return nil, false +} + +// AsWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { + return &wi, true +} + +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &wi, true +} + +// WorkloadItemResource base class for backup item. Workload-specific backup items are derived from this +// class. +type WorkloadItemResource struct { + // Properties - WorkloadItemResource properties + Properties BasicWorkloadItem `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for WorkloadItemResource. +func (wir WorkloadItemResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = wir.Properties + if wir.Location != nil { + objectMap["location"] = wir.Location + } + if wir.Tags != nil { + objectMap["tags"] = wir.Tags + } + if wir.ETag != nil { + objectMap["eTag"] = wir.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WorkloadItemResource struct. +func (wir *WorkloadItemResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicWorkloadItem(*v) + if err != nil { + return err + } + wir.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + wir.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wir.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + wir.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + wir.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + wir.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + wir.ETag = &eTag + } + } + } + + return nil +} + +// WorkloadItemResourceList list of WorkloadItem resources +type WorkloadItemResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]WorkloadItemResource `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"` +} + +// WorkloadItemResourceListIterator provides access to a complete listing of WorkloadItemResource values. +type WorkloadItemResourceListIterator struct { + i int + page WorkloadItemResourceListPage +} + +// NextWithContext 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 *WorkloadItemResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadItemResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *WorkloadItemResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WorkloadItemResourceListIterator) 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 WorkloadItemResourceListIterator) Response() WorkloadItemResourceList { + 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 WorkloadItemResourceListIterator) Value() WorkloadItemResource { + if !iter.page.NotDone() { + return WorkloadItemResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the WorkloadItemResourceListIterator type. +func NewWorkloadItemResourceListIterator(page WorkloadItemResourceListPage) WorkloadItemResourceListIterator { + return WorkloadItemResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (wirl WorkloadItemResourceList) IsEmpty() bool { + return wirl.Value == nil || len(*wirl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (wirl WorkloadItemResourceList) hasNextLink() bool { + return wirl.NextLink != nil && len(*wirl.NextLink) != 0 +} + +// workloadItemResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wirl WorkloadItemResourceList) workloadItemResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !wirl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(wirl.NextLink))) +} + +// WorkloadItemResourceListPage contains a page of WorkloadItemResource values. +type WorkloadItemResourceListPage struct { + fn func(context.Context, WorkloadItemResourceList) (WorkloadItemResourceList, error) + wirl WorkloadItemResourceList +} + +// NextWithContext 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 *WorkloadItemResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadItemResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.wirl) + if err != nil { + return err + } + page.wirl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *WorkloadItemResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WorkloadItemResourceListPage) NotDone() bool { + return !page.wirl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WorkloadItemResourceListPage) Response() WorkloadItemResourceList { + return page.wirl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WorkloadItemResourceListPage) Values() []WorkloadItemResource { + if page.wirl.IsEmpty() { + return nil + } + return *page.wirl.Value +} + +// Creates a new instance of the WorkloadItemResourceListPage type. +func NewWorkloadItemResourceListPage(cur WorkloadItemResourceList, getNextPage func(context.Context, WorkloadItemResourceList) (WorkloadItemResourceList, error)) WorkloadItemResourceListPage { + return WorkloadItemResourceListPage{ + fn: getNextPage, + wirl: cur, + } +} + +// BasicWorkloadProtectableItem base class for backup item. Workload-specific backup items are derived from this class. +type BasicWorkloadProtectableItem interface { + AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) + AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) + AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) + AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) + AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) + AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) + AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) + AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) + AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) + AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) + AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) + AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) + AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) + AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +} + +// WorkloadProtectableItem base class for backup item. Workload-specific backup items are derived from this +// class. +type WorkloadProtectableItem struct { + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +func unmarshalBasicWorkloadProtectableItem(body []byte) (BasicWorkloadProtectableItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectableItemType"] { + case string(ProtectableItemTypeAzureFileShare): + var afspi AzureFileShareProtectableItem + err := json.Unmarshal(body, &afspi) + return afspi, err + case string(ProtectableItemTypeMicrosoftClassicComputevirtualMachines): + var aisccvpi AzureIaaSClassicComputeVMProtectableItem + err := json.Unmarshal(body, &aisccvpi) + return aisccvpi, err + case string(ProtectableItemTypeMicrosoftComputevirtualMachines): + var aiscvpi AzureIaaSComputeVMProtectableItem + err := json.Unmarshal(body, &aiscvpi) + return aiscvpi, err + case string(ProtectableItemTypeAzureVMWorkloadProtectableItem): + var avwpi AzureVMWorkloadProtectableItem + err := json.Unmarshal(body, &avwpi) + return avwpi, err + case string(ProtectableItemTypeSAPAseSystem): + var avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem + err := json.Unmarshal(body, &avwsaspi) + return avwsaspi, err + case string(ProtectableItemTypeSAPHanaDatabase): + var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem + err := json.Unmarshal(body, &avwshdpi) + return avwshdpi, err + case string(ProtectableItemTypeSAPHanaSystem): + var avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem + err := json.Unmarshal(body, &avwshspi) + return avwshspi, err + case string(ProtectableItemTypeSQLAvailabilityGroupContainer): + var avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem + err := json.Unmarshal(body, &avwsagpi) + return avwsagpi, err + case string(ProtectableItemTypeSQLDataBase): + var avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem + err := json.Unmarshal(body, &avwsdpi) + return avwsdpi, err + case string(ProtectableItemTypeSQLInstance): + var avwsipi AzureVMWorkloadSQLInstanceProtectableItem + err := json.Unmarshal(body, &avwsipi) + return avwsipi, err + case string(ProtectableItemTypeIaaSVMProtectableItem): + var ispi IaaSVMProtectableItem + err := json.Unmarshal(body, &ispi) + return ispi, err + default: + var wpi WorkloadProtectableItem + err := json.Unmarshal(body, &wpi) + return wpi, err + } +} +func unmarshalBasicWorkloadProtectableItemArray(body []byte) ([]BasicWorkloadProtectableItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + wpiArray := make([]BasicWorkloadProtectableItem, len(rawMessages)) + + for index, rawMessage := range rawMessages { + wpi, err := unmarshalBasicWorkloadProtectableItem(*rawMessage) + if err != nil { + return nil, err + } + wpiArray[index] = wpi + } + return wpiArray, nil +} + +// MarshalJSON is the custom marshaler for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) MarshalJSON() ([]byte, error) { + wpi.ProtectableItemType = ProtectableItemTypeWorkloadProtectableItem + objectMap := make(map[string]interface{}) + if wpi.BackupManagementType != nil { + objectMap["backupManagementType"] = wpi.BackupManagementType + } + if wpi.WorkloadType != nil { + objectMap["workloadType"] = wpi.WorkloadType + } + if wpi.FriendlyName != nil { + objectMap["friendlyName"] = wpi.FriendlyName + } + if wpi.ProtectionState != "" { + objectMap["protectionState"] = wpi.ProtectionState + } + if wpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = wpi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return &wpi, true +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &wpi, true +} + +// WorkloadProtectableItemResource base class for backup item. Workload-specific backup items are derived +// from this class. +type WorkloadProtectableItemResource struct { + // Properties - WorkloadProtectableItemResource properties + Properties BasicWorkloadProtectableItem `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for WorkloadProtectableItemResource. +func (wpir WorkloadProtectableItemResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = wpir.Properties + if wpir.Location != nil { + objectMap["location"] = wpir.Location + } + if wpir.Tags != nil { + objectMap["tags"] = wpir.Tags + } + if wpir.ETag != nil { + objectMap["eTag"] = wpir.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WorkloadProtectableItemResource struct. +func (wpir *WorkloadProtectableItemResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicWorkloadProtectableItem(*v) + if err != nil { + return err + } + wpir.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + wpir.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wpir.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + wpir.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + wpir.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + wpir.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + wpir.ETag = &eTag + } + } + } + + return nil +} + +// WorkloadProtectableItemResourceList list of WorkloadProtectableItem resources +type WorkloadProtectableItemResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]WorkloadProtectableItemResource `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"` +} + +// WorkloadProtectableItemResourceListIterator provides access to a complete listing of +// WorkloadProtectableItemResource values. +type WorkloadProtectableItemResourceListIterator struct { + i int + page WorkloadProtectableItemResourceListPage +} + +// NextWithContext 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 *WorkloadProtectableItemResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadProtectableItemResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *WorkloadProtectableItemResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WorkloadProtectableItemResourceListIterator) 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 WorkloadProtectableItemResourceListIterator) Response() WorkloadProtectableItemResourceList { + 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 WorkloadProtectableItemResourceListIterator) Value() WorkloadProtectableItemResource { + if !iter.page.NotDone() { + return WorkloadProtectableItemResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the WorkloadProtectableItemResourceListIterator type. +func NewWorkloadProtectableItemResourceListIterator(page WorkloadProtectableItemResourceListPage) WorkloadProtectableItemResourceListIterator { + return WorkloadProtectableItemResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (wpirl WorkloadProtectableItemResourceList) IsEmpty() bool { + return wpirl.Value == nil || len(*wpirl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (wpirl WorkloadProtectableItemResourceList) hasNextLink() bool { + return wpirl.NextLink != nil && len(*wpirl.NextLink) != 0 +} + +// workloadProtectableItemResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wpirl WorkloadProtectableItemResourceList) workloadProtectableItemResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !wpirl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(wpirl.NextLink))) +} + +// WorkloadProtectableItemResourceListPage contains a page of WorkloadProtectableItemResource values. +type WorkloadProtectableItemResourceListPage struct { + fn func(context.Context, WorkloadProtectableItemResourceList) (WorkloadProtectableItemResourceList, error) + wpirl WorkloadProtectableItemResourceList +} + +// NextWithContext 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 *WorkloadProtectableItemResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadProtectableItemResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.wpirl) + if err != nil { + return err + } + page.wpirl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *WorkloadProtectableItemResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WorkloadProtectableItemResourceListPage) NotDone() bool { + return !page.wpirl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WorkloadProtectableItemResourceListPage) Response() WorkloadProtectableItemResourceList { + return page.wpirl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WorkloadProtectableItemResourceListPage) Values() []WorkloadProtectableItemResource { + if page.wpirl.IsEmpty() { + return nil + } + return *page.wpirl.Value +} + +// Creates a new instance of the WorkloadProtectableItemResourceListPage type. +func NewWorkloadProtectableItemResourceListPage(cur WorkloadProtectableItemResourceList, getNextPage func(context.Context, WorkloadProtectableItemResourceList) (WorkloadProtectableItemResourceList, error)) WorkloadProtectableItemResourceListPage { + return WorkloadProtectableItemResourceListPage{ + fn: getNextPage, + wpirl: cur, + } +} + +// YearlyRetentionSchedule yearly retention schedule. +type YearlyRetentionSchedule struct { + // RetentionScheduleFormatType - Retention schedule format for yearly retention policy. Possible values include: 'RetentionScheduleFormatInvalid', 'RetentionScheduleFormatDaily', 'RetentionScheduleFormatWeekly' + RetentionScheduleFormatType RetentionScheduleFormat `json:"retentionScheduleFormatType,omitempty"` + // MonthsOfYear - List of months of year of yearly retention policy. + MonthsOfYear *[]MonthOfYear `json:"monthsOfYear,omitempty"` + // RetentionScheduleDaily - Daily retention format for yearly retention policy. + RetentionScheduleDaily *DailyRetentionFormat `json:"retentionScheduleDaily,omitempty"` + // RetentionScheduleWeekly - Weekly retention format for yearly retention policy. + RetentionScheduleWeekly *WeeklyRetentionFormat `json:"retentionScheduleWeekly,omitempty"` + // RetentionTimes - Retention times of retention policy. + RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` + // RetentionDuration - Retention duration of retention Policy. + RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` +} diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/operation.go b/services/recoveryservices/mgmt/2020-12-01/backup/operation.go similarity index 99% rename from services/recoveryservices/mgmt/2020-02-02/backup/operation.go rename to services/recoveryservices/mgmt/2020-12-01/backup/operation.go index 4c61f457c948..ec7e9f37e21a 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/operation.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/operation.go @@ -76,7 +76,7 @@ func (client OperationClient) ValidatePreparer(ctx context.Context, vaultName st "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2019-06-15" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/operationresults.go b/services/recoveryservices/mgmt/2020-12-01/backup/operationresults.go similarity index 99% rename from services/recoveryservices/mgmt/2019-06-15/backup/operationresults.go rename to services/recoveryservices/mgmt/2020-12-01/backup/operationresults.go index d183574f15b9..24d3b941c891 100644 --- a/services/recoveryservices/mgmt/2019-06-15/backup/operationresults.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/operationresults.go @@ -82,7 +82,7 @@ func (client OperationResultsClient) GetPreparer(ctx context.Context, vaultName "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/operationstatuses.go b/services/recoveryservices/mgmt/2020-12-01/backup/operationstatuses.go similarity index 99% rename from services/recoveryservices/mgmt/2019-06-15/backup/operationstatuses.go rename to services/recoveryservices/mgmt/2020-12-01/backup/operationstatuses.go index 44d75d9efebd..9b5821536ea0 100644 --- a/services/recoveryservices/mgmt/2019-06-15/backup/operationstatuses.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/operationstatuses.go @@ -81,7 +81,7 @@ func (client OperationStatusesClient) GetPreparer(ctx context.Context, vaultName "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/policies.go b/services/recoveryservices/mgmt/2020-12-01/backup/policies.go similarity index 99% rename from services/recoveryservices/mgmt/2020-02-02/backup/policies.go rename to services/recoveryservices/mgmt/2020-12-01/backup/policies.go index 0c6b11841020..064105d80cec 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/policies.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/policies.go @@ -82,7 +82,7 @@ func (client PoliciesClient) ListPreparer(ctx context.Context, vaultName string, "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2019-06-15" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2020-12-01/backup/privateendpoint.go b/services/recoveryservices/mgmt/2020-12-01/backup/privateendpoint.go new file mode 100644 index 000000000000..63c655c7a967 --- /dev/null +++ b/services/recoveryservices/mgmt/2020-12-01/backup/privateendpoint.go @@ -0,0 +1,111 @@ +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PrivateEndpointClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type PrivateEndpointClient struct { + BaseClient +} + +// NewPrivateEndpointClient creates an instance of the PrivateEndpointClient client. +func NewPrivateEndpointClient(subscriptionID string) PrivateEndpointClient { + return NewPrivateEndpointClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateEndpointClientWithBaseURI creates an instance of the PrivateEndpointClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewPrivateEndpointClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointClient { + return PrivateEndpointClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetOperationStatus sends the get operation status request. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// privateEndpointConnectionName - the name of the private endpoint connection. +// operationID - operation id +func (client PrivateEndpointClient) GetOperationStatus(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string, operationID string) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointClient.GetOperationStatus") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetOperationStatusPreparer(ctx, vaultName, resourceGroupName, privateEndpointConnectionName, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.PrivateEndpointClient", "GetOperationStatus", nil, "Failure preparing request") + return + } + + resp, err := client.GetOperationStatusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.PrivateEndpointClient", "GetOperationStatus", resp, "Failure sending request") + return + } + + result, err = client.GetOperationStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.PrivateEndpointClient", "GetOperationStatus", resp, "Failure responding to request") + return + } + + return +} + +// GetOperationStatusPreparer prepares the GetOperationStatus request. +func (client PrivateEndpointClient) GetOperationStatusPreparer(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "operationId": autorest.Encode("path", operationID), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2020-12-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}/privateEndpointConnections/{privateEndpointConnectionName}/operationsStatus/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetOperationStatusSender sends the GetOperationStatus request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointClient) GetOperationStatusSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetOperationStatusResponder handles the response to the GetOperationStatus request. The method always +// closes the http.Response Body. +func (client PrivateEndpointClient) GetOperationStatusResponder(resp *http.Response) (result OperationStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2020-12-01/backup/privateendpointconnection.go b/services/recoveryservices/mgmt/2020-12-01/backup/privateendpointconnection.go new file mode 100644 index 000000000000..6234289bfa27 --- /dev/null +++ b/services/recoveryservices/mgmt/2020-12-01/backup/privateendpointconnection.go @@ -0,0 +1,274 @@ +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PrivateEndpointConnectionClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type PrivateEndpointConnectionClient struct { + BaseClient +} + +// NewPrivateEndpointConnectionClient creates an instance of the PrivateEndpointConnectionClient client. +func NewPrivateEndpointConnectionClient(subscriptionID string) PrivateEndpointConnectionClient { + return NewPrivateEndpointConnectionClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateEndpointConnectionClientWithBaseURI creates an instance of the PrivateEndpointConnectionClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewPrivateEndpointConnectionClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionClient { + return PrivateEndpointConnectionClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Delete delete Private Endpoint requests. This call is made by Backup Admin. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// privateEndpointConnectionName - the name of the private endpoint connection. +func (client PrivateEndpointConnectionClient) Delete(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string) (result PrivateEndpointConnectionDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, vaultName, resourceGroupName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.PrivateEndpointConnectionClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.PrivateEndpointConnectionClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PrivateEndpointConnectionClient) DeletePreparer(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2020-12-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}/privateEndpointConnections/{privateEndpointConnectionName}", 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 PrivateEndpointConnectionClient) DeleteSender(req *http.Request) (future PrivateEndpointConnectionDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get Private Endpoint Connection. This call is made by Backup Admin. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// privateEndpointConnectionName - the name of the private endpoint connection. +func (client PrivateEndpointConnectionClient) Get(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string) (result PrivateEndpointConnectionResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.PrivateEndpointConnectionClient", "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.PrivateEndpointConnectionClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.PrivateEndpointConnectionClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateEndpointConnectionClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2020-12-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}/privateEndpointConnections/{privateEndpointConnectionName}", 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 PrivateEndpointConnectionClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionClient) GetResponder(resp *http.Response) (result PrivateEndpointConnectionResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Put approve or Reject Private Endpoint requests. This call is made by Backup Admin. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// privateEndpointConnectionName - the name of the private endpoint connection. +// parameters - request body for operation +func (client PrivateEndpointConnectionClient) Put(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string, parameters PrivateEndpointConnectionResource) (result PrivateEndpointConnectionPutFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionClient.Put") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PutPreparer(ctx, vaultName, resourceGroupName, privateEndpointConnectionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.PrivateEndpointConnectionClient", "Put", nil, "Failure preparing request") + return + } + + result, err = client.PutSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.PrivateEndpointConnectionClient", "Put", result.Response(), "Failure sending request") + return + } + + return +} + +// PutPreparer prepares the Put request. +func (client PrivateEndpointConnectionClient) PutPreparer(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string, parameters PrivateEndpointConnectionResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2020-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PutSender sends the Put request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionClient) PutSender(req *http.Request) (future PrivateEndpointConnectionPutFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PutResponder handles the response to the Put request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionClient) PutResponder(resp *http.Response) (result PrivateEndpointConnectionResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/protectablecontainers.go b/services/recoveryservices/mgmt/2020-12-01/backup/protectablecontainers.go similarity index 99% rename from services/recoveryservices/mgmt/2019-05-13/backup/protectablecontainers.go rename to services/recoveryservices/mgmt/2020-12-01/backup/protectablecontainers.go index 65f847abf488..ba392ed2252d 100644 --- a/services/recoveryservices/mgmt/2019-05-13/backup/protectablecontainers.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/protectablecontainers.go @@ -83,7 +83,7 @@ func (client ProtectableContainersClient) ListPreparer(ctx context.Context, vaul "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/protectableitems.go b/services/recoveryservices/mgmt/2020-12-01/backup/protectableitems.go similarity index 99% rename from services/recoveryservices/mgmt/2019-05-13/backup/protectableitems.go rename to services/recoveryservices/mgmt/2020-12-01/backup/protectableitems.go index 167e39969e21..d98e59d560ef 100644 --- a/services/recoveryservices/mgmt/2019-05-13/backup/protectableitems.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/protectableitems.go @@ -84,7 +84,7 @@ func (client ProtectableItemsClient) ListPreparer(ctx context.Context, vaultName "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/protecteditemoperationresults.go b/services/recoveryservices/mgmt/2020-12-01/backup/protecteditemoperationresults.go similarity index 99% rename from services/recoveryservices/mgmt/2020-02-02/backup/protecteditemoperationresults.go rename to services/recoveryservices/mgmt/2020-12-01/backup/protecteditemoperationresults.go index 46f3dc85d361..2787d34eb185 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/protecteditemoperationresults.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/protecteditemoperationresults.go @@ -84,7 +84,7 @@ func (client ProtectedItemOperationResultsClient) GetPreparer(ctx context.Contex "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2019-06-15" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/protecteditemoperationstatuses.go b/services/recoveryservices/mgmt/2020-12-01/backup/protecteditemoperationstatuses.go similarity index 99% rename from services/recoveryservices/mgmt/2019-06-15/backup/protecteditemoperationstatuses.go rename to services/recoveryservices/mgmt/2020-12-01/backup/protecteditemoperationstatuses.go index c75e6bfe8f46..d1f34f307817 100644 --- a/services/recoveryservices/mgmt/2019-06-15/backup/protecteditemoperationstatuses.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/protecteditemoperationstatuses.go @@ -87,7 +87,7 @@ func (client ProtectedItemOperationStatusesClient) GetPreparer(ctx context.Conte "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/protecteditems.go b/services/recoveryservices/mgmt/2020-12-01/backup/protecteditems.go similarity index 99% rename from services/recoveryservices/mgmt/2020-02-02/backup/protecteditems.go rename to services/recoveryservices/mgmt/2020-12-01/backup/protecteditems.go index 3be348c4abc7..4aefa0cc605e 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/protecteditems.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/protecteditems.go @@ -84,7 +84,7 @@ func (client ProtectedItemsClient) CreateOrUpdatePreparer(ctx context.Context, v "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2019-06-15" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -170,7 +170,7 @@ func (client ProtectedItemsClient) DeletePreparer(ctx context.Context, vaultName "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2019-06-15" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -254,7 +254,7 @@ func (client ProtectedItemsClient) GetPreparer(ctx context.Context, vaultName st "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2019-06-15" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/protecteditemsgroup.go b/services/recoveryservices/mgmt/2020-12-01/backup/protecteditemsgroup.go similarity index 99% rename from services/recoveryservices/mgmt/2020-02-02/backup/protecteditemsgroup.go rename to services/recoveryservices/mgmt/2020-12-01/backup/protecteditemsgroup.go index c3e675d17d9f..2a3aa8c35b2a 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/protecteditemsgroup.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/protecteditemsgroup.go @@ -83,7 +83,7 @@ func (client ProtectedItemsGroupClient) ListPreparer(ctx context.Context, vaultN "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2019-06-15" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/protectioncontaineroperationresults.go b/services/recoveryservices/mgmt/2020-12-01/backup/protectioncontaineroperationresults.go similarity index 99% rename from services/recoveryservices/mgmt/2019-05-13/backup/protectioncontaineroperationresults.go rename to services/recoveryservices/mgmt/2020-12-01/backup/protectioncontaineroperationresults.go index 3972ce476457..9663f2797819 100644 --- a/services/recoveryservices/mgmt/2019-05-13/backup/protectioncontaineroperationresults.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/protectioncontaineroperationresults.go @@ -83,7 +83,7 @@ func (client ProtectionContainerOperationResultsClient) GetPreparer(ctx context. "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/protectioncontainerrefreshoperationresults.go b/services/recoveryservices/mgmt/2020-12-01/backup/protectioncontainerrefreshoperationresults.go similarity index 99% rename from services/recoveryservices/mgmt/2020-02-02/backup/protectioncontainerrefreshoperationresults.go rename to services/recoveryservices/mgmt/2020-12-01/backup/protectioncontainerrefreshoperationresults.go index 5b491864b588..3c57772aa317 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/protectioncontainerrefreshoperationresults.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/protectioncontainerrefreshoperationresults.go @@ -81,7 +81,7 @@ func (client ProtectionContainerRefreshOperationResultsClient) GetPreparer(ctx c "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/protectioncontainers.go b/services/recoveryservices/mgmt/2020-12-01/backup/protectioncontainers.go similarity index 99% rename from services/recoveryservices/mgmt/2019-05-13/backup/protectioncontainers.go rename to services/recoveryservices/mgmt/2020-12-01/backup/protectioncontainers.go index d12c30289ff6..808b50f651c6 100644 --- a/services/recoveryservices/mgmt/2019-05-13/backup/protectioncontainers.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/protectioncontainers.go @@ -80,7 +80,7 @@ func (client ProtectionContainersClient) GetPreparer(ctx context.Context, vaultN "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -161,7 +161,7 @@ func (client ProtectionContainersClient) InquirePreparer(ctx context.Context, va "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -244,7 +244,7 @@ func (client ProtectionContainersClient) RefreshPreparer(ctx context.Context, va "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -329,7 +329,7 @@ func (client ProtectionContainersClient) RegisterPreparer(ctx context.Context, v "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -413,7 +413,7 @@ func (client ProtectionContainersClient) UnregisterPreparer(ctx context.Context, "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/protectioncontainersgroup.go b/services/recoveryservices/mgmt/2020-12-01/backup/protectioncontainersgroup.go similarity index 99% rename from services/recoveryservices/mgmt/2019-06-15/backup/protectioncontainersgroup.go rename to services/recoveryservices/mgmt/2020-12-01/backup/protectioncontainersgroup.go index 408df75c78bd..18548886696a 100644 --- a/services/recoveryservices/mgmt/2019-06-15/backup/protectioncontainersgroup.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/protectioncontainersgroup.go @@ -82,7 +82,7 @@ func (client ProtectionContainersGroupClient) ListPreparer(ctx context.Context, "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/protectionpolicies.go b/services/recoveryservices/mgmt/2020-12-01/backup/protectionpolicies.go similarity index 93% rename from services/recoveryservices/mgmt/2020-02-02/backup/protectionpolicies.go rename to services/recoveryservices/mgmt/2020-12-01/backup/protectionpolicies.go index df90a3956237..f67698644491 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/protectionpolicies.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/protectionpolicies.go @@ -81,7 +81,7 @@ func (client ProtectionPoliciesClient) CreateOrUpdatePreparer(ctx context.Contex "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2019-06-15" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -116,18 +116,18 @@ func (client ProtectionPoliciesClient) CreateOrUpdateResponder(resp *http.Respon // Delete deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status // of the -// operation can be fetched using GetPolicyOperationResult API. +// operation can be fetched using GetProtectionPolicyOperationResult API. // Parameters: // vaultName - the name of the recovery services vault. // resourceGroupName - the name of the resource group where the recovery services vault is present. // policyName - backup policy to be deleted. -func (client ProtectionPoliciesClient) Delete(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (result autorest.Response, err error) { +func (client ProtectionPoliciesClient) Delete(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (result ProtectionPoliciesDeleteFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionPoliciesClient.Delete") defer func() { sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -138,16 +138,9 @@ func (client ProtectionPoliciesClient) Delete(ctx context.Context, vaultName str return } - resp, err := client.DeleteSender(req) + result, err = client.DeleteSender(req) if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "Delete", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "Delete", result.Response(), "Failure sending request") return } @@ -163,7 +156,7 @@ func (client ProtectionPoliciesClient) DeletePreparer(ctx context.Context, vault "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -178,8 +171,18 @@ func (client ProtectionPoliciesClient) DeletePreparer(ctx context.Context, vault // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client ProtectionPoliciesClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client ProtectionPoliciesClient) DeleteSender(req *http.Request) (future ProtectionPoliciesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return } // DeleteResponder handles the response to the Delete request. The method always @@ -241,7 +244,7 @@ func (client ProtectionPoliciesClient) GetPreparer(ctx context.Context, vaultNam "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2019-06-15" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/protectionpolicyoperationresults.go b/services/recoveryservices/mgmt/2020-12-01/backup/protectionpolicyoperationresults.go similarity index 99% rename from services/recoveryservices/mgmt/2020-02-02/backup/protectionpolicyoperationresults.go rename to services/recoveryservices/mgmt/2020-12-01/backup/protectionpolicyoperationresults.go index 58807b9bb92e..115abb27c124 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/protectionpolicyoperationresults.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/protectionpolicyoperationresults.go @@ -80,7 +80,7 @@ func (client ProtectionPolicyOperationResultsClient) GetPreparer(ctx context.Con "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2019-06-15" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/protectionpolicyoperationstatuses.go b/services/recoveryservices/mgmt/2020-12-01/backup/protectionpolicyoperationstatuses.go similarity index 99% rename from services/recoveryservices/mgmt/2019-06-15/backup/protectionpolicyoperationstatuses.go rename to services/recoveryservices/mgmt/2020-12-01/backup/protectionpolicyoperationstatuses.go index 7f45850a8d3a..33328f4d223f 100644 --- a/services/recoveryservices/mgmt/2019-06-15/backup/protectionpolicyoperationstatuses.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/protectionpolicyoperationstatuses.go @@ -84,7 +84,7 @@ func (client ProtectionPolicyOperationStatusesClient) GetPreparer(ctx context.Co "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/recoverypoints.go b/services/recoveryservices/mgmt/2020-12-01/backup/recoverypoints.go similarity index 99% rename from services/recoveryservices/mgmt/2020-02-02/backup/recoverypoints.go rename to services/recoveryservices/mgmt/2020-12-01/backup/recoverypoints.go index 2baea6a6f0ff..7c6166c2a783 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/recoverypoints.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/recoverypoints.go @@ -85,7 +85,7 @@ func (client RecoveryPointsClient) GetPreparer(ctx context.Context, vaultName st "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2019-06-15" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -173,7 +173,7 @@ func (client RecoveryPointsClient) ListPreparer(ctx context.Context, vaultName s "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2019-06-15" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2020-12-01/backup/resourceencryptionconfigs.go b/services/recoveryservices/mgmt/2020-12-01/backup/resourceencryptionconfigs.go new file mode 100644 index 000000000000..40996253597a --- /dev/null +++ b/services/recoveryservices/mgmt/2020-12-01/backup/resourceencryptionconfigs.go @@ -0,0 +1,186 @@ +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ResourceEncryptionConfigsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ResourceEncryptionConfigsClient struct { + BaseClient +} + +// NewResourceEncryptionConfigsClient creates an instance of the ResourceEncryptionConfigsClient client. +func NewResourceEncryptionConfigsClient(subscriptionID string) ResourceEncryptionConfigsClient { + return NewResourceEncryptionConfigsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewResourceEncryptionConfigsClientWithBaseURI creates an instance of the ResourceEncryptionConfigsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewResourceEncryptionConfigsClientWithBaseURI(baseURI string, subscriptionID string) ResourceEncryptionConfigsClient { + return ResourceEncryptionConfigsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get fetches Vault Encryption config. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +func (client ResourceEncryptionConfigsClient) Get(ctx context.Context, vaultName string, resourceGroupName string) (result ResourceEncryptionConfigResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceEncryptionConfigsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ResourceEncryptionConfigsClient", "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.ResourceEncryptionConfigsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ResourceEncryptionConfigsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ResourceEncryptionConfigsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName 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 = "2020-12-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}/backupEncryptionConfigs/backupResourceEncryptionConfig", 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 ResourceEncryptionConfigsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ResourceEncryptionConfigsClient) GetResponder(resp *http.Response) (result ResourceEncryptionConfigResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates Vault encryption config. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// parameters - vault encryption input config request +func (client ResourceEncryptionConfigsClient) Update(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceEncryptionConfigResource) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceEncryptionConfigsClient.Update") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, vaultName, resourceGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ResourceEncryptionConfigsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "backup.ResourceEncryptionConfigsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ResourceEncryptionConfigsClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ResourceEncryptionConfigsClient) UpdatePreparer(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceEncryptionConfigResource) (*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 = "2020-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEncryptionConfigs/backupResourceEncryptionConfig", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ResourceEncryptionConfigsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ResourceEncryptionConfigsClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/resourcevaultconfigs.go b/services/recoveryservices/mgmt/2020-12-01/backup/resourcevaultconfigs.go similarity index 97% rename from services/recoveryservices/mgmt/2020-02-02/backup/resourcevaultconfigs.go rename to services/recoveryservices/mgmt/2020-12-01/backup/resourcevaultconfigs.go index d678d2bb072e..1e7bec32861f 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/resourcevaultconfigs.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/resourcevaultconfigs.go @@ -76,7 +76,7 @@ func (client ResourceVaultConfigsClient) GetPreparer(ctx context.Context, vaultN "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2019-06-15" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -84,7 +84,7 @@ func (client ResourceVaultConfigsClient) GetPreparer(ctx context.Context, vaultN preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -153,7 +153,7 @@ func (client ResourceVaultConfigsClient) PutPreparer(ctx context.Context, vaultN "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2019-06-15" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -162,7 +162,7 @@ func (client ResourceVaultConfigsClient) PutPreparer(ctx context.Context, vaultN autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -232,7 +232,7 @@ func (client ResourceVaultConfigsClient) UpdatePreparer(ctx context.Context, vau "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2019-06-15" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -241,7 +241,7 @@ func (client ResourceVaultConfigsClient) UpdatePreparer(ctx context.Context, vau autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/restores.go b/services/recoveryservices/mgmt/2020-12-01/backup/restores.go similarity index 99% rename from services/recoveryservices/mgmt/2020-02-02/backup/restores.go rename to services/recoveryservices/mgmt/2020-12-01/backup/restores.go index 37591b0549a5..ce1a190ec717 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/restores.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/restores.go @@ -86,7 +86,7 @@ func (client RestoresClient) TriggerPreparer(ctx context.Context, vaultName stri "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2019-06-15" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/securitypins.go b/services/recoveryservices/mgmt/2020-12-01/backup/securitypins.go similarity index 99% rename from services/recoveryservices/mgmt/2019-05-13/backup/securitypins.go rename to services/recoveryservices/mgmt/2020-12-01/backup/securitypins.go index 824a5f3c8eb4..211855335a10 100644 --- a/services/recoveryservices/mgmt/2019-05-13/backup/securitypins.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/securitypins.go @@ -75,7 +75,7 @@ func (client SecurityPINsClient) GetPreparer(ctx context.Context, vaultName stri "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2020-12-01/backup/version.go b/services/recoveryservices/mgmt/2020-12-01/backup/version.go new file mode 100644 index 000000000000..da4c0c6b42c0 --- /dev/null +++ b/services/recoveryservices/mgmt/2020-12-01/backup/version.go @@ -0,0 +1,19 @@ +package backup + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " backup/2020-12-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/workloaditems.go b/services/recoveryservices/mgmt/2020-12-01/backup/workloaditems.go similarity index 99% rename from services/recoveryservices/mgmt/2020-02-02/backup/workloaditems.go rename to services/recoveryservices/mgmt/2020-12-01/backup/workloaditems.go index 8f400e70af4e..7f02d9ca4ad2 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/workloaditems.go +++ b/services/recoveryservices/mgmt/2020-12-01/backup/workloaditems.go @@ -88,7 +88,7 @@ func (client WorkloadItemsClient) ListPreparer(ctx context.Context, vaultName st "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2021-01-01/backup/CHANGELOG.md b/services/recoveryservices/mgmt/2021-01-01/backup/CHANGELOG.md index 52911e4cc5e4..f452c2363423 100644 --- a/services/recoveryservices/mgmt/2021-01-01/backup/CHANGELOG.md +++ b/services/recoveryservices/mgmt/2021-01-01/backup/CHANGELOG.md @@ -1,2 +1,393 @@ -# Change History +# Unreleased +## Breaking Changes + +### Removed Constants + +1. FabricName.FabricNameAzure +1. FabricName.FabricNameInvalid +1. FeatureType.FeatureTypeAzureBackupGoals +1. FeatureType.FeatureTypeAzureVMResourceBackup +1. FeatureType.FeatureTypeFeatureSupportRequest +1. IntentItemType.IntentItemTypeInvalid +1. IntentItemType.IntentItemTypeSQLAvailabilityGroupContainer +1. IntentItemType.IntentItemTypeSQLInstance +1. ObjectTypeBasicCrrAccessToken.ObjectTypeBasicCrrAccessTokenObjectTypeCrrAccessToken +1. ObjectTypeBasicCrrAccessToken.ObjectTypeBasicCrrAccessTokenObjectTypeWorkloadCrrAccessToken +1. ObjectTypeBasicOperationStatusExtendedInfo.ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusRecoveryPointExtendedInfo +1. ProtectionIntentItemType.ProtectionIntentItemTypeAzureResourceItem +1. ProtectionIntentItemType.ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent +1. ProtectionIntentItemType.ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent +1. ProtectionIntentItemType.ProtectionIntentItemTypeProtectionIntent +1. ProtectionIntentItemType.ProtectionIntentItemTypeRecoveryServiceVaultItem +1. SupportStatus.SupportStatusDefaultOFF +1. SupportStatus.SupportStatusDefaultON +1. SupportStatus.SupportStatusInvalid +1. SupportStatus.SupportStatusNotSupported +1. SupportStatus.SupportStatusSupported +1. Type.TypeBackupProtectedItemCountSummary +1. Type.TypeBackupProtectionContainerCountSummary +1. TypeEnum.TypeEnumCopyOnlyFull +1. TypeEnum.TypeEnumDifferential +1. TypeEnum.TypeEnumFull +1. TypeEnum.TypeEnumIncremental +1. TypeEnum.TypeEnumInvalid +1. TypeEnum.TypeEnumLog +1. UsagesUnit.UsagesUnitBytes +1. UsagesUnit.UsagesUnitBytesPerSecond +1. UsagesUnit.UsagesUnitCount +1. UsagesUnit.UsagesUnitCountPerSecond +1. UsagesUnit.UsagesUnitPercent +1. UsagesUnit.UsagesUnitSeconds +1. ValidationStatus.ValidationStatusFailed +1. ValidationStatus.ValidationStatusInvalid +1. ValidationStatus.ValidationStatusSucceeded + +### Removed Funcs + +1. *ClientDiscoveryResponseIterator.Next() error +1. *ClientDiscoveryResponseIterator.NextWithContext(context.Context) error +1. *ClientDiscoveryResponsePage.Next() error +1. *ClientDiscoveryResponsePage.NextWithContext(context.Context) error +1. *CrossRegionRestoreRequest.UnmarshalJSON([]byte) error +1. *CrossRegionRestoreTriggerFuture.UnmarshalJSON([]byte) error +1. *CrrAccessTokenResource.UnmarshalJSON([]byte) error +1. *OperationStatusRecoveryPointExtendedInfo.UnmarshalJSON([]byte) error +1. *ProtectionIntentResource.UnmarshalJSON([]byte) error +1. *ProtectionIntentResourceListIterator.Next() error +1. *ProtectionIntentResourceListIterator.NextWithContext(context.Context) error +1. *ProtectionIntentResourceListPage.Next() error +1. *ProtectionIntentResourceListPage.NextWithContext(context.Context) error +1. AADPropertiesResource.MarshalJSON() ([]byte, error) +1. AadPropertiesClient.Get(context.Context, string, string) (AADPropertiesResource, error) +1. AadPropertiesClient.GetPreparer(context.Context, string, string) (*http.Request, error) +1. AadPropertiesClient.GetResponder(*http.Response) (AADPropertiesResource, error) +1. AadPropertiesClient.GetSender(*http.Request) (*http.Response, error) +1. AzureBackupGoalFeatureSupportRequest.AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) +1. AzureBackupGoalFeatureSupportRequest.AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) +1. AzureBackupGoalFeatureSupportRequest.AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) +1. AzureBackupGoalFeatureSupportRequest.AsFeatureSupportRequest() (*FeatureSupportRequest, bool) +1. AzureBackupGoalFeatureSupportRequest.MarshalJSON() ([]byte, error) +1. AzureRecoveryServiceVaultProtectionIntent.AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsBasicProtectionIntent() (BasicProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.AsProtectionIntent() (*ProtectionIntent, bool) +1. AzureRecoveryServiceVaultProtectionIntent.MarshalJSON() ([]byte, error) +1. AzureResourceProtectionIntent.AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsBasicProtectionIntent() (BasicProtectionIntent, bool) +1. AzureResourceProtectionIntent.AsProtectionIntent() (*ProtectionIntent, bool) +1. AzureResourceProtectionIntent.MarshalJSON() ([]byte, error) +1. AzureVMResourceFeatureSupportRequest.AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) +1. AzureVMResourceFeatureSupportRequest.AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) +1. AzureVMResourceFeatureSupportRequest.AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) +1. AzureVMResourceFeatureSupportRequest.AsFeatureSupportRequest() (*FeatureSupportRequest, bool) +1. AzureVMResourceFeatureSupportRequest.MarshalJSON() ([]byte, error) +1. AzureWorkloadAutoProtectionIntent.AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsBasicProtectionIntent() (BasicProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.AsProtectionIntent() (*ProtectionIntent, bool) +1. AzureWorkloadAutoProtectionIntent.MarshalJSON() ([]byte, error) +1. AzureWorkloadSQLAutoProtectionIntent.AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsBasicProtectionIntent() (BasicProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.AsProtectionIntent() (*ProtectionIntent, bool) +1. AzureWorkloadSQLAutoProtectionIntent.MarshalJSON() ([]byte, error) +1. AzureWorkloadSQLRecoveryPointExtendedInfo.MarshalJSON() ([]byte, error) +1. ClientDiscoveryResponse.IsEmpty() bool +1. ClientDiscoveryResponseIterator.NotDone() bool +1. ClientDiscoveryResponseIterator.Response() ClientDiscoveryResponse +1. ClientDiscoveryResponseIterator.Value() ClientDiscoveryValueForSingleAPI +1. ClientDiscoveryResponsePage.NotDone() bool +1. ClientDiscoveryResponsePage.Response() ClientDiscoveryResponse +1. ClientDiscoveryResponsePage.Values() []ClientDiscoveryValueForSingleAPI +1. CrossRegionRestoreClient.Trigger(context.Context, string, CrossRegionRestoreRequest) (CrossRegionRestoreTriggerFuture, error) +1. CrossRegionRestoreClient.TriggerPreparer(context.Context, string, CrossRegionRestoreRequest) (*http.Request, error) +1. CrossRegionRestoreClient.TriggerResponder(*http.Response) (autorest.Response, error) +1. CrossRegionRestoreClient.TriggerSender(*http.Request) (CrossRegionRestoreTriggerFuture, error) +1. CrossRegionRestoreRequestResource.MarshalJSON() ([]byte, error) +1. CrrAccessToken.AsBasicCrrAccessToken() (BasicCrrAccessToken, bool) +1. CrrAccessToken.AsCrrAccessToken() (*CrrAccessToken, bool) +1. CrrAccessToken.AsWorkloadCrrAccessToken() (*WorkloadCrrAccessToken, bool) +1. CrrAccessToken.MarshalJSON() ([]byte, error) +1. CrrAccessTokenResource.MarshalJSON() ([]byte, error) +1. CrrJobDetailsClient.Get(context.Context, string, CrrJobRequest) (JobResource, error) +1. CrrJobDetailsClient.GetPreparer(context.Context, string, CrrJobRequest) (*http.Request, error) +1. CrrJobDetailsClient.GetResponder(*http.Response) (JobResource, error) +1. CrrJobDetailsClient.GetSender(*http.Request) (*http.Response, error) +1. CrrJobRequestResource.MarshalJSON() ([]byte, error) +1. CrrJobsClient.List(context.Context, string, CrrJobRequest, string, string) (JobResourceListPage, error) +1. CrrJobsClient.ListComplete(context.Context, string, CrrJobRequest, string, string) (JobResourceListIterator, error) +1. CrrJobsClient.ListPreparer(context.Context, string, CrrJobRequest, string, string) (*http.Request, error) +1. CrrJobsClient.ListResponder(*http.Response) (JobResourceList, error) +1. CrrJobsClient.ListSender(*http.Request) (*http.Response, error) +1. CrrOperationResultsClient.Get(context.Context, string, string) (autorest.Response, error) +1. CrrOperationResultsClient.GetPreparer(context.Context, string, string) (*http.Request, error) +1. CrrOperationResultsClient.GetResponder(*http.Response) (autorest.Response, error) +1. CrrOperationResultsClient.GetSender(*http.Request) (*http.Response, error) +1. CrrOperationStatusClient.Get(context.Context, string, string) (OperationStatus, error) +1. CrrOperationStatusClient.GetPreparer(context.Context, string, string) (*http.Request, error) +1. CrrOperationStatusClient.GetResponder(*http.Response) (OperationStatus, error) +1. CrrOperationStatusClient.GetSender(*http.Request) (*http.Response, error) +1. FeatureSupportClient.Validate(context.Context, string, BasicFeatureSupportRequest) (AzureVMResourceFeatureSupportResponse, error) +1. FeatureSupportClient.ValidatePreparer(context.Context, string, BasicFeatureSupportRequest) (*http.Request, error) +1. FeatureSupportClient.ValidateResponder(*http.Response) (AzureVMResourceFeatureSupportResponse, error) +1. FeatureSupportClient.ValidateSender(*http.Request) (*http.Response, error) +1. FeatureSupportRequest.AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) +1. FeatureSupportRequest.AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) +1. FeatureSupportRequest.AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) +1. FeatureSupportRequest.AsFeatureSupportRequest() (*FeatureSupportRequest, bool) +1. FeatureSupportRequest.MarshalJSON() ([]byte, error) +1. NewAadPropertiesClient(string) AadPropertiesClient +1. NewAadPropertiesClientWithBaseURI(string, string) AadPropertiesClient +1. NewClientDiscoveryResponseIterator(ClientDiscoveryResponsePage) ClientDiscoveryResponseIterator +1. NewClientDiscoveryResponsePage(ClientDiscoveryResponse, func(context.Context, ClientDiscoveryResponse) (ClientDiscoveryResponse, error)) ClientDiscoveryResponsePage +1. NewCrossRegionRestoreClient(string) CrossRegionRestoreClient +1. NewCrossRegionRestoreClientWithBaseURI(string, string) CrossRegionRestoreClient +1. NewCrrJobDetailsClient(string) CrrJobDetailsClient +1. NewCrrJobDetailsClientWithBaseURI(string, string) CrrJobDetailsClient +1. NewCrrJobsClient(string) CrrJobsClient +1. NewCrrJobsClientWithBaseURI(string, string) CrrJobsClient +1. NewCrrOperationResultsClient(string) CrrOperationResultsClient +1. NewCrrOperationResultsClientWithBaseURI(string, string) CrrOperationResultsClient +1. NewCrrOperationStatusClient(string) CrrOperationStatusClient +1. NewCrrOperationStatusClientWithBaseURI(string, string) CrrOperationStatusClient +1. NewFeatureSupportClient(string) FeatureSupportClient +1. NewFeatureSupportClientWithBaseURI(string, string) FeatureSupportClient +1. NewOperationsClient(string) OperationsClient +1. NewOperationsClientWithBaseURI(string, string) OperationsClient +1. NewProtectedItemsCrrClient(string) ProtectedItemsCrrClient +1. NewProtectedItemsCrrClientWithBaseURI(string, string) ProtectedItemsCrrClient +1. NewProtectionIntentClient(string) ProtectionIntentClient +1. NewProtectionIntentClientWithBaseURI(string, string) ProtectionIntentClient +1. NewProtectionIntentGroupClient(string) ProtectionIntentGroupClient +1. NewProtectionIntentGroupClientWithBaseURI(string, string) ProtectionIntentGroupClient +1. NewProtectionIntentResourceListIterator(ProtectionIntentResourceListPage) ProtectionIntentResourceListIterator +1. NewProtectionIntentResourceListPage(ProtectionIntentResourceList, func(context.Context, ProtectionIntentResourceList) (ProtectionIntentResourceList, error)) ProtectionIntentResourceListPage +1. NewRecoveryPointsCrrClient(string) RecoveryPointsCrrClient +1. NewRecoveryPointsCrrClientWithBaseURI(string, string) RecoveryPointsCrrClient +1. NewResourceStorageConfigsClient(string) ResourceStorageConfigsClient +1. NewResourceStorageConfigsClientWithBaseURI(string, string) ResourceStorageConfigsClient +1. NewStatusClient(string) StatusClient +1. NewStatusClientWithBaseURI(string, string) StatusClient +1. NewUsageSummariesCRRClient(string) UsageSummariesCRRClient +1. NewUsageSummariesCRRClientWithBaseURI(string, string) UsageSummariesCRRClient +1. NewUsageSummariesClient(string) UsageSummariesClient +1. NewUsageSummariesClientWithBaseURI(string, string) UsageSummariesClient +1. OperationStatusExtendedInfo.AsOperationStatusRecoveryPointExtendedInfo() (*OperationStatusRecoveryPointExtendedInfo, bool) +1. OperationStatusJobExtendedInfo.AsOperationStatusRecoveryPointExtendedInfo() (*OperationStatusRecoveryPointExtendedInfo, bool) +1. OperationStatusJobsExtendedInfo.AsOperationStatusRecoveryPointExtendedInfo() (*OperationStatusRecoveryPointExtendedInfo, bool) +1. OperationStatusProvisionILRExtendedInfo.AsOperationStatusRecoveryPointExtendedInfo() (*OperationStatusRecoveryPointExtendedInfo, bool) +1. OperationStatusRecoveryPointExtendedInfo.AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) +1. OperationStatusRecoveryPointExtendedInfo.AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) +1. OperationStatusRecoveryPointExtendedInfo.AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) +1. OperationStatusRecoveryPointExtendedInfo.AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) +1. OperationStatusRecoveryPointExtendedInfo.AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) +1. OperationStatusRecoveryPointExtendedInfo.AsOperationStatusRecoveryPointExtendedInfo() (*OperationStatusRecoveryPointExtendedInfo, bool) +1. OperationStatusRecoveryPointExtendedInfo.MarshalJSON() ([]byte, error) +1. OperationsClient.List(context.Context) (ClientDiscoveryResponsePage, error) +1. OperationsClient.ListComplete(context.Context) (ClientDiscoveryResponseIterator, error) +1. OperationsClient.ListPreparer(context.Context) (*http.Request, error) +1. OperationsClient.ListResponder(*http.Response) (ClientDiscoveryResponse, error) +1. OperationsClient.ListSender(*http.Request) (*http.Response, error) +1. PossibleFabricNameValues() []FabricName +1. PossibleFeatureTypeValues() []FeatureType +1. PossibleIntentItemTypeValues() []IntentItemType +1. PossibleObjectTypeBasicCrrAccessTokenValues() []ObjectTypeBasicCrrAccessToken +1. PossibleProtectionIntentItemTypeValues() []ProtectionIntentItemType +1. PossibleSupportStatusValues() []SupportStatus +1. PossibleTypeEnumValues() []TypeEnum +1. PossibleUsagesUnitValues() []UsagesUnit +1. PossibleValidationStatusValues() []ValidationStatus +1. ProtectedItemsCrrClient.List(context.Context, string, string, string, string) (ProtectedItemResourceListPage, error) +1. ProtectedItemsCrrClient.ListComplete(context.Context, string, string, string, string) (ProtectedItemResourceListIterator, error) +1. ProtectedItemsCrrClient.ListPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectedItemsCrrClient.ListResponder(*http.Response) (ProtectedItemResourceList, error) +1. ProtectedItemsCrrClient.ListSender(*http.Request) (*http.Response, error) +1. ProtectionIntent.AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) +1. ProtectionIntent.AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) +1. ProtectionIntent.AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) +1. ProtectionIntent.AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) +1. ProtectionIntent.AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) +1. ProtectionIntent.AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) +1. ProtectionIntent.AsBasicProtectionIntent() (BasicProtectionIntent, bool) +1. ProtectionIntent.AsProtectionIntent() (*ProtectionIntent, bool) +1. ProtectionIntent.MarshalJSON() ([]byte, error) +1. ProtectionIntentClient.CreateOrUpdate(context.Context, string, string, string, string, ProtectionIntentResource) (ProtectionIntentResource, error) +1. ProtectionIntentClient.CreateOrUpdatePreparer(context.Context, string, string, string, string, ProtectionIntentResource) (*http.Request, error) +1. ProtectionIntentClient.CreateOrUpdateResponder(*http.Response) (ProtectionIntentResource, error) +1. ProtectionIntentClient.CreateOrUpdateSender(*http.Request) (*http.Response, error) +1. ProtectionIntentClient.Delete(context.Context, string, string, string, string) (autorest.Response, error) +1. ProtectionIntentClient.DeletePreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionIntentClient.DeleteResponder(*http.Response) (autorest.Response, error) +1. ProtectionIntentClient.DeleteSender(*http.Request) (*http.Response, error) +1. ProtectionIntentClient.Get(context.Context, string, string, string, string) (ProtectionIntentResource, error) +1. ProtectionIntentClient.GetPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionIntentClient.GetResponder(*http.Response) (ProtectionIntentResource, error) +1. ProtectionIntentClient.GetSender(*http.Request) (*http.Response, error) +1. ProtectionIntentClient.Validate(context.Context, string, PreValidateEnableBackupRequest) (PreValidateEnableBackupResponse, error) +1. ProtectionIntentClient.ValidatePreparer(context.Context, string, PreValidateEnableBackupRequest) (*http.Request, error) +1. ProtectionIntentClient.ValidateResponder(*http.Response) (PreValidateEnableBackupResponse, error) +1. ProtectionIntentClient.ValidateSender(*http.Request) (*http.Response, error) +1. ProtectionIntentGroupClient.List(context.Context, string, string, string, string) (ProtectionIntentResourceListPage, error) +1. ProtectionIntentGroupClient.ListComplete(context.Context, string, string, string, string) (ProtectionIntentResourceListIterator, error) +1. ProtectionIntentGroupClient.ListPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectionIntentGroupClient.ListResponder(*http.Response) (ProtectionIntentResourceList, error) +1. ProtectionIntentGroupClient.ListSender(*http.Request) (*http.Response, error) +1. ProtectionIntentResource.MarshalJSON() ([]byte, error) +1. ProtectionIntentResourceList.IsEmpty() bool +1. ProtectionIntentResourceListIterator.NotDone() bool +1. ProtectionIntentResourceListIterator.Response() ProtectionIntentResourceList +1. ProtectionIntentResourceListIterator.Value() ProtectionIntentResource +1. ProtectionIntentResourceListPage.NotDone() bool +1. ProtectionIntentResourceListPage.Response() ProtectionIntentResourceList +1. ProtectionIntentResourceListPage.Values() []ProtectionIntentResource +1. RecoveryPointsClient.GetAccessToken(context.Context, string, string, string, string, string, string, AADPropertiesResource) (CrrAccessTokenResource, error) +1. RecoveryPointsClient.GetAccessTokenPreparer(context.Context, string, string, string, string, string, string, AADPropertiesResource) (*http.Request, error) +1. RecoveryPointsClient.GetAccessTokenResponder(*http.Response) (CrrAccessTokenResource, error) +1. RecoveryPointsClient.GetAccessTokenSender(*http.Request) (*http.Response, error) +1. RecoveryPointsCrrClient.List(context.Context, string, string, string, string, string, string) (RecoveryPointResourceListPage, error) +1. RecoveryPointsCrrClient.ListComplete(context.Context, string, string, string, string, string, string) (RecoveryPointResourceListIterator, error) +1. RecoveryPointsCrrClient.ListPreparer(context.Context, string, string, string, string, string, string) (*http.Request, error) +1. RecoveryPointsCrrClient.ListResponder(*http.Response) (RecoveryPointResourceList, error) +1. RecoveryPointsCrrClient.ListSender(*http.Request) (*http.Response, error) +1. ResourceConfigResource.MarshalJSON() ([]byte, error) +1. ResourceStorageConfigsClient.Get(context.Context, string, string) (ResourceConfigResource, error) +1. ResourceStorageConfigsClient.GetPreparer(context.Context, string, string) (*http.Request, error) +1. ResourceStorageConfigsClient.GetResponder(*http.Response) (ResourceConfigResource, error) +1. ResourceStorageConfigsClient.GetSender(*http.Request) (*http.Response, error) +1. ResourceStorageConfigsClient.Patch(context.Context, string, string, ResourceConfigResource) (autorest.Response, error) +1. ResourceStorageConfigsClient.PatchPreparer(context.Context, string, string, ResourceConfigResource) (*http.Request, error) +1. ResourceStorageConfigsClient.PatchResponder(*http.Response) (autorest.Response, error) +1. ResourceStorageConfigsClient.PatchSender(*http.Request) (*http.Response, error) +1. ResourceStorageConfigsClient.Update(context.Context, string, string, ResourceConfigResource) (ResourceConfigResource, error) +1. ResourceStorageConfigsClient.UpdatePreparer(context.Context, string, string, ResourceConfigResource) (*http.Request, error) +1. ResourceStorageConfigsClient.UpdateResponder(*http.Response) (ResourceConfigResource, error) +1. ResourceStorageConfigsClient.UpdateSender(*http.Request) (*http.Response, error) +1. StatusClient.Get(context.Context, string, StatusRequest) (StatusResponse, error) +1. StatusClient.GetPreparer(context.Context, string, StatusRequest) (*http.Request, error) +1. StatusClient.GetResponder(*http.Response) (StatusResponse, error) +1. StatusClient.GetSender(*http.Request) (*http.Response, error) +1. UsageSummariesCRRClient.List(context.Context, string, string, string, string) (ManagementUsageList, error) +1. UsageSummariesCRRClient.ListPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. UsageSummariesCRRClient.ListResponder(*http.Response) (ManagementUsageList, error) +1. UsageSummariesCRRClient.ListSender(*http.Request) (*http.Response, error) +1. UsageSummariesClient.List(context.Context, string, string, string, string) (ManagementUsageList, error) +1. UsageSummariesClient.ListPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. UsageSummariesClient.ListResponder(*http.Response) (ManagementUsageList, error) +1. UsageSummariesClient.ListSender(*http.Request) (*http.Response, error) +1. WorkloadCrrAccessToken.AsBasicCrrAccessToken() (BasicCrrAccessToken, bool) +1. WorkloadCrrAccessToken.AsCrrAccessToken() (*CrrAccessToken, bool) +1. WorkloadCrrAccessToken.AsWorkloadCrrAccessToken() (*WorkloadCrrAccessToken, bool) +1. WorkloadCrrAccessToken.MarshalJSON() ([]byte, error) + +### Struct Changes + +#### Removed Structs + +1. AADProperties +1. AADPropertiesResource +1. AadPropertiesClient +1. AzureBackupGoalFeatureSupportRequest +1. AzureRecoveryServiceVaultProtectionIntent +1. AzureResourceProtectionIntent +1. AzureVMResourceFeatureSupportRequest +1. AzureVMResourceFeatureSupportResponse +1. AzureWorkloadAutoProtectionIntent +1. AzureWorkloadSQLAutoProtectionIntent +1. BMSAADPropertiesQueryObject +1. BMSBackupSummariesQueryObject +1. ClientDiscoveryDisplay +1. ClientDiscoveryForLogSpecification +1. ClientDiscoveryForProperties +1. ClientDiscoveryForServiceSpecification +1. ClientDiscoveryResponse +1. ClientDiscoveryResponseIterator +1. ClientDiscoveryResponsePage +1. ClientDiscoveryValueForSingleAPI +1. CrossRegionRestoreClient +1. CrossRegionRestoreRequest +1. CrossRegionRestoreRequestResource +1. CrossRegionRestoreTriggerFuture +1. CrrAccessToken +1. CrrAccessTokenResource +1. CrrJobDetailsClient +1. CrrJobRequest +1. CrrJobRequestResource +1. CrrJobsClient +1. CrrOperationResultsClient +1. CrrOperationStatusClient +1. FeatureSupportClient +1. FeatureSupportRequest +1. ManagementUsage +1. ManagementUsageList +1. NameInfo +1. OperationStatusRecoveryPointExtendedInfo +1. OperationsClient +1. PreValidateEnableBackupRequest +1. PreValidateEnableBackupResponse +1. ProtectedItemsCrrClient +1. ProtectionIntent +1. ProtectionIntentClient +1. ProtectionIntentGroupClient +1. ProtectionIntentQueryObject +1. ProtectionIntentResource +1. ProtectionIntentResourceList +1. ProtectionIntentResourceListIterator +1. ProtectionIntentResourceListPage +1. RecoveryPointsCrrClient +1. ResourceConfig +1. ResourceConfigResource +1. ResourceStorageConfigsClient +1. StatusClient +1. StatusRequest +1. StatusResponse +1. UsageSummariesCRRClient +1. UsageSummariesClient +1. WorkloadCrrAccessToken + +#### Removed Struct Fields + +1. AzureFileshareProtectedItem.HealthStatus +1. AzureWorkloadPointInTimeRestoreRequest.TargetVirtualMachineID +1. AzureWorkloadRestoreRequest.TargetVirtualMachineID +1. AzureWorkloadSAPHanaPointInTimeRestoreRequest.TargetVirtualMachineID +1. AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest.TargetVirtualMachineID +1. AzureWorkloadSAPHanaRestoreRequest.TargetVirtualMachineID +1. AzureWorkloadSAPHanaRestoreWithRehydrateRequest.TargetVirtualMachineID +1. AzureWorkloadSQLPointInTimeRestoreRequest.TargetVirtualMachineID +1. AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest.TargetVirtualMachineID +1. AzureWorkloadSQLRestoreRequest.TargetVirtualMachineID +1. AzureWorkloadSQLRestoreWithRehydrateRequest.TargetVirtualMachineID + +### Signature Changes + +#### Struct Fields + +1. AzureWorkloadBackupRequest.BackupType changed type from TypeEnum to Type + +## Additive Changes + +### New Constants + +1. Type.TypeCopyOnlyFull +1. Type.TypeDifferential +1. Type.TypeFull +1. Type.TypeIncremental +1. Type.TypeLog diff --git a/services/recoveryservices/mgmt/2021-01-01/backup/_meta.json b/services/recoveryservices/mgmt/2021-01-01/backup/_meta.json index 25f19ca686e5..f1aabb036d3d 100644 --- a/services/recoveryservices/mgmt/2021-01-01/backup/_meta.json +++ b/services/recoveryservices/mgmt/2021-01-01/backup/_meta.json @@ -1,5 +1,5 @@ { - "commit": "394395ed0bdc1c5c05cb37a031379ca03bfebbb5", + "commit": "4742065e8d48160292fbce6790710c6835f8dc4f", "readme": "/_/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/readme.md", "tag": "package-2021-01", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/recoveryservices/mgmt/2021-01-01/backup/aadproperties.go b/services/recoveryservices/mgmt/2021-01-01/backup/aadproperties.go deleted file mode 100644 index ef951a5266f8..000000000000 --- a/services/recoveryservices/mgmt/2021-01-01/backup/aadproperties.go +++ /dev/null @@ -1,109 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AadPropertiesClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type AadPropertiesClient struct { - BaseClient -} - -// NewAadPropertiesClient creates an instance of the AadPropertiesClient client. -func NewAadPropertiesClient(subscriptionID string) AadPropertiesClient { - return NewAadPropertiesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAadPropertiesClientWithBaseURI creates an instance of the AadPropertiesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewAadPropertiesClientWithBaseURI(baseURI string, subscriptionID string) AadPropertiesClient { - return AadPropertiesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get sends the get request. -// Parameters: -// azureRegion - azure region to hit Api -// filter - oData filter options. -func (client AadPropertiesClient) Get(ctx context.Context, azureRegion string, filter string) (result AADPropertiesResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AadPropertiesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, azureRegion, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.AadPropertiesClient", "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.AadPropertiesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.AadPropertiesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client AadPropertiesClient) GetPreparer(ctx context.Context, azureRegion string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "azureRegion": autorest.Encode("path", azureRegion), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-12-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupAadProperties", 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 AadPropertiesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client AadPropertiesClient) GetResponder(resp *http.Response) (result AADPropertiesResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/recoveryservices/mgmt/2021-01-01/backup/backupapi/interfaces.go b/services/recoveryservices/mgmt/2021-01-01/backup/backupapi/interfaces.go index cdc11baadfec..a2aedfa0dfca 100644 --- a/services/recoveryservices/mgmt/2021-01-01/backup/backupapi/interfaces.go +++ b/services/recoveryservices/mgmt/2021-01-01/backup/backupapi/interfaces.go @@ -81,7 +81,6 @@ var _ ProtectedItemOperationResultsClientAPI = (*backup.ProtectedItemOperationRe // RecoveryPointsClientAPI contains the set of methods on the RecoveryPointsClient type. type RecoveryPointsClientAPI interface { Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string) (result backup.RecoveryPointResource, err error) - GetAccessToken(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters backup.AADPropertiesResource) (result backup.CrrAccessTokenResource, err error) List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result backup.RecoveryPointResourceListPage, err error) ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result backup.RecoveryPointResourceListIterator, err error) } @@ -300,125 +299,3 @@ type RecoveryPointsRecommendedForMoveClientAPI interface { } var _ RecoveryPointsRecommendedForMoveClientAPI = (*backup.RecoveryPointsRecommendedForMoveClient)(nil) - -// UsageSummariesCRRClientAPI contains the set of methods on the UsageSummariesCRRClient type. -type UsageSummariesCRRClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ManagementUsageList, err error) -} - -var _ UsageSummariesCRRClientAPI = (*backup.UsageSummariesCRRClient)(nil) - -// AadPropertiesClientAPI contains the set of methods on the AadPropertiesClient type. -type AadPropertiesClientAPI interface { - Get(ctx context.Context, azureRegion string, filter string) (result backup.AADPropertiesResource, err error) -} - -var _ AadPropertiesClientAPI = (*backup.AadPropertiesClient)(nil) - -// CrossRegionRestoreClientAPI contains the set of methods on the CrossRegionRestoreClient type. -type CrossRegionRestoreClientAPI interface { - Trigger(ctx context.Context, azureRegion string, parameters backup.CrossRegionRestoreRequest) (result backup.CrossRegionRestoreTriggerFuture, err error) -} - -var _ CrossRegionRestoreClientAPI = (*backup.CrossRegionRestoreClient)(nil) - -// CrrJobDetailsClientAPI contains the set of methods on the CrrJobDetailsClient type. -type CrrJobDetailsClientAPI interface { - Get(ctx context.Context, azureRegion string, parameters backup.CrrJobRequest) (result backup.JobResource, err error) -} - -var _ CrrJobDetailsClientAPI = (*backup.CrrJobDetailsClient)(nil) - -// CrrJobsClientAPI contains the set of methods on the CrrJobsClient type. -type CrrJobsClientAPI interface { - List(ctx context.Context, azureRegion string, parameters backup.CrrJobRequest, filter string, skipToken string) (result backup.JobResourceListPage, err error) - ListComplete(ctx context.Context, azureRegion string, parameters backup.CrrJobRequest, filter string, skipToken string) (result backup.JobResourceListIterator, err error) -} - -var _ CrrJobsClientAPI = (*backup.CrrJobsClient)(nil) - -// CrrOperationResultsClientAPI contains the set of methods on the CrrOperationResultsClient type. -type CrrOperationResultsClientAPI interface { - Get(ctx context.Context, azureRegion string, operationID string) (result autorest.Response, err error) -} - -var _ CrrOperationResultsClientAPI = (*backup.CrrOperationResultsClient)(nil) - -// CrrOperationStatusClientAPI contains the set of methods on the CrrOperationStatusClient type. -type CrrOperationStatusClientAPI interface { - Get(ctx context.Context, azureRegion string, operationID string) (result backup.OperationStatus, err error) -} - -var _ CrrOperationStatusClientAPI = (*backup.CrrOperationStatusClient)(nil) - -// ResourceStorageConfigsClientAPI contains the set of methods on the ResourceStorageConfigsClient type. -type ResourceStorageConfigsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string) (result backup.ResourceConfigResource, err error) - Patch(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.ResourceConfigResource) (result autorest.Response, err error) - Update(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.ResourceConfigResource) (result backup.ResourceConfigResource, err error) -} - -var _ ResourceStorageConfigsClientAPI = (*backup.ResourceStorageConfigsClient)(nil) - -// RecoveryPointsCrrClientAPI contains the set of methods on the RecoveryPointsCrrClient type. -type RecoveryPointsCrrClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result backup.RecoveryPointResourceListPage, err error) - ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result backup.RecoveryPointResourceListIterator, err error) -} - -var _ RecoveryPointsCrrClientAPI = (*backup.RecoveryPointsCrrClient)(nil) - -// ProtectedItemsCrrClientAPI contains the set of methods on the ProtectedItemsCrrClient type. -type ProtectedItemsCrrClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ProtectedItemResourceListPage, err error) - ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ProtectedItemResourceListIterator, err error) -} - -var _ ProtectedItemsCrrClientAPI = (*backup.ProtectedItemsCrrClient)(nil) - -// ProtectionIntentClientAPI contains the set of methods on the ProtectionIntentClient type. -type ProtectionIntentClientAPI interface { - CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string, parameters backup.ProtectionIntentResource) (result backup.ProtectionIntentResource, err error) - Delete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string) (result autorest.Response, err error) - Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string) (result backup.ProtectionIntentResource, err error) - Validate(ctx context.Context, azureRegion string, parameters backup.PreValidateEnableBackupRequest) (result backup.PreValidateEnableBackupResponse, err error) -} - -var _ ProtectionIntentClientAPI = (*backup.ProtectionIntentClient)(nil) - -// StatusClientAPI contains the set of methods on the StatusClient type. -type StatusClientAPI interface { - Get(ctx context.Context, azureRegion string, parameters backup.StatusRequest) (result backup.StatusResponse, err error) -} - -var _ StatusClientAPI = (*backup.StatusClient)(nil) - -// FeatureSupportClientAPI contains the set of methods on the FeatureSupportClient type. -type FeatureSupportClientAPI interface { - Validate(ctx context.Context, azureRegion string, parameters backup.BasicFeatureSupportRequest) (result backup.AzureVMResourceFeatureSupportResponse, err error) -} - -var _ FeatureSupportClientAPI = (*backup.FeatureSupportClient)(nil) - -// ProtectionIntentGroupClientAPI contains the set of methods on the ProtectionIntentGroupClient type. -type ProtectionIntentGroupClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ProtectionIntentResourceListPage, err error) - ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ProtectionIntentResourceListIterator, err error) -} - -var _ ProtectionIntentGroupClientAPI = (*backup.ProtectionIntentGroupClient)(nil) - -// UsageSummariesClientAPI contains the set of methods on the UsageSummariesClient type. -type UsageSummariesClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ManagementUsageList, err error) -} - -var _ UsageSummariesClientAPI = (*backup.UsageSummariesClient)(nil) - -// OperationsClientAPI contains the set of methods on the OperationsClient type. -type OperationsClientAPI interface { - List(ctx context.Context) (result backup.ClientDiscoveryResponsePage, err error) - ListComplete(ctx context.Context) (result backup.ClientDiscoveryResponseIterator, err error) -} - -var _ OperationsClientAPI = (*backup.OperationsClient)(nil) diff --git a/services/recoveryservices/mgmt/2021-01-01/backup/client.go b/services/recoveryservices/mgmt/2021-01-01/backup/client.go index 86c7956c1606..6ef255305db1 100644 --- a/services/recoveryservices/mgmt/2021-01-01/backup/client.go +++ b/services/recoveryservices/mgmt/2021-01-01/backup/client.go @@ -1,4 +1,4 @@ -// Package backup implements the Azure ARM Backup service API version . +// Package backup implements the Azure ARM Backup service API version 2021-01-01. // // Open API 2.0 Specs for Azure RecoveryServices Backup service package backup diff --git a/services/recoveryservices/mgmt/2021-01-01/backup/crossregionrestore.go b/services/recoveryservices/mgmt/2021-01-01/backup/crossregionrestore.go deleted file mode 100644 index e28639b72aa7..000000000000 --- a/services/recoveryservices/mgmt/2021-01-01/backup/crossregionrestore.go +++ /dev/null @@ -1,111 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CrossRegionRestoreClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type CrossRegionRestoreClient struct { - BaseClient -} - -// NewCrossRegionRestoreClient creates an instance of the CrossRegionRestoreClient client. -func NewCrossRegionRestoreClient(subscriptionID string) CrossRegionRestoreClient { - return NewCrossRegionRestoreClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCrossRegionRestoreClientWithBaseURI creates an instance of the CrossRegionRestoreClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewCrossRegionRestoreClientWithBaseURI(baseURI string, subscriptionID string) CrossRegionRestoreClient { - return CrossRegionRestoreClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Trigger sends the trigger request. -// Parameters: -// azureRegion - azure region to hit Api -// parameters - resource cross region restore request -func (client CrossRegionRestoreClient) Trigger(ctx context.Context, azureRegion string, parameters CrossRegionRestoreRequest) (result CrossRegionRestoreTriggerFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CrossRegionRestoreClient.Trigger") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.TriggerPreparer(ctx, azureRegion, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.CrossRegionRestoreClient", "Trigger", nil, "Failure preparing request") - return - } - - result, err = client.TriggerSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.CrossRegionRestoreClient", "Trigger", result.Response(), "Failure sending request") - return - } - - return -} - -// TriggerPreparer prepares the Trigger request. -func (client CrossRegionRestoreClient) TriggerPreparer(ctx context.Context, azureRegion string, parameters CrossRegionRestoreRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "azureRegion": autorest.Encode("path", azureRegion), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-12-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrossRegionRestore", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TriggerSender sends the Trigger request. The method will close the -// http.Response Body if it receives an error. -func (client CrossRegionRestoreClient) TriggerSender(req *http.Request) (future CrossRegionRestoreTriggerFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// TriggerResponder handles the response to the Trigger request. The method always -// closes the http.Response Body. -func (client CrossRegionRestoreClient) TriggerResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/services/recoveryservices/mgmt/2021-01-01/backup/crrjobdetails.go b/services/recoveryservices/mgmt/2021-01-01/backup/crrjobdetails.go deleted file mode 100644 index 71e262c790a7..000000000000 --- a/services/recoveryservices/mgmt/2021-01-01/backup/crrjobdetails.go +++ /dev/null @@ -1,108 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CrrJobDetailsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type CrrJobDetailsClient struct { - BaseClient -} - -// NewCrrJobDetailsClient creates an instance of the CrrJobDetailsClient client. -func NewCrrJobDetailsClient(subscriptionID string) CrrJobDetailsClient { - return NewCrrJobDetailsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCrrJobDetailsClientWithBaseURI creates an instance of the CrrJobDetailsClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewCrrJobDetailsClientWithBaseURI(baseURI string, subscriptionID string) CrrJobDetailsClient { - return CrrJobDetailsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get sends the get request. -// Parameters: -// azureRegion - azure region to hit Api -// parameters - CRR Job request -func (client CrrJobDetailsClient) Get(ctx context.Context, azureRegion string, parameters CrrJobRequest) (result JobResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CrrJobDetailsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, azureRegion, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.CrrJobDetailsClient", "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.CrrJobDetailsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.CrrJobDetailsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client CrrJobDetailsClient) GetPreparer(ctx context.Context, azureRegion string, parameters CrrJobRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "azureRegion": autorest.Encode("path", azureRegion), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-12-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJob", pathParameters), - autorest.WithJSON(parameters), - 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 CrrJobDetailsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client CrrJobDetailsClient) GetResponder(resp *http.Response) (result JobResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/recoveryservices/mgmt/2021-01-01/backup/crrjobs.go b/services/recoveryservices/mgmt/2021-01-01/backup/crrjobs.go deleted file mode 100644 index 59c94321a7cb..000000000000 --- a/services/recoveryservices/mgmt/2021-01-01/backup/crrjobs.go +++ /dev/null @@ -1,158 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CrrJobsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type CrrJobsClient struct { - BaseClient -} - -// NewCrrJobsClient creates an instance of the CrrJobsClient client. -func NewCrrJobsClient(subscriptionID string) CrrJobsClient { - return NewCrrJobsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCrrJobsClientWithBaseURI creates an instance of the CrrJobsClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewCrrJobsClientWithBaseURI(baseURI string, subscriptionID string) CrrJobsClient { - return CrrJobsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List sends the list request. -// Parameters: -// azureRegion - azure region to hit Api -// parameters - backup CRR Job request -// filter - oData filter options. -// skipToken - skipToken Filter. -func (client CrrJobsClient) List(ctx context.Context, azureRegion string, parameters CrrJobRequest, filter string, skipToken string) (result JobResourceListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CrrJobsClient.List") - defer func() { - sc := -1 - if result.jrl.Response.Response != nil { - sc = result.jrl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, azureRegion, parameters, filter, skipToken) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.CrrJobsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.jrl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.CrrJobsClient", "List", resp, "Failure sending request") - return - } - - result.jrl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.CrrJobsClient", "List", resp, "Failure responding to request") - return - } - if result.jrl.hasNextLink() && result.jrl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client CrrJobsClient) ListPreparer(ctx context.Context, azureRegion string, parameters CrrJobRequest, filter string, skipToken string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "azureRegion": autorest.Encode("path", azureRegion), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-12-20" - 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.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJobs", pathParameters), - autorest.WithJSON(parameters), - 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 CrrJobsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client CrrJobsClient) ListResponder(resp *http.Response) (result JobResourceList, err error) { - err = autorest.Respond( - resp, - 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 CrrJobsClient) listNextResults(ctx context.Context, lastResults JobResourceList) (result JobResourceList, err error) { - req, err := lastResults.jobResourceListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "backup.CrrJobsClient", "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.CrrJobsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.CrrJobsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client CrrJobsClient) ListComplete(ctx context.Context, azureRegion string, parameters CrrJobRequest, filter string, skipToken string) (result JobResourceListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CrrJobsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, azureRegion, parameters, filter, skipToken) - return -} diff --git a/services/recoveryservices/mgmt/2021-01-01/backup/crroperationresults.go b/services/recoveryservices/mgmt/2021-01-01/backup/crroperationresults.go deleted file mode 100644 index 55dfa9ad021f..000000000000 --- a/services/recoveryservices/mgmt/2021-01-01/backup/crroperationresults.go +++ /dev/null @@ -1,106 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CrrOperationResultsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type CrrOperationResultsClient struct { - BaseClient -} - -// NewCrrOperationResultsClient creates an instance of the CrrOperationResultsClient client. -func NewCrrOperationResultsClient(subscriptionID string) CrrOperationResultsClient { - return NewCrrOperationResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCrrOperationResultsClientWithBaseURI creates an instance of the CrrOperationResultsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewCrrOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) CrrOperationResultsClient { - return CrrOperationResultsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get sends the get request. -// Parameters: -// azureRegion - azure region to hit Api -func (client CrrOperationResultsClient) Get(ctx context.Context, azureRegion string, operationID string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CrrOperationResultsClient.Get") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, azureRegion, operationID) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.CrrOperationResultsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "backup.CrrOperationResultsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.CrrOperationResultsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client CrrOperationResultsClient) GetPreparer(ctx context.Context, azureRegion string, operationID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "azureRegion": autorest.Encode("path", azureRegion), - "operationId": autorest.Encode("path", operationID), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-12-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrOperationResults/{operationId}", 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 CrrOperationResultsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client CrrOperationResultsClient) GetResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/services/recoveryservices/mgmt/2021-01-01/backup/crroperationstatus.go b/services/recoveryservices/mgmt/2021-01-01/backup/crroperationstatus.go deleted file mode 100644 index 75fc8c000111..000000000000 --- a/services/recoveryservices/mgmt/2021-01-01/backup/crroperationstatus.go +++ /dev/null @@ -1,107 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CrrOperationStatusClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type CrrOperationStatusClient struct { - BaseClient -} - -// NewCrrOperationStatusClient creates an instance of the CrrOperationStatusClient client. -func NewCrrOperationStatusClient(subscriptionID string) CrrOperationStatusClient { - return NewCrrOperationStatusClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCrrOperationStatusClientWithBaseURI creates an instance of the CrrOperationStatusClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewCrrOperationStatusClientWithBaseURI(baseURI string, subscriptionID string) CrrOperationStatusClient { - return CrrOperationStatusClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get sends the get request. -// Parameters: -// azureRegion - azure region to hit Api -func (client CrrOperationStatusClient) Get(ctx context.Context, azureRegion string, operationID string) (result OperationStatus, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CrrOperationStatusClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, azureRegion, operationID) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.CrrOperationStatusClient", "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.CrrOperationStatusClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.CrrOperationStatusClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client CrrOperationStatusClient) GetPreparer(ctx context.Context, azureRegion string, operationID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "azureRegion": autorest.Encode("path", azureRegion), - "operationId": autorest.Encode("path", operationID), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-12-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrOperationsStatus/{operationId}", 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 CrrOperationStatusClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client CrrOperationStatusClient) GetResponder(resp *http.Response) (result OperationStatus, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/recoveryservices/mgmt/2021-01-01/backup/enums.go b/services/recoveryservices/mgmt/2021-01-01/backup/enums.go index 29f19c8150c7..0fa9994da8f0 100644 --- a/services/recoveryservices/mgmt/2021-01-01/backup/enums.go +++ b/services/recoveryservices/mgmt/2021-01-01/backup/enums.go @@ -273,38 +273,6 @@ func PossibleEnhancedSecurityStateValues() []EnhancedSecurityState { return []EnhancedSecurityState{EnhancedSecurityStateDisabled, EnhancedSecurityStateEnabled, EnhancedSecurityStateInvalid} } -// FabricName enumerates the values for fabric name. -type FabricName string - -const ( - // FabricNameAzure ... - FabricNameAzure FabricName = "Azure" - // FabricNameInvalid ... - FabricNameInvalid FabricName = "Invalid" -) - -// PossibleFabricNameValues returns an array of possible values for the FabricName const type. -func PossibleFabricNameValues() []FabricName { - return []FabricName{FabricNameAzure, FabricNameInvalid} -} - -// FeatureType enumerates the values for feature type. -type FeatureType string - -const ( - // FeatureTypeAzureBackupGoals ... - FeatureTypeAzureBackupGoals FeatureType = "AzureBackupGoals" - // FeatureTypeAzureVMResourceBackup ... - FeatureTypeAzureVMResourceBackup FeatureType = "AzureVMResourceBackup" - // FeatureTypeFeatureSupportRequest ... - FeatureTypeFeatureSupportRequest FeatureType = "FeatureSupportRequest" -) - -// PossibleFeatureTypeValues returns an array of possible values for the FeatureType const type. -func PossibleFeatureTypeValues() []FeatureType { - return []FeatureType{FeatureTypeAzureBackupGoals, FeatureTypeAzureVMResourceBackup, FeatureTypeFeatureSupportRequest} -} - // HealthState enumerates the values for health state. type HealthState string @@ -482,23 +450,6 @@ 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 @@ -831,21 +782,6 @@ func PossibleObjectTypeValues() []ObjectType { return []ObjectType{ObjectTypeExportJobsOperationResultInfo, ObjectTypeOperationResultInfo, ObjectTypeOperationResultInfoBase} } -// ObjectTypeBasicCrrAccessToken enumerates the values for object type basic crr access token. -type ObjectTypeBasicCrrAccessToken string - -const ( - // ObjectTypeBasicCrrAccessTokenObjectTypeCrrAccessToken ... - ObjectTypeBasicCrrAccessTokenObjectTypeCrrAccessToken ObjectTypeBasicCrrAccessToken = "CrrAccessToken" - // ObjectTypeBasicCrrAccessTokenObjectTypeWorkloadCrrAccessToken ... - ObjectTypeBasicCrrAccessTokenObjectTypeWorkloadCrrAccessToken ObjectTypeBasicCrrAccessToken = "WorkloadCrrAccessToken" -) - -// PossibleObjectTypeBasicCrrAccessTokenValues returns an array of possible values for the ObjectTypeBasicCrrAccessToken const type. -func PossibleObjectTypeBasicCrrAccessTokenValues() []ObjectTypeBasicCrrAccessToken { - return []ObjectTypeBasicCrrAccessToken{ObjectTypeBasicCrrAccessTokenObjectTypeCrrAccessToken, ObjectTypeBasicCrrAccessTokenObjectTypeWorkloadCrrAccessToken} -} - // ObjectTypeBasicILRRequest enumerates the values for object type basic ilr request. type ObjectTypeBasicILRRequest string @@ -876,13 +812,11 @@ const ( ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobsExtendedInfo ObjectTypeBasicOperationStatusExtendedInfo = "OperationStatusJobsExtendedInfo" // ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusProvisionILRExtendedInfo ... ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusProvisionILRExtendedInfo ObjectTypeBasicOperationStatusExtendedInfo = "OperationStatusProvisionILRExtendedInfo" - // ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusRecoveryPointExtendedInfo ... - ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusRecoveryPointExtendedInfo ObjectTypeBasicOperationStatusExtendedInfo = "OperationStatusRecoveryPointExtendedInfo" ) // PossibleObjectTypeBasicOperationStatusExtendedInfoValues returns an array of possible values for the ObjectTypeBasicOperationStatusExtendedInfo const type. func PossibleObjectTypeBasicOperationStatusExtendedInfoValues() []ObjectTypeBasicOperationStatusExtendedInfo { - return []ObjectTypeBasicOperationStatusExtendedInfo{ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusExtendedInfo, ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobExtendedInfo, ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobsExtendedInfo, ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusProvisionILRExtendedInfo, ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusRecoveryPointExtendedInfo} + return []ObjectTypeBasicOperationStatusExtendedInfo{ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusExtendedInfo, ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobExtendedInfo, ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobsExtendedInfo, ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusProvisionILRExtendedInfo} } // ObjectTypeBasicRecoveryPoint enumerates the values for object type basic recovery point. @@ -1238,27 +1172,6 @@ func PossibleProtectedItemTypeValues() []ProtectedItemType { return []ProtectedItemType{ProtectedItemTypeAzureFileShareProtectedItem, ProtectedItemTypeAzureIaaSVMProtectedItem, ProtectedItemTypeAzureVMWorkloadProtectedItem, ProtectedItemTypeAzureVMWorkloadSAPAseDatabase, ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase, ProtectedItemTypeAzureVMWorkloadSQLDatabase, ProtectedItemTypeDPMProtectedItem, ProtectedItemTypeGenericProtectedItem, ProtectedItemTypeMabFileFolderProtectedItem, ProtectedItemTypeMicrosoftClassicComputevirtualMachines, ProtectedItemTypeMicrosoftComputevirtualMachines, ProtectedItemTypeMicrosoftSqlserversdatabases, ProtectedItemTypeProtectedItem} } -// ProtectionIntentItemType enumerates the values for protection intent item type. -type ProtectionIntentItemType string - -const ( - // ProtectionIntentItemTypeAzureResourceItem ... - ProtectionIntentItemTypeAzureResourceItem ProtectionIntentItemType = "AzureResourceItem" - // ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent ... - ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent ProtectionIntentItemType = "AzureWorkloadAutoProtectionIntent" - // ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent ... - ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent ProtectionIntentItemType = "AzureWorkloadSQLAutoProtectionIntent" - // ProtectionIntentItemTypeProtectionIntent ... - ProtectionIntentItemTypeProtectionIntent ProtectionIntentItemType = "ProtectionIntent" - // ProtectionIntentItemTypeRecoveryServiceVaultItem ... - ProtectionIntentItemTypeRecoveryServiceVaultItem ProtectionIntentItemType = "RecoveryServiceVaultItem" -) - -// PossibleProtectionIntentItemTypeValues returns an array of possible values for the ProtectionIntentItemType const type. -func PossibleProtectionIntentItemTypeValues() []ProtectionIntentItemType { - return []ProtectionIntentItemType{ProtectionIntentItemTypeAzureResourceItem, ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent, ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent, ProtectionIntentItemTypeProtectionIntent, ProtectionIntentItemTypeRecoveryServiceVaultItem} -} - // ProtectionState enumerates the values for protection state. type ProtectionState string @@ -1664,105 +1577,27 @@ func PossibleStorageTypeStateValues() []StorageTypeState { return []StorageTypeState{StorageTypeStateInvalid, StorageTypeStateLocked, StorageTypeStateUnlocked} } -// SupportStatus enumerates the values for support status. -type SupportStatus string - -const ( - // SupportStatusDefaultOFF ... - SupportStatusDefaultOFF SupportStatus = "DefaultOFF" - // SupportStatusDefaultON ... - SupportStatusDefaultON SupportStatus = "DefaultON" - // SupportStatusInvalid ... - SupportStatusInvalid SupportStatus = "Invalid" - // SupportStatusNotSupported ... - SupportStatusNotSupported SupportStatus = "NotSupported" - // SupportStatusSupported ... - SupportStatusSupported SupportStatus = "Supported" -) - -// PossibleSupportStatusValues returns an array of possible values for the SupportStatus const type. -func PossibleSupportStatusValues() []SupportStatus { - return []SupportStatus{SupportStatusDefaultOFF, SupportStatusDefaultON, SupportStatusInvalid, SupportStatusNotSupported, SupportStatusSupported} -} - // Type enumerates the values for type. type Type string const ( - // TypeBackupProtectedItemCountSummary ... - TypeBackupProtectedItemCountSummary Type = "BackupProtectedItemCountSummary" - // TypeBackupProtectionContainerCountSummary ... - TypeBackupProtectionContainerCountSummary Type = "BackupProtectionContainerCountSummary" + // TypeCopyOnlyFull ... + TypeCopyOnlyFull Type = "CopyOnlyFull" + // TypeDifferential ... + TypeDifferential Type = "Differential" + // TypeFull ... + TypeFull Type = "Full" + // TypeIncremental ... + TypeIncremental Type = "Incremental" // TypeInvalid ... TypeInvalid Type = "Invalid" + // TypeLog ... + TypeLog Type = "Log" ) // PossibleTypeValues returns an array of possible values for the Type const type. func PossibleTypeValues() []Type { - return []Type{TypeBackupProtectedItemCountSummary, TypeBackupProtectionContainerCountSummary, TypeInvalid} -} - -// TypeEnum enumerates the values for type enum. -type TypeEnum string - -const ( - // TypeEnumCopyOnlyFull ... - TypeEnumCopyOnlyFull TypeEnum = "CopyOnlyFull" - // TypeEnumDifferential ... - TypeEnumDifferential TypeEnum = "Differential" - // TypeEnumFull ... - TypeEnumFull TypeEnum = "Full" - // TypeEnumIncremental ... - TypeEnumIncremental TypeEnum = "Incremental" - // TypeEnumInvalid ... - TypeEnumInvalid TypeEnum = "Invalid" - // TypeEnumLog ... - TypeEnumLog TypeEnum = "Log" -) - -// PossibleTypeEnumValues returns an array of possible values for the TypeEnum const type. -func PossibleTypeEnumValues() []TypeEnum { - return []TypeEnum{TypeEnumCopyOnlyFull, TypeEnumDifferential, TypeEnumFull, TypeEnumIncremental, TypeEnumInvalid, TypeEnumLog} -} - -// UsagesUnit enumerates the values for usages unit. -type UsagesUnit string - -const ( - // UsagesUnitBytes ... - UsagesUnitBytes UsagesUnit = "Bytes" - // UsagesUnitBytesPerSecond ... - UsagesUnitBytesPerSecond UsagesUnit = "BytesPerSecond" - // UsagesUnitCount ... - UsagesUnitCount UsagesUnit = "Count" - // UsagesUnitCountPerSecond ... - UsagesUnitCountPerSecond UsagesUnit = "CountPerSecond" - // UsagesUnitPercent ... - UsagesUnitPercent UsagesUnit = "Percent" - // UsagesUnitSeconds ... - UsagesUnitSeconds UsagesUnit = "Seconds" -) - -// PossibleUsagesUnitValues returns an array of possible values for the UsagesUnit const type. -func PossibleUsagesUnitValues() []UsagesUnit { - return []UsagesUnit{UsagesUnitBytes, UsagesUnitBytesPerSecond, UsagesUnitCount, UsagesUnitCountPerSecond, UsagesUnitPercent, UsagesUnitSeconds} -} - -// ValidationStatus enumerates the values for validation status. -type ValidationStatus string - -const ( - // ValidationStatusFailed ... - ValidationStatusFailed ValidationStatus = "Failed" - // ValidationStatusInvalid ... - ValidationStatusInvalid ValidationStatus = "Invalid" - // ValidationStatusSucceeded ... - ValidationStatusSucceeded ValidationStatus = "Succeeded" -) - -// PossibleValidationStatusValues returns an array of possible values for the ValidationStatus const type. -func PossibleValidationStatusValues() []ValidationStatus { - return []ValidationStatus{ValidationStatusFailed, ValidationStatusInvalid, ValidationStatusSucceeded} + return []Type{TypeCopyOnlyFull, TypeDifferential, TypeFull, TypeIncremental, TypeInvalid, TypeLog} } // WeekOfMonth enumerates the values for week of month. diff --git a/services/recoveryservices/mgmt/2021-01-01/backup/featuresupport.go b/services/recoveryservices/mgmt/2021-01-01/backup/featuresupport.go deleted file mode 100644 index 89bd19a91d48..000000000000 --- a/services/recoveryservices/mgmt/2021-01-01/backup/featuresupport.go +++ /dev/null @@ -1,108 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// FeatureSupportClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type FeatureSupportClient struct { - BaseClient -} - -// NewFeatureSupportClient creates an instance of the FeatureSupportClient client. -func NewFeatureSupportClient(subscriptionID string) FeatureSupportClient { - return NewFeatureSupportClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewFeatureSupportClientWithBaseURI creates an instance of the FeatureSupportClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewFeatureSupportClientWithBaseURI(baseURI string, subscriptionID string) FeatureSupportClient { - return FeatureSupportClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Validate sends the validate request. -// Parameters: -// azureRegion - azure region to hit Api -// parameters - feature support request object -func (client FeatureSupportClient) Validate(ctx context.Context, azureRegion string, parameters BasicFeatureSupportRequest) (result AzureVMResourceFeatureSupportResponse, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FeatureSupportClient.Validate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ValidatePreparer(ctx, azureRegion, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.FeatureSupportClient", "Validate", nil, "Failure preparing request") - return - } - - resp, err := client.ValidateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.FeatureSupportClient", "Validate", resp, "Failure sending request") - return - } - - result, err = client.ValidateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.FeatureSupportClient", "Validate", resp, "Failure responding to request") - return - } - - return -} - -// ValidatePreparer prepares the Validate request. -func (client FeatureSupportClient) ValidatePreparer(ctx context.Context, azureRegion string, parameters BasicFeatureSupportRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "azureRegion": autorest.Encode("path", azureRegion), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupValidateFeatures", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ValidateSender sends the Validate request. The method will close the -// http.Response Body if it receives an error. -func (client FeatureSupportClient) ValidateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ValidateResponder handles the response to the Validate request. The method always -// closes the http.Response Body. -func (client FeatureSupportClient) ValidateResponder(resp *http.Response) (result AzureVMResourceFeatureSupportResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/recoveryservices/mgmt/2021-01-01/backup/models.go b/services/recoveryservices/mgmt/2021-01-01/backup/models.go index 53a112ec5d97..bf5171a31f21 100644 --- a/services/recoveryservices/mgmt/2021-01-01/backup/models.go +++ b/services/recoveryservices/mgmt/2021-01-01/backup/models.go @@ -20,88 +20,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-01-01/backup" -// AADProperties ... -type AADProperties struct { - ServicePrincipalClientID *string `json:"servicePrincipalClientId,omitempty"` - TenantID *string `json:"tenantId,omitempty"` - Authority *string `json:"authority,omitempty"` - Audience *string `json:"audience,omitempty"` - ServicePrincipalObjectID *string `json:"servicePrincipalObjectId,omitempty"` -} - -// AADPropertiesResource ... -type AADPropertiesResource struct { - autorest.Response `json:"-"` - // Properties - AADPropertiesResource properties - Properties *AADProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for AADPropertiesResource. -func (apr AADPropertiesResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if apr.Properties != nil { - objectMap["properties"] = apr.Properties - } - if apr.Location != nil { - objectMap["location"] = apr.Location - } - if apr.Tags != nil { - objectMap["tags"] = apr.Tags - } - if apr.ETag != nil { - objectMap["eTag"] = apr.ETag - } - return json.Marshal(objectMap) -} - -// AzureBackupGoalFeatureSupportRequest azure backup goal feature specific request. -type AzureBackupGoalFeatureSupportRequest struct { - // FeatureType - Possible values include: 'FeatureTypeFeatureSupportRequest', 'FeatureTypeAzureBackupGoals', 'FeatureTypeAzureVMResourceBackup' - FeatureType FeatureType `json:"featureType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureBackupGoalFeatureSupportRequest. -func (abgfsr AzureBackupGoalFeatureSupportRequest) MarshalJSON() ([]byte, error) { - abgfsr.FeatureType = FeatureTypeAzureBackupGoals - objectMap := make(map[string]interface{}) - if abgfsr.FeatureType != "" { - objectMap["featureType"] = abgfsr.FeatureType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupGoalFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. -func (abgfsr AzureBackupGoalFeatureSupportRequest) AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) { - return &abgfsr, true -} - -// AsAzureVMResourceFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. -func (abgfsr AzureBackupGoalFeatureSupportRequest) AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) { - return nil, false -} - -// AsFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. -func (abgfsr AzureBackupGoalFeatureSupportRequest) AsFeatureSupportRequest() (*FeatureSupportRequest, bool) { - return nil, false -} - -// AsBasicFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. -func (abgfsr AzureBackupGoalFeatureSupportRequest) AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) { - return &abgfsr, true -} - // AzureBackupServerContainer azureBackupServer (DPMVenus) workload-specific protection container. type AzureBackupServerContainer struct { // CanReRegister - Specifies whether the container is re-registrable. @@ -547,8 +465,6 @@ type AzureFileshareProtectedItem struct { KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` // ExtendedInfo - Additional information with this backup item. ExtendedInfo *AzureFileshareProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // HealthStatus - backups running status for this backup item. Possible values include: 'HealthStatusPassed', 'HealthStatusActionRequired', 'HealthStatusActionSuggested', 'HealthStatusInvalid' - HealthStatus HealthStatus `json:"healthStatus,omitempty"` // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' @@ -604,9 +520,6 @@ func (afpi AzureFileshareProtectedItem) MarshalJSON() ([]byte, error) { if afpi.ExtendedInfo != nil { objectMap["extendedInfo"] = afpi.ExtendedInfo } - if afpi.HealthStatus != "" { - objectMap["healthStatus"] = afpi.HealthStatus - } if afpi.BackupManagementType != "" { objectMap["backupManagementType"] = afpi.BackupManagementType } @@ -954,13 +867,13 @@ func (afspir AzureFileShareProvisionILRRequest) AsBasicILRRequest() (BasicILRReq // AzureFileShareRecoveryPoint azure File Share workload specific backup copy. type AzureFileShareRecoveryPoint struct { - // RecoveryPointType - READ-ONLY; Type of the backup copy. Specifies whether it is a crash consistent backup or app consistent. + // RecoveryPointType - Type of the backup copy. Specifies whether it is a crash consistent backup or app consistent. RecoveryPointType *string `json:"recoveryPointType,omitempty"` - // RecoveryPointTime - READ-ONLY; Time at which this backup copy was created. + // RecoveryPointTime - Time at which this backup copy was created. RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` - // FileShareSnapshotURI - READ-ONLY; Contains Url to the snapshot of fileshare, if applicable + // FileShareSnapshotURI - Contains Url to the snapshot of fileshare, if applicable FileShareSnapshotURI *string `json:"fileShareSnapshotUri,omitempty"` - // RecoveryPointSizeInGB - READ-ONLY; Contains recovery point size + // RecoveryPointSizeInGB - Contains recovery point size RecoveryPointSizeInGB *int32 `json:"recoveryPointSizeInGB,omitempty"` // ObjectType - Possible values include: 'ObjectTypeBasicRecoveryPointObjectTypeRecoveryPoint', 'ObjectTypeBasicRecoveryPointObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeBasicRecoveryPointObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeBasicRecoveryPointObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeBasicRecoveryPointObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeBasicRecoveryPointObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeBasicRecoveryPointObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeBasicRecoveryPointObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeBasicRecoveryPointObjectTypeGenericRecoveryPoint', 'ObjectTypeBasicRecoveryPointObjectTypeIaasVMRecoveryPoint' ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` @@ -970,6 +883,18 @@ type AzureFileShareRecoveryPoint struct { func (afsrp AzureFileShareRecoveryPoint) MarshalJSON() ([]byte, error) { afsrp.ObjectType = ObjectTypeBasicRecoveryPointObjectTypeAzureFileShareRecoveryPoint objectMap := make(map[string]interface{}) + if afsrp.RecoveryPointType != nil { + objectMap["recoveryPointType"] = afsrp.RecoveryPointType + } + if afsrp.RecoveryPointTime != nil { + objectMap["recoveryPointTime"] = afsrp.RecoveryPointTime + } + if afsrp.FileShareSnapshotURI != nil { + objectMap["fileShareSnapshotUri"] = afsrp.FileShareSnapshotURI + } + if afsrp.RecoveryPointSizeInGB != nil { + objectMap["recoveryPointSizeInGB"] = afsrp.RecoveryPointSizeInGB + } if afsrp.ObjectType != "" { objectMap["objectType"] = afsrp.ObjectType } @@ -2795,222 +2720,6 @@ func (aispp *AzureIaaSVMProtectionPolicy) UnmarshalJSON(body []byte) error { return nil } -// BasicAzureRecoveryServiceVaultProtectionIntent azure Recovery Services Vault specific protection intent item. -type BasicAzureRecoveryServiceVaultProtectionIntent interface { - AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) - AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) - AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) - AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) -} - -// AzureRecoveryServiceVaultProtectionIntent azure Recovery Services Vault specific protection intent item. -type AzureRecoveryServiceVaultProtectionIntent struct { - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId - ItemID *string `json:"itemId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' - ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` -} - -func unmarshalBasicAzureRecoveryServiceVaultProtectionIntent(body []byte) (BasicAzureRecoveryServiceVaultProtectionIntent, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["protectionIntentItemType"] { - case string(ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent): - var awapi AzureWorkloadAutoProtectionIntent - err := json.Unmarshal(body, &awapi) - return awapi, err - case string(ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent): - var awsapi AzureWorkloadSQLAutoProtectionIntent - err := json.Unmarshal(body, &awsapi) - return awsapi, err - default: - var arsvpi AzureRecoveryServiceVaultProtectionIntent - err := json.Unmarshal(body, &arsvpi) - return arsvpi, err - } -} -func unmarshalBasicAzureRecoveryServiceVaultProtectionIntentArray(body []byte) ([]BasicAzureRecoveryServiceVaultProtectionIntent, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - arsvpiArray := make([]BasicAzureRecoveryServiceVaultProtectionIntent, len(rawMessages)) - - for index, rawMessage := range rawMessages { - arsvpi, err := unmarshalBasicAzureRecoveryServiceVaultProtectionIntent(*rawMessage) - if err != nil { - return nil, err - } - arsvpiArray[index] = arsvpi - } - return arsvpiArray, nil -} - -// MarshalJSON is the custom marshaler for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) MarshalJSON() ([]byte, error) { - arsvpi.ProtectionIntentItemType = ProtectionIntentItemTypeRecoveryServiceVaultItem - objectMap := make(map[string]interface{}) - if arsvpi.BackupManagementType != "" { - objectMap["backupManagementType"] = arsvpi.BackupManagementType - } - if arsvpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = arsvpi.SourceResourceID - } - if arsvpi.ItemID != nil { - objectMap["itemId"] = arsvpi.ItemID - } - if arsvpi.PolicyID != nil { - objectMap["policyId"] = arsvpi.PolicyID - } - if arsvpi.ProtectionState != "" { - objectMap["protectionState"] = arsvpi.ProtectionState - } - if arsvpi.ProtectionIntentItemType != "" { - objectMap["protectionIntentItemType"] = arsvpi.ProtectionIntentItemType - } - return json.Marshal(objectMap) -} - -// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { - return &arsvpi, true -} - -// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { - return &arsvpi, true -} - -// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { - return nil, false -} - -// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { - return nil, false -} - -// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { - return nil, false -} - -// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { - return nil, false -} - -// AsProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { - return nil, false -} - -// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. -func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { - return &arsvpi, true -} - -// AzureResourceProtectionIntent iaaS VM specific backup protection intent item. -type AzureResourceProtectionIntent struct { - // FriendlyName - Friendly name of the VM represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId - ItemID *string `json:"itemId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' - ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) MarshalJSON() ([]byte, error) { - arpi.ProtectionIntentItemType = ProtectionIntentItemTypeAzureResourceItem - objectMap := make(map[string]interface{}) - if arpi.FriendlyName != nil { - objectMap["friendlyName"] = arpi.FriendlyName - } - if arpi.BackupManagementType != "" { - objectMap["backupManagementType"] = arpi.BackupManagementType - } - if arpi.SourceResourceID != nil { - objectMap["sourceResourceId"] = arpi.SourceResourceID - } - if arpi.ItemID != nil { - objectMap["itemId"] = arpi.ItemID - } - if arpi.PolicyID != nil { - objectMap["policyId"] = arpi.PolicyID - } - if arpi.ProtectionState != "" { - objectMap["protectionState"] = arpi.ProtectionState - } - if arpi.ProtectionIntentItemType != "" { - objectMap["protectionIntentItemType"] = arpi.ProtectionIntentItemType - } - return json.Marshal(objectMap) -} - -// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { - return nil, false -} - -// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { - return nil, false -} - -// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { - return &arpi, true -} - -// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { - return nil, false -} - -// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { - return nil, false -} - -// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { - return nil, false -} - -// AsProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { - return nil, false -} - -// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. -func (arpi AzureResourceProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { - return &arpi, true -} - // AzureSQLAGWorkloadContainerProtectionContainer container for SQL workloads under SQL Availability Group. type AzureSQLAGWorkloadContainerProtectionContainer struct { // SourceResourceID - ARM ID of the virtual machine represented by this Azure Workload Container @@ -4132,59 +3841,6 @@ func (avacpc AzureVMAppContainerProtectionContainer) AsBasicProtectionContainer( return &avacpc, true } -// AzureVMResourceFeatureSupportRequest azureResource(IaaS VM) Specific feature support request -type AzureVMResourceFeatureSupportRequest struct { - // VMSize - Size of the resource: VM size(A/D series etc) in case of IaasVM - VMSize *string `json:"vmSize,omitempty"` - // VMSku - SKUs (Premium/Managed etc) in case of IaasVM - VMSku *string `json:"vmSku,omitempty"` - // FeatureType - Possible values include: 'FeatureTypeFeatureSupportRequest', 'FeatureTypeAzureBackupGoals', 'FeatureTypeAzureVMResourceBackup' - FeatureType FeatureType `json:"featureType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureVMResourceFeatureSupportRequest. -func (avrfsr AzureVMResourceFeatureSupportRequest) MarshalJSON() ([]byte, error) { - avrfsr.FeatureType = FeatureTypeAzureVMResourceBackup - objectMap := make(map[string]interface{}) - if avrfsr.VMSize != nil { - objectMap["vmSize"] = avrfsr.VMSize - } - if avrfsr.VMSku != nil { - objectMap["vmSku"] = avrfsr.VMSku - } - if avrfsr.FeatureType != "" { - objectMap["featureType"] = avrfsr.FeatureType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupGoalFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureVMResourceFeatureSupportRequest. -func (avrfsr AzureVMResourceFeatureSupportRequest) AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) { - return nil, false -} - -// AsAzureVMResourceFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureVMResourceFeatureSupportRequest. -func (avrfsr AzureVMResourceFeatureSupportRequest) AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) { - return &avrfsr, true -} - -// AsFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureVMResourceFeatureSupportRequest. -func (avrfsr AzureVMResourceFeatureSupportRequest) AsFeatureSupportRequest() (*FeatureSupportRequest, bool) { - return nil, false -} - -// AsBasicFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureVMResourceFeatureSupportRequest. -func (avrfsr AzureVMResourceFeatureSupportRequest) AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) { - return &avrfsr, true -} - -// AzureVMResourceFeatureSupportResponse response for feature support requests for Azure IaasVm -type AzureVMResourceFeatureSupportResponse struct { - autorest.Response `json:"-"` - // SupportStatus - Support status of feature. Possible values include: 'SupportStatusInvalid', 'SupportStatusSupported', 'SupportStatusDefaultOFF', 'SupportStatusDefaultON', 'SupportStatusNotSupported' - SupportStatus SupportStatus `json:"supportStatus,omitempty"` -} - // BasicAzureVMWorkloadItem azure VM workload-specific workload item. type BasicAzureVMWorkloadItem interface { AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) @@ -7231,134 +6887,10 @@ func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsBasicWorkloadItem() (Bas return &avwsiwi, true } -// BasicAzureWorkloadAutoProtectionIntent azure Recovery Services Vault specific protection intent item. -type BasicAzureWorkloadAutoProtectionIntent interface { - AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) - AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) -} - -// AzureWorkloadAutoProtectionIntent azure Recovery Services Vault specific protection intent item. -type AzureWorkloadAutoProtectionIntent struct { - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId - ItemID *string `json:"itemId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' - ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` -} - -func unmarshalBasicAzureWorkloadAutoProtectionIntent(body []byte) (BasicAzureWorkloadAutoProtectionIntent, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["protectionIntentItemType"] { - case string(ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent): - var awsapi AzureWorkloadSQLAutoProtectionIntent - err := json.Unmarshal(body, &awsapi) - return awsapi, err - default: - var awapi AzureWorkloadAutoProtectionIntent - err := json.Unmarshal(body, &awapi) - return awapi, err - } -} -func unmarshalBasicAzureWorkloadAutoProtectionIntentArray(body []byte) ([]BasicAzureWorkloadAutoProtectionIntent, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - awapiArray := make([]BasicAzureWorkloadAutoProtectionIntent, len(rawMessages)) - - for index, rawMessage := range rawMessages { - awapi, err := unmarshalBasicAzureWorkloadAutoProtectionIntent(*rawMessage) - if err != nil { - return nil, err - } - awapiArray[index] = awapi - } - return awapiArray, nil -} - -// MarshalJSON is the custom marshaler for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) MarshalJSON() ([]byte, error) { - awapi.ProtectionIntentItemType = ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent - objectMap := make(map[string]interface{}) - if awapi.BackupManagementType != "" { - objectMap["backupManagementType"] = awapi.BackupManagementType - } - if awapi.SourceResourceID != nil { - objectMap["sourceResourceId"] = awapi.SourceResourceID - } - if awapi.ItemID != nil { - objectMap["itemId"] = awapi.ItemID - } - if awapi.PolicyID != nil { - objectMap["policyId"] = awapi.PolicyID - } - if awapi.ProtectionState != "" { - objectMap["protectionState"] = awapi.ProtectionState - } - if awapi.ProtectionIntentItemType != "" { - objectMap["protectionIntentItemType"] = awapi.ProtectionIntentItemType - } - return json.Marshal(objectMap) -} - -// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { - return nil, false -} - -// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { - return &awapi, true -} - -// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { - return nil, false -} - -// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { - return &awapi, true -} - -// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { - return &awapi, true -} - -// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { - return nil, false -} - -// AsProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { - return nil, false -} - -// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. -func (awapi AzureWorkloadAutoProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { - return &awapi, true -} - // AzureWorkloadBackupRequest azureWorkload workload-specific backup request. type AzureWorkloadBackupRequest struct { - // BackupType - Type of backup, viz. Full, Differential, Log or CopyOnlyFull. Possible values include: 'TypeEnumInvalid', 'TypeEnumFull', 'TypeEnumDifferential', 'TypeEnumLog', 'TypeEnumCopyOnlyFull', 'TypeEnumIncremental' - BackupType TypeEnum `json:"backupType,omitempty"` + // BackupType - Type of backup, viz. Full, Differential, Log or CopyOnlyFull. Possible values include: 'TypeInvalid', 'TypeFull', 'TypeDifferential', 'TypeLog', 'TypeCopyOnlyFull', 'TypeIncremental' + BackupType Type `json:"backupType,omitempty"` // EnableCompression - Bool for Compression setting EnableCompression *bool `json:"enableCompression,omitempty"` // RecoveryPointExpiryTimeInUTC - Backup copy will expire after the time specified (UTC). @@ -7788,9 +7320,9 @@ type BasicAzureWorkloadPointInTimeRecoveryPoint interface { type AzureWorkloadPointInTimeRecoveryPoint struct { // TimeRanges - List of log ranges TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + // RecoveryPointTimeInUTC - UTC time at which recovery point was created RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' + // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' Type RestorePointType `json:"type,omitempty"` // RecoveryPointTierDetails - Recovery point tier information. RecoveryPointTierDetails *[]RecoveryPointTierInformation `json:"recoveryPointTierDetails,omitempty"` @@ -7844,6 +7376,12 @@ func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) MarshalJSON() ([]byte, erro if awpitrp.TimeRanges != nil { objectMap["timeRanges"] = awpitrp.TimeRanges } + if awpitrp.RecoveryPointTimeInUTC != nil { + objectMap["recoveryPointTimeInUTC"] = awpitrp.RecoveryPointTimeInUTC + } + if awpitrp.Type != "" { + objectMap["type"] = awpitrp.Type + } if awpitrp.RecoveryPointTierDetails != nil { objectMap["recoveryPointTierDetails"] = awpitrp.RecoveryPointTierDetails } @@ -7941,9 +7479,6 @@ type AzureWorkloadPointInTimeRestoreRequest struct { TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` - // TargetVirtualMachineID - This is the complete ARM Id of the target VM - // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} - TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` // ObjectType - Possible values include: 'ObjectTypeBasicRestoreRequestObjectTypeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeIaasVMRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeIaasVMRestoreWithRehydrationRequest' ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } @@ -7970,9 +7505,6 @@ func (awpitrr AzureWorkloadPointInTimeRestoreRequest) MarshalJSON() ([]byte, err if awpitrr.RecoveryMode != "" { objectMap["recoveryMode"] = awpitrr.RecoveryMode } - if awpitrr.TargetVirtualMachineID != nil { - objectMap["targetVirtualMachineId"] = awpitrr.TargetVirtualMachineID - } if awpitrr.ObjectType != "" { objectMap["objectType"] = awpitrr.ObjectType } @@ -8099,9 +7631,9 @@ type BasicAzureWorkloadRecoveryPoint interface { // AzureWorkloadRecoveryPoint workload specific recovery point, specifically encapsulates full/diff recovery // point type AzureWorkloadRecoveryPoint struct { - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + // RecoveryPointTimeInUTC - UTC time at which recovery point was created RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' + // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' Type RestorePointType `json:"type,omitempty"` // RecoveryPointTierDetails - Recovery point tier information. RecoveryPointTierDetails *[]RecoveryPointTierInformation `json:"recoveryPointTierDetails,omitempty"` @@ -8168,6 +7700,12 @@ func unmarshalBasicAzureWorkloadRecoveryPointArray(body []byte) ([]BasicAzureWor func (awrp AzureWorkloadRecoveryPoint) MarshalJSON() ([]byte, error) { awrp.ObjectType = ObjectTypeBasicRecoveryPointObjectTypeAzureWorkloadRecoveryPoint objectMap := make(map[string]interface{}) + if awrp.RecoveryPointTimeInUTC != nil { + objectMap["recoveryPointTimeInUTC"] = awrp.RecoveryPointTimeInUTC + } + if awrp.Type != "" { + objectMap["type"] = awrp.Type + } if awrp.RecoveryPointTierDetails != nil { objectMap["recoveryPointTierDetails"] = awrp.RecoveryPointTierDetails } @@ -8280,9 +7818,6 @@ type AzureWorkloadRestoreRequest struct { TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` - // TargetVirtualMachineID - This is the complete ARM Id of the target VM - // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} - TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` // ObjectType - Possible values include: 'ObjectTypeBasicRestoreRequestObjectTypeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeIaasVMRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeIaasVMRestoreWithRehydrationRequest' ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } @@ -8375,9 +7910,6 @@ func (awrr AzureWorkloadRestoreRequest) MarshalJSON() ([]byte, error) { if awrr.RecoveryMode != "" { objectMap["recoveryMode"] = awrr.RecoveryMode } - if awrr.TargetVirtualMachineID != nil { - objectMap["targetVirtualMachineId"] = awrr.TargetVirtualMachineID - } if awrr.ObjectType != "" { objectMap["objectType"] = awrr.ObjectType } @@ -8493,9 +8025,9 @@ func (awrr AzureWorkloadRestoreRequest) AsBasicRestoreRequest() (BasicRestoreReq type AzureWorkloadSAPHanaPointInTimeRecoveryPoint struct { // TimeRanges - List of log ranges TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + // RecoveryPointTimeInUTC - UTC time at which recovery point was created RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' + // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' Type RestorePointType `json:"type,omitempty"` // RecoveryPointTierDetails - Recovery point tier information. RecoveryPointTierDetails *[]RecoveryPointTierInformation `json:"recoveryPointTierDetails,omitempty"` @@ -8512,7 +8044,13 @@ func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) MarshalJSON() ([]b if awshpitrp.TimeRanges != nil { objectMap["timeRanges"] = awshpitrp.TimeRanges } - if awshpitrp.RecoveryPointTierDetails != nil { + if awshpitrp.RecoveryPointTimeInUTC != nil { + objectMap["recoveryPointTimeInUTC"] = awshpitrp.RecoveryPointTimeInUTC + } + if awshpitrp.Type != "" { + objectMap["type"] = awshpitrp.Type + } + if awshpitrp.RecoveryPointTierDetails != nil { objectMap["recoveryPointTierDetails"] = awshpitrp.RecoveryPointTierDetails } if awshpitrp.RecoveryPointMoveReadinessInfo != nil { @@ -8616,9 +8154,6 @@ type AzureWorkloadSAPHanaPointInTimeRestoreRequest struct { TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` - // TargetVirtualMachineID - This is the complete ARM Id of the target VM - // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} - TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` // ObjectType - Possible values include: 'ObjectTypeBasicRestoreRequestObjectTypeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeIaasVMRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeIaasVMRestoreWithRehydrationRequest' ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } @@ -8682,9 +8217,6 @@ func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) MarshalJSON() ([] if awshpitrr.RecoveryMode != "" { objectMap["recoveryMode"] = awshpitrr.RecoveryMode } - if awshpitrr.TargetVirtualMachineID != nil { - objectMap["targetVirtualMachineId"] = awshpitrr.TargetVirtualMachineID - } if awshpitrr.ObjectType != "" { objectMap["objectType"] = awshpitrr.ObjectType } @@ -8813,9 +8345,6 @@ type AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest struct { TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` - // TargetVirtualMachineID - This is the complete ARM Id of the target VM - // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} - TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` // ObjectType - Possible values include: 'ObjectTypeBasicRestoreRequestObjectTypeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeIaasVMRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeIaasVMRestoreWithRehydrationRequest' ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } @@ -8845,9 +8374,6 @@ func (awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) Ma if awshpitrwrr.RecoveryMode != "" { objectMap["recoveryMode"] = awshpitrwrr.RecoveryMode } - if awshpitrwrr.TargetVirtualMachineID != nil { - objectMap["targetVirtualMachineId"] = awshpitrwrr.TargetVirtualMachineID - } if awshpitrwrr.ObjectType != "" { objectMap["objectType"] = awshpitrwrr.ObjectType } @@ -8962,9 +8488,9 @@ func (awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) As // AzureWorkloadSAPHanaRecoveryPoint sAPHana specific recoverypoint, specifically encapsulates full/diff // recoverypoints type AzureWorkloadSAPHanaRecoveryPoint struct { - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + // RecoveryPointTimeInUTC - UTC time at which recovery point was created RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' + // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' Type RestorePointType `json:"type,omitempty"` // RecoveryPointTierDetails - Recovery point tier information. RecoveryPointTierDetails *[]RecoveryPointTierInformation `json:"recoveryPointTierDetails,omitempty"` @@ -8978,6 +8504,12 @@ type AzureWorkloadSAPHanaRecoveryPoint struct { func (awshrp AzureWorkloadSAPHanaRecoveryPoint) MarshalJSON() ([]byte, error) { awshrp.ObjectType = ObjectTypeBasicRecoveryPointObjectTypeAzureWorkloadSAPHanaRecoveryPoint objectMap := make(map[string]interface{}) + if awshrp.RecoveryPointTimeInUTC != nil { + objectMap["recoveryPointTimeInUTC"] = awshrp.RecoveryPointTimeInUTC + } + if awshrp.Type != "" { + objectMap["type"] = awshrp.Type + } if awshrp.RecoveryPointTierDetails != nil { objectMap["recoveryPointTierDetails"] = awshrp.RecoveryPointTierDetails } @@ -9081,9 +8613,6 @@ type AzureWorkloadSAPHanaRestoreRequest struct { TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` - // TargetVirtualMachineID - This is the complete ARM Id of the target VM - // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} - TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` // ObjectType - Possible values include: 'ObjectTypeBasicRestoreRequestObjectTypeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeIaasVMRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeIaasVMRestoreWithRehydrationRequest' ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } @@ -9152,9 +8681,6 @@ func (awshrr AzureWorkloadSAPHanaRestoreRequest) MarshalJSON() ([]byte, error) { if awshrr.RecoveryMode != "" { objectMap["recoveryMode"] = awshrr.RecoveryMode } - if awshrr.TargetVirtualMachineID != nil { - objectMap["targetVirtualMachineId"] = awshrr.TargetVirtualMachineID - } if awshrr.ObjectType != "" { objectMap["objectType"] = awshrr.ObjectType } @@ -9281,9 +8807,6 @@ type AzureWorkloadSAPHanaRestoreWithRehydrateRequest struct { TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` - // TargetVirtualMachineID - This is the complete ARM Id of the target VM - // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} - TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` // ObjectType - Possible values include: 'ObjectTypeBasicRestoreRequestObjectTypeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeIaasVMRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeIaasVMRestoreWithRehydrationRequest' ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } @@ -9310,9 +8833,6 @@ func (awshrwrr AzureWorkloadSAPHanaRestoreWithRehydrateRequest) MarshalJSON() ([ if awshrwrr.RecoveryMode != "" { objectMap["recoveryMode"] = awshrwrr.RecoveryMode } - if awshrwrr.TargetVirtualMachineID != nil { - objectMap["targetVirtualMachineId"] = awshrwrr.TargetVirtualMachineID - } if awshrwrr.ObjectType != "" { objectMap["objectType"] = awshrwrr.ObjectType } @@ -9424,92 +8944,6 @@ func (awshrwrr AzureWorkloadSAPHanaRestoreWithRehydrateRequest) AsBasicRestoreRe return &awshrwrr, true } -// AzureWorkloadSQLAutoProtectionIntent azure Workload SQL Auto Protection intent item. -type AzureWorkloadSQLAutoProtectionIntent struct { - // WorkloadItemType - Workload item type of the item for which intent is to be set. Possible values include: 'WorkloadItemTypeInvalid', 'WorkloadItemTypeSQLInstance', 'WorkloadItemTypeSQLDataBase', 'WorkloadItemTypeSAPHanaSystem', 'WorkloadItemTypeSAPHanaDatabase', 'WorkloadItemTypeSAPAseSystem', 'WorkloadItemTypeSAPAseDatabase' - WorkloadItemType WorkloadItemType `json:"workloadItemType,omitempty"` - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId - ItemID *string `json:"itemId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' - ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) MarshalJSON() ([]byte, error) { - awsapi.ProtectionIntentItemType = ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent - objectMap := make(map[string]interface{}) - if awsapi.WorkloadItemType != "" { - objectMap["workloadItemType"] = awsapi.WorkloadItemType - } - if awsapi.BackupManagementType != "" { - objectMap["backupManagementType"] = awsapi.BackupManagementType - } - if awsapi.SourceResourceID != nil { - objectMap["sourceResourceId"] = awsapi.SourceResourceID - } - if awsapi.ItemID != nil { - objectMap["itemId"] = awsapi.ItemID - } - if awsapi.PolicyID != nil { - objectMap["policyId"] = awsapi.PolicyID - } - if awsapi.ProtectionState != "" { - objectMap["protectionState"] = awsapi.ProtectionState - } - if awsapi.ProtectionIntentItemType != "" { - objectMap["protectionIntentItemType"] = awsapi.ProtectionIntentItemType - } - return json.Marshal(objectMap) -} - -// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { - return nil, false -} - -// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { - return &awsapi, true -} - -// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { - return nil, false -} - -// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { - return nil, false -} - -// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { - return &awsapi, true -} - -// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { - return &awsapi, true -} - -// AsProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { - return nil, false -} - -// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. -func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { - return &awsapi, true -} - // AzureWorkloadSQLPointInTimeRecoveryPoint recovery point specific to PointInTime type AzureWorkloadSQLPointInTimeRecoveryPoint struct { // TimeRanges - List of log ranges @@ -9518,9 +8952,9 @@ type AzureWorkloadSQLPointInTimeRecoveryPoint struct { // When a specific recovery point is accessed using GetRecoveryPoint // Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter ExtendedInfo *AzureWorkloadSQLRecoveryPointExtendedInfo `json:"extendedInfo,omitempty"` - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + // RecoveryPointTimeInUTC - UTC time at which recovery point was created RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' + // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' Type RestorePointType `json:"type,omitempty"` // RecoveryPointTierDetails - Recovery point tier information. RecoveryPointTierDetails *[]RecoveryPointTierInformation `json:"recoveryPointTierDetails,omitempty"` @@ -9540,6 +8974,12 @@ func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) MarshalJSON() ([]byte, if awspitrp.ExtendedInfo != nil { objectMap["extendedInfo"] = awspitrp.ExtendedInfo } + if awspitrp.RecoveryPointTimeInUTC != nil { + objectMap["recoveryPointTimeInUTC"] = awspitrp.RecoveryPointTimeInUTC + } + if awspitrp.Type != "" { + objectMap["type"] = awspitrp.Type + } if awspitrp.RecoveryPointTierDetails != nil { objectMap["recoveryPointTierDetails"] = awspitrp.RecoveryPointTierDetails } @@ -9650,9 +9090,6 @@ type AzureWorkloadSQLPointInTimeRestoreRequest struct { TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` - // TargetVirtualMachineID - This is the complete ARM Id of the target VM - // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} - TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` // ObjectType - Possible values include: 'ObjectTypeBasicRestoreRequestObjectTypeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeIaasVMRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeIaasVMRestoreWithRehydrationRequest' ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } @@ -9725,9 +9162,6 @@ func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) MarshalJSON() ([]byte, if awspitrr.RecoveryMode != "" { objectMap["recoveryMode"] = awspitrr.RecoveryMode } - if awspitrr.TargetVirtualMachineID != nil { - objectMap["targetVirtualMachineId"] = awspitrr.TargetVirtualMachineID - } if awspitrr.ObjectType != "" { objectMap["objectType"] = awspitrr.ObjectType } @@ -9862,9 +9296,6 @@ type AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest struct { TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` - // TargetVirtualMachineID - This is the complete ARM Id of the target VM - // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} - TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` // ObjectType - Possible values include: 'ObjectTypeBasicRestoreRequestObjectTypeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeIaasVMRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeIaasVMRestoreWithRehydrationRequest' ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } @@ -9903,9 +9334,6 @@ func (awspitrwrr AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) Marshal if awspitrwrr.RecoveryMode != "" { objectMap["recoveryMode"] = awspitrwrr.RecoveryMode } - if awspitrwrr.TargetVirtualMachineID != nil { - objectMap["targetVirtualMachineId"] = awspitrwrr.TargetVirtualMachineID - } if awspitrwrr.ObjectType != "" { objectMap["objectType"] = awspitrwrr.ObjectType } @@ -10031,9 +9459,9 @@ type AzureWorkloadSQLRecoveryPoint struct { // When a specific recovery point is accessed using GetRecoveryPoint // Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter ExtendedInfo *AzureWorkloadSQLRecoveryPointExtendedInfo `json:"extendedInfo,omitempty"` - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + // RecoveryPointTimeInUTC - UTC time at which recovery point was created RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' + // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' Type RestorePointType `json:"type,omitempty"` // RecoveryPointTierDetails - Recovery point tier information. RecoveryPointTierDetails *[]RecoveryPointTierInformation `json:"recoveryPointTierDetails,omitempty"` @@ -10087,6 +9515,12 @@ func (awsrp AzureWorkloadSQLRecoveryPoint) MarshalJSON() ([]byte, error) { if awsrp.ExtendedInfo != nil { objectMap["extendedInfo"] = awsrp.ExtendedInfo } + if awsrp.RecoveryPointTimeInUTC != nil { + objectMap["recoveryPointTimeInUTC"] = awsrp.RecoveryPointTimeInUTC + } + if awsrp.Type != "" { + objectMap["type"] = awsrp.Type + } if awsrp.RecoveryPointTierDetails != nil { objectMap["recoveryPointTierDetails"] = awsrp.RecoveryPointTierDetails } @@ -10171,18 +9605,12 @@ func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicRecoveryPoint() (BasicRecovery // AzureWorkloadSQLRecoveryPointExtendedInfo extended info class details type AzureWorkloadSQLRecoveryPointExtendedInfo struct { - // DataDirectoryTimeInUTC - READ-ONLY; UTC time at which data directory info was captured + // DataDirectoryTimeInUTC - UTC time at which data directory info was captured DataDirectoryTimeInUTC *date.Time `json:"dataDirectoryTimeInUTC,omitempty"` - // DataDirectoryPaths - READ-ONLY; List of data directory paths during restore operation. + // DataDirectoryPaths - List of data directory paths during restore operation. DataDirectoryPaths *[]SQLDataDirectory `json:"dataDirectoryPaths,omitempty"` } -// MarshalJSON is the custom marshaler for AzureWorkloadSQLRecoveryPointExtendedInfo. -func (awsrpei AzureWorkloadSQLRecoveryPointExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - // BasicAzureWorkloadSQLRestoreRequest azureWorkload SQL -specific restore. Specifically for full/diff restore type BasicAzureWorkloadSQLRestoreRequest interface { AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) @@ -10210,9 +9638,6 @@ type AzureWorkloadSQLRestoreRequest struct { TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` - // TargetVirtualMachineID - This is the complete ARM Id of the target VM - // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} - TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` // ObjectType - Possible values include: 'ObjectTypeBasicRestoreRequestObjectTypeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeIaasVMRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeIaasVMRestoreWithRehydrationRequest' ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } @@ -10290,9 +9715,6 @@ func (awsrr AzureWorkloadSQLRestoreRequest) MarshalJSON() ([]byte, error) { if awsrr.RecoveryMode != "" { objectMap["recoveryMode"] = awsrr.RecoveryMode } - if awsrr.TargetVirtualMachineID != nil { - objectMap["targetVirtualMachineId"] = awsrr.TargetVirtualMachineID - } if awsrr.ObjectType != "" { objectMap["objectType"] = awsrr.ObjectType } @@ -10425,9 +9847,6 @@ type AzureWorkloadSQLRestoreWithRehydrateRequest struct { TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` - // TargetVirtualMachineID - This is the complete ARM Id of the target VM - // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} - TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` // ObjectType - Possible values include: 'ObjectTypeBasicRestoreRequestObjectTypeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeIaasVMRestoreRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest', 'ObjectTypeBasicRestoreRequestObjectTypeIaasVMRestoreWithRehydrationRequest' ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` } @@ -10463,9 +9882,6 @@ func (awsrwrr AzureWorkloadSQLRestoreWithRehydrateRequest) MarshalJSON() ([]byte if awsrwrr.RecoveryMode != "" { objectMap["recoveryMode"] = awsrwrr.RecoveryMode } - if awsrwrr.TargetVirtualMachineID != nil { - objectMap["targetVirtualMachineId"] = awsrwrr.TargetVirtualMachineID - } if awsrwrr.ObjectType != "" { objectMap["objectType"] = awsrwrr.ObjectType } @@ -10587,12 +10003,6 @@ type BEKDetails struct { SecretData *string `json:"secretData,omitempty"` } -// BMSAADPropertiesQueryObject filters to list backup items. -type BMSAADPropertiesQueryObject 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"` -} - // BMSBackupEngineQueryObject query parameters to fetch list of backup engines. type BMSBackupEngineQueryObject struct { // Expand - attribute to add extended info @@ -10609,12 +10019,6 @@ type BMSBackupEnginesQueryObject struct { Expand *string `json:"expand,omitempty"` } -// BMSBackupSummariesQueryObject query parameters to fetch backup summaries. -type BMSBackupSummariesQueryObject struct { - // Type - Backup management type for this container. Possible values include: 'TypeInvalid', 'TypeBackupProtectedItemCountSummary', 'TypeBackupProtectionContainerCountSummary' - Type Type `json:"type,omitempty"` -} - // BMSContainerQueryObject the query filters that can be used with the list containers API. type BMSContainerQueryObject struct { // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' @@ -10759,214 +10163,6 @@ type BMSWorkloadItemQueryObject struct { ProtectionStatus ProtectionStatus `json:"protectionStatus,omitempty"` } -// ClientDiscoveryDisplay localized display information of an operation. -type ClientDiscoveryDisplay struct { - // Provider - Name of the provider for display purposes - Provider *string `json:"provider,omitempty"` - // Resource - ResourceType for which this Operation can be performed. - Resource *string `json:"resource,omitempty"` - // Operation - Operations Name itself. - Operation *string `json:"operation,omitempty"` - // Description - Description of the operation having details of what operation is about. - Description *string `json:"description,omitempty"` -} - -// ClientDiscoveryForLogSpecification class to represent shoebox log specification in json client -// discovery. -type ClientDiscoveryForLogSpecification struct { - // Name - Name for shoebox log specification. - Name *string `json:"name,omitempty"` - // DisplayName - Localized display name - DisplayName *string `json:"displayName,omitempty"` - // BlobDuration - blob duration of shoebox log specification - BlobDuration *string `json:"blobDuration,omitempty"` -} - -// ClientDiscoveryForProperties class to represent shoebox properties in json client discovery. -type ClientDiscoveryForProperties struct { - // ServiceSpecification - Operation properties. - ServiceSpecification *ClientDiscoveryForServiceSpecification `json:"serviceSpecification,omitempty"` -} - -// ClientDiscoveryForServiceSpecification class to represent shoebox service specification in json client -// discovery. -type ClientDiscoveryForServiceSpecification struct { - // LogSpecifications - List of log specifications of this operation. - LogSpecifications *[]ClientDiscoveryForLogSpecification `json:"logSpecifications,omitempty"` -} - -// ClientDiscoveryResponse operations List response which contains list of available APIs. -type ClientDiscoveryResponse struct { - autorest.Response `json:"-"` - // Value - List of available operations. - Value *[]ClientDiscoveryValueForSingleAPI `json:"value,omitempty"` - // NextLink - Link to the next chunk of Response. - NextLink *string `json:"nextLink,omitempty"` -} - -// ClientDiscoveryResponseIterator provides access to a complete listing of -// ClientDiscoveryValueForSingleAPI values. -type ClientDiscoveryResponseIterator struct { - i int - page ClientDiscoveryResponsePage -} - -// NextWithContext 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 *ClientDiscoveryResponseIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ClientDiscoveryResponseIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ClientDiscoveryResponseIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ClientDiscoveryResponseIterator) 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 ClientDiscoveryResponseIterator) Response() ClientDiscoveryResponse { - 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 ClientDiscoveryResponseIterator) Value() ClientDiscoveryValueForSingleAPI { - if !iter.page.NotDone() { - return ClientDiscoveryValueForSingleAPI{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ClientDiscoveryResponseIterator type. -func NewClientDiscoveryResponseIterator(page ClientDiscoveryResponsePage) ClientDiscoveryResponseIterator { - return ClientDiscoveryResponseIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (cdr ClientDiscoveryResponse) IsEmpty() bool { - return cdr.Value == nil || len(*cdr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (cdr ClientDiscoveryResponse) hasNextLink() bool { - return cdr.NextLink != nil && len(*cdr.NextLink) != 0 -} - -// clientDiscoveryResponsePreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cdr ClientDiscoveryResponse) clientDiscoveryResponsePreparer(ctx context.Context) (*http.Request, error) { - if !cdr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cdr.NextLink))) -} - -// ClientDiscoveryResponsePage contains a page of ClientDiscoveryValueForSingleAPI values. -type ClientDiscoveryResponsePage struct { - fn func(context.Context, ClientDiscoveryResponse) (ClientDiscoveryResponse, error) - cdr ClientDiscoveryResponse -} - -// NextWithContext 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 *ClientDiscoveryResponsePage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ClientDiscoveryResponsePage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.cdr) - if err != nil { - return err - } - page.cdr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *ClientDiscoveryResponsePage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ClientDiscoveryResponsePage) NotDone() bool { - return !page.cdr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ClientDiscoveryResponsePage) Response() ClientDiscoveryResponse { - return page.cdr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ClientDiscoveryResponsePage) Values() []ClientDiscoveryValueForSingleAPI { - if page.cdr.IsEmpty() { - return nil - } - return *page.cdr.Value -} - -// Creates a new instance of the ClientDiscoveryResponsePage type. -func NewClientDiscoveryResponsePage(cur ClientDiscoveryResponse, getNextPage func(context.Context, ClientDiscoveryResponse) (ClientDiscoveryResponse, error)) ClientDiscoveryResponsePage { - return ClientDiscoveryResponsePage{ - fn: getNextPage, - cdr: cur, - } -} - -// ClientDiscoveryValueForSingleAPI available operation details. -type ClientDiscoveryValueForSingleAPI struct { - // Name - Name of the Operation. - Name *string `json:"name,omitempty"` - // Display - Contains the localized display information for this particular operation - Display *ClientDiscoveryDisplay `json:"display,omitempty"` - // Origin - The intended executor of the operation;governs the display of the operation in the RBAC UX and the audit logs UX - Origin *string `json:"origin,omitempty"` - // Properties - ShoeBox properties for the given operation. - Properties *ClientDiscoveryForProperties `json:"properties,omitempty"` -} - // ClientScriptForConnect client script details for file / folder restore. type ClientScriptForConnect struct { // ScriptContent - File content of the client script for file / folder restore. @@ -11020,493 +10216,26 @@ type ContainerIdentityInfo struct { Audience *string `json:"audience,omitempty"` } -// CrossRegionRestoreRequest ... -type CrossRegionRestoreRequest struct { - // CrossRegionRestoreAccessDetails - Access details for cross region restore - CrossRegionRestoreAccessDetails BasicCrrAccessToken `json:"crossRegionRestoreAccessDetails,omitempty"` - // RestoreRequest - Request object for triggering restore - RestoreRequest BasicRestoreRequest `json:"restoreRequest,omitempty"` +// DailyRetentionFormat daily retention format. +type DailyRetentionFormat struct { + // DaysOfTheMonth - List of days of the month. + DaysOfTheMonth *[]Day `json:"daysOfTheMonth,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for CrossRegionRestoreRequest struct. -func (crrr *CrossRegionRestoreRequest) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "crossRegionRestoreAccessDetails": - if v != nil { - crossRegionRestoreAccessDetails, err := unmarshalBasicCrrAccessToken(*v) - if err != nil { - return err - } - crrr.CrossRegionRestoreAccessDetails = crossRegionRestoreAccessDetails - } - case "restoreRequest": - if v != nil { - restoreRequest, err := unmarshalBasicRestoreRequest(*v) - if err != nil { - return err - } - crrr.RestoreRequest = restoreRequest - } - } - } +// DailyRetentionSchedule daily retention schedule. +type DailyRetentionSchedule struct { + // RetentionTimes - Retention times of retention policy. + RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` + // RetentionDuration - Retention duration of retention Policy. + RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` +} - return nil -} - -// CrossRegionRestoreRequestResource ... -type CrossRegionRestoreRequestResource struct { - // Properties - CrossRegionRestoreRequestResource properties - Properties *CrossRegionRestoreRequest `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for CrossRegionRestoreRequestResource. -func (crrrr CrossRegionRestoreRequestResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if crrrr.Properties != nil { - objectMap["properties"] = crrrr.Properties - } - if crrrr.Location != nil { - objectMap["location"] = crrrr.Location - } - if crrrr.Tags != nil { - objectMap["tags"] = crrrr.Tags - } - if crrrr.ETag != nil { - objectMap["eTag"] = crrrr.ETag - } - return json.Marshal(objectMap) -} - -// CrossRegionRestoreTriggerFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type CrossRegionRestoreTriggerFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CrossRegionRestoreClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CrossRegionRestoreTriggerFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CrossRegionRestoreTriggerFuture.Result. -func (future *CrossRegionRestoreTriggerFuture) result(client CrossRegionRestoreClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.CrossRegionRestoreTriggerFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("backup.CrossRegionRestoreTriggerFuture") - return - } - ar.Response = future.Response() - return -} - -// BasicCrrAccessToken ... -type BasicCrrAccessToken interface { - AsWorkloadCrrAccessToken() (*WorkloadCrrAccessToken, bool) - AsCrrAccessToken() (*CrrAccessToken, bool) -} - -// CrrAccessToken ... -type CrrAccessToken struct { - // AccessTokenString - Access token used for authentication - AccessTokenString *string `json:"accessTokenString,omitempty"` - // SubscriptionID - Subscription Id of the source vault - SubscriptionID *string `json:"subscriptionId,omitempty"` - // ResourceGroupName - Resource Group name of the source vault - ResourceGroupName *string `json:"resourceGroupName,omitempty"` - // ResourceName - Resource Name of the source vault - ResourceName *string `json:"resourceName,omitempty"` - // ResourceID - Resource Id of the source vault - ResourceID *string `json:"resourceId,omitempty"` - // ProtectionContainerID - Protected item container id - ProtectionContainerID *int64 `json:"protectionContainerId,omitempty"` - // RecoveryPointID - Recovery Point Id - RecoveryPointID *string `json:"recoveryPointId,omitempty"` - // RecoveryPointTime - Recovery Point Time - RecoveryPointTime *string `json:"recoveryPointTime,omitempty"` - // ContainerName - Container Unique name - ContainerName *string `json:"containerName,omitempty"` - // ContainerType - Container Type - ContainerType *string `json:"containerType,omitempty"` - // BackupManagementType - Backup Management Type - BackupManagementType *string `json:"backupManagementType,omitempty"` - // DatasourceType - Datasource Type - DatasourceType *string `json:"datasourceType,omitempty"` - // DatasourceName - Datasource Friendly Name - DatasourceName *string `json:"datasourceName,omitempty"` - // DatasourceID - Datasource Id - DatasourceID *string `json:"datasourceId,omitempty"` - // DatasourceContainerName - Datasource Container Unique Name - DatasourceContainerName *string `json:"datasourceContainerName,omitempty"` - // CoordinatorServiceStampID - CoordinatorServiceStampId to be used by BCM in restore call - CoordinatorServiceStampID *string `json:"coordinatorServiceStampId,omitempty"` - // CoordinatorServiceStampURI - CoordinatorServiceStampUri to be used by BCM in restore call - CoordinatorServiceStampURI *string `json:"coordinatorServiceStampUri,omitempty"` - // ProtectionServiceStampID - ProtectionServiceStampId to be used by BCM in restore call - ProtectionServiceStampID *string `json:"protectionServiceStampId,omitempty"` - // ProtectionServiceStampURI - ProtectionServiceStampUri to be used by BCM in restore call - ProtectionServiceStampURI *string `json:"protectionServiceStampUri,omitempty"` - // TokenExtendedInformation - Extended Information about the token like FileSpec etc. - TokenExtendedInformation *string `json:"tokenExtendedInformation,omitempty"` - // RpTierInformation - Recovery point Tier Information - RpTierInformation map[string]*string `json:"rpTierInformation"` - // RpOriginalSAOption - Recovery point information: Original SA option - RpOriginalSAOption *bool `json:"rpOriginalSAOption,omitempty"` - // RpIsManagedVirtualMachine - Recovery point information: Managed virtual machine - RpIsManagedVirtualMachine *bool `json:"rpIsManagedVirtualMachine,omitempty"` - // RpVMSizeDescription - Recovery point information: VM size description - RpVMSizeDescription *string `json:"rpVMSizeDescription,omitempty"` - // BMSActiveRegion - Active region name of BMS Stamp - BMSActiveRegion *string `json:"bMSActiveRegion,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeBasicCrrAccessTokenObjectTypeCrrAccessToken', 'ObjectTypeBasicCrrAccessTokenObjectTypeWorkloadCrrAccessToken' - ObjectType ObjectTypeBasicCrrAccessToken `json:"objectType,omitempty"` -} - -func unmarshalBasicCrrAccessToken(body []byte) (BasicCrrAccessToken, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeBasicCrrAccessTokenObjectTypeWorkloadCrrAccessToken): - var wcat WorkloadCrrAccessToken - err := json.Unmarshal(body, &wcat) - return wcat, err - default: - var cat CrrAccessToken - err := json.Unmarshal(body, &cat) - return cat, err - } -} -func unmarshalBasicCrrAccessTokenArray(body []byte) ([]BasicCrrAccessToken, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - catArray := make([]BasicCrrAccessToken, len(rawMessages)) - - for index, rawMessage := range rawMessages { - cat, err := unmarshalBasicCrrAccessToken(*rawMessage) - if err != nil { - return nil, err - } - catArray[index] = cat - } - return catArray, nil -} - -// MarshalJSON is the custom marshaler for CrrAccessToken. -func (cat CrrAccessToken) MarshalJSON() ([]byte, error) { - cat.ObjectType = ObjectTypeBasicCrrAccessTokenObjectTypeCrrAccessToken - objectMap := make(map[string]interface{}) - if cat.AccessTokenString != nil { - objectMap["accessTokenString"] = cat.AccessTokenString - } - if cat.SubscriptionID != nil { - objectMap["subscriptionId"] = cat.SubscriptionID - } - if cat.ResourceGroupName != nil { - objectMap["resourceGroupName"] = cat.ResourceGroupName - } - if cat.ResourceName != nil { - objectMap["resourceName"] = cat.ResourceName - } - if cat.ResourceID != nil { - objectMap["resourceId"] = cat.ResourceID - } - if cat.ProtectionContainerID != nil { - objectMap["protectionContainerId"] = cat.ProtectionContainerID - } - if cat.RecoveryPointID != nil { - objectMap["recoveryPointId"] = cat.RecoveryPointID - } - if cat.RecoveryPointTime != nil { - objectMap["recoveryPointTime"] = cat.RecoveryPointTime - } - if cat.ContainerName != nil { - objectMap["containerName"] = cat.ContainerName - } - if cat.ContainerType != nil { - objectMap["containerType"] = cat.ContainerType - } - if cat.BackupManagementType != nil { - objectMap["backupManagementType"] = cat.BackupManagementType - } - if cat.DatasourceType != nil { - objectMap["datasourceType"] = cat.DatasourceType - } - if cat.DatasourceName != nil { - objectMap["datasourceName"] = cat.DatasourceName - } - if cat.DatasourceID != nil { - objectMap["datasourceId"] = cat.DatasourceID - } - if cat.DatasourceContainerName != nil { - objectMap["datasourceContainerName"] = cat.DatasourceContainerName - } - if cat.CoordinatorServiceStampID != nil { - objectMap["coordinatorServiceStampId"] = cat.CoordinatorServiceStampID - } - if cat.CoordinatorServiceStampURI != nil { - objectMap["coordinatorServiceStampUri"] = cat.CoordinatorServiceStampURI - } - if cat.ProtectionServiceStampID != nil { - objectMap["protectionServiceStampId"] = cat.ProtectionServiceStampID - } - if cat.ProtectionServiceStampURI != nil { - objectMap["protectionServiceStampUri"] = cat.ProtectionServiceStampURI - } - if cat.TokenExtendedInformation != nil { - objectMap["tokenExtendedInformation"] = cat.TokenExtendedInformation - } - if cat.RpTierInformation != nil { - objectMap["rpTierInformation"] = cat.RpTierInformation - } - if cat.RpOriginalSAOption != nil { - objectMap["rpOriginalSAOption"] = cat.RpOriginalSAOption - } - if cat.RpIsManagedVirtualMachine != nil { - objectMap["rpIsManagedVirtualMachine"] = cat.RpIsManagedVirtualMachine - } - if cat.RpVMSizeDescription != nil { - objectMap["rpVMSizeDescription"] = cat.RpVMSizeDescription - } - if cat.BMSActiveRegion != nil { - objectMap["bMSActiveRegion"] = cat.BMSActiveRegion - } - if cat.ObjectType != "" { - objectMap["objectType"] = cat.ObjectType - } - return json.Marshal(objectMap) -} - -// AsWorkloadCrrAccessToken is the BasicCrrAccessToken implementation for CrrAccessToken. -func (cat CrrAccessToken) AsWorkloadCrrAccessToken() (*WorkloadCrrAccessToken, bool) { - return nil, false -} - -// AsCrrAccessToken is the BasicCrrAccessToken implementation for CrrAccessToken. -func (cat CrrAccessToken) AsCrrAccessToken() (*CrrAccessToken, bool) { - return &cat, true -} - -// AsBasicCrrAccessToken is the BasicCrrAccessToken implementation for CrrAccessToken. -func (cat CrrAccessToken) AsBasicCrrAccessToken() (BasicCrrAccessToken, bool) { - return &cat, true -} - -// CrrAccessTokenResource ... -type CrrAccessTokenResource struct { - autorest.Response `json:"-"` - // Properties - CrrAccessTokenResource properties - Properties BasicCrrAccessToken `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for CrrAccessTokenResource. -func (catr CrrAccessTokenResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = catr.Properties - if catr.Location != nil { - objectMap["location"] = catr.Location - } - if catr.Tags != nil { - objectMap["tags"] = catr.Tags - } - if catr.ETag != nil { - objectMap["eTag"] = catr.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for CrrAccessTokenResource struct. -func (catr *CrrAccessTokenResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicCrrAccessToken(*v) - if err != nil { - return err - } - catr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - catr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - catr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - catr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - catr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - catr.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - catr.ETag = &eTag - } - } - } - - return nil -} - -// CrrJobRequest request object for fetching CRR jobs. -type CrrJobRequest struct { - // ResourceID - Entire ARM resource id of the resource - ResourceID *string `json:"resourceId,omitempty"` - // JobName - Job Name of the job to be fetched - JobName *string `json:"jobName,omitempty"` -} - -// CrrJobRequestResource request object for fetching CRR jobs. -type CrrJobRequestResource struct { - // Properties - CrrJobRequestResource properties - Properties *CrrJobRequest `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for CrrJobRequestResource. -func (cjrr CrrJobRequestResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cjrr.Properties != nil { - objectMap["properties"] = cjrr.Properties - } - if cjrr.Location != nil { - objectMap["location"] = cjrr.Location - } - if cjrr.Tags != nil { - objectMap["tags"] = cjrr.Tags - } - if cjrr.ETag != nil { - objectMap["eTag"] = cjrr.ETag - } - return json.Marshal(objectMap) -} - -// DailyRetentionFormat daily retention format. -type DailyRetentionFormat struct { - // DaysOfTheMonth - List of days of the month. - DaysOfTheMonth *[]Day `json:"daysOfTheMonth,omitempty"` -} - -// DailyRetentionSchedule daily retention schedule. -type DailyRetentionSchedule struct { - // RetentionTimes - Retention times of retention policy. - RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` - // RetentionDuration - Retention duration of retention Policy. - RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` -} - -// Day day of the week. -type Day struct { - // Date - Date of the month - Date *int32 `json:"date,omitempty"` - // IsLast - Whether Date is last date of month - IsLast *bool `json:"isLast,omitempty"` +// Day day of the week. +type Day struct { + // Date - Date of the month + Date *int32 `json:"date,omitempty"` + // IsLast - Whether Date is last date of month + IsLast *bool `json:"isLast,omitempty"` } // DiskExclusionProperties ... @@ -12821,90 +11550,6 @@ type ExtendedProperties struct { DiskExclusionProperties *DiskExclusionProperties `json:"diskExclusionProperties,omitempty"` } -// BasicFeatureSupportRequest base class for feature request -type BasicFeatureSupportRequest interface { - AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) - AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) - AsFeatureSupportRequest() (*FeatureSupportRequest, bool) -} - -// FeatureSupportRequest base class for feature request -type FeatureSupportRequest struct { - // FeatureType - Possible values include: 'FeatureTypeFeatureSupportRequest', 'FeatureTypeAzureBackupGoals', 'FeatureTypeAzureVMResourceBackup' - FeatureType FeatureType `json:"featureType,omitempty"` -} - -func unmarshalBasicFeatureSupportRequest(body []byte) (BasicFeatureSupportRequest, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["featureType"] { - case string(FeatureTypeAzureBackupGoals): - var abgfsr AzureBackupGoalFeatureSupportRequest - err := json.Unmarshal(body, &abgfsr) - return abgfsr, err - case string(FeatureTypeAzureVMResourceBackup): - var avrfsr AzureVMResourceFeatureSupportRequest - err := json.Unmarshal(body, &avrfsr) - return avrfsr, err - default: - var fsr FeatureSupportRequest - err := json.Unmarshal(body, &fsr) - return fsr, err - } -} -func unmarshalBasicFeatureSupportRequestArray(body []byte) ([]BasicFeatureSupportRequest, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - fsrArray := make([]BasicFeatureSupportRequest, len(rawMessages)) - - for index, rawMessage := range rawMessages { - fsr, err := unmarshalBasicFeatureSupportRequest(*rawMessage) - if err != nil { - return nil, err - } - fsrArray[index] = fsr - } - return fsrArray, nil -} - -// MarshalJSON is the custom marshaler for FeatureSupportRequest. -func (fsr FeatureSupportRequest) MarshalJSON() ([]byte, error) { - fsr.FeatureType = FeatureTypeFeatureSupportRequest - objectMap := make(map[string]interface{}) - if fsr.FeatureType != "" { - objectMap["featureType"] = fsr.FeatureType - } - return json.Marshal(objectMap) -} - -// AsAzureBackupGoalFeatureSupportRequest is the BasicFeatureSupportRequest implementation for FeatureSupportRequest. -func (fsr FeatureSupportRequest) AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) { - return nil, false -} - -// AsAzureVMResourceFeatureSupportRequest is the BasicFeatureSupportRequest implementation for FeatureSupportRequest. -func (fsr FeatureSupportRequest) AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) { - return nil, false -} - -// AsFeatureSupportRequest is the BasicFeatureSupportRequest implementation for FeatureSupportRequest. -func (fsr FeatureSupportRequest) AsFeatureSupportRequest() (*FeatureSupportRequest, bool) { - return &fsr, true -} - -// AsBasicFeatureSupportRequest is the BasicFeatureSupportRequest implementation for FeatureSupportRequest. -func (fsr FeatureSupportRequest) AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) { - return &fsr, true -} - // GenericContainer base class for generic container of backup items type GenericContainer struct { // FabricName - Name of the container's fabric @@ -13892,15 +12537,15 @@ func (ispi IaaSVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloa // IaasVMRecoveryPoint iaaS VM workload specific backup copy. type IaasVMRecoveryPoint struct { - // RecoveryPointType - READ-ONLY; Type of the backup copy. + // RecoveryPointType - Type of the backup copy. RecoveryPointType *string `json:"recoveryPointType,omitempty"` - // RecoveryPointTime - READ-ONLY; Time at which this backup copy was created. + // RecoveryPointTime - Time at which this backup copy was created. RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` - // RecoveryPointAdditionalInfo - READ-ONLY; Additional information associated with this backup copy. + // RecoveryPointAdditionalInfo - Additional information associated with this backup copy. RecoveryPointAdditionalInfo *string `json:"recoveryPointAdditionalInfo,omitempty"` - // SourceVMStorageType - READ-ONLY; Storage type of the VM whose backup copy is created. + // SourceVMStorageType - Storage type of the VM whose backup copy is created. SourceVMStorageType *string `json:"sourceVMStorageType,omitempty"` - // IsSourceVMEncrypted - READ-ONLY; Identifies whether the VM was encrypted when the backup copy is created. + // IsSourceVMEncrypted - Identifies whether the VM was encrypted when the backup copy is created. IsSourceVMEncrypted *bool `json:"isSourceVMEncrypted,omitempty"` // KeyAndSecret - Required details for recovering an encrypted VM. Applicable only when IsSourceVMEncrypted is true. KeyAndSecret *KeyAndSecretDetails `json:"keyAndSecret,omitempty"` @@ -13930,6 +12575,21 @@ type IaasVMRecoveryPoint struct { func (ivrp IaasVMRecoveryPoint) MarshalJSON() ([]byte, error) { ivrp.ObjectType = ObjectTypeBasicRecoveryPointObjectTypeIaasVMRecoveryPoint objectMap := make(map[string]interface{}) + if ivrp.RecoveryPointType != nil { + objectMap["recoveryPointType"] = ivrp.RecoveryPointType + } + if ivrp.RecoveryPointTime != nil { + objectMap["recoveryPointTime"] = ivrp.RecoveryPointTime + } + if ivrp.RecoveryPointAdditionalInfo != nil { + objectMap["recoveryPointAdditionalInfo"] = ivrp.RecoveryPointAdditionalInfo + } + if ivrp.SourceVMStorageType != nil { + objectMap["sourceVMStorageType"] = ivrp.SourceVMStorageType + } + if ivrp.IsSourceVMEncrypted != nil { + objectMap["isSourceVMEncrypted"] = ivrp.IsSourceVMEncrypted + } if ivrp.KeyAndSecret != nil { objectMap["keyAndSecret"] = ivrp.KeyAndSecret } @@ -16076,29 +14736,6 @@ func (mpp *MabProtectionPolicy) UnmarshalJSON(body []byte) error { return nil } -// ManagementUsage backup management usages of a vault. -type ManagementUsage struct { - // Unit - Unit of the usage. Possible values include: 'UsagesUnitCount', 'UsagesUnitBytes', 'UsagesUnitSeconds', 'UsagesUnitPercent', 'UsagesUnitCountPerSecond', 'UsagesUnitBytesPerSecond' - Unit UsagesUnit `json:"unit,omitempty"` - // QuotaPeriod - Quota period of usage. - QuotaPeriod *string `json:"quotaPeriod,omitempty"` - // NextResetTime - Next reset time of usage. - NextResetTime *date.Time `json:"nextResetTime,omitempty"` - // CurrentValue - Current value of usage. - CurrentValue *int64 `json:"currentValue,omitempty"` - // Limit - Limit of usage. - Limit *int64 `json:"limit,omitempty"` - // Name - Name of usage. - Name *NameInfo `json:"name,omitempty"` -} - -// ManagementUsageList backup management usage for vault. -type ManagementUsageList struct { - autorest.Response `json:"-"` - // Value - The list of backup management usages for the given vault. - Value *[]ManagementUsage `json:"value,omitempty"` -} - // MonthlyRetentionSchedule monthly retention schedule. type MonthlyRetentionSchedule struct { // RetentionScheduleFormatType - Retention schedule format type for monthly retention policy. Possible values include: 'RetentionScheduleFormatInvalid', 'RetentionScheduleFormatDaily', 'RetentionScheduleFormatWeekly' @@ -16160,14 +14797,6 @@ type MoveRPAcrossTiersRequest struct { TargetTierType RecoveryPointTierType `json:"targetTierType,omitempty"` } -// NameInfo the name of usage. -type NameInfo struct { - // Value - Value of usage. - Value *string `json:"value,omitempty"` - // LocalizedValue - Localized value of usage. - LocalizedValue *string `json:"localizedValue,omitempty"` -} - // NewErrorResponse the resource management error response. type NewErrorResponse struct { // Error - The error object. @@ -16493,13 +15122,12 @@ type BasicOperationStatusExtendedInfo interface { AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) - AsOperationStatusRecoveryPointExtendedInfo() (*OperationStatusRecoveryPointExtendedInfo, bool) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) } // OperationStatusExtendedInfo base class for additional information of operation status. type OperationStatusExtendedInfo struct { - // ObjectType - Possible values include: 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusProvisionILRExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusRecoveryPointExtendedInfo' + // ObjectType - Possible values include: 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusProvisionILRExtendedInfo' ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` } @@ -16523,10 +15151,6 @@ func unmarshalBasicOperationStatusExtendedInfo(body []byte) (BasicOperationStatu var ospiei OperationStatusProvisionILRExtendedInfo err := json.Unmarshal(body, &ospiei) return ospiei, err - case string(ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusRecoveryPointExtendedInfo): - var osrpei OperationStatusRecoveryPointExtendedInfo - err := json.Unmarshal(body, &osrpei) - return osrpei, err default: var osei OperationStatusExtendedInfo err := json.Unmarshal(body, &osei) @@ -16577,11 +15201,6 @@ func (osei OperationStatusExtendedInfo) AsOperationStatusProvisionILRExtendedInf return nil, false } -// AsOperationStatusRecoveryPointExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. -func (osei OperationStatusExtendedInfo) AsOperationStatusRecoveryPointExtendedInfo() (*OperationStatusRecoveryPointExtendedInfo, bool) { - return nil, false -} - // AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. func (osei OperationStatusExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { return &osei, true @@ -16596,7 +15215,7 @@ func (osei OperationStatusExtendedInfo) AsBasicOperationStatusExtendedInfo() (Ba type OperationStatusJobExtendedInfo struct { // JobID - ID of the job created for this protected item. JobID *string `json:"jobId,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusProvisionILRExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusRecoveryPointExtendedInfo' + // ObjectType - Possible values include: 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusProvisionILRExtendedInfo' ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` } @@ -16628,11 +15247,6 @@ func (osjei OperationStatusJobExtendedInfo) AsOperationStatusProvisionILRExtende return nil, false } -// AsOperationStatusRecoveryPointExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. -func (osjei OperationStatusJobExtendedInfo) AsOperationStatusRecoveryPointExtendedInfo() (*OperationStatusRecoveryPointExtendedInfo, bool) { - return nil, false -} - // AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. func (osjei OperationStatusJobExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { return nil, false @@ -16649,7 +15263,7 @@ type OperationStatusJobsExtendedInfo struct { JobIds *[]string `json:"jobIds,omitempty"` // FailedJobsError - Stores all the failed jobs along with the corresponding error codes. FailedJobsError map[string]*string `json:"failedJobsError"` - // ObjectType - Possible values include: 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusProvisionILRExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusRecoveryPointExtendedInfo' + // ObjectType - Possible values include: 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusProvisionILRExtendedInfo' ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` } @@ -16684,11 +15298,6 @@ func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusProvisionILRExtend return nil, false } -// AsOperationStatusRecoveryPointExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. -func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusRecoveryPointExtendedInfo() (*OperationStatusRecoveryPointExtendedInfo, bool) { - return nil, false -} - // AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { return nil, false @@ -16703,7 +15312,7 @@ func (osjei OperationStatusJobsExtendedInfo) AsBasicOperationStatusExtendedInfo( type OperationStatusProvisionILRExtendedInfo struct { // RecoveryTarget - Target details for file / folder restore. RecoveryTarget *InstantItemRecoveryTarget `json:"recoveryTarget,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusProvisionILRExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusRecoveryPointExtendedInfo' + // ObjectType - Possible values include: 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusProvisionILRExtendedInfo' ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` } @@ -16735,11 +15344,6 @@ func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusProvision return &ospiei, true } -// AsOperationStatusRecoveryPointExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. -func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusRecoveryPointExtendedInfo() (*OperationStatusRecoveryPointExtendedInfo, bool) { - return nil, false -} - // AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { return nil, false @@ -16750,101 +15354,6 @@ func (ospiei OperationStatusProvisionILRExtendedInfo) AsBasicOperationStatusExte return &ospiei, true } -// OperationStatusRecoveryPointExtendedInfo operation status extended info for Updated Recovery Point. -type OperationStatusRecoveryPointExtendedInfo struct { - // UpdatedRecoveryPoint - Recovery Point info with updated source snapshot URI - UpdatedRecoveryPoint BasicRecoveryPoint `json:"updatedRecoveryPoint,omitempty"` - // DeletedBackupItemVersion - In case the share is in soft-deleted state, populate this field with deleted backup item - DeletedBackupItemVersion *string `json:"deletedBackupItemVersion,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusProvisionILRExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusRecoveryPointExtendedInfo' - ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationStatusRecoveryPointExtendedInfo. -func (osrpei OperationStatusRecoveryPointExtendedInfo) MarshalJSON() ([]byte, error) { - osrpei.ObjectType = ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusRecoveryPointExtendedInfo - objectMap := make(map[string]interface{}) - objectMap["updatedRecoveryPoint"] = osrpei.UpdatedRecoveryPoint - if osrpei.DeletedBackupItemVersion != nil { - objectMap["deletedBackupItemVersion"] = osrpei.DeletedBackupItemVersion - } - if osrpei.ObjectType != "" { - objectMap["objectType"] = osrpei.ObjectType - } - return json.Marshal(objectMap) -} - -// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusRecoveryPointExtendedInfo. -func (osrpei OperationStatusRecoveryPointExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusRecoveryPointExtendedInfo. -func (osrpei OperationStatusRecoveryPointExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusRecoveryPointExtendedInfo. -func (osrpei OperationStatusRecoveryPointExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusRecoveryPointExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusRecoveryPointExtendedInfo. -func (osrpei OperationStatusRecoveryPointExtendedInfo) AsOperationStatusRecoveryPointExtendedInfo() (*OperationStatusRecoveryPointExtendedInfo, bool) { - return &osrpei, true -} - -// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusRecoveryPointExtendedInfo. -func (osrpei OperationStatusRecoveryPointExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { - return nil, false -} - -// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusRecoveryPointExtendedInfo. -func (osrpei OperationStatusRecoveryPointExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { - return &osrpei, true -} - -// UnmarshalJSON is the custom unmarshaler for OperationStatusRecoveryPointExtendedInfo struct. -func (osrpei *OperationStatusRecoveryPointExtendedInfo) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "updatedRecoveryPoint": - if v != nil { - updatedRecoveryPoint, err := unmarshalBasicRecoveryPoint(*v) - if err != nil { - return err - } - osrpei.UpdatedRecoveryPoint = updatedRecoveryPoint - } - case "deletedBackupItemVersion": - if v != nil { - var deletedBackupItemVersion string - err = json.Unmarshal(*v, &deletedBackupItemVersion) - if err != nil { - return err - } - osrpei.DeletedBackupItemVersion = &deletedBackupItemVersion - } - case "objectType": - if v != nil { - var objectType ObjectTypeBasicOperationStatusExtendedInfo - err = json.Unmarshal(*v, &objectType) - if err != nil { - return err - } - osrpei.ObjectType = objectType - } - } - } - - return nil -} - // OperationWorkerResponse this is the base class for operation result responses. type OperationWorkerResponse struct { // StatusCode - HTTP Status Code of the operation. Possible values include: 'HTTPStatusCodeContinue', 'HTTPStatusCodeSwitchingProtocols', 'HTTPStatusCodeOK', 'HTTPStatusCodeCreated', 'HTTPStatusCodeAccepted', 'HTTPStatusCodeNonAuthoritativeInformation', 'HTTPStatusCodeNoContent', 'HTTPStatusCodeResetContent', 'HTTPStatusCodePartialContent', 'HTTPStatusCodeMultipleChoices', 'HTTPStatusCodeAmbiguous', 'HTTPStatusCodeMovedPermanently', 'HTTPStatusCodeMoved', 'HTTPStatusCodeFound', 'HTTPStatusCodeRedirect', 'HTTPStatusCodeSeeOther', 'HTTPStatusCodeRedirectMethod', 'HTTPStatusCodeNotModified', 'HTTPStatusCodeUseProxy', 'HTTPStatusCodeUnused', 'HTTPStatusCodeTemporaryRedirect', 'HTTPStatusCodeRedirectKeepVerb', 'HTTPStatusCodeBadRequest', 'HTTPStatusCodeUnauthorized', 'HTTPStatusCodePaymentRequired', 'HTTPStatusCodeForbidden', 'HTTPStatusCodeNotFound', 'HTTPStatusCodeMethodNotAllowed', 'HTTPStatusCodeNotAcceptable', 'HTTPStatusCodeProxyAuthenticationRequired', 'HTTPStatusCodeRequestTimeout', 'HTTPStatusCodeConflict', 'HTTPStatusCodeGone', 'HTTPStatusCodeLengthRequired', 'HTTPStatusCodePreconditionFailed', 'HTTPStatusCodeRequestEntityTooLarge', 'HTTPStatusCodeRequestURITooLong', 'HTTPStatusCodeUnsupportedMediaType', 'HTTPStatusCodeRequestedRangeNotSatisfiable', 'HTTPStatusCodeExpectationFailed', 'HTTPStatusCodeUpgradeRequired', 'HTTPStatusCodeInternalServerError', 'HTTPStatusCodeNotImplemented', 'HTTPStatusCodeBadGateway', 'HTTPStatusCodeServiceUnavailable', 'HTTPStatusCodeGatewayTimeout', 'HTTPStatusCodeHTTPVersionNotSupported' @@ -16939,41 +15448,6 @@ func (pdmr PrepareDataMoveResponse) AsBasicVaultStorageConfigOperationResultResp return &pdmr, true } -// PreValidateEnableBackupRequest contract to validate if backup can be enabled on the given resource in a -// given vault and given configuration. -// It will validate followings -// 1. Vault capacity -// 2. VM is already protected -// 3. Any VM related configuration passed in properties. -type PreValidateEnableBackupRequest struct { - // ResourceType - ProtectedItem Type- VM, SqlDataBase, AzureFileShare etc. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - ResourceType DataSourceType `json:"resourceType,omitempty"` - // ResourceID - ARM Virtual Machine Id - ResourceID *string `json:"resourceId,omitempty"` - // VaultID - ARM id of the Recovery Services Vault - VaultID *string `json:"vaultId,omitempty"` - // Properties - Configuration of VM if any needs to be validated like OS type etc - Properties *string `json:"properties,omitempty"` -} - -// PreValidateEnableBackupResponse response contract for enable backup validation request -type PreValidateEnableBackupResponse struct { - autorest.Response `json:"-"` - // Status - Validation Status. Possible values include: 'ValidationStatusInvalid', 'ValidationStatusSucceeded', 'ValidationStatusFailed' - Status ValidationStatus `json:"status,omitempty"` - // ErrorCode - Response error code - ErrorCode *string `json:"errorCode,omitempty"` - // ErrorMessage - Response error message - ErrorMessage *string `json:"errorMessage,omitempty"` - // Recommendation - Recommended action for user - Recommendation *string `json:"recommendation,omitempty"` - // ContainerName - Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is required - // for portal - ContainerName *string `json:"containerName,omitempty"` - // ProtectedItemName - Specifies the product specific ds name. E.g. vm;iaasvmcontainer;rgname;vmname. This is required for portal - ProtectedItemName *string `json:"protectedItemName,omitempty"` -} - // PrivateEndpoint the Private Endpoint network resource that is linked to the Private Endpoint connection type PrivateEndpoint struct { // ID - Gets or sets id @@ -18205,502 +16679,77 @@ func (pc ProtectionContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() return nil, false } -// AsAzureSQLContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { - return nil, false -} - -// AsAzureStorageContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { - return nil, false -} - -// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { - return nil, false -} - -// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { - return nil, false -} - -// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { - return nil, false -} - -// AsDpmContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsDpmContainer() (*DpmContainer, bool) { - return nil, false -} - -// AsBasicDpmContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { - return nil, false -} - -// AsGenericContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsGenericContainer() (*GenericContainer, bool) { - return nil, false -} - -// AsIaaSVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { - return nil, false -} - -// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { - return nil, false -} - -// AsMabContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsMabContainer() (*MabContainer, bool) { - return nil, false -} - -// AsProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsProtectionContainer() (*ProtectionContainer, bool) { - return &pc, true -} - -// AsBasicProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. -func (pc ProtectionContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { - return &pc, true -} - -// ProtectionContainerResource base class for container with backup items. Containers with specific -// workloads are derived from this class. -type ProtectionContainerResource struct { - autorest.Response `json:"-"` - // Properties - ProtectionContainerResource properties - Properties BasicProtectionContainer `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProtectionContainerResource. -func (pcr ProtectionContainerResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = pcr.Properties - if pcr.Location != nil { - objectMap["location"] = pcr.Location - } - if pcr.Tags != nil { - objectMap["tags"] = pcr.Tags - } - if pcr.ETag != nil { - objectMap["eTag"] = pcr.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ProtectionContainerResource struct. -func (pcr *ProtectionContainerResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicProtectionContainer(*v) - if err != nil { - return err - } - pcr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pcr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pcr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pcr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - pcr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - pcr.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - pcr.ETag = &eTag - } - } - } - - return nil -} - -// ProtectionContainerResourceList list of ProtectionContainer resources -type ProtectionContainerResourceList struct { - autorest.Response `json:"-"` - // Value - List of resources. - Value *[]ProtectionContainerResource `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"` -} - -// ProtectionContainerResourceListIterator provides access to a complete listing of -// ProtectionContainerResource values. -type ProtectionContainerResourceListIterator struct { - i int - page ProtectionContainerResourceListPage -} - -// NextWithContext 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 *ProtectionContainerResourceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerResourceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ProtectionContainerResourceListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ProtectionContainerResourceListIterator) 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 ProtectionContainerResourceListIterator) Response() ProtectionContainerResourceList { - 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 ProtectionContainerResourceListIterator) Value() ProtectionContainerResource { - if !iter.page.NotDone() { - return ProtectionContainerResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ProtectionContainerResourceListIterator type. -func NewProtectionContainerResourceListIterator(page ProtectionContainerResourceListPage) ProtectionContainerResourceListIterator { - return ProtectionContainerResourceListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (pcrl ProtectionContainerResourceList) IsEmpty() bool { - return pcrl.Value == nil || len(*pcrl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (pcrl ProtectionContainerResourceList) hasNextLink() bool { - return pcrl.NextLink != nil && len(*pcrl.NextLink) != 0 -} - -// protectionContainerResourceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (pcrl ProtectionContainerResourceList) protectionContainerResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !pcrl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(pcrl.NextLink))) -} - -// ProtectionContainerResourceListPage contains a page of ProtectionContainerResource values. -type ProtectionContainerResourceListPage struct { - fn func(context.Context, ProtectionContainerResourceList) (ProtectionContainerResourceList, error) - pcrl ProtectionContainerResourceList -} - -// NextWithContext 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 *ProtectionContainerResourceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerResourceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.pcrl) - if err != nil { - return err - } - page.pcrl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// 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. -// Deprecated: Use NextWithContext() instead. -func (page *ProtectionContainerResourceListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ProtectionContainerResourceListPage) NotDone() bool { - return !page.pcrl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ProtectionContainerResourceListPage) Response() ProtectionContainerResourceList { - return page.pcrl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ProtectionContainerResourceListPage) Values() []ProtectionContainerResource { - if page.pcrl.IsEmpty() { - return nil - } - return *page.pcrl.Value -} - -// Creates a new instance of the ProtectionContainerResourceListPage type. -func NewProtectionContainerResourceListPage(cur ProtectionContainerResourceList, getNextPage func(context.Context, ProtectionContainerResourceList) (ProtectionContainerResourceList, error)) ProtectionContainerResourceListPage { - return ProtectionContainerResourceListPage{ - fn: getNextPage, - pcrl: cur, - } -} - -// BasicProtectionIntent base class for backup ProtectionIntent. -type BasicProtectionIntent interface { - AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) - AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) - AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) - AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) - AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) - AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) - AsProtectionIntent() (*ProtectionIntent, bool) -} - -// ProtectionIntent base class for backup ProtectionIntent. -type ProtectionIntent struct { - // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' - BackupManagementType ManagementType `json:"backupManagementType,omitempty"` - // SourceResourceID - ARM ID of the resource to be backed up. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId - ItemID *string `json:"itemId,omitempty"` - // PolicyID - ID of the backup policy with which this item is backed up. - PolicyID *string `json:"policyId,omitempty"` - // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionState ProtectionStatus `json:"protectionState,omitempty"` - // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' - ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` -} - -func unmarshalBasicProtectionIntent(body []byte) (BasicProtectionIntent, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["protectionIntentItemType"] { - case string(ProtectionIntentItemTypeRecoveryServiceVaultItem): - var arsvpi AzureRecoveryServiceVaultProtectionIntent - err := json.Unmarshal(body, &arsvpi) - return arsvpi, err - case string(ProtectionIntentItemTypeAzureResourceItem): - var arpi AzureResourceProtectionIntent - err := json.Unmarshal(body, &arpi) - return arpi, err - case string(ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent): - var awapi AzureWorkloadAutoProtectionIntent - err := json.Unmarshal(body, &awapi) - return awapi, err - case string(ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent): - var awsapi AzureWorkloadSQLAutoProtectionIntent - err := json.Unmarshal(body, &awsapi) - return awsapi, err - default: - var pi ProtectionIntent - err := json.Unmarshal(body, &pi) - return pi, err - } -} -func unmarshalBasicProtectionIntentArray(body []byte) ([]BasicProtectionIntent, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - piArray := make([]BasicProtectionIntent, len(rawMessages)) +// AsAzureSQLContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} - for index, rawMessage := range rawMessages { - pi, err := unmarshalBasicProtectionIntent(*rawMessage) - if err != nil { - return nil, err - } - piArray[index] = pi - } - return piArray, nil +// AsAzureStorageContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for ProtectionIntent. -func (pi ProtectionIntent) MarshalJSON() ([]byte, error) { - pi.ProtectionIntentItemType = ProtectionIntentItemTypeProtectionIntent - objectMap := make(map[string]interface{}) - if pi.BackupManagementType != "" { - objectMap["backupManagementType"] = pi.BackupManagementType - } - if pi.SourceResourceID != nil { - objectMap["sourceResourceId"] = pi.SourceResourceID - } - if pi.ItemID != nil { - objectMap["itemId"] = pi.ItemID - } - if pi.PolicyID != nil { - objectMap["policyId"] = pi.PolicyID - } - if pi.ProtectionState != "" { - objectMap["protectionState"] = pi.ProtectionState - } - if pi.ProtectionIntentItemType != "" { - objectMap["protectionIntentItemType"] = pi.ProtectionIntentItemType - } - return json.Marshal(objectMap) +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false } -// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { return nil, false } -// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { +// AsDpmContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsDpmContainer() (*DpmContainer, bool) { return nil, false } -// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { +// AsBasicDpmContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { return nil, false } -// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { +// AsGenericContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsGenericContainer() (*GenericContainer, bool) { return nil, false } -// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { +// AsIaaSVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { return nil, false } -// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { return nil, false } -// AsProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { - return &pi, true +// AsMabContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false } -// AsBasicProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. -func (pi ProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { - return &pi, true +// AsProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return &pc, 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"` +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &pc, true } -// ProtectionIntentResource base class for backup ProtectionIntent. -type ProtectionIntentResource struct { +// ProtectionContainerResource base class for container with backup items. Containers with specific +// workloads are derived from this class. +type ProtectionContainerResource struct { autorest.Response `json:"-"` - // Properties - ProtectionIntentResource properties - Properties BasicProtectionIntent `json:"properties,omitempty"` + // Properties - ProtectionContainerResource properties + Properties BasicProtectionContainer `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id represents the complete path to the resource. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name associated with the resource. @@ -18715,24 +16764,24 @@ type ProtectionIntentResource struct { ETag *string `json:"eTag,omitempty"` } -// MarshalJSON is the custom marshaler for ProtectionIntentResource. -func (pir ProtectionIntentResource) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ProtectionContainerResource. +func (pcr ProtectionContainerResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["properties"] = pir.Properties - if pir.Location != nil { - objectMap["location"] = pir.Location + objectMap["properties"] = pcr.Properties + if pcr.Location != nil { + objectMap["location"] = pcr.Location } - if pir.Tags != nil { - objectMap["tags"] = pir.Tags + if pcr.Tags != nil { + objectMap["tags"] = pcr.Tags } - if pir.ETag != nil { - objectMap["eTag"] = pir.ETag + if pcr.ETag != nil { + objectMap["eTag"] = pcr.ETag } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ProtectionIntentResource struct. -func (pir *ProtectionIntentResource) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ProtectionContainerResource struct. +func (pcr *ProtectionContainerResource) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -18742,11 +16791,11 @@ func (pir *ProtectionIntentResource) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - properties, err := unmarshalBasicProtectionIntent(*v) + properties, err := unmarshalBasicProtectionContainer(*v) if err != nil { return err } - pir.Properties = properties + pcr.Properties = properties } case "id": if v != nil { @@ -18755,7 +16804,7 @@ func (pir *ProtectionIntentResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - pir.ID = &ID + pcr.ID = &ID } case "name": if v != nil { @@ -18764,7 +16813,7 @@ func (pir *ProtectionIntentResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - pir.Name = &name + pcr.Name = &name } case "type": if v != nil { @@ -18773,7 +16822,7 @@ func (pir *ProtectionIntentResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - pir.Type = &typeVar + pcr.Type = &typeVar } case "location": if v != nil { @@ -18782,7 +16831,7 @@ func (pir *ProtectionIntentResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - pir.Location = &location + pcr.Location = &location } case "tags": if v != nil { @@ -18791,7 +16840,7 @@ func (pir *ProtectionIntentResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - pir.Tags = tags + pcr.Tags = tags } case "eTag": if v != nil { @@ -18800,7 +16849,7 @@ func (pir *ProtectionIntentResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - pir.ETag = &eTag + pcr.ETag = &eTag } } } @@ -18808,27 +16857,27 @@ func (pir *ProtectionIntentResource) UnmarshalJSON(body []byte) error { return nil } -// ProtectionIntentResourceList list of ProtectionIntent resources -type ProtectionIntentResourceList struct { +// ProtectionContainerResourceList list of ProtectionContainer resources +type ProtectionContainerResourceList struct { autorest.Response `json:"-"` // Value - List of resources. - Value *[]ProtectionIntentResource `json:"value,omitempty"` + Value *[]ProtectionContainerResource `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 { +// ProtectionContainerResourceListIterator provides access to a complete listing of +// ProtectionContainerResource values. +type ProtectionContainerResourceListIterator struct { i int - page ProtectionIntentResourceListPage + page ProtectionContainerResourceListPage } // NextWithContext 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) NextWithContext(ctx context.Context) (err error) { +func (iter *ProtectionContainerResourceListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionIntentResourceListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerResourceListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -18853,67 +16902,67 @@ func (iter *ProtectionIntentResourceListIterator) NextWithContext(ctx context.Co // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *ProtectionIntentResourceListIterator) Next() error { +func (iter *ProtectionContainerResourceListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ProtectionIntentResourceListIterator) NotDone() bool { +func (iter ProtectionContainerResourceListIterator) 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 { +func (iter ProtectionContainerResourceListIterator) Response() ProtectionContainerResourceList { 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 { +func (iter ProtectionContainerResourceListIterator) Value() ProtectionContainerResource { if !iter.page.NotDone() { - return ProtectionIntentResource{} + return ProtectionContainerResource{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the ProtectionIntentResourceListIterator type. -func NewProtectionIntentResourceListIterator(page ProtectionIntentResourceListPage) ProtectionIntentResourceListIterator { - return ProtectionIntentResourceListIterator{page: page} +// Creates a new instance of the ProtectionContainerResourceListIterator type. +func NewProtectionContainerResourceListIterator(page ProtectionContainerResourceListPage) ProtectionContainerResourceListIterator { + return ProtectionContainerResourceListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (pirl ProtectionIntentResourceList) IsEmpty() bool { - return pirl.Value == nil || len(*pirl.Value) == 0 +func (pcrl ProtectionContainerResourceList) IsEmpty() bool { + return pcrl.Value == nil || len(*pcrl.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (pirl ProtectionIntentResourceList) hasNextLink() bool { - return pirl.NextLink != nil && len(*pirl.NextLink) != 0 +func (pcrl ProtectionContainerResourceList) hasNextLink() bool { + return pcrl.NextLink != nil && len(*pcrl.NextLink) != 0 } -// protectionIntentResourceListPreparer prepares a request to retrieve the next set of results. +// protectionContainerResourceListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (pirl ProtectionIntentResourceList) protectionIntentResourceListPreparer(ctx context.Context) (*http.Request, error) { - if !pirl.hasNextLink() { +func (pcrl ProtectionContainerResourceList) protectionContainerResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !pcrl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(pirl.NextLink))) + autorest.WithBaseURL(to.String(pcrl.NextLink))) } -// ProtectionIntentResourceListPage contains a page of ProtectionIntentResource values. -type ProtectionIntentResourceListPage struct { - fn func(context.Context, ProtectionIntentResourceList) (ProtectionIntentResourceList, error) - pirl ProtectionIntentResourceList +// ProtectionContainerResourceListPage contains a page of ProtectionContainerResource values. +type ProtectionContainerResourceListPage struct { + fn func(context.Context, ProtectionContainerResourceList) (ProtectionContainerResourceList, error) + pcrl ProtectionContainerResourceList } // NextWithContext 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) NextWithContext(ctx context.Context) (err error) { +func (page *ProtectionContainerResourceListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionIntentResourceListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerResourceListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -18923,11 +16972,11 @@ func (page *ProtectionIntentResourceListPage) NextWithContext(ctx context.Contex }() } for { - next, err := page.fn(ctx, page.pirl) + next, err := page.fn(ctx, page.pcrl) if err != nil { return err } - page.pirl = next + page.pcrl = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -18938,33 +16987,33 @@ func (page *ProtectionIntentResourceListPage) NextWithContext(ctx context.Contex // 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. // Deprecated: Use NextWithContext() instead. -func (page *ProtectionIntentResourceListPage) Next() error { +func (page *ProtectionContainerResourceListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ProtectionIntentResourceListPage) NotDone() bool { - return !page.pirl.IsEmpty() +func (page ProtectionContainerResourceListPage) NotDone() bool { + return !page.pcrl.IsEmpty() } // Response returns the raw server response from the last page request. -func (page ProtectionIntentResourceListPage) Response() ProtectionIntentResourceList { - return page.pirl +func (page ProtectionContainerResourceListPage) Response() ProtectionContainerResourceList { + return page.pcrl } // 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() { +func (page ProtectionContainerResourceListPage) Values() []ProtectionContainerResource { + if page.pcrl.IsEmpty() { return nil } - return *page.pirl.Value + return *page.pcrl.Value } -// Creates a new instance of the ProtectionIntentResourceListPage type. -func NewProtectionIntentResourceListPage(cur ProtectionIntentResourceList, getNextPage func(context.Context, ProtectionIntentResourceList) (ProtectionIntentResourceList, error)) ProtectionIntentResourceListPage { - return ProtectionIntentResourceListPage{ +// Creates a new instance of the ProtectionContainerResourceListPage type. +func NewProtectionContainerResourceListPage(cur ProtectionContainerResourceList, getNextPage func(context.Context, ProtectionContainerResourceList) (ProtectionContainerResourceList, error)) ProtectionContainerResourceListPage { + return ProtectionContainerResourceListPage{ fn: getNextPage, - pirl: cur, + pcrl: cur, } } @@ -20151,55 +18200,6 @@ func (r Resource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// ResourceConfig the resource storage details. -type ResourceConfig struct { - // StorageModelType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant', 'StorageTypeZoneRedundant', 'StorageTypeReadAccessGeoZoneRedundant' - StorageModelType StorageType `json:"storageModelType,omitempty"` - // StorageType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant', 'StorageTypeZoneRedundant', 'StorageTypeReadAccessGeoZoneRedundant' - StorageType StorageType `json:"storageType,omitempty"` - // StorageTypeState - Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. Possible values include: 'StorageTypeStateInvalid', 'StorageTypeStateLocked', 'StorageTypeStateUnlocked' - StorageTypeState StorageTypeState `json:"storageTypeState,omitempty"` - // CrossRegionRestoreFlag - Opt in details of Cross Region Restore feature. - CrossRegionRestoreFlag *bool `json:"crossRegionRestoreFlag,omitempty"` -} - -// ResourceConfigResource the resource storage details. -type ResourceConfigResource struct { - autorest.Response `json:"-"` - // Properties - BackupResourceConfigResource properties - Properties *ResourceConfig `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceConfigResource. -func (rcr ResourceConfigResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rcr.Properties != nil { - objectMap["properties"] = rcr.Properties - } - if rcr.Location != nil { - objectMap["location"] = rcr.Location - } - if rcr.Tags != nil { - objectMap["tags"] = rcr.Tags - } - if rcr.ETag != nil { - objectMap["eTag"] = rcr.ETag - } - return json.Marshal(objectMap) -} - // ResourceEncryptionConfig ... type ResourceEncryptionConfig struct { // EncryptionAtRestType - Encryption At Rest Type. Possible values include: 'EncryptionAtRestTypeInvalid', 'EncryptionAtRestTypeMicrosoftManaged', 'EncryptionAtRestTypeCustomerManaged' @@ -21038,39 +19038,6 @@ type SQLDataDirectoryMapping struct { TargetPath *string `json:"targetPath,omitempty"` } -// StatusRequest backupStatus request. -type StatusRequest struct { - // ResourceType - Container Type - VM, SQLPaaS, DPM, AzureFileShare. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' - ResourceType DataSourceType `json:"resourceType,omitempty"` - // ResourceID - Entire ARM resource id of the resource - ResourceID *string `json:"resourceId,omitempty"` - // PoLogicalName - Protectable Item Logical Name - PoLogicalName *string `json:"poLogicalName,omitempty"` -} - -// StatusResponse backupStatus response. -type StatusResponse struct { - autorest.Response `json:"-"` - // ProtectionStatus - Specifies whether the container is registered or not. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' - ProtectionStatus ProtectionStatus `json:"protectionStatus,omitempty"` - // VaultID - Specifies the arm resource id of the vault - VaultID *string `json:"vaultId,omitempty"` - // FabricName - Specifies the fabric name - Azure or AD. Possible values include: 'FabricNameInvalid', 'FabricNameAzure' - FabricName FabricName `json:"fabricName,omitempty"` - // ContainerName - Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;csname;vmname. - ContainerName *string `json:"containerName,omitempty"` - // ProtectedItemName - Specifies the product specific ds name. E.g. vm;iaasvmcontainer;csname;vmname. - ProtectedItemName *string `json:"protectedItemName,omitempty"` - // ErrorCode - ErrorCode in case of intent failed - ErrorCode *string `json:"errorCode,omitempty"` - // ErrorMessage - ErrorMessage in case of intent failed. - ErrorMessage *string `json:"errorMessage,omitempty"` - // PolicyName - Specifies the policy name which is used for protection - PolicyName *string `json:"policyName,omitempty"` - // RegistrationStatus - Container registration status - RegistrationStatus *string `json:"registrationStatus,omitempty"` -} - // SubProtectionPolicy sub-protection policy which includes schedule and retention type SubProtectionPolicy struct { // PolicyType - Type of backup policy type. Possible values include: 'PolicyTypeInvalid', 'PolicyTypeFull', 'PolicyTypeDifferential', 'PolicyTypeLog', 'PolicyTypeCopyOnlyFull', 'PolicyTypeIncremental' @@ -21711,201 +19678,6 @@ type WeeklyRetentionSchedule struct { RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` } -// WorkloadCrrAccessToken ... -type WorkloadCrrAccessToken struct { - ProtectableObjectUniqueName *string `json:"protectableObjectUniqueName,omitempty"` - ProtectableObjectFriendlyName *string `json:"protectableObjectFriendlyName,omitempty"` - ProtectableObjectWorkloadType *string `json:"protectableObjectWorkloadType,omitempty"` - ProtectableObjectProtectionState *string `json:"protectableObjectProtectionState,omitempty"` - ProtectableObjectContainerHostOsName *string `json:"protectableObjectContainerHostOsName,omitempty"` - ProtectableObjectParentLogicalContainerName *string `json:"protectableObjectParentLogicalContainerName,omitempty"` - // ContainerID - Container Id - ContainerID *string `json:"containerId,omitempty"` - // PolicyName - Policy Name - PolicyName *string `json:"policyName,omitempty"` - // PolicyID - Policy Id - PolicyID *string `json:"policyId,omitempty"` - // AccessTokenString - Access token used for authentication - AccessTokenString *string `json:"accessTokenString,omitempty"` - // SubscriptionID - Subscription Id of the source vault - SubscriptionID *string `json:"subscriptionId,omitempty"` - // ResourceGroupName - Resource Group name of the source vault - ResourceGroupName *string `json:"resourceGroupName,omitempty"` - // ResourceName - Resource Name of the source vault - ResourceName *string `json:"resourceName,omitempty"` - // ResourceID - Resource Id of the source vault - ResourceID *string `json:"resourceId,omitempty"` - // ProtectionContainerID - Protected item container id - ProtectionContainerID *int64 `json:"protectionContainerId,omitempty"` - // RecoveryPointID - Recovery Point Id - RecoveryPointID *string `json:"recoveryPointId,omitempty"` - // RecoveryPointTime - Recovery Point Time - RecoveryPointTime *string `json:"recoveryPointTime,omitempty"` - // ContainerName - Container Unique name - ContainerName *string `json:"containerName,omitempty"` - // ContainerType - Container Type - ContainerType *string `json:"containerType,omitempty"` - // BackupManagementType - Backup Management Type - BackupManagementType *string `json:"backupManagementType,omitempty"` - // DatasourceType - Datasource Type - DatasourceType *string `json:"datasourceType,omitempty"` - // DatasourceName - Datasource Friendly Name - DatasourceName *string `json:"datasourceName,omitempty"` - // DatasourceID - Datasource Id - DatasourceID *string `json:"datasourceId,omitempty"` - // DatasourceContainerName - Datasource Container Unique Name - DatasourceContainerName *string `json:"datasourceContainerName,omitempty"` - // CoordinatorServiceStampID - CoordinatorServiceStampId to be used by BCM in restore call - CoordinatorServiceStampID *string `json:"coordinatorServiceStampId,omitempty"` - // CoordinatorServiceStampURI - CoordinatorServiceStampUri to be used by BCM in restore call - CoordinatorServiceStampURI *string `json:"coordinatorServiceStampUri,omitempty"` - // ProtectionServiceStampID - ProtectionServiceStampId to be used by BCM in restore call - ProtectionServiceStampID *string `json:"protectionServiceStampId,omitempty"` - // ProtectionServiceStampURI - ProtectionServiceStampUri to be used by BCM in restore call - ProtectionServiceStampURI *string `json:"protectionServiceStampUri,omitempty"` - // TokenExtendedInformation - Extended Information about the token like FileSpec etc. - TokenExtendedInformation *string `json:"tokenExtendedInformation,omitempty"` - // RpTierInformation - Recovery point Tier Information - RpTierInformation map[string]*string `json:"rpTierInformation"` - // RpOriginalSAOption - Recovery point information: Original SA option - RpOriginalSAOption *bool `json:"rpOriginalSAOption,omitempty"` - // RpIsManagedVirtualMachine - Recovery point information: Managed virtual machine - RpIsManagedVirtualMachine *bool `json:"rpIsManagedVirtualMachine,omitempty"` - // RpVMSizeDescription - Recovery point information: VM size description - RpVMSizeDescription *string `json:"rpVMSizeDescription,omitempty"` - // BMSActiveRegion - Active region name of BMS Stamp - BMSActiveRegion *string `json:"bMSActiveRegion,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeBasicCrrAccessTokenObjectTypeCrrAccessToken', 'ObjectTypeBasicCrrAccessTokenObjectTypeWorkloadCrrAccessToken' - ObjectType ObjectTypeBasicCrrAccessToken `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for WorkloadCrrAccessToken. -func (wcat WorkloadCrrAccessToken) MarshalJSON() ([]byte, error) { - wcat.ObjectType = ObjectTypeBasicCrrAccessTokenObjectTypeWorkloadCrrAccessToken - objectMap := make(map[string]interface{}) - if wcat.ProtectableObjectUniqueName != nil { - objectMap["protectableObjectUniqueName"] = wcat.ProtectableObjectUniqueName - } - if wcat.ProtectableObjectFriendlyName != nil { - objectMap["protectableObjectFriendlyName"] = wcat.ProtectableObjectFriendlyName - } - if wcat.ProtectableObjectWorkloadType != nil { - objectMap["protectableObjectWorkloadType"] = wcat.ProtectableObjectWorkloadType - } - if wcat.ProtectableObjectProtectionState != nil { - objectMap["protectableObjectProtectionState"] = wcat.ProtectableObjectProtectionState - } - if wcat.ProtectableObjectContainerHostOsName != nil { - objectMap["protectableObjectContainerHostOsName"] = wcat.ProtectableObjectContainerHostOsName - } - if wcat.ProtectableObjectParentLogicalContainerName != nil { - objectMap["protectableObjectParentLogicalContainerName"] = wcat.ProtectableObjectParentLogicalContainerName - } - if wcat.ContainerID != nil { - objectMap["containerId"] = wcat.ContainerID - } - if wcat.PolicyName != nil { - objectMap["policyName"] = wcat.PolicyName - } - if wcat.PolicyID != nil { - objectMap["policyId"] = wcat.PolicyID - } - if wcat.AccessTokenString != nil { - objectMap["accessTokenString"] = wcat.AccessTokenString - } - if wcat.SubscriptionID != nil { - objectMap["subscriptionId"] = wcat.SubscriptionID - } - if wcat.ResourceGroupName != nil { - objectMap["resourceGroupName"] = wcat.ResourceGroupName - } - if wcat.ResourceName != nil { - objectMap["resourceName"] = wcat.ResourceName - } - if wcat.ResourceID != nil { - objectMap["resourceId"] = wcat.ResourceID - } - if wcat.ProtectionContainerID != nil { - objectMap["protectionContainerId"] = wcat.ProtectionContainerID - } - if wcat.RecoveryPointID != nil { - objectMap["recoveryPointId"] = wcat.RecoveryPointID - } - if wcat.RecoveryPointTime != nil { - objectMap["recoveryPointTime"] = wcat.RecoveryPointTime - } - if wcat.ContainerName != nil { - objectMap["containerName"] = wcat.ContainerName - } - if wcat.ContainerType != nil { - objectMap["containerType"] = wcat.ContainerType - } - if wcat.BackupManagementType != nil { - objectMap["backupManagementType"] = wcat.BackupManagementType - } - if wcat.DatasourceType != nil { - objectMap["datasourceType"] = wcat.DatasourceType - } - if wcat.DatasourceName != nil { - objectMap["datasourceName"] = wcat.DatasourceName - } - if wcat.DatasourceID != nil { - objectMap["datasourceId"] = wcat.DatasourceID - } - if wcat.DatasourceContainerName != nil { - objectMap["datasourceContainerName"] = wcat.DatasourceContainerName - } - if wcat.CoordinatorServiceStampID != nil { - objectMap["coordinatorServiceStampId"] = wcat.CoordinatorServiceStampID - } - if wcat.CoordinatorServiceStampURI != nil { - objectMap["coordinatorServiceStampUri"] = wcat.CoordinatorServiceStampURI - } - if wcat.ProtectionServiceStampID != nil { - objectMap["protectionServiceStampId"] = wcat.ProtectionServiceStampID - } - if wcat.ProtectionServiceStampURI != nil { - objectMap["protectionServiceStampUri"] = wcat.ProtectionServiceStampURI - } - if wcat.TokenExtendedInformation != nil { - objectMap["tokenExtendedInformation"] = wcat.TokenExtendedInformation - } - if wcat.RpTierInformation != nil { - objectMap["rpTierInformation"] = wcat.RpTierInformation - } - if wcat.RpOriginalSAOption != nil { - objectMap["rpOriginalSAOption"] = wcat.RpOriginalSAOption - } - if wcat.RpIsManagedVirtualMachine != nil { - objectMap["rpIsManagedVirtualMachine"] = wcat.RpIsManagedVirtualMachine - } - if wcat.RpVMSizeDescription != nil { - objectMap["rpVMSizeDescription"] = wcat.RpVMSizeDescription - } - if wcat.BMSActiveRegion != nil { - objectMap["bMSActiveRegion"] = wcat.BMSActiveRegion - } - if wcat.ObjectType != "" { - objectMap["objectType"] = wcat.ObjectType - } - return json.Marshal(objectMap) -} - -// AsWorkloadCrrAccessToken is the BasicCrrAccessToken implementation for WorkloadCrrAccessToken. -func (wcat WorkloadCrrAccessToken) AsWorkloadCrrAccessToken() (*WorkloadCrrAccessToken, bool) { - return &wcat, true -} - -// AsCrrAccessToken is the BasicCrrAccessToken implementation for WorkloadCrrAccessToken. -func (wcat WorkloadCrrAccessToken) AsCrrAccessToken() (*CrrAccessToken, bool) { - return nil, false -} - -// AsBasicCrrAccessToken is the BasicCrrAccessToken implementation for WorkloadCrrAccessToken. -func (wcat WorkloadCrrAccessToken) AsBasicCrrAccessToken() (BasicCrrAccessToken, bool) { - return &wcat, true -} - // WorkloadInquiryDetails details of an inquired protectable item. type WorkloadInquiryDetails struct { // Type - Type of the Workload such as SQL, Oracle etc. diff --git a/services/recoveryservices/mgmt/2021-01-01/backup/operations.go b/services/recoveryservices/mgmt/2021-01-01/backup/operations.go deleted file mode 100644 index 75e1357de17f..000000000000 --- a/services/recoveryservices/mgmt/2021-01-01/backup/operations.go +++ /dev/null @@ -1,140 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// OperationsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type OperationsClient struct { - BaseClient -} - -// NewOperationsClient creates an instance of the OperationsClient client. -func NewOperationsClient(subscriptionID string) OperationsClient { - return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { - return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List returns the list of available operations. -func (client OperationsClient) List(ctx context.Context) (result ClientDiscoveryResponsePage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") - defer func() { - sc := -1 - if result.cdr.Response.Response != nil { - sc = result.cdr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.OperationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cdr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.OperationsClient", "List", resp, "Failure sending request") - return - } - - result.cdr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.OperationsClient", "List", resp, "Failure responding to request") - return - } - if result.cdr.hasNextLink() && result.cdr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2016-08-10" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.RecoveryServices/operations"), - 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 OperationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client OperationsClient) ListResponder(resp *http.Response) (result ClientDiscoveryResponse, err error) { - err = autorest.Respond( - resp, - 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 OperationsClient) listNextResults(ctx context.Context, lastResults ClientDiscoveryResponse) (result ClientDiscoveryResponse, err error) { - req, err := lastResults.clientDiscoveryResponsePreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "backup.OperationsClient", "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.OperationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.OperationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client OperationsClient) ListComplete(ctx context.Context) (result ClientDiscoveryResponseIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} diff --git a/services/recoveryservices/mgmt/2021-01-01/backup/protectionintent.go b/services/recoveryservices/mgmt/2021-01-01/backup/protectionintent.go deleted file mode 100644 index 0327017ed0bb..000000000000 --- a/services/recoveryservices/mgmt/2021-01-01/backup/protectionintent.go +++ /dev/null @@ -1,353 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ProtectionIntentClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type ProtectionIntentClient struct { - BaseClient -} - -// NewProtectionIntentClient creates an instance of the ProtectionIntentClient client. -func NewProtectionIntentClient(subscriptionID string) ProtectionIntentClient { - return NewProtectionIntentClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewProtectionIntentClientWithBaseURI creates an instance of the ProtectionIntentClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewProtectionIntentClientWithBaseURI(baseURI string, subscriptionID string) ProtectionIntentClient { - return ProtectionIntentClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create Intent for Enabling backup of an item. This is a synchronous operation. -// 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 backup item. -// intentObjectName - intent object name. -// parameters - resource backed up item -func (client ProtectionIntentClient) CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string, parameters ProtectionIntentResource) (result ProtectionIntentResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionIntentClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, vaultName, resourceGroupName, fabricName, intentObjectName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionIntentClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.ProtectionIntentClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionIntentClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ProtectionIntentClient) CreateOrUpdatePreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string, parameters ProtectionIntentResource) (*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.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ProtectionIntentClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ProtectionIntentClient) CreateOrUpdateResponder(resp *http.Response) (result ProtectionIntentResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionIntentClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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 - } - - 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 client.Send(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, - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionIntentClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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 - } - - 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 client.Send(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, - 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 -// parameters - enable backup validation request on Virtual Machine -func (client ProtectionIntentClient) Validate(ctx context.Context, azureRegion string, parameters PreValidateEnableBackupRequest) (result PreValidateEnableBackupResponse, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionIntentClient.Validate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ValidatePreparer(ctx, azureRegion, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionIntentClient", "Validate", nil, "Failure preparing request") - return - } - - resp, err := client.ValidateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.ProtectionIntentClient", "Validate", resp, "Failure sending request") - return - } - - result, err = client.ValidateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionIntentClient", "Validate", resp, "Failure responding to request") - return - } - - return -} - -// ValidatePreparer prepares the Validate request. -func (client ProtectionIntentClient) ValidatePreparer(ctx context.Context, azureRegion string, parameters PreValidateEnableBackupRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "azureRegion": autorest.Encode("path", azureRegion), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupPreValidateProtection", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ValidateSender sends the Validate request. The method will close the -// http.Response Body if it receives an error. -func (client ProtectionIntentClient) ValidateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ValidateResponder handles the response to the Validate request. The method always -// closes the http.Response Body. -func (client ProtectionIntentClient) ValidateResponder(resp *http.Response) (result PreValidateEnableBackupResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/recoveryservices/mgmt/2021-01-01/backup/protectionintentgroup.go b/services/recoveryservices/mgmt/2021-01-01/backup/protectionintentgroup.go deleted file mode 100644 index a7975f8baaec..000000000000 --- a/services/recoveryservices/mgmt/2021-01-01/backup/protectionintentgroup.go +++ /dev/null @@ -1,158 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "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 using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionIntentGroupClient.List") - defer func() { - sc := -1 - if result.pirl.Response.Response != nil { - sc = result.pirl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - 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 - } - if result.pirl.hasNextLink() && result.pirl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - 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 client.Send(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, - 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(ctx context.Context, lastResults ProtectionIntentResourceList) (result ProtectionIntentResourceList, err error) { - req, err := lastResults.protectionIntentResourceListPreparer(ctx) - 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) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionIntentGroupClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, vaultName, resourceGroupName, filter, skipToken) - return -} diff --git a/services/recoveryservices/mgmt/2021-01-01/backup/recoverypoints.go b/services/recoveryservices/mgmt/2021-01-01/backup/recoverypoints.go index 3789c1b063e7..c375a9cc57ff 100644 --- a/services/recoveryservices/mgmt/2021-01-01/backup/recoverypoints.go +++ b/services/recoveryservices/mgmt/2021-01-01/backup/recoverypoints.go @@ -116,93 +116,6 @@ func (client RecoveryPointsClient) GetResponder(resp *http.Response) (result Rec return } -// GetAccessToken sends the get access token request. -// 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 container. -// containerName - name of the container. -// protectedItemName - name of the Protected Item. -// recoveryPointID - recovery Point Id -// parameters - get Access Token request -func (client RecoveryPointsClient) GetAccessToken(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters AADPropertiesResource) (result CrrAccessTokenResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.GetAccessToken") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetAccessTokenPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointID, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "GetAccessToken", nil, "Failure preparing request") - return - } - - resp, err := client.GetAccessTokenSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "GetAccessToken", resp, "Failure sending request") - return - } - - result, err = client.GetAccessTokenResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "GetAccessToken", resp, "Failure responding to request") - return - } - - return -} - -// GetAccessTokenPreparer prepares the GetAccessToken request. -func (client RecoveryPointsClient) GetAccessTokenPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters AADPropertiesResource) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "containerName": autorest.Encode("path", containerName), - "fabricName": autorest.Encode("path", fabricName), - "protectedItemName": autorest.Encode("path", protectedItemName), - "recoveryPointId": autorest.Encode("path", recoveryPointID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2018-12-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/accessToken", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetAccessTokenSender sends the GetAccessToken request. The method will close the -// http.Response Body if it receives an error. -func (client RecoveryPointsClient) GetAccessTokenSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetAccessTokenResponder handles the response to the GetAccessToken request. The method always -// closes the http.Response Body. -func (client RecoveryPointsClient) GetAccessTokenResponder(resp *http.Response) (result CrrAccessTokenResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusBadRequest), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - // List lists the backup copies for the backed up item. // Parameters: // vaultName - the name of the recovery services vault. diff --git a/services/recoveryservices/mgmt/2021-01-01/backup/recoverypointscrr.go b/services/recoveryservices/mgmt/2021-01-01/backup/recoverypointscrr.go deleted file mode 100644 index 65031ef88a9e..000000000000 --- a/services/recoveryservices/mgmt/2021-01-01/backup/recoverypointscrr.go +++ /dev/null @@ -1,160 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// RecoveryPointsCrrClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type RecoveryPointsCrrClient struct { - BaseClient -} - -// NewRecoveryPointsCrrClient creates an instance of the RecoveryPointsCrrClient client. -func NewRecoveryPointsCrrClient(subscriptionID string) RecoveryPointsCrrClient { - return NewRecoveryPointsCrrClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewRecoveryPointsCrrClientWithBaseURI creates an instance of the RecoveryPointsCrrClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewRecoveryPointsCrrClientWithBaseURI(baseURI string, subscriptionID string) RecoveryPointsCrrClient { - return RecoveryPointsCrrClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List lists the backup copies for the backed up 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 backed up item. -// containerName - container name associated with the backed up item. -// protectedItemName - backed up item whose backup copies are to be fetched. -// filter - oData filter options. -func (client RecoveryPointsCrrClient) List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result RecoveryPointResourceListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsCrrClient.List") - defer func() { - sc := -1 - if result.rprl.Response.Response != nil { - sc = result.rprl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.RecoveryPointsCrrClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.rprl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.RecoveryPointsCrrClient", "List", resp, "Failure sending request") - return - } - - result.rprl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.RecoveryPointsCrrClient", "List", resp, "Failure responding to request") - return - } - if result.rprl.hasNextLink() && result.rprl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client RecoveryPointsCrrClient) ListPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "containerName": autorest.Encode("path", containerName), - "fabricName": autorest.Encode("path", fabricName), - "protectedItemName": autorest.Encode("path", protectedItemName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2018-12-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/", 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 RecoveryPointsCrrClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client RecoveryPointsCrrClient) ListResponder(resp *http.Response) (result RecoveryPointResourceList, err error) { - err = autorest.Respond( - resp, - 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 RecoveryPointsCrrClient) listNextResults(ctx context.Context, lastResults RecoveryPointResourceList) (result RecoveryPointResourceList, err error) { - req, err := lastResults.recoveryPointResourceListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "backup.RecoveryPointsCrrClient", "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.RecoveryPointsCrrClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.RecoveryPointsCrrClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client RecoveryPointsCrrClient) ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result RecoveryPointResourceListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsCrrClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter) - return -} diff --git a/services/recoveryservices/mgmt/2021-01-01/backup/usagesummaries.go b/services/recoveryservices/mgmt/2021-01-01/backup/usagesummaries.go deleted file mode 100644 index 1c70d7b13444..000000000000 --- a/services/recoveryservices/mgmt/2021-01-01/backup/usagesummaries.go +++ /dev/null @@ -1,115 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// UsageSummariesClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type UsageSummariesClient struct { - BaseClient -} - -// NewUsageSummariesClient creates an instance of the UsageSummariesClient client. -func NewUsageSummariesClient(subscriptionID string) UsageSummariesClient { - return NewUsageSummariesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewUsageSummariesClientWithBaseURI creates an instance of the UsageSummariesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewUsageSummariesClientWithBaseURI(baseURI string, subscriptionID string) UsageSummariesClient { - return UsageSummariesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List fetches the backup management usage summaries of the 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 UsageSummariesClient) List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result ManagementUsageList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsageSummariesClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, vaultName, resourceGroupName, filter, skipToken) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.UsageSummariesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.UsageSummariesClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.UsageSummariesClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client UsageSummariesClient) 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}/backupUsageSummaries", 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 UsageSummariesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client UsageSummariesClient) ListResponder(resp *http.Response) (result ManagementUsageList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/recoveryservices/mgmt/2021-01-01/backup/usagesummariescrr.go b/services/recoveryservices/mgmt/2021-01-01/backup/usagesummariescrr.go deleted file mode 100644 index a2ae6f0ab9a9..000000000000 --- a/services/recoveryservices/mgmt/2021-01-01/backup/usagesummariescrr.go +++ /dev/null @@ -1,116 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// UsageSummariesCRRClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type UsageSummariesCRRClient struct { - BaseClient -} - -// NewUsageSummariesCRRClient creates an instance of the UsageSummariesCRRClient client. -func NewUsageSummariesCRRClient(subscriptionID string) UsageSummariesCRRClient { - return NewUsageSummariesCRRClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewUsageSummariesCRRClientWithBaseURI creates an instance of the UsageSummariesCRRClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewUsageSummariesCRRClientWithBaseURI(baseURI string, subscriptionID string) UsageSummariesCRRClient { - return UsageSummariesCRRClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List fetches the backup management usage summaries of the 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 UsageSummariesCRRClient) List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result ManagementUsageList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsageSummariesCRRClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, vaultName, resourceGroupName, filter, skipToken) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.UsageSummariesCRRClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.UsageSummariesCRRClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.UsageSummariesCRRClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client UsageSummariesCRRClient) 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 = "2018-12-20" - 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}/backupUsageSummaries", 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 UsageSummariesCRRClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client UsageSummariesCRRClient) ListResponder(resp *http.Response) (result ManagementUsageList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/recoveryservices/mgmt/2021-07-01/backup/CHANGELOG.md b/services/recoveryservices/mgmt/2021-07-01/backup/CHANGELOG.md index 52911e4cc5e4..f888c5ccfd1c 100644 --- a/services/recoveryservices/mgmt/2021-07-01/backup/CHANGELOG.md +++ b/services/recoveryservices/mgmt/2021-07-01/backup/CHANGELOG.md @@ -1,2 +1,147 @@ -# Change History +# Unreleased +## Breaking Changes + +### Removed Constants + +1. ObjectTypeBasicCrrAccessToken.ObjectTypeBasicCrrAccessTokenObjectTypeCrrAccessToken +1. ObjectTypeBasicCrrAccessToken.ObjectTypeBasicCrrAccessTokenObjectTypeWorkloadCrrAccessToken +1. ObjectTypeBasicOperationStatusExtendedInfo.ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusRecoveryPointExtendedInfo + +### Removed Funcs + +1. *CrossRegionRestoreRequest.UnmarshalJSON([]byte) error +1. *CrossRegionRestoreTriggerFuture.UnmarshalJSON([]byte) error +1. *CrrAccessTokenResource.UnmarshalJSON([]byte) error +1. *OperationStatusRecoveryPointExtendedInfo.UnmarshalJSON([]byte) error +1. AADPropertiesResource.MarshalJSON() ([]byte, error) +1. AadPropertiesClient.Get(context.Context, string, string) (AADPropertiesResource, error) +1. AadPropertiesClient.GetPreparer(context.Context, string, string) (*http.Request, error) +1. AadPropertiesClient.GetResponder(*http.Response) (AADPropertiesResource, error) +1. AadPropertiesClient.GetSender(*http.Request) (*http.Response, error) +1. AzureWorkloadSQLRecoveryPointExtendedInfo.MarshalJSON() ([]byte, error) +1. CrossRegionRestoreClient.Trigger(context.Context, string, CrossRegionRestoreRequest) (CrossRegionRestoreTriggerFuture, error) +1. CrossRegionRestoreClient.TriggerPreparer(context.Context, string, CrossRegionRestoreRequest) (*http.Request, error) +1. CrossRegionRestoreClient.TriggerResponder(*http.Response) (autorest.Response, error) +1. CrossRegionRestoreClient.TriggerSender(*http.Request) (CrossRegionRestoreTriggerFuture, error) +1. CrossRegionRestoreRequestResource.MarshalJSON() ([]byte, error) +1. CrrAccessToken.AsBasicCrrAccessToken() (BasicCrrAccessToken, bool) +1. CrrAccessToken.AsCrrAccessToken() (*CrrAccessToken, bool) +1. CrrAccessToken.AsWorkloadCrrAccessToken() (*WorkloadCrrAccessToken, bool) +1. CrrAccessToken.MarshalJSON() ([]byte, error) +1. CrrAccessTokenResource.MarshalJSON() ([]byte, error) +1. CrrJobDetailsClient.Get(context.Context, string, CrrJobRequest) (JobResource, error) +1. CrrJobDetailsClient.GetPreparer(context.Context, string, CrrJobRequest) (*http.Request, error) +1. CrrJobDetailsClient.GetResponder(*http.Response) (JobResource, error) +1. CrrJobDetailsClient.GetSender(*http.Request) (*http.Response, error) +1. CrrJobRequestResource.MarshalJSON() ([]byte, error) +1. CrrJobsClient.List(context.Context, string, CrrJobRequest, string, string) (JobResourceListPage, error) +1. CrrJobsClient.ListComplete(context.Context, string, CrrJobRequest, string, string) (JobResourceListIterator, error) +1. CrrJobsClient.ListPreparer(context.Context, string, CrrJobRequest, string, string) (*http.Request, error) +1. CrrJobsClient.ListResponder(*http.Response) (JobResourceList, error) +1. CrrJobsClient.ListSender(*http.Request) (*http.Response, error) +1. CrrOperationResultsClient.Get(context.Context, string, string) (autorest.Response, error) +1. CrrOperationResultsClient.GetPreparer(context.Context, string, string) (*http.Request, error) +1. CrrOperationResultsClient.GetResponder(*http.Response) (autorest.Response, error) +1. CrrOperationResultsClient.GetSender(*http.Request) (*http.Response, error) +1. CrrOperationStatusClient.Get(context.Context, string, string) (OperationStatus, error) +1. CrrOperationStatusClient.GetPreparer(context.Context, string, string) (*http.Request, error) +1. CrrOperationStatusClient.GetResponder(*http.Response) (OperationStatus, error) +1. CrrOperationStatusClient.GetSender(*http.Request) (*http.Response, error) +1. NewAadPropertiesClient(string) AadPropertiesClient +1. NewAadPropertiesClientWithBaseURI(string, string) AadPropertiesClient +1. NewCrossRegionRestoreClient(string) CrossRegionRestoreClient +1. NewCrossRegionRestoreClientWithBaseURI(string, string) CrossRegionRestoreClient +1. NewCrrJobDetailsClient(string) CrrJobDetailsClient +1. NewCrrJobDetailsClientWithBaseURI(string, string) CrrJobDetailsClient +1. NewCrrJobsClient(string) CrrJobsClient +1. NewCrrJobsClientWithBaseURI(string, string) CrrJobsClient +1. NewCrrOperationResultsClient(string) CrrOperationResultsClient +1. NewCrrOperationResultsClientWithBaseURI(string, string) CrrOperationResultsClient +1. NewCrrOperationStatusClient(string) CrrOperationStatusClient +1. NewCrrOperationStatusClientWithBaseURI(string, string) CrrOperationStatusClient +1. NewProtectedItemsCrrClient(string) ProtectedItemsCrrClient +1. NewProtectedItemsCrrClientWithBaseURI(string, string) ProtectedItemsCrrClient +1. NewRecoveryPointsCrrClient(string) RecoveryPointsCrrClient +1. NewRecoveryPointsCrrClientWithBaseURI(string, string) RecoveryPointsCrrClient +1. NewResourceStorageConfigsClient(string) ResourceStorageConfigsClient +1. NewResourceStorageConfigsClientWithBaseURI(string, string) ResourceStorageConfigsClient +1. NewUsageSummariesCRRClient(string) UsageSummariesCRRClient +1. NewUsageSummariesCRRClientWithBaseURI(string, string) UsageSummariesCRRClient +1. OperationStatusExtendedInfo.AsOperationStatusRecoveryPointExtendedInfo() (*OperationStatusRecoveryPointExtendedInfo, bool) +1. OperationStatusJobExtendedInfo.AsOperationStatusRecoveryPointExtendedInfo() (*OperationStatusRecoveryPointExtendedInfo, bool) +1. OperationStatusJobsExtendedInfo.AsOperationStatusRecoveryPointExtendedInfo() (*OperationStatusRecoveryPointExtendedInfo, bool) +1. OperationStatusProvisionILRExtendedInfo.AsOperationStatusRecoveryPointExtendedInfo() (*OperationStatusRecoveryPointExtendedInfo, bool) +1. OperationStatusRecoveryPointExtendedInfo.AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) +1. OperationStatusRecoveryPointExtendedInfo.AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) +1. OperationStatusRecoveryPointExtendedInfo.AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) +1. OperationStatusRecoveryPointExtendedInfo.AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) +1. OperationStatusRecoveryPointExtendedInfo.AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) +1. OperationStatusRecoveryPointExtendedInfo.AsOperationStatusRecoveryPointExtendedInfo() (*OperationStatusRecoveryPointExtendedInfo, bool) +1. OperationStatusRecoveryPointExtendedInfo.MarshalJSON() ([]byte, error) +1. PossibleObjectTypeBasicCrrAccessTokenValues() []ObjectTypeBasicCrrAccessToken +1. ProtectedItemsCrrClient.List(context.Context, string, string, string, string) (ProtectedItemResourceListPage, error) +1. ProtectedItemsCrrClient.ListComplete(context.Context, string, string, string, string) (ProtectedItemResourceListIterator, error) +1. ProtectedItemsCrrClient.ListPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. ProtectedItemsCrrClient.ListResponder(*http.Response) (ProtectedItemResourceList, error) +1. ProtectedItemsCrrClient.ListSender(*http.Request) (*http.Response, error) +1. RecoveryPointsClient.GetAccessToken(context.Context, string, string, string, string, string, string, AADPropertiesResource) (CrrAccessTokenResource, error) +1. RecoveryPointsClient.GetAccessTokenPreparer(context.Context, string, string, string, string, string, string, AADPropertiesResource) (*http.Request, error) +1. RecoveryPointsClient.GetAccessTokenResponder(*http.Response) (CrrAccessTokenResource, error) +1. RecoveryPointsClient.GetAccessTokenSender(*http.Request) (*http.Response, error) +1. RecoveryPointsCrrClient.List(context.Context, string, string, string, string, string, string) (RecoveryPointResourceListPage, error) +1. RecoveryPointsCrrClient.ListComplete(context.Context, string, string, string, string, string, string) (RecoveryPointResourceListIterator, error) +1. RecoveryPointsCrrClient.ListPreparer(context.Context, string, string, string, string, string, string) (*http.Request, error) +1. RecoveryPointsCrrClient.ListResponder(*http.Response) (RecoveryPointResourceList, error) +1. RecoveryPointsCrrClient.ListSender(*http.Request) (*http.Response, error) +1. ResourceStorageConfigsClient.Get(context.Context, string, string) (ResourceConfigResource, error) +1. ResourceStorageConfigsClient.GetPreparer(context.Context, string, string) (*http.Request, error) +1. ResourceStorageConfigsClient.GetResponder(*http.Response) (ResourceConfigResource, error) +1. ResourceStorageConfigsClient.GetSender(*http.Request) (*http.Response, error) +1. ResourceStorageConfigsClient.Patch(context.Context, string, string, ResourceConfigResource) (autorest.Response, error) +1. ResourceStorageConfigsClient.PatchPreparer(context.Context, string, string, ResourceConfigResource) (*http.Request, error) +1. ResourceStorageConfigsClient.PatchResponder(*http.Response) (autorest.Response, error) +1. ResourceStorageConfigsClient.PatchSender(*http.Request) (*http.Response, error) +1. ResourceStorageConfigsClient.Update(context.Context, string, string, ResourceConfigResource) (ResourceConfigResource, error) +1. ResourceStorageConfigsClient.UpdatePreparer(context.Context, string, string, ResourceConfigResource) (*http.Request, error) +1. ResourceStorageConfigsClient.UpdateResponder(*http.Response) (ResourceConfigResource, error) +1. ResourceStorageConfigsClient.UpdateSender(*http.Request) (*http.Response, error) +1. UsageSummariesCRRClient.List(context.Context, string, string, string, string) (ManagementUsageList, error) +1. UsageSummariesCRRClient.ListPreparer(context.Context, string, string, string, string) (*http.Request, error) +1. UsageSummariesCRRClient.ListResponder(*http.Response) (ManagementUsageList, error) +1. UsageSummariesCRRClient.ListSender(*http.Request) (*http.Response, error) +1. WorkloadCrrAccessToken.AsBasicCrrAccessToken() (BasicCrrAccessToken, bool) +1. WorkloadCrrAccessToken.AsCrrAccessToken() (*CrrAccessToken, bool) +1. WorkloadCrrAccessToken.AsWorkloadCrrAccessToken() (*WorkloadCrrAccessToken, bool) +1. WorkloadCrrAccessToken.MarshalJSON() ([]byte, error) + +### Struct Changes + +#### Removed Structs + +1. AADProperties +1. AADPropertiesResource +1. AadPropertiesClient +1. BMSAADPropertiesQueryObject +1. CrossRegionRestoreClient +1. CrossRegionRestoreRequest +1. CrossRegionRestoreRequestResource +1. CrossRegionRestoreTriggerFuture +1. CrrAccessToken +1. CrrAccessTokenResource +1. CrrJobDetailsClient +1. CrrJobRequest +1. CrrJobRequestResource +1. CrrJobsClient +1. CrrOperationResultsClient +1. CrrOperationStatusClient +1. OperationStatusRecoveryPointExtendedInfo +1. ProtectedItemsCrrClient +1. RecoveryPointsCrrClient +1. ResourceStorageConfigsClient +1. UsageSummariesCRRClient +1. WorkloadCrrAccessToken + +#### Removed Struct Fields + +1. AzureFileshareProtectedItem.HealthStatus diff --git a/services/recoveryservices/mgmt/2021-07-01/backup/_meta.json b/services/recoveryservices/mgmt/2021-07-01/backup/_meta.json index 5f971639a368..639238b88986 100644 --- a/services/recoveryservices/mgmt/2021-07-01/backup/_meta.json +++ b/services/recoveryservices/mgmt/2021-07-01/backup/_meta.json @@ -1,5 +1,5 @@ { - "commit": "547fc2c120bac50455ab85831747d7041a2cc4ea", + "commit": "4742065e8d48160292fbce6790710c6835f8dc4f", "readme": "/_/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/readme.md", "tag": "package-2021-07", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/recoveryservices/mgmt/2021-07-01/backup/aadproperties.go b/services/recoveryservices/mgmt/2021-07-01/backup/aadproperties.go deleted file mode 100644 index ef951a5266f8..000000000000 --- a/services/recoveryservices/mgmt/2021-07-01/backup/aadproperties.go +++ /dev/null @@ -1,109 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AadPropertiesClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type AadPropertiesClient struct { - BaseClient -} - -// NewAadPropertiesClient creates an instance of the AadPropertiesClient client. -func NewAadPropertiesClient(subscriptionID string) AadPropertiesClient { - return NewAadPropertiesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAadPropertiesClientWithBaseURI creates an instance of the AadPropertiesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewAadPropertiesClientWithBaseURI(baseURI string, subscriptionID string) AadPropertiesClient { - return AadPropertiesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get sends the get request. -// Parameters: -// azureRegion - azure region to hit Api -// filter - oData filter options. -func (client AadPropertiesClient) Get(ctx context.Context, azureRegion string, filter string) (result AADPropertiesResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AadPropertiesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, azureRegion, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.AadPropertiesClient", "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.AadPropertiesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.AadPropertiesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client AadPropertiesClient) GetPreparer(ctx context.Context, azureRegion string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "azureRegion": autorest.Encode("path", azureRegion), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-12-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupAadProperties", 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 AadPropertiesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client AadPropertiesClient) GetResponder(resp *http.Response) (result AADPropertiesResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/recoveryservices/mgmt/2021-07-01/backup/backupapi/interfaces.go b/services/recoveryservices/mgmt/2021-07-01/backup/backupapi/interfaces.go index 4d9ede9ed585..f3a67e174dec 100644 --- a/services/recoveryservices/mgmt/2021-07-01/backup/backupapi/interfaces.go +++ b/services/recoveryservices/mgmt/2021-07-01/backup/backupapi/interfaces.go @@ -137,7 +137,6 @@ var _ ProtectedItemOperationResultsClientAPI = (*backup.ProtectedItemOperationRe // RecoveryPointsClientAPI contains the set of methods on the RecoveryPointsClient type. type RecoveryPointsClientAPI interface { Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string) (result backup.RecoveryPointResource, err error) - GetAccessToken(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters backup.AADPropertiesResource) (result backup.CrrAccessTokenResource, err error) List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result backup.RecoveryPointResourceListPage, err error) ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result backup.RecoveryPointResourceListIterator, err error) } @@ -374,78 +373,3 @@ type ResourceGuardProxyClientAPI interface { } var _ ResourceGuardProxyClientAPI = (*backup.ResourceGuardProxyClient)(nil) - -// UsageSummariesCRRClientAPI contains the set of methods on the UsageSummariesCRRClient type. -type UsageSummariesCRRClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ManagementUsageList, err error) -} - -var _ UsageSummariesCRRClientAPI = (*backup.UsageSummariesCRRClient)(nil) - -// AadPropertiesClientAPI contains the set of methods on the AadPropertiesClient type. -type AadPropertiesClientAPI interface { - Get(ctx context.Context, azureRegion string, filter string) (result backup.AADPropertiesResource, err error) -} - -var _ AadPropertiesClientAPI = (*backup.AadPropertiesClient)(nil) - -// CrossRegionRestoreClientAPI contains the set of methods on the CrossRegionRestoreClient type. -type CrossRegionRestoreClientAPI interface { - Trigger(ctx context.Context, azureRegion string, parameters backup.CrossRegionRestoreRequest) (result backup.CrossRegionRestoreTriggerFuture, err error) -} - -var _ CrossRegionRestoreClientAPI = (*backup.CrossRegionRestoreClient)(nil) - -// CrrJobDetailsClientAPI contains the set of methods on the CrrJobDetailsClient type. -type CrrJobDetailsClientAPI interface { - Get(ctx context.Context, azureRegion string, parameters backup.CrrJobRequest) (result backup.JobResource, err error) -} - -var _ CrrJobDetailsClientAPI = (*backup.CrrJobDetailsClient)(nil) - -// CrrJobsClientAPI contains the set of methods on the CrrJobsClient type. -type CrrJobsClientAPI interface { - List(ctx context.Context, azureRegion string, parameters backup.CrrJobRequest, filter string, skipToken string) (result backup.JobResourceListPage, err error) - ListComplete(ctx context.Context, azureRegion string, parameters backup.CrrJobRequest, filter string, skipToken string) (result backup.JobResourceListIterator, err error) -} - -var _ CrrJobsClientAPI = (*backup.CrrJobsClient)(nil) - -// CrrOperationResultsClientAPI contains the set of methods on the CrrOperationResultsClient type. -type CrrOperationResultsClientAPI interface { - Get(ctx context.Context, azureRegion string, operationID string) (result autorest.Response, err error) -} - -var _ CrrOperationResultsClientAPI = (*backup.CrrOperationResultsClient)(nil) - -// CrrOperationStatusClientAPI contains the set of methods on the CrrOperationStatusClient type. -type CrrOperationStatusClientAPI interface { - Get(ctx context.Context, azureRegion string, operationID string) (result backup.OperationStatus, err error) -} - -var _ CrrOperationStatusClientAPI = (*backup.CrrOperationStatusClient)(nil) - -// ResourceStorageConfigsClientAPI contains the set of methods on the ResourceStorageConfigsClient type. -type ResourceStorageConfigsClientAPI interface { - Get(ctx context.Context, vaultName string, resourceGroupName string) (result backup.ResourceConfigResource, err error) - Patch(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.ResourceConfigResource) (result autorest.Response, err error) - Update(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.ResourceConfigResource) (result backup.ResourceConfigResource, err error) -} - -var _ ResourceStorageConfigsClientAPI = (*backup.ResourceStorageConfigsClient)(nil) - -// RecoveryPointsCrrClientAPI contains the set of methods on the RecoveryPointsCrrClient type. -type RecoveryPointsCrrClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result backup.RecoveryPointResourceListPage, err error) - ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result backup.RecoveryPointResourceListIterator, err error) -} - -var _ RecoveryPointsCrrClientAPI = (*backup.RecoveryPointsCrrClient)(nil) - -// ProtectedItemsCrrClientAPI contains the set of methods on the ProtectedItemsCrrClient type. -type ProtectedItemsCrrClientAPI interface { - List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ProtectedItemResourceListPage, err error) - ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ProtectedItemResourceListIterator, err error) -} - -var _ ProtectedItemsCrrClientAPI = (*backup.ProtectedItemsCrrClient)(nil) diff --git a/services/recoveryservices/mgmt/2021-07-01/backup/client.go b/services/recoveryservices/mgmt/2021-07-01/backup/client.go index 480217beface..bee0a8479807 100644 --- a/services/recoveryservices/mgmt/2021-07-01/backup/client.go +++ b/services/recoveryservices/mgmt/2021-07-01/backup/client.go @@ -1,4 +1,4 @@ -// Package backup implements the Azure ARM Backup service API version . +// Package backup implements the Azure ARM Backup service API version 2021-07-01. // // Open API 2.0 Specs for Azure RecoveryServices Backup service package backup diff --git a/services/recoveryservices/mgmt/2021-07-01/backup/crossregionrestore.go b/services/recoveryservices/mgmt/2021-07-01/backup/crossregionrestore.go deleted file mode 100644 index e28639b72aa7..000000000000 --- a/services/recoveryservices/mgmt/2021-07-01/backup/crossregionrestore.go +++ /dev/null @@ -1,111 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CrossRegionRestoreClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type CrossRegionRestoreClient struct { - BaseClient -} - -// NewCrossRegionRestoreClient creates an instance of the CrossRegionRestoreClient client. -func NewCrossRegionRestoreClient(subscriptionID string) CrossRegionRestoreClient { - return NewCrossRegionRestoreClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCrossRegionRestoreClientWithBaseURI creates an instance of the CrossRegionRestoreClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewCrossRegionRestoreClientWithBaseURI(baseURI string, subscriptionID string) CrossRegionRestoreClient { - return CrossRegionRestoreClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Trigger sends the trigger request. -// Parameters: -// azureRegion - azure region to hit Api -// parameters - resource cross region restore request -func (client CrossRegionRestoreClient) Trigger(ctx context.Context, azureRegion string, parameters CrossRegionRestoreRequest) (result CrossRegionRestoreTriggerFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CrossRegionRestoreClient.Trigger") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.TriggerPreparer(ctx, azureRegion, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.CrossRegionRestoreClient", "Trigger", nil, "Failure preparing request") - return - } - - result, err = client.TriggerSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.CrossRegionRestoreClient", "Trigger", result.Response(), "Failure sending request") - return - } - - return -} - -// TriggerPreparer prepares the Trigger request. -func (client CrossRegionRestoreClient) TriggerPreparer(ctx context.Context, azureRegion string, parameters CrossRegionRestoreRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "azureRegion": autorest.Encode("path", azureRegion), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-12-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrossRegionRestore", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// TriggerSender sends the Trigger request. The method will close the -// http.Response Body if it receives an error. -func (client CrossRegionRestoreClient) TriggerSender(req *http.Request) (future CrossRegionRestoreTriggerFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// TriggerResponder handles the response to the Trigger request. The method always -// closes the http.Response Body. -func (client CrossRegionRestoreClient) TriggerResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/services/recoveryservices/mgmt/2021-07-01/backup/crrjobdetails.go b/services/recoveryservices/mgmt/2021-07-01/backup/crrjobdetails.go deleted file mode 100644 index 71e262c790a7..000000000000 --- a/services/recoveryservices/mgmt/2021-07-01/backup/crrjobdetails.go +++ /dev/null @@ -1,108 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CrrJobDetailsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type CrrJobDetailsClient struct { - BaseClient -} - -// NewCrrJobDetailsClient creates an instance of the CrrJobDetailsClient client. -func NewCrrJobDetailsClient(subscriptionID string) CrrJobDetailsClient { - return NewCrrJobDetailsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCrrJobDetailsClientWithBaseURI creates an instance of the CrrJobDetailsClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewCrrJobDetailsClientWithBaseURI(baseURI string, subscriptionID string) CrrJobDetailsClient { - return CrrJobDetailsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get sends the get request. -// Parameters: -// azureRegion - azure region to hit Api -// parameters - CRR Job request -func (client CrrJobDetailsClient) Get(ctx context.Context, azureRegion string, parameters CrrJobRequest) (result JobResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CrrJobDetailsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, azureRegion, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.CrrJobDetailsClient", "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.CrrJobDetailsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.CrrJobDetailsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client CrrJobDetailsClient) GetPreparer(ctx context.Context, azureRegion string, parameters CrrJobRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "azureRegion": autorest.Encode("path", azureRegion), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-12-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJob", pathParameters), - autorest.WithJSON(parameters), - 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 CrrJobDetailsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client CrrJobDetailsClient) GetResponder(resp *http.Response) (result JobResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/recoveryservices/mgmt/2021-07-01/backup/crrjobs.go b/services/recoveryservices/mgmt/2021-07-01/backup/crrjobs.go deleted file mode 100644 index 59c94321a7cb..000000000000 --- a/services/recoveryservices/mgmt/2021-07-01/backup/crrjobs.go +++ /dev/null @@ -1,158 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CrrJobsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type CrrJobsClient struct { - BaseClient -} - -// NewCrrJobsClient creates an instance of the CrrJobsClient client. -func NewCrrJobsClient(subscriptionID string) CrrJobsClient { - return NewCrrJobsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCrrJobsClientWithBaseURI creates an instance of the CrrJobsClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewCrrJobsClientWithBaseURI(baseURI string, subscriptionID string) CrrJobsClient { - return CrrJobsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List sends the list request. -// Parameters: -// azureRegion - azure region to hit Api -// parameters - backup CRR Job request -// filter - oData filter options. -// skipToken - skipToken Filter. -func (client CrrJobsClient) List(ctx context.Context, azureRegion string, parameters CrrJobRequest, filter string, skipToken string) (result JobResourceListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CrrJobsClient.List") - defer func() { - sc := -1 - if result.jrl.Response.Response != nil { - sc = result.jrl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, azureRegion, parameters, filter, skipToken) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.CrrJobsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.jrl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.CrrJobsClient", "List", resp, "Failure sending request") - return - } - - result.jrl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.CrrJobsClient", "List", resp, "Failure responding to request") - return - } - if result.jrl.hasNextLink() && result.jrl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client CrrJobsClient) ListPreparer(ctx context.Context, azureRegion string, parameters CrrJobRequest, filter string, skipToken string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "azureRegion": autorest.Encode("path", azureRegion), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-12-20" - 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.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJobs", pathParameters), - autorest.WithJSON(parameters), - 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 CrrJobsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client CrrJobsClient) ListResponder(resp *http.Response) (result JobResourceList, err error) { - err = autorest.Respond( - resp, - 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 CrrJobsClient) listNextResults(ctx context.Context, lastResults JobResourceList) (result JobResourceList, err error) { - req, err := lastResults.jobResourceListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "backup.CrrJobsClient", "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.CrrJobsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.CrrJobsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client CrrJobsClient) ListComplete(ctx context.Context, azureRegion string, parameters CrrJobRequest, filter string, skipToken string) (result JobResourceListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CrrJobsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, azureRegion, parameters, filter, skipToken) - return -} diff --git a/services/recoveryservices/mgmt/2021-07-01/backup/crroperationresults.go b/services/recoveryservices/mgmt/2021-07-01/backup/crroperationresults.go deleted file mode 100644 index 55dfa9ad021f..000000000000 --- a/services/recoveryservices/mgmt/2021-07-01/backup/crroperationresults.go +++ /dev/null @@ -1,106 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CrrOperationResultsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type CrrOperationResultsClient struct { - BaseClient -} - -// NewCrrOperationResultsClient creates an instance of the CrrOperationResultsClient client. -func NewCrrOperationResultsClient(subscriptionID string) CrrOperationResultsClient { - return NewCrrOperationResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCrrOperationResultsClientWithBaseURI creates an instance of the CrrOperationResultsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewCrrOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) CrrOperationResultsClient { - return CrrOperationResultsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get sends the get request. -// Parameters: -// azureRegion - azure region to hit Api -func (client CrrOperationResultsClient) Get(ctx context.Context, azureRegion string, operationID string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CrrOperationResultsClient.Get") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, azureRegion, operationID) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.CrrOperationResultsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "backup.CrrOperationResultsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.CrrOperationResultsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client CrrOperationResultsClient) GetPreparer(ctx context.Context, azureRegion string, operationID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "azureRegion": autorest.Encode("path", azureRegion), - "operationId": autorest.Encode("path", operationID), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-12-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrOperationResults/{operationId}", 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 CrrOperationResultsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client CrrOperationResultsClient) GetResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/services/recoveryservices/mgmt/2021-07-01/backup/crroperationstatus.go b/services/recoveryservices/mgmt/2021-07-01/backup/crroperationstatus.go deleted file mode 100644 index 75fc8c000111..000000000000 --- a/services/recoveryservices/mgmt/2021-07-01/backup/crroperationstatus.go +++ /dev/null @@ -1,107 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CrrOperationStatusClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type CrrOperationStatusClient struct { - BaseClient -} - -// NewCrrOperationStatusClient creates an instance of the CrrOperationStatusClient client. -func NewCrrOperationStatusClient(subscriptionID string) CrrOperationStatusClient { - return NewCrrOperationStatusClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCrrOperationStatusClientWithBaseURI creates an instance of the CrrOperationStatusClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewCrrOperationStatusClientWithBaseURI(baseURI string, subscriptionID string) CrrOperationStatusClient { - return CrrOperationStatusClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get sends the get request. -// Parameters: -// azureRegion - azure region to hit Api -func (client CrrOperationStatusClient) Get(ctx context.Context, azureRegion string, operationID string) (result OperationStatus, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CrrOperationStatusClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, azureRegion, operationID) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.CrrOperationStatusClient", "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.CrrOperationStatusClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.CrrOperationStatusClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client CrrOperationStatusClient) GetPreparer(ctx context.Context, azureRegion string, operationID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "azureRegion": autorest.Encode("path", azureRegion), - "operationId": autorest.Encode("path", operationID), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-12-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrOperationsStatus/{operationId}", 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 CrrOperationStatusClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client CrrOperationStatusClient) GetResponder(resp *http.Response) (result OperationStatus, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/recoveryservices/mgmt/2021-07-01/backup/enums.go b/services/recoveryservices/mgmt/2021-07-01/backup/enums.go index 7a7da15f874a..1cd7235e25a7 100644 --- a/services/recoveryservices/mgmt/2021-07-01/backup/enums.go +++ b/services/recoveryservices/mgmt/2021-07-01/backup/enums.go @@ -835,21 +835,6 @@ func PossibleObjectTypeValues() []ObjectType { return []ObjectType{ObjectTypeExportJobsOperationResultInfo, ObjectTypeOperationResultInfo, ObjectTypeOperationResultInfoBase} } -// ObjectTypeBasicCrrAccessToken enumerates the values for object type basic crr access token. -type ObjectTypeBasicCrrAccessToken string - -const ( - // ObjectTypeBasicCrrAccessTokenObjectTypeCrrAccessToken ... - ObjectTypeBasicCrrAccessTokenObjectTypeCrrAccessToken ObjectTypeBasicCrrAccessToken = "CrrAccessToken" - // ObjectTypeBasicCrrAccessTokenObjectTypeWorkloadCrrAccessToken ... - ObjectTypeBasicCrrAccessTokenObjectTypeWorkloadCrrAccessToken ObjectTypeBasicCrrAccessToken = "WorkloadCrrAccessToken" -) - -// PossibleObjectTypeBasicCrrAccessTokenValues returns an array of possible values for the ObjectTypeBasicCrrAccessToken const type. -func PossibleObjectTypeBasicCrrAccessTokenValues() []ObjectTypeBasicCrrAccessToken { - return []ObjectTypeBasicCrrAccessToken{ObjectTypeBasicCrrAccessTokenObjectTypeCrrAccessToken, ObjectTypeBasicCrrAccessTokenObjectTypeWorkloadCrrAccessToken} -} - // ObjectTypeBasicILRRequest enumerates the values for object type basic ilr request. type ObjectTypeBasicILRRequest string @@ -880,13 +865,11 @@ const ( ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobsExtendedInfo ObjectTypeBasicOperationStatusExtendedInfo = "OperationStatusJobsExtendedInfo" // ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusProvisionILRExtendedInfo ... ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusProvisionILRExtendedInfo ObjectTypeBasicOperationStatusExtendedInfo = "OperationStatusProvisionILRExtendedInfo" - // ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusRecoveryPointExtendedInfo ... - ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusRecoveryPointExtendedInfo ObjectTypeBasicOperationStatusExtendedInfo = "OperationStatusRecoveryPointExtendedInfo" ) // PossibleObjectTypeBasicOperationStatusExtendedInfoValues returns an array of possible values for the ObjectTypeBasicOperationStatusExtendedInfo const type. func PossibleObjectTypeBasicOperationStatusExtendedInfoValues() []ObjectTypeBasicOperationStatusExtendedInfo { - return []ObjectTypeBasicOperationStatusExtendedInfo{ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusExtendedInfo, ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobExtendedInfo, ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobsExtendedInfo, ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusProvisionILRExtendedInfo, ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusRecoveryPointExtendedInfo} + return []ObjectTypeBasicOperationStatusExtendedInfo{ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusExtendedInfo, ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobExtendedInfo, ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobsExtendedInfo, ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusProvisionILRExtendedInfo} } // ObjectTypeBasicRecoveryPoint enumerates the values for object type basic recovery point. diff --git a/services/recoveryservices/mgmt/2021-07-01/backup/models.go b/services/recoveryservices/mgmt/2021-07-01/backup/models.go index 687afe5a7993..e62e784a928e 100644 --- a/services/recoveryservices/mgmt/2021-07-01/backup/models.go +++ b/services/recoveryservices/mgmt/2021-07-01/backup/models.go @@ -20,52 +20,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2021-07-01/backup" -// AADProperties ... -type AADProperties struct { - ServicePrincipalClientID *string `json:"servicePrincipalClientId,omitempty"` - TenantID *string `json:"tenantId,omitempty"` - Authority *string `json:"authority,omitempty"` - Audience *string `json:"audience,omitempty"` - ServicePrincipalObjectID *string `json:"servicePrincipalObjectId,omitempty"` -} - -// AADPropertiesResource ... -type AADPropertiesResource struct { - autorest.Response `json:"-"` - // Properties - AADPropertiesResource properties - Properties *AADProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for AADPropertiesResource. -func (apr AADPropertiesResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if apr.Properties != nil { - objectMap["properties"] = apr.Properties - } - if apr.Location != nil { - objectMap["location"] = apr.Location - } - if apr.Tags != nil { - objectMap["tags"] = apr.Tags - } - if apr.ETag != nil { - objectMap["eTag"] = apr.ETag - } - return json.Marshal(objectMap) -} - // AzureBackupGoalFeatureSupportRequest azure backup goal feature specific request. type AzureBackupGoalFeatureSupportRequest struct { // FeatureType - Possible values include: 'FeatureTypeFeatureSupportRequest', 'FeatureTypeAzureBackupGoals', 'FeatureTypeAzureVMResourceBackup' @@ -547,8 +501,6 @@ type AzureFileshareProtectedItem struct { KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` // ExtendedInfo - Additional information with this backup item. ExtendedInfo *AzureFileshareProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // HealthStatus - backups running status for this backup item. Possible values include: 'HealthStatusPassed', 'HealthStatusActionRequired', 'HealthStatusActionSuggested', 'HealthStatusInvalid' - HealthStatus HealthStatus `json:"healthStatus,omitempty"` // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' BackupManagementType ManagementType `json:"backupManagementType,omitempty"` // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' @@ -606,9 +558,6 @@ func (afpi AzureFileshareProtectedItem) MarshalJSON() ([]byte, error) { if afpi.ExtendedInfo != nil { objectMap["extendedInfo"] = afpi.ExtendedInfo } - if afpi.HealthStatus != "" { - objectMap["healthStatus"] = afpi.HealthStatus - } if afpi.BackupManagementType != "" { objectMap["backupManagementType"] = afpi.BackupManagementType } @@ -973,13 +922,13 @@ func (afspir AzureFileShareProvisionILRRequest) AsBasicILRRequest() (BasicILRReq // AzureFileShareRecoveryPoint azure File Share workload specific backup copy. type AzureFileShareRecoveryPoint struct { - // RecoveryPointType - READ-ONLY; Type of the backup copy. Specifies whether it is a crash consistent backup or app consistent. + // RecoveryPointType - Type of the backup copy. Specifies whether it is a crash consistent backup or app consistent. RecoveryPointType *string `json:"recoveryPointType,omitempty"` - // RecoveryPointTime - READ-ONLY; Time at which this backup copy was created. + // RecoveryPointTime - Time at which this backup copy was created. RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` - // FileShareSnapshotURI - READ-ONLY; Contains Url to the snapshot of fileshare, if applicable + // FileShareSnapshotURI - Contains Url to the snapshot of fileshare, if applicable FileShareSnapshotURI *string `json:"fileShareSnapshotUri,omitempty"` - // RecoveryPointSizeInGB - READ-ONLY; Contains recovery point size + // RecoveryPointSizeInGB - Contains recovery point size RecoveryPointSizeInGB *int32 `json:"recoveryPointSizeInGB,omitempty"` // ObjectType - Possible values include: 'ObjectTypeBasicRecoveryPointObjectTypeRecoveryPoint', 'ObjectTypeBasicRecoveryPointObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeBasicRecoveryPointObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeBasicRecoveryPointObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeBasicRecoveryPointObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeBasicRecoveryPointObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeBasicRecoveryPointObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeBasicRecoveryPointObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeBasicRecoveryPointObjectTypeGenericRecoveryPoint', 'ObjectTypeBasicRecoveryPointObjectTypeIaasVMRecoveryPoint' ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` @@ -989,6 +938,18 @@ type AzureFileShareRecoveryPoint struct { func (afsrp AzureFileShareRecoveryPoint) MarshalJSON() ([]byte, error) { afsrp.ObjectType = ObjectTypeBasicRecoveryPointObjectTypeAzureFileShareRecoveryPoint objectMap := make(map[string]interface{}) + if afsrp.RecoveryPointType != nil { + objectMap["recoveryPointType"] = afsrp.RecoveryPointType + } + if afsrp.RecoveryPointTime != nil { + objectMap["recoveryPointTime"] = afsrp.RecoveryPointTime + } + if afsrp.FileShareSnapshotURI != nil { + objectMap["fileShareSnapshotUri"] = afsrp.FileShareSnapshotURI + } + if afsrp.RecoveryPointSizeInGB != nil { + objectMap["recoveryPointSizeInGB"] = afsrp.RecoveryPointSizeInGB + } if afsrp.ObjectType != "" { objectMap["objectType"] = afsrp.ObjectType } @@ -7880,9 +7841,9 @@ type BasicAzureWorkloadPointInTimeRecoveryPoint interface { type AzureWorkloadPointInTimeRecoveryPoint struct { // TimeRanges - List of log ranges TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + // RecoveryPointTimeInUTC - UTC time at which recovery point was created RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' + // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' Type RestorePointType `json:"type,omitempty"` // RecoveryPointTierDetails - Recovery point tier information. RecoveryPointTierDetails *[]RecoveryPointTierInformation `json:"recoveryPointTierDetails,omitempty"` @@ -7936,6 +7897,12 @@ func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) MarshalJSON() ([]byte, erro if awpitrp.TimeRanges != nil { objectMap["timeRanges"] = awpitrp.TimeRanges } + if awpitrp.RecoveryPointTimeInUTC != nil { + objectMap["recoveryPointTimeInUTC"] = awpitrp.RecoveryPointTimeInUTC + } + if awpitrp.Type != "" { + objectMap["type"] = awpitrp.Type + } if awpitrp.RecoveryPointTierDetails != nil { objectMap["recoveryPointTierDetails"] = awpitrp.RecoveryPointTierDetails } @@ -8191,9 +8158,9 @@ type BasicAzureWorkloadRecoveryPoint interface { // AzureWorkloadRecoveryPoint workload specific recovery point, specifically encapsulates full/diff recovery // point type AzureWorkloadRecoveryPoint struct { - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + // RecoveryPointTimeInUTC - UTC time at which recovery point was created RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' + // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' Type RestorePointType `json:"type,omitempty"` // RecoveryPointTierDetails - Recovery point tier information. RecoveryPointTierDetails *[]RecoveryPointTierInformation `json:"recoveryPointTierDetails,omitempty"` @@ -8260,6 +8227,12 @@ func unmarshalBasicAzureWorkloadRecoveryPointArray(body []byte) ([]BasicAzureWor func (awrp AzureWorkloadRecoveryPoint) MarshalJSON() ([]byte, error) { awrp.ObjectType = ObjectTypeBasicRecoveryPointObjectTypeAzureWorkloadRecoveryPoint objectMap := make(map[string]interface{}) + if awrp.RecoveryPointTimeInUTC != nil { + objectMap["recoveryPointTimeInUTC"] = awrp.RecoveryPointTimeInUTC + } + if awrp.Type != "" { + objectMap["type"] = awrp.Type + } if awrp.RecoveryPointTierDetails != nil { objectMap["recoveryPointTierDetails"] = awrp.RecoveryPointTierDetails } @@ -8585,9 +8558,9 @@ func (awrr AzureWorkloadRestoreRequest) AsBasicRestoreRequest() (BasicRestoreReq type AzureWorkloadSAPHanaPointInTimeRecoveryPoint struct { // TimeRanges - List of log ranges TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + // RecoveryPointTimeInUTC - UTC time at which recovery point was created RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' + // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' Type RestorePointType `json:"type,omitempty"` // RecoveryPointTierDetails - Recovery point tier information. RecoveryPointTierDetails *[]RecoveryPointTierInformation `json:"recoveryPointTierDetails,omitempty"` @@ -8604,6 +8577,12 @@ func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) MarshalJSON() ([]b if awshpitrp.TimeRanges != nil { objectMap["timeRanges"] = awshpitrp.TimeRanges } + if awshpitrp.RecoveryPointTimeInUTC != nil { + objectMap["recoveryPointTimeInUTC"] = awshpitrp.RecoveryPointTimeInUTC + } + if awshpitrp.Type != "" { + objectMap["type"] = awshpitrp.Type + } if awshpitrp.RecoveryPointTierDetails != nil { objectMap["recoveryPointTierDetails"] = awshpitrp.RecoveryPointTierDetails } @@ -9054,9 +9033,9 @@ func (awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) As // AzureWorkloadSAPHanaRecoveryPoint sAPHana specific recoverypoint, specifically encapsulates full/diff // recoverypoints type AzureWorkloadSAPHanaRecoveryPoint struct { - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + // RecoveryPointTimeInUTC - UTC time at which recovery point was created RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' + // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' Type RestorePointType `json:"type,omitempty"` // RecoveryPointTierDetails - Recovery point tier information. RecoveryPointTierDetails *[]RecoveryPointTierInformation `json:"recoveryPointTierDetails,omitempty"` @@ -9070,6 +9049,12 @@ type AzureWorkloadSAPHanaRecoveryPoint struct { func (awshrp AzureWorkloadSAPHanaRecoveryPoint) MarshalJSON() ([]byte, error) { awshrp.ObjectType = ObjectTypeBasicRecoveryPointObjectTypeAzureWorkloadSAPHanaRecoveryPoint objectMap := make(map[string]interface{}) + if awshrp.RecoveryPointTimeInUTC != nil { + objectMap["recoveryPointTimeInUTC"] = awshrp.RecoveryPointTimeInUTC + } + if awshrp.Type != "" { + objectMap["type"] = awshrp.Type + } if awshrp.RecoveryPointTierDetails != nil { objectMap["recoveryPointTierDetails"] = awshrp.RecoveryPointTierDetails } @@ -9610,9 +9595,9 @@ type AzureWorkloadSQLPointInTimeRecoveryPoint struct { // When a specific recovery point is accessed using GetRecoveryPoint // Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter ExtendedInfo *AzureWorkloadSQLRecoveryPointExtendedInfo `json:"extendedInfo,omitempty"` - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + // RecoveryPointTimeInUTC - UTC time at which recovery point was created RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' + // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' Type RestorePointType `json:"type,omitempty"` // RecoveryPointTierDetails - Recovery point tier information. RecoveryPointTierDetails *[]RecoveryPointTierInformation `json:"recoveryPointTierDetails,omitempty"` @@ -9632,6 +9617,12 @@ func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) MarshalJSON() ([]byte, if awspitrp.ExtendedInfo != nil { objectMap["extendedInfo"] = awspitrp.ExtendedInfo } + if awspitrp.RecoveryPointTimeInUTC != nil { + objectMap["recoveryPointTimeInUTC"] = awspitrp.RecoveryPointTimeInUTC + } + if awspitrp.Type != "" { + objectMap["type"] = awspitrp.Type + } if awspitrp.RecoveryPointTierDetails != nil { objectMap["recoveryPointTierDetails"] = awspitrp.RecoveryPointTierDetails } @@ -10123,9 +10114,9 @@ type AzureWorkloadSQLRecoveryPoint struct { // When a specific recovery point is accessed using GetRecoveryPoint // Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter ExtendedInfo *AzureWorkloadSQLRecoveryPointExtendedInfo `json:"extendedInfo,omitempty"` - // RecoveryPointTimeInUTC - READ-ONLY; UTC time at which recovery point was created + // RecoveryPointTimeInUTC - UTC time at which recovery point was created RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` - // Type - READ-ONLY; Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' + // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' Type RestorePointType `json:"type,omitempty"` // RecoveryPointTierDetails - Recovery point tier information. RecoveryPointTierDetails *[]RecoveryPointTierInformation `json:"recoveryPointTierDetails,omitempty"` @@ -10179,6 +10170,12 @@ func (awsrp AzureWorkloadSQLRecoveryPoint) MarshalJSON() ([]byte, error) { if awsrp.ExtendedInfo != nil { objectMap["extendedInfo"] = awsrp.ExtendedInfo } + if awsrp.RecoveryPointTimeInUTC != nil { + objectMap["recoveryPointTimeInUTC"] = awsrp.RecoveryPointTimeInUTC + } + if awsrp.Type != "" { + objectMap["type"] = awsrp.Type + } if awsrp.RecoveryPointTierDetails != nil { objectMap["recoveryPointTierDetails"] = awsrp.RecoveryPointTierDetails } @@ -10263,18 +10260,12 @@ func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicRecoveryPoint() (BasicRecovery // AzureWorkloadSQLRecoveryPointExtendedInfo extended info class details type AzureWorkloadSQLRecoveryPointExtendedInfo struct { - // DataDirectoryTimeInUTC - READ-ONLY; UTC time at which data directory info was captured + // DataDirectoryTimeInUTC - UTC time at which data directory info was captured DataDirectoryTimeInUTC *date.Time `json:"dataDirectoryTimeInUTC,omitempty"` - // DataDirectoryPaths - READ-ONLY; List of data directory paths during restore operation. + // DataDirectoryPaths - List of data directory paths during restore operation. DataDirectoryPaths *[]SQLDataDirectory `json:"dataDirectoryPaths,omitempty"` } -// MarshalJSON is the custom marshaler for AzureWorkloadSQLRecoveryPointExtendedInfo. -func (awsrpei AzureWorkloadSQLRecoveryPointExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - // BasicAzureWorkloadSQLRestoreRequest azureWorkload SQL -specific restore. Specifically for full/diff restore type BasicAzureWorkloadSQLRestoreRequest interface { AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) @@ -10679,12 +10670,6 @@ type BEKDetails struct { SecretData *string `json:"secretData,omitempty"` } -// BMSAADPropertiesQueryObject filters to list backup items. -type BMSAADPropertiesQueryObject 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"` -} - // BMSBackupEngineQueryObject query parameters to fetch list of backup engines. type BMSBackupEngineQueryObject struct { // Expand - attribute to add extended info @@ -11112,473 +11097,6 @@ type ContainerIdentityInfo struct { Audience *string `json:"audience,omitempty"` } -// CrossRegionRestoreRequest ... -type CrossRegionRestoreRequest struct { - // CrossRegionRestoreAccessDetails - Access details for cross region restore - CrossRegionRestoreAccessDetails BasicCrrAccessToken `json:"crossRegionRestoreAccessDetails,omitempty"` - // RestoreRequest - Request object for triggering restore - RestoreRequest BasicRestoreRequest `json:"restoreRequest,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for CrossRegionRestoreRequest struct. -func (crrr *CrossRegionRestoreRequest) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "crossRegionRestoreAccessDetails": - if v != nil { - crossRegionRestoreAccessDetails, err := unmarshalBasicCrrAccessToken(*v) - if err != nil { - return err - } - crrr.CrossRegionRestoreAccessDetails = crossRegionRestoreAccessDetails - } - case "restoreRequest": - if v != nil { - restoreRequest, err := unmarshalBasicRestoreRequest(*v) - if err != nil { - return err - } - crrr.RestoreRequest = restoreRequest - } - } - } - - return nil -} - -// CrossRegionRestoreRequestResource ... -type CrossRegionRestoreRequestResource struct { - // Properties - CrossRegionRestoreRequestResource properties - Properties *CrossRegionRestoreRequest `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for CrossRegionRestoreRequestResource. -func (crrrr CrossRegionRestoreRequestResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if crrrr.Properties != nil { - objectMap["properties"] = crrrr.Properties - } - if crrrr.Location != nil { - objectMap["location"] = crrrr.Location - } - if crrrr.Tags != nil { - objectMap["tags"] = crrrr.Tags - } - if crrrr.ETag != nil { - objectMap["eTag"] = crrrr.ETag - } - return json.Marshal(objectMap) -} - -// CrossRegionRestoreTriggerFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type CrossRegionRestoreTriggerFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CrossRegionRestoreClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CrossRegionRestoreTriggerFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CrossRegionRestoreTriggerFuture.Result. -func (future *CrossRegionRestoreTriggerFuture) result(client CrossRegionRestoreClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.CrossRegionRestoreTriggerFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("backup.CrossRegionRestoreTriggerFuture") - return - } - ar.Response = future.Response() - return -} - -// BasicCrrAccessToken ... -type BasicCrrAccessToken interface { - AsWorkloadCrrAccessToken() (*WorkloadCrrAccessToken, bool) - AsCrrAccessToken() (*CrrAccessToken, bool) -} - -// CrrAccessToken ... -type CrrAccessToken struct { - // AccessTokenString - Access token used for authentication - AccessTokenString *string `json:"accessTokenString,omitempty"` - // SubscriptionID - Subscription Id of the source vault - SubscriptionID *string `json:"subscriptionId,omitempty"` - // ResourceGroupName - Resource Group name of the source vault - ResourceGroupName *string `json:"resourceGroupName,omitempty"` - // ResourceName - Resource Name of the source vault - ResourceName *string `json:"resourceName,omitempty"` - // ResourceID - Resource Id of the source vault - ResourceID *string `json:"resourceId,omitempty"` - // ProtectionContainerID - Protected item container id - ProtectionContainerID *int64 `json:"protectionContainerId,omitempty"` - // RecoveryPointID - Recovery Point Id - RecoveryPointID *string `json:"recoveryPointId,omitempty"` - // RecoveryPointTime - Recovery Point Time - RecoveryPointTime *string `json:"recoveryPointTime,omitempty"` - // ContainerName - Container Unique name - ContainerName *string `json:"containerName,omitempty"` - // ContainerType - Container Type - ContainerType *string `json:"containerType,omitempty"` - // BackupManagementType - Backup Management Type - BackupManagementType *string `json:"backupManagementType,omitempty"` - // DatasourceType - Datasource Type - DatasourceType *string `json:"datasourceType,omitempty"` - // DatasourceName - Datasource Friendly Name - DatasourceName *string `json:"datasourceName,omitempty"` - // DatasourceID - Datasource Id - DatasourceID *string `json:"datasourceId,omitempty"` - // DatasourceContainerName - Datasource Container Unique Name - DatasourceContainerName *string `json:"datasourceContainerName,omitempty"` - // CoordinatorServiceStampID - CoordinatorServiceStampId to be used by BCM in restore call - CoordinatorServiceStampID *string `json:"coordinatorServiceStampId,omitempty"` - // CoordinatorServiceStampURI - CoordinatorServiceStampUri to be used by BCM in restore call - CoordinatorServiceStampURI *string `json:"coordinatorServiceStampUri,omitempty"` - // ProtectionServiceStampID - ProtectionServiceStampId to be used by BCM in restore call - ProtectionServiceStampID *string `json:"protectionServiceStampId,omitempty"` - // ProtectionServiceStampURI - ProtectionServiceStampUri to be used by BCM in restore call - ProtectionServiceStampURI *string `json:"protectionServiceStampUri,omitempty"` - // TokenExtendedInformation - Extended Information about the token like FileSpec etc. - TokenExtendedInformation *string `json:"tokenExtendedInformation,omitempty"` - // RpTierInformation - Recovery point Tier Information - RpTierInformation map[string]*string `json:"rpTierInformation"` - // RpOriginalSAOption - Recovery point information: Original SA option - RpOriginalSAOption *bool `json:"rpOriginalSAOption,omitempty"` - // RpIsManagedVirtualMachine - Recovery point information: Managed virtual machine - RpIsManagedVirtualMachine *bool `json:"rpIsManagedVirtualMachine,omitempty"` - // RpVMSizeDescription - Recovery point information: VM size description - RpVMSizeDescription *string `json:"rpVMSizeDescription,omitempty"` - // BMSActiveRegion - Active region name of BMS Stamp - BMSActiveRegion *string `json:"bMSActiveRegion,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeBasicCrrAccessTokenObjectTypeCrrAccessToken', 'ObjectTypeBasicCrrAccessTokenObjectTypeWorkloadCrrAccessToken' - ObjectType ObjectTypeBasicCrrAccessToken `json:"objectType,omitempty"` -} - -func unmarshalBasicCrrAccessToken(body []byte) (BasicCrrAccessToken, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["objectType"] { - case string(ObjectTypeBasicCrrAccessTokenObjectTypeWorkloadCrrAccessToken): - var wcat WorkloadCrrAccessToken - err := json.Unmarshal(body, &wcat) - return wcat, err - default: - var cat CrrAccessToken - err := json.Unmarshal(body, &cat) - return cat, err - } -} -func unmarshalBasicCrrAccessTokenArray(body []byte) ([]BasicCrrAccessToken, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - catArray := make([]BasicCrrAccessToken, len(rawMessages)) - - for index, rawMessage := range rawMessages { - cat, err := unmarshalBasicCrrAccessToken(*rawMessage) - if err != nil { - return nil, err - } - catArray[index] = cat - } - return catArray, nil -} - -// MarshalJSON is the custom marshaler for CrrAccessToken. -func (cat CrrAccessToken) MarshalJSON() ([]byte, error) { - cat.ObjectType = ObjectTypeBasicCrrAccessTokenObjectTypeCrrAccessToken - objectMap := make(map[string]interface{}) - if cat.AccessTokenString != nil { - objectMap["accessTokenString"] = cat.AccessTokenString - } - if cat.SubscriptionID != nil { - objectMap["subscriptionId"] = cat.SubscriptionID - } - if cat.ResourceGroupName != nil { - objectMap["resourceGroupName"] = cat.ResourceGroupName - } - if cat.ResourceName != nil { - objectMap["resourceName"] = cat.ResourceName - } - if cat.ResourceID != nil { - objectMap["resourceId"] = cat.ResourceID - } - if cat.ProtectionContainerID != nil { - objectMap["protectionContainerId"] = cat.ProtectionContainerID - } - if cat.RecoveryPointID != nil { - objectMap["recoveryPointId"] = cat.RecoveryPointID - } - if cat.RecoveryPointTime != nil { - objectMap["recoveryPointTime"] = cat.RecoveryPointTime - } - if cat.ContainerName != nil { - objectMap["containerName"] = cat.ContainerName - } - if cat.ContainerType != nil { - objectMap["containerType"] = cat.ContainerType - } - if cat.BackupManagementType != nil { - objectMap["backupManagementType"] = cat.BackupManagementType - } - if cat.DatasourceType != nil { - objectMap["datasourceType"] = cat.DatasourceType - } - if cat.DatasourceName != nil { - objectMap["datasourceName"] = cat.DatasourceName - } - if cat.DatasourceID != nil { - objectMap["datasourceId"] = cat.DatasourceID - } - if cat.DatasourceContainerName != nil { - objectMap["datasourceContainerName"] = cat.DatasourceContainerName - } - if cat.CoordinatorServiceStampID != nil { - objectMap["coordinatorServiceStampId"] = cat.CoordinatorServiceStampID - } - if cat.CoordinatorServiceStampURI != nil { - objectMap["coordinatorServiceStampUri"] = cat.CoordinatorServiceStampURI - } - if cat.ProtectionServiceStampID != nil { - objectMap["protectionServiceStampId"] = cat.ProtectionServiceStampID - } - if cat.ProtectionServiceStampURI != nil { - objectMap["protectionServiceStampUri"] = cat.ProtectionServiceStampURI - } - if cat.TokenExtendedInformation != nil { - objectMap["tokenExtendedInformation"] = cat.TokenExtendedInformation - } - if cat.RpTierInformation != nil { - objectMap["rpTierInformation"] = cat.RpTierInformation - } - if cat.RpOriginalSAOption != nil { - objectMap["rpOriginalSAOption"] = cat.RpOriginalSAOption - } - if cat.RpIsManagedVirtualMachine != nil { - objectMap["rpIsManagedVirtualMachine"] = cat.RpIsManagedVirtualMachine - } - if cat.RpVMSizeDescription != nil { - objectMap["rpVMSizeDescription"] = cat.RpVMSizeDescription - } - if cat.BMSActiveRegion != nil { - objectMap["bMSActiveRegion"] = cat.BMSActiveRegion - } - if cat.ObjectType != "" { - objectMap["objectType"] = cat.ObjectType - } - return json.Marshal(objectMap) -} - -// AsWorkloadCrrAccessToken is the BasicCrrAccessToken implementation for CrrAccessToken. -func (cat CrrAccessToken) AsWorkloadCrrAccessToken() (*WorkloadCrrAccessToken, bool) { - return nil, false -} - -// AsCrrAccessToken is the BasicCrrAccessToken implementation for CrrAccessToken. -func (cat CrrAccessToken) AsCrrAccessToken() (*CrrAccessToken, bool) { - return &cat, true -} - -// AsBasicCrrAccessToken is the BasicCrrAccessToken implementation for CrrAccessToken. -func (cat CrrAccessToken) AsBasicCrrAccessToken() (BasicCrrAccessToken, bool) { - return &cat, true -} - -// CrrAccessTokenResource ... -type CrrAccessTokenResource struct { - autorest.Response `json:"-"` - // Properties - CrrAccessTokenResource properties - Properties BasicCrrAccessToken `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for CrrAccessTokenResource. -func (catr CrrAccessTokenResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = catr.Properties - if catr.Location != nil { - objectMap["location"] = catr.Location - } - if catr.Tags != nil { - objectMap["tags"] = catr.Tags - } - if catr.ETag != nil { - objectMap["eTag"] = catr.ETag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for CrrAccessTokenResource struct. -func (catr *CrrAccessTokenResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicCrrAccessToken(*v) - if err != nil { - return err - } - catr.Properties = properties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - catr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - catr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - catr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - catr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - catr.Tags = tags - } - case "eTag": - if v != nil { - var eTag string - err = json.Unmarshal(*v, &eTag) - if err != nil { - return err - } - catr.ETag = &eTag - } - } - } - - return nil -} - -// CrrJobRequest request object for fetching CRR jobs. -type CrrJobRequest struct { - // ResourceID - Entire ARM resource id of the resource - ResourceID *string `json:"resourceId,omitempty"` - // JobName - Job Name of the job to be fetched - JobName *string `json:"jobName,omitempty"` -} - -// CrrJobRequestResource request object for fetching CRR jobs. -type CrrJobRequestResource struct { - // Properties - CrrJobRequestResource properties - Properties *CrrJobRequest `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id represents the complete path to the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name associated with the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ETag - Optional ETag. - ETag *string `json:"eTag,omitempty"` -} - -// MarshalJSON is the custom marshaler for CrrJobRequestResource. -func (cjrr CrrJobRequestResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cjrr.Properties != nil { - objectMap["properties"] = cjrr.Properties - } - if cjrr.Location != nil { - objectMap["location"] = cjrr.Location - } - if cjrr.Tags != nil { - objectMap["tags"] = cjrr.Tags - } - if cjrr.ETag != nil { - objectMap["eTag"] = cjrr.ETag - } - return json.Marshal(objectMap) -} - // DailyRetentionFormat daily retention format. type DailyRetentionFormat struct { // DaysOfTheMonth - List of days of the month. @@ -13999,15 +13517,15 @@ func (ispi IaaSVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloa // IaasVMRecoveryPoint iaaS VM workload specific backup copy. type IaasVMRecoveryPoint struct { - // RecoveryPointType - READ-ONLY; Type of the backup copy. + // RecoveryPointType - Type of the backup copy. RecoveryPointType *string `json:"recoveryPointType,omitempty"` - // RecoveryPointTime - READ-ONLY; Time at which this backup copy was created. + // RecoveryPointTime - Time at which this backup copy was created. RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` - // RecoveryPointAdditionalInfo - READ-ONLY; Additional information associated with this backup copy. + // RecoveryPointAdditionalInfo - Additional information associated with this backup copy. RecoveryPointAdditionalInfo *string `json:"recoveryPointAdditionalInfo,omitempty"` - // SourceVMStorageType - READ-ONLY; Storage type of the VM whose backup copy is created. + // SourceVMStorageType - Storage type of the VM whose backup copy is created. SourceVMStorageType *string `json:"sourceVMStorageType,omitempty"` - // IsSourceVMEncrypted - READ-ONLY; Identifies whether the VM was encrypted when the backup copy is created. + // IsSourceVMEncrypted - Identifies whether the VM was encrypted when the backup copy is created. IsSourceVMEncrypted *bool `json:"isSourceVMEncrypted,omitempty"` // KeyAndSecret - Required details for recovering an encrypted VM. Applicable only when IsSourceVMEncrypted is true. KeyAndSecret *KeyAndSecretDetails `json:"keyAndSecret,omitempty"` @@ -14037,6 +13555,21 @@ type IaasVMRecoveryPoint struct { func (ivrp IaasVMRecoveryPoint) MarshalJSON() ([]byte, error) { ivrp.ObjectType = ObjectTypeBasicRecoveryPointObjectTypeIaasVMRecoveryPoint objectMap := make(map[string]interface{}) + if ivrp.RecoveryPointType != nil { + objectMap["recoveryPointType"] = ivrp.RecoveryPointType + } + if ivrp.RecoveryPointTime != nil { + objectMap["recoveryPointTime"] = ivrp.RecoveryPointTime + } + if ivrp.RecoveryPointAdditionalInfo != nil { + objectMap["recoveryPointAdditionalInfo"] = ivrp.RecoveryPointAdditionalInfo + } + if ivrp.SourceVMStorageType != nil { + objectMap["sourceVMStorageType"] = ivrp.SourceVMStorageType + } + if ivrp.IsSourceVMEncrypted != nil { + objectMap["isSourceVMEncrypted"] = ivrp.IsSourceVMEncrypted + } if ivrp.KeyAndSecret != nil { objectMap["keyAndSecret"] = ivrp.KeyAndSecret } @@ -16657,13 +16190,12 @@ type BasicOperationStatusExtendedInfo interface { AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) - AsOperationStatusRecoveryPointExtendedInfo() (*OperationStatusRecoveryPointExtendedInfo, bool) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) } // OperationStatusExtendedInfo base class for additional information of operation status. type OperationStatusExtendedInfo struct { - // ObjectType - Possible values include: 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusProvisionILRExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusRecoveryPointExtendedInfo' + // ObjectType - Possible values include: 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusProvisionILRExtendedInfo' ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` } @@ -16687,10 +16219,6 @@ func unmarshalBasicOperationStatusExtendedInfo(body []byte) (BasicOperationStatu var ospiei OperationStatusProvisionILRExtendedInfo err := json.Unmarshal(body, &ospiei) return ospiei, err - case string(ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusRecoveryPointExtendedInfo): - var osrpei OperationStatusRecoveryPointExtendedInfo - err := json.Unmarshal(body, &osrpei) - return osrpei, err default: var osei OperationStatusExtendedInfo err := json.Unmarshal(body, &osei) @@ -16741,11 +16269,6 @@ func (osei OperationStatusExtendedInfo) AsOperationStatusProvisionILRExtendedInf return nil, false } -// AsOperationStatusRecoveryPointExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. -func (osei OperationStatusExtendedInfo) AsOperationStatusRecoveryPointExtendedInfo() (*OperationStatusRecoveryPointExtendedInfo, bool) { - return nil, false -} - // AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. func (osei OperationStatusExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { return &osei, true @@ -16760,7 +16283,7 @@ func (osei OperationStatusExtendedInfo) AsBasicOperationStatusExtendedInfo() (Ba type OperationStatusJobExtendedInfo struct { // JobID - ID of the job created for this protected item. JobID *string `json:"jobId,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusProvisionILRExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusRecoveryPointExtendedInfo' + // ObjectType - Possible values include: 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusProvisionILRExtendedInfo' ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` } @@ -16792,11 +16315,6 @@ func (osjei OperationStatusJobExtendedInfo) AsOperationStatusProvisionILRExtende return nil, false } -// AsOperationStatusRecoveryPointExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. -func (osjei OperationStatusJobExtendedInfo) AsOperationStatusRecoveryPointExtendedInfo() (*OperationStatusRecoveryPointExtendedInfo, bool) { - return nil, false -} - // AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. func (osjei OperationStatusJobExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { return nil, false @@ -16813,7 +16331,7 @@ type OperationStatusJobsExtendedInfo struct { JobIds *[]string `json:"jobIds,omitempty"` // FailedJobsError - Stores all the failed jobs along with the corresponding error codes. FailedJobsError map[string]*string `json:"failedJobsError"` - // ObjectType - Possible values include: 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusProvisionILRExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusRecoveryPointExtendedInfo' + // ObjectType - Possible values include: 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusProvisionILRExtendedInfo' ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` } @@ -16848,11 +16366,6 @@ func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusProvisionILRExtend return nil, false } -// AsOperationStatusRecoveryPointExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. -func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusRecoveryPointExtendedInfo() (*OperationStatusRecoveryPointExtendedInfo, bool) { - return nil, false -} - // AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { return nil, false @@ -16867,7 +16380,7 @@ func (osjei OperationStatusJobsExtendedInfo) AsBasicOperationStatusExtendedInfo( type OperationStatusProvisionILRExtendedInfo struct { // RecoveryTarget - Target details for file / folder restore. RecoveryTarget *InstantItemRecoveryTarget `json:"recoveryTarget,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusProvisionILRExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusRecoveryPointExtendedInfo' + // ObjectType - Possible values include: 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusProvisionILRExtendedInfo' ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` } @@ -16899,11 +16412,6 @@ func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusProvision return &ospiei, true } -// AsOperationStatusRecoveryPointExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. -func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusRecoveryPointExtendedInfo() (*OperationStatusRecoveryPointExtendedInfo, bool) { - return nil, false -} - // AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { return nil, false @@ -16914,101 +16422,6 @@ func (ospiei OperationStatusProvisionILRExtendedInfo) AsBasicOperationStatusExte return &ospiei, true } -// OperationStatusRecoveryPointExtendedInfo operation status extended info for Updated Recovery Point. -type OperationStatusRecoveryPointExtendedInfo struct { - // UpdatedRecoveryPoint - Recovery Point info with updated source snapshot URI - UpdatedRecoveryPoint BasicRecoveryPoint `json:"updatedRecoveryPoint,omitempty"` - // DeletedBackupItemVersion - In case the share is in soft-deleted state, populate this field with deleted backup item - DeletedBackupItemVersion *string `json:"deletedBackupItemVersion,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusProvisionILRExtendedInfo', 'ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusRecoveryPointExtendedInfo' - ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationStatusRecoveryPointExtendedInfo. -func (osrpei OperationStatusRecoveryPointExtendedInfo) MarshalJSON() ([]byte, error) { - osrpei.ObjectType = ObjectTypeBasicOperationStatusExtendedInfoObjectTypeOperationStatusRecoveryPointExtendedInfo - objectMap := make(map[string]interface{}) - objectMap["updatedRecoveryPoint"] = osrpei.UpdatedRecoveryPoint - if osrpei.DeletedBackupItemVersion != nil { - objectMap["deletedBackupItemVersion"] = osrpei.DeletedBackupItemVersion - } - if osrpei.ObjectType != "" { - objectMap["objectType"] = osrpei.ObjectType - } - return json.Marshal(objectMap) -} - -// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusRecoveryPointExtendedInfo. -func (osrpei OperationStatusRecoveryPointExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusRecoveryPointExtendedInfo. -func (osrpei OperationStatusRecoveryPointExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusRecoveryPointExtendedInfo. -func (osrpei OperationStatusRecoveryPointExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { - return nil, false -} - -// AsOperationStatusRecoveryPointExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusRecoveryPointExtendedInfo. -func (osrpei OperationStatusRecoveryPointExtendedInfo) AsOperationStatusRecoveryPointExtendedInfo() (*OperationStatusRecoveryPointExtendedInfo, bool) { - return &osrpei, true -} - -// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusRecoveryPointExtendedInfo. -func (osrpei OperationStatusRecoveryPointExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { - return nil, false -} - -// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusRecoveryPointExtendedInfo. -func (osrpei OperationStatusRecoveryPointExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { - return &osrpei, true -} - -// UnmarshalJSON is the custom unmarshaler for OperationStatusRecoveryPointExtendedInfo struct. -func (osrpei *OperationStatusRecoveryPointExtendedInfo) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "updatedRecoveryPoint": - if v != nil { - updatedRecoveryPoint, err := unmarshalBasicRecoveryPoint(*v) - if err != nil { - return err - } - osrpei.UpdatedRecoveryPoint = updatedRecoveryPoint - } - case "deletedBackupItemVersion": - if v != nil { - var deletedBackupItemVersion string - err = json.Unmarshal(*v, &deletedBackupItemVersion) - if err != nil { - return err - } - osrpei.DeletedBackupItemVersion = &deletedBackupItemVersion - } - case "objectType": - if v != nil { - var objectType ObjectTypeBasicOperationStatusExtendedInfo - err = json.Unmarshal(*v, &objectType) - if err != nil { - return err - } - osrpei.ObjectType = objectType - } - } - } - - return nil -} - // OperationWorkerResponse this is the base class for operation result responses. type OperationWorkerResponse struct { // StatusCode - HTTP Status Code of the operation. Possible values include: 'HTTPStatusCodeContinue', 'HTTPStatusCodeSwitchingProtocols', 'HTTPStatusCodeOK', 'HTTPStatusCodeCreated', 'HTTPStatusCodeAccepted', 'HTTPStatusCodeNonAuthoritativeInformation', 'HTTPStatusCodeNoContent', 'HTTPStatusCodeResetContent', 'HTTPStatusCodePartialContent', 'HTTPStatusCodeMultipleChoices', 'HTTPStatusCodeAmbiguous', 'HTTPStatusCodeMovedPermanently', 'HTTPStatusCodeMoved', 'HTTPStatusCodeFound', 'HTTPStatusCodeRedirect', 'HTTPStatusCodeSeeOther', 'HTTPStatusCodeRedirectMethod', 'HTTPStatusCodeNotModified', 'HTTPStatusCodeUseProxy', 'HTTPStatusCodeUnused', 'HTTPStatusCodeTemporaryRedirect', 'HTTPStatusCodeRedirectKeepVerb', 'HTTPStatusCodeBadRequest', 'HTTPStatusCodeUnauthorized', 'HTTPStatusCodePaymentRequired', 'HTTPStatusCodeForbidden', 'HTTPStatusCodeNotFound', 'HTTPStatusCodeMethodNotAllowed', 'HTTPStatusCodeNotAcceptable', 'HTTPStatusCodeProxyAuthenticationRequired', 'HTTPStatusCodeRequestTimeout', 'HTTPStatusCodeConflict', 'HTTPStatusCodeGone', 'HTTPStatusCodeLengthRequired', 'HTTPStatusCodePreconditionFailed', 'HTTPStatusCodeRequestEntityTooLarge', 'HTTPStatusCodeRequestURITooLong', 'HTTPStatusCodeUnsupportedMediaType', 'HTTPStatusCodeRequestedRangeNotSatisfiable', 'HTTPStatusCodeExpectationFailed', 'HTTPStatusCodeUpgradeRequired', 'HTTPStatusCodeInternalServerError', 'HTTPStatusCodeNotImplemented', 'HTTPStatusCodeBadGateway', 'HTTPStatusCodeServiceUnavailable', 'HTTPStatusCodeGatewayTimeout', 'HTTPStatusCodeHTTPVersionNotSupported' @@ -22171,201 +21584,6 @@ type WeeklyRetentionSchedule struct { RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` } -// WorkloadCrrAccessToken ... -type WorkloadCrrAccessToken struct { - ProtectableObjectUniqueName *string `json:"protectableObjectUniqueName,omitempty"` - ProtectableObjectFriendlyName *string `json:"protectableObjectFriendlyName,omitempty"` - ProtectableObjectWorkloadType *string `json:"protectableObjectWorkloadType,omitempty"` - ProtectableObjectProtectionState *string `json:"protectableObjectProtectionState,omitempty"` - ProtectableObjectContainerHostOsName *string `json:"protectableObjectContainerHostOsName,omitempty"` - ProtectableObjectParentLogicalContainerName *string `json:"protectableObjectParentLogicalContainerName,omitempty"` - // ContainerID - Container Id - ContainerID *string `json:"containerId,omitempty"` - // PolicyName - Policy Name - PolicyName *string `json:"policyName,omitempty"` - // PolicyID - Policy Id - PolicyID *string `json:"policyId,omitempty"` - // AccessTokenString - Access token used for authentication - AccessTokenString *string `json:"accessTokenString,omitempty"` - // SubscriptionID - Subscription Id of the source vault - SubscriptionID *string `json:"subscriptionId,omitempty"` - // ResourceGroupName - Resource Group name of the source vault - ResourceGroupName *string `json:"resourceGroupName,omitempty"` - // ResourceName - Resource Name of the source vault - ResourceName *string `json:"resourceName,omitempty"` - // ResourceID - Resource Id of the source vault - ResourceID *string `json:"resourceId,omitempty"` - // ProtectionContainerID - Protected item container id - ProtectionContainerID *int64 `json:"protectionContainerId,omitempty"` - // RecoveryPointID - Recovery Point Id - RecoveryPointID *string `json:"recoveryPointId,omitempty"` - // RecoveryPointTime - Recovery Point Time - RecoveryPointTime *string `json:"recoveryPointTime,omitempty"` - // ContainerName - Container Unique name - ContainerName *string `json:"containerName,omitempty"` - // ContainerType - Container Type - ContainerType *string `json:"containerType,omitempty"` - // BackupManagementType - Backup Management Type - BackupManagementType *string `json:"backupManagementType,omitempty"` - // DatasourceType - Datasource Type - DatasourceType *string `json:"datasourceType,omitempty"` - // DatasourceName - Datasource Friendly Name - DatasourceName *string `json:"datasourceName,omitempty"` - // DatasourceID - Datasource Id - DatasourceID *string `json:"datasourceId,omitempty"` - // DatasourceContainerName - Datasource Container Unique Name - DatasourceContainerName *string `json:"datasourceContainerName,omitempty"` - // CoordinatorServiceStampID - CoordinatorServiceStampId to be used by BCM in restore call - CoordinatorServiceStampID *string `json:"coordinatorServiceStampId,omitempty"` - // CoordinatorServiceStampURI - CoordinatorServiceStampUri to be used by BCM in restore call - CoordinatorServiceStampURI *string `json:"coordinatorServiceStampUri,omitempty"` - // ProtectionServiceStampID - ProtectionServiceStampId to be used by BCM in restore call - ProtectionServiceStampID *string `json:"protectionServiceStampId,omitempty"` - // ProtectionServiceStampURI - ProtectionServiceStampUri to be used by BCM in restore call - ProtectionServiceStampURI *string `json:"protectionServiceStampUri,omitempty"` - // TokenExtendedInformation - Extended Information about the token like FileSpec etc. - TokenExtendedInformation *string `json:"tokenExtendedInformation,omitempty"` - // RpTierInformation - Recovery point Tier Information - RpTierInformation map[string]*string `json:"rpTierInformation"` - // RpOriginalSAOption - Recovery point information: Original SA option - RpOriginalSAOption *bool `json:"rpOriginalSAOption,omitempty"` - // RpIsManagedVirtualMachine - Recovery point information: Managed virtual machine - RpIsManagedVirtualMachine *bool `json:"rpIsManagedVirtualMachine,omitempty"` - // RpVMSizeDescription - Recovery point information: VM size description - RpVMSizeDescription *string `json:"rpVMSizeDescription,omitempty"` - // BMSActiveRegion - Active region name of BMS Stamp - BMSActiveRegion *string `json:"bMSActiveRegion,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeBasicCrrAccessTokenObjectTypeCrrAccessToken', 'ObjectTypeBasicCrrAccessTokenObjectTypeWorkloadCrrAccessToken' - ObjectType ObjectTypeBasicCrrAccessToken `json:"objectType,omitempty"` -} - -// MarshalJSON is the custom marshaler for WorkloadCrrAccessToken. -func (wcat WorkloadCrrAccessToken) MarshalJSON() ([]byte, error) { - wcat.ObjectType = ObjectTypeBasicCrrAccessTokenObjectTypeWorkloadCrrAccessToken - objectMap := make(map[string]interface{}) - if wcat.ProtectableObjectUniqueName != nil { - objectMap["protectableObjectUniqueName"] = wcat.ProtectableObjectUniqueName - } - if wcat.ProtectableObjectFriendlyName != nil { - objectMap["protectableObjectFriendlyName"] = wcat.ProtectableObjectFriendlyName - } - if wcat.ProtectableObjectWorkloadType != nil { - objectMap["protectableObjectWorkloadType"] = wcat.ProtectableObjectWorkloadType - } - if wcat.ProtectableObjectProtectionState != nil { - objectMap["protectableObjectProtectionState"] = wcat.ProtectableObjectProtectionState - } - if wcat.ProtectableObjectContainerHostOsName != nil { - objectMap["protectableObjectContainerHostOsName"] = wcat.ProtectableObjectContainerHostOsName - } - if wcat.ProtectableObjectParentLogicalContainerName != nil { - objectMap["protectableObjectParentLogicalContainerName"] = wcat.ProtectableObjectParentLogicalContainerName - } - if wcat.ContainerID != nil { - objectMap["containerId"] = wcat.ContainerID - } - if wcat.PolicyName != nil { - objectMap["policyName"] = wcat.PolicyName - } - if wcat.PolicyID != nil { - objectMap["policyId"] = wcat.PolicyID - } - if wcat.AccessTokenString != nil { - objectMap["accessTokenString"] = wcat.AccessTokenString - } - if wcat.SubscriptionID != nil { - objectMap["subscriptionId"] = wcat.SubscriptionID - } - if wcat.ResourceGroupName != nil { - objectMap["resourceGroupName"] = wcat.ResourceGroupName - } - if wcat.ResourceName != nil { - objectMap["resourceName"] = wcat.ResourceName - } - if wcat.ResourceID != nil { - objectMap["resourceId"] = wcat.ResourceID - } - if wcat.ProtectionContainerID != nil { - objectMap["protectionContainerId"] = wcat.ProtectionContainerID - } - if wcat.RecoveryPointID != nil { - objectMap["recoveryPointId"] = wcat.RecoveryPointID - } - if wcat.RecoveryPointTime != nil { - objectMap["recoveryPointTime"] = wcat.RecoveryPointTime - } - if wcat.ContainerName != nil { - objectMap["containerName"] = wcat.ContainerName - } - if wcat.ContainerType != nil { - objectMap["containerType"] = wcat.ContainerType - } - if wcat.BackupManagementType != nil { - objectMap["backupManagementType"] = wcat.BackupManagementType - } - if wcat.DatasourceType != nil { - objectMap["datasourceType"] = wcat.DatasourceType - } - if wcat.DatasourceName != nil { - objectMap["datasourceName"] = wcat.DatasourceName - } - if wcat.DatasourceID != nil { - objectMap["datasourceId"] = wcat.DatasourceID - } - if wcat.DatasourceContainerName != nil { - objectMap["datasourceContainerName"] = wcat.DatasourceContainerName - } - if wcat.CoordinatorServiceStampID != nil { - objectMap["coordinatorServiceStampId"] = wcat.CoordinatorServiceStampID - } - if wcat.CoordinatorServiceStampURI != nil { - objectMap["coordinatorServiceStampUri"] = wcat.CoordinatorServiceStampURI - } - if wcat.ProtectionServiceStampID != nil { - objectMap["protectionServiceStampId"] = wcat.ProtectionServiceStampID - } - if wcat.ProtectionServiceStampURI != nil { - objectMap["protectionServiceStampUri"] = wcat.ProtectionServiceStampURI - } - if wcat.TokenExtendedInformation != nil { - objectMap["tokenExtendedInformation"] = wcat.TokenExtendedInformation - } - if wcat.RpTierInformation != nil { - objectMap["rpTierInformation"] = wcat.RpTierInformation - } - if wcat.RpOriginalSAOption != nil { - objectMap["rpOriginalSAOption"] = wcat.RpOriginalSAOption - } - if wcat.RpIsManagedVirtualMachine != nil { - objectMap["rpIsManagedVirtualMachine"] = wcat.RpIsManagedVirtualMachine - } - if wcat.RpVMSizeDescription != nil { - objectMap["rpVMSizeDescription"] = wcat.RpVMSizeDescription - } - if wcat.BMSActiveRegion != nil { - objectMap["bMSActiveRegion"] = wcat.BMSActiveRegion - } - if wcat.ObjectType != "" { - objectMap["objectType"] = wcat.ObjectType - } - return json.Marshal(objectMap) -} - -// AsWorkloadCrrAccessToken is the BasicCrrAccessToken implementation for WorkloadCrrAccessToken. -func (wcat WorkloadCrrAccessToken) AsWorkloadCrrAccessToken() (*WorkloadCrrAccessToken, bool) { - return &wcat, true -} - -// AsCrrAccessToken is the BasicCrrAccessToken implementation for WorkloadCrrAccessToken. -func (wcat WorkloadCrrAccessToken) AsCrrAccessToken() (*CrrAccessToken, bool) { - return nil, false -} - -// AsBasicCrrAccessToken is the BasicCrrAccessToken implementation for WorkloadCrrAccessToken. -func (wcat WorkloadCrrAccessToken) AsBasicCrrAccessToken() (BasicCrrAccessToken, bool) { - return &wcat, true -} - // WorkloadInquiryDetails details of an inquired protectable item. type WorkloadInquiryDetails struct { // Type - Type of the Workload such as SQL, Oracle etc. diff --git a/services/recoveryservices/mgmt/2021-07-01/backup/recoverypoints.go b/services/recoveryservices/mgmt/2021-07-01/backup/recoverypoints.go index 434f5356e09d..27801ef37146 100644 --- a/services/recoveryservices/mgmt/2021-07-01/backup/recoverypoints.go +++ b/services/recoveryservices/mgmt/2021-07-01/backup/recoverypoints.go @@ -116,93 +116,6 @@ func (client RecoveryPointsClient) GetResponder(resp *http.Response) (result Rec return } -// GetAccessToken sends the get access token request. -// 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 container. -// containerName - name of the container. -// protectedItemName - name of the Protected Item. -// recoveryPointID - recovery Point Id -// parameters - get Access Token request -func (client RecoveryPointsClient) GetAccessToken(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters AADPropertiesResource) (result CrrAccessTokenResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.GetAccessToken") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetAccessTokenPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointID, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "GetAccessToken", nil, "Failure preparing request") - return - } - - resp, err := client.GetAccessTokenSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "GetAccessToken", resp, "Failure sending request") - return - } - - result, err = client.GetAccessTokenResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "GetAccessToken", resp, "Failure responding to request") - return - } - - return -} - -// GetAccessTokenPreparer prepares the GetAccessToken request. -func (client RecoveryPointsClient) GetAccessTokenPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters AADPropertiesResource) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "containerName": autorest.Encode("path", containerName), - "fabricName": autorest.Encode("path", fabricName), - "protectedItemName": autorest.Encode("path", protectedItemName), - "recoveryPointId": autorest.Encode("path", recoveryPointID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vaultName": autorest.Encode("path", vaultName), - } - - const APIVersion = "2018-12-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/accessToken", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetAccessTokenSender sends the GetAccessToken request. The method will close the -// http.Response Body if it receives an error. -func (client RecoveryPointsClient) GetAccessTokenSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetAccessTokenResponder handles the response to the GetAccessToken request. The method always -// closes the http.Response Body. -func (client RecoveryPointsClient) GetAccessTokenResponder(resp *http.Response) (result CrrAccessTokenResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusBadRequest), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - // List lists the backup copies for the backed up item. // Parameters: // vaultName - the name of the recovery services vault. diff --git a/services/recoveryservices/mgmt/2021-07-01/backup/resourcestorageconfigs.go b/services/recoveryservices/mgmt/2021-07-01/backup/resourcestorageconfigs.go deleted file mode 100644 index 35cfa96543b8..000000000000 --- a/services/recoveryservices/mgmt/2021-07-01/backup/resourcestorageconfigs.go +++ /dev/null @@ -1,265 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ResourceStorageConfigsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type ResourceStorageConfigsClient struct { - BaseClient -} - -// NewResourceStorageConfigsClient creates an instance of the ResourceStorageConfigsClient client. -func NewResourceStorageConfigsClient(subscriptionID string) ResourceStorageConfigsClient { - return NewResourceStorageConfigsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewResourceStorageConfigsClientWithBaseURI creates an instance of the ResourceStorageConfigsClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewResourceStorageConfigsClientWithBaseURI(baseURI string, subscriptionID string) ResourceStorageConfigsClient { - return ResourceStorageConfigsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get fetches resource storage config. -// Parameters: -// vaultName - the name of the recovery services vault. -// resourceGroupName - the name of the resource group where the recovery services vault is present. -func (client ResourceStorageConfigsClient) Get(ctx context.Context, vaultName string, resourceGroupName string) (result ResourceConfigResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceStorageConfigsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, vaultName, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "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.ResourceStorageConfigsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ResourceStorageConfigsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName 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 = "2018-12-20" - 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}/backupstorageconfig/vaultstorageconfig", 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 ResourceStorageConfigsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ResourceStorageConfigsClient) GetResponder(resp *http.Response) (result ResourceConfigResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Patch updates vault storage model type. -// Parameters: -// vaultName - the name of the recovery services vault. -// resourceGroupName - the name of the resource group where the recovery services vault is present. -// parameters - vault storage config request -func (client ResourceStorageConfigsClient) Patch(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceConfigResource) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceStorageConfigsClient.Patch") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PatchPreparer(ctx, vaultName, resourceGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Patch", nil, "Failure preparing request") - return - } - - resp, err := client.PatchSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Patch", resp, "Failure sending request") - return - } - - result, err = client.PatchResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Patch", resp, "Failure responding to request") - return - } - - return -} - -// PatchPreparer prepares the Patch request. -func (client ResourceStorageConfigsClient) PatchPreparer(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceConfigResource) (*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 = "2018-12-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PatchSender sends the Patch request. The method will close the -// http.Response Body if it receives an error. -func (client ResourceStorageConfigsClient) PatchSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// PatchResponder handles the response to the Patch request. The method always -// closes the http.Response Body. -func (client ResourceStorageConfigsClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update updates vault storage model type. -// Parameters: -// vaultName - the name of the recovery services vault. -// resourceGroupName - the name of the resource group where the recovery services vault is present. -// parameters - vault storage config request -func (client ResourceStorageConfigsClient) Update(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceConfigResource) (result ResourceConfigResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceStorageConfigsClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, vaultName, resourceGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ResourceStorageConfigsClient) UpdatePreparer(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceConfigResource) (*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 = "2018-12-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client ResourceStorageConfigsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client ResourceStorageConfigsClient) UpdateResponder(resp *http.Response) (result ResourceConfigResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/recoveryservices/mgmt/2021-07-01/backup/usagesummariescrr.go b/services/recoveryservices/mgmt/2021-07-01/backup/usagesummariescrr.go deleted file mode 100644 index a2ae6f0ab9a9..000000000000 --- a/services/recoveryservices/mgmt/2021-07-01/backup/usagesummariescrr.go +++ /dev/null @@ -1,116 +0,0 @@ -package backup - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// 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" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// UsageSummariesCRRClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type UsageSummariesCRRClient struct { - BaseClient -} - -// NewUsageSummariesCRRClient creates an instance of the UsageSummariesCRRClient client. -func NewUsageSummariesCRRClient(subscriptionID string) UsageSummariesCRRClient { - return NewUsageSummariesCRRClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewUsageSummariesCRRClientWithBaseURI creates an instance of the UsageSummariesCRRClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewUsageSummariesCRRClientWithBaseURI(baseURI string, subscriptionID string) UsageSummariesCRRClient { - return UsageSummariesCRRClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List fetches the backup management usage summaries of the 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 UsageSummariesCRRClient) List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result ManagementUsageList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsageSummariesCRRClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, vaultName, resourceGroupName, filter, skipToken) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.UsageSummariesCRRClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.UsageSummariesCRRClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "backup.UsageSummariesCRRClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client UsageSummariesCRRClient) 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 = "2018-12-20" - 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}/backupUsageSummaries", 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 UsageSummariesCRRClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client UsageSummariesCRRClient) ListResponder(resp *http.Response) (result ManagementUsageList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/recoveryservices/mgmt/2021-12-01/backup/CHANGELOG.md b/services/recoveryservices/mgmt/2021-12-01/backup/CHANGELOG.md index 6bff0be83a06..a1ecf841edb0 100644 --- a/services/recoveryservices/mgmt/2021-12-01/backup/CHANGELOG.md +++ b/services/recoveryservices/mgmt/2021-12-01/backup/CHANGELOG.md @@ -1,39 +1,2 @@ -# Change History +# Unreleased -## Breaking Changes - -### Removed Constants - -1. ContainerTypeBasicProtectionContainer.ContainerTypeBasicProtectionContainerContainerTypeIaaSVMContainer - -## Additive Changes - -### New Constants - -1. ContainerTypeBasicProtectionContainer.ContainerTypeBasicProtectionContainerContainerTypeIaasVMContainer -1. TieringMode.TieringModeDoNotTier -1. TieringMode.TieringModeInvalid -1. TieringMode.TieringModeTierAfter -1. TieringMode.TieringModeTierRecommended - -### New Funcs - -1. PossibleTieringModeValues() []TieringMode -1. SubProtectionPolicy.MarshalJSON() ([]byte, error) - -### Struct Changes - -#### New Structs - -1. TieringPolicy - -#### New Struct Fields - -1. AzureIaaSVMProtectedItemExtendedInfo.NewestRecoveryPointInArchive -1. AzureIaaSVMProtectedItemExtendedInfo.OldestRecoveryPointInArchive -1. AzureIaaSVMProtectedItemExtendedInfo.OldestRecoveryPointInVault -1. AzureIaaSVMProtectionPolicy.TieringPolicy -1. AzureVMWorkloadProtectedItemExtendedInfo.NewestRecoveryPointInArchive -1. AzureVMWorkloadProtectedItemExtendedInfo.OldestRecoveryPointInArchive -1. AzureVMWorkloadProtectedItemExtendedInfo.OldestRecoveryPointInVault -1. SubProtectionPolicy.TieringPolicy diff --git a/services/recoveryservices/mgmt/2021-12-01/backup/_meta.json b/services/recoveryservices/mgmt/2021-12-01/backup/_meta.json index aab88b29be7b..b53d68e2b674 100644 --- a/services/recoveryservices/mgmt/2021-12-01/backup/_meta.json +++ b/services/recoveryservices/mgmt/2021-12-01/backup/_meta.json @@ -1,5 +1,5 @@ { - "commit": "50ed15bd61ac79f2368d769df0c207a00b9e099f", + "commit": "4742065e8d48160292fbce6790710c6835f8dc4f", "readme": "/_/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/readme.md", "tag": "package-2021-12", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/recoveryservices/mgmt/2022-03-01/backup/CHANGELOG.md b/services/recoveryservices/mgmt/2022-03-01/backup/CHANGELOG.md new file mode 100644 index 000000000000..a1ecf841edb0 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-03-01/backup/CHANGELOG.md @@ -0,0 +1,2 @@ +# Unreleased + diff --git a/services/recoveryservices/mgmt/2022-03-01/backup/_meta.json b/services/recoveryservices/mgmt/2022-03-01/backup/_meta.json new file mode 100644 index 000000000000..8f742c72fbbb --- /dev/null +++ b/services/recoveryservices/mgmt/2022-03-01/backup/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "4742065e8d48160292fbce6790710c6835f8dc4f", + "readme": "/_/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/readme.md", + "tag": "package-2022-03", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2022-03 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/services/recoveryservices/mgmt/2022-03-01/backup/backupapi/interfaces.go b/services/recoveryservices/mgmt/2022-03-01/backup/backupapi/interfaces.go new file mode 100644 index 000000000000..235fde7aa989 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-03-01/backup/backupapi/interfaces.go @@ -0,0 +1,396 @@ +package backupapi + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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/azure-sdk-for-go/services/recoveryservices/mgmt/2022-03-01/backup" + "github.com/Azure/go-autorest/autorest" +) + +// BaseClientAPI contains the set of methods on the BaseClient type. +type BaseClientAPI interface { + BMSPrepareDataMove(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.PrepareDataMoveRequest) (result backup.BMSPrepareDataMoveFuture, err error) + BMSTriggerDataMove(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.TriggerDataMoveRequest) (result backup.BMSTriggerDataMoveFuture, err error) + GetOperationStatus(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result backup.OperationStatus, err error) + MoveRecoveryPoint(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters backup.MoveRPAcrossTiersRequest) (result backup.MoveRecoveryPointFuture, err error) +} + +var _ BaseClientAPI = (*backup.BaseClient)(nil) + +// ResourceStorageConfigsNonCRRClientAPI contains the set of methods on the ResourceStorageConfigsNonCRRClient type. +type ResourceStorageConfigsNonCRRClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string) (result backup.ResourceConfigResource, err error) + Patch(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.ResourceConfigResource) (result autorest.Response, err error) + Update(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.ResourceConfigResource) (result backup.ResourceConfigResource, err error) +} + +var _ ResourceStorageConfigsNonCRRClientAPI = (*backup.ResourceStorageConfigsNonCRRClient)(nil) + +// ProtectionIntentClientAPI contains the set of methods on the ProtectionIntentClient type. +type ProtectionIntentClientAPI interface { + CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string, parameters backup.ProtectionIntentResource) (result backup.ProtectionIntentResource, err error) + Delete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string) (result autorest.Response, err error) + Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string) (result backup.ProtectionIntentResource, err error) + Validate(ctx context.Context, azureRegion string, parameters backup.PreValidateEnableBackupRequest) (result backup.PreValidateEnableBackupResponse, err error) +} + +var _ ProtectionIntentClientAPI = (*backup.ProtectionIntentClient)(nil) + +// StatusClientAPI contains the set of methods on the StatusClient type. +type StatusClientAPI interface { + Get(ctx context.Context, azureRegion string, parameters backup.StatusRequest) (result backup.StatusResponse, err error) +} + +var _ StatusClientAPI = (*backup.StatusClient)(nil) + +// FeatureSupportClientAPI contains the set of methods on the FeatureSupportClient type. +type FeatureSupportClientAPI interface { + Validate(ctx context.Context, azureRegion string, parameters backup.BasicFeatureSupportRequest) (result backup.AzureVMResourceFeatureSupportResponse, err error) +} + +var _ FeatureSupportClientAPI = (*backup.FeatureSupportClient)(nil) + +// ProtectionIntentGroupClientAPI contains the set of methods on the ProtectionIntentGroupClient type. +type ProtectionIntentGroupClientAPI interface { + List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ProtectionIntentResourceListPage, err error) + ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ProtectionIntentResourceListIterator, err error) +} + +var _ ProtectionIntentGroupClientAPI = (*backup.ProtectionIntentGroupClient)(nil) + +// UsageSummariesClientAPI contains the set of methods on the UsageSummariesClient type. +type UsageSummariesClientAPI interface { + List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ManagementUsageList, err error) +} + +var _ UsageSummariesClientAPI = (*backup.UsageSummariesClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result backup.ClientDiscoveryResponsePage, err error) + ListComplete(ctx context.Context) (result backup.ClientDiscoveryResponseIterator, err error) +} + +var _ OperationsClientAPI = (*backup.OperationsClient)(nil) + +// ResourceVaultConfigsClientAPI contains the set of methods on the ResourceVaultConfigsClient type. +type ResourceVaultConfigsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string) (result backup.ResourceVaultConfigResource, err error) + Put(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.ResourceVaultConfigResource) (result backup.ResourceVaultConfigResource, err error) + Update(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.ResourceVaultConfigResource) (result backup.ResourceVaultConfigResource, err error) +} + +var _ ResourceVaultConfigsClientAPI = (*backup.ResourceVaultConfigsClient)(nil) + +// ResourceEncryptionConfigsClientAPI contains the set of methods on the ResourceEncryptionConfigsClient type. +type ResourceEncryptionConfigsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string) (result backup.ResourceEncryptionConfigExtendedResource, err error) + Update(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.ResourceEncryptionConfigResource) (result autorest.Response, err error) +} + +var _ ResourceEncryptionConfigsClientAPI = (*backup.ResourceEncryptionConfigsClient)(nil) + +// PrivateEndpointConnectionClientAPI contains the set of methods on the PrivateEndpointConnectionClient type. +type PrivateEndpointConnectionClientAPI interface { + Delete(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string) (result backup.PrivateEndpointConnectionDeleteFuture, err error) + Get(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string) (result backup.PrivateEndpointConnectionResource, err error) + Put(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string, parameters backup.PrivateEndpointConnectionResource) (result backup.PrivateEndpointConnectionPutFuture, err error) +} + +var _ PrivateEndpointConnectionClientAPI = (*backup.PrivateEndpointConnectionClient)(nil) + +// PrivateEndpointClientAPI contains the set of methods on the PrivateEndpointClient type. +type PrivateEndpointClientAPI interface { + GetOperationStatus(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string, operationID string) (result backup.OperationStatus, err error) +} + +var _ PrivateEndpointClientAPI = (*backup.PrivateEndpointClient)(nil) + +// BMSPrepareDataMoveOperationResultClientAPI contains the set of methods on the BMSPrepareDataMoveOperationResultClient type. +type BMSPrepareDataMoveOperationResultClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result backup.VaultStorageConfigOperationResultResponseModel, err error) +} + +var _ BMSPrepareDataMoveOperationResultClientAPI = (*backup.BMSPrepareDataMoveOperationResultClient)(nil) + +// ProtectedItemsClientAPI contains the set of methods on the ProtectedItemsClient type. +type ProtectedItemsClientAPI interface { + CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters backup.ProtectedItemResource) (result backup.ProtectedItemResource, err error) + Delete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string) (result autorest.Response, err error) + Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result backup.ProtectedItemResource, err error) +} + +var _ ProtectedItemsClientAPI = (*backup.ProtectedItemsClient)(nil) + +// ProtectedItemOperationResultsClientAPI contains the set of methods on the ProtectedItemOperationResultsClient type. +type ProtectedItemOperationResultsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, operationID string) (result backup.ProtectedItemResource, err error) +} + +var _ ProtectedItemOperationResultsClientAPI = (*backup.ProtectedItemOperationResultsClient)(nil) + +// RecoveryPointsClientAPI contains the set of methods on the RecoveryPointsClient type. +type RecoveryPointsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string) (result backup.RecoveryPointResource, err error) + List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result backup.RecoveryPointResourceListPage, err error) + ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result backup.RecoveryPointResourceListIterator, err error) +} + +var _ RecoveryPointsClientAPI = (*backup.RecoveryPointsClient)(nil) + +// RestoresClientAPI contains the set of methods on the RestoresClient type. +type RestoresClientAPI interface { + Trigger(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters backup.RestoreRequestResource) (result backup.RestoresTriggerFuture, err error) +} + +var _ RestoresClientAPI = (*backup.RestoresClient)(nil) + +// PoliciesClientAPI contains the set of methods on the PoliciesClient type. +type PoliciesClientAPI interface { + List(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result backup.ProtectionPolicyResourceListPage, err error) + ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result backup.ProtectionPolicyResourceListIterator, err error) +} + +var _ PoliciesClientAPI = (*backup.PoliciesClient)(nil) + +// ProtectionPoliciesClientAPI contains the set of methods on the ProtectionPoliciesClient type. +type ProtectionPoliciesClientAPI interface { + CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, policyName string, parameters backup.ProtectionPolicyResource) (result backup.ProtectionPolicyResource, err error) + Delete(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (result backup.ProtectionPoliciesDeleteFuture, err error) + Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (result backup.ProtectionPolicyResource, err error) +} + +var _ ProtectionPoliciesClientAPI = (*backup.ProtectionPoliciesClient)(nil) + +// ProtectionPolicyOperationResultsClientAPI contains the set of methods on the ProtectionPolicyOperationResultsClient type. +type ProtectionPolicyOperationResultsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string) (result backup.ProtectionPolicyResource, err error) +} + +var _ ProtectionPolicyOperationResultsClientAPI = (*backup.ProtectionPolicyOperationResultsClient)(nil) + +// JobsClientAPI contains the set of methods on the JobsClient type. +type JobsClientAPI interface { + List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.JobResourceListPage, err error) + ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.JobResourceListIterator, err error) +} + +var _ JobsClientAPI = (*backup.JobsClient)(nil) + +// JobDetailsClientAPI contains the set of methods on the JobDetailsClient type. +type JobDetailsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, jobName string) (result backup.JobResource, err error) +} + +var _ JobDetailsClientAPI = (*backup.JobDetailsClient)(nil) + +// JobCancellationsClientAPI contains the set of methods on the JobCancellationsClient type. +type JobCancellationsClientAPI interface { + Trigger(ctx context.Context, vaultName string, resourceGroupName string, jobName string) (result autorest.Response, err error) +} + +var _ JobCancellationsClientAPI = (*backup.JobCancellationsClient)(nil) + +// JobOperationResultsClientAPI contains the set of methods on the JobOperationResultsClient type. +type JobOperationResultsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, jobName string, operationID string) (result autorest.Response, err error) +} + +var _ JobOperationResultsClientAPI = (*backup.JobOperationResultsClient)(nil) + +// ExportJobsOperationResultsClientAPI contains the set of methods on the ExportJobsOperationResultsClient type. +type ExportJobsOperationResultsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result backup.OperationResultInfoBaseResource, err error) +} + +var _ ExportJobsOperationResultsClientAPI = (*backup.ExportJobsOperationResultsClient)(nil) + +// JobsGroupClientAPI contains the set of methods on the JobsGroupClient type. +type JobsGroupClientAPI interface { + Export(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result autorest.Response, err error) +} + +var _ JobsGroupClientAPI = (*backup.JobsGroupClient)(nil) + +// ProtectedItemsGroupClientAPI contains the set of methods on the ProtectedItemsGroupClient type. +type ProtectedItemsGroupClientAPI interface { + List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ProtectedItemResourceListPage, err error) + ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.ProtectedItemResourceListIterator, err error) +} + +var _ ProtectedItemsGroupClientAPI = (*backup.ProtectedItemsGroupClient)(nil) + +// OperationClientAPI contains the set of methods on the OperationClient type. +type OperationClientAPI interface { + Validate(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.BasicValidateOperationRequest) (result backup.ValidateOperationsResponse, err error) +} + +var _ OperationClientAPI = (*backup.OperationClient)(nil) + +// ValidateOperationClientAPI contains the set of methods on the ValidateOperationClient type. +type ValidateOperationClientAPI interface { + Trigger(ctx context.Context, vaultName string, resourceGroupName string, parameters backup.BasicValidateOperationRequest) (result backup.ValidateOperationTriggerFuture, err error) +} + +var _ ValidateOperationClientAPI = (*backup.ValidateOperationClient)(nil) + +// ValidateOperationResultsClientAPI contains the set of methods on the ValidateOperationResultsClient type. +type ValidateOperationResultsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result backup.ValidateOperationsResponse, err error) +} + +var _ ValidateOperationResultsClientAPI = (*backup.ValidateOperationResultsClient)(nil) + +// ValidateOperationStatusesClientAPI contains the set of methods on the ValidateOperationStatusesClient type. +type ValidateOperationStatusesClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result backup.OperationStatus, err error) +} + +var _ ValidateOperationStatusesClientAPI = (*backup.ValidateOperationStatusesClient)(nil) + +// EnginesClientAPI contains the set of methods on the EnginesClient type. +type EnginesClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, backupEngineName string, filter string, skipToken string) (result backup.EngineBaseResource, err error) + List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.EngineBaseResourceListPage, err error) + ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.EngineBaseResourceListIterator, err error) +} + +var _ EnginesClientAPI = (*backup.EnginesClient)(nil) + +// ProtectionContainerRefreshOperationResultsClientAPI contains the set of methods on the ProtectionContainerRefreshOperationResultsClient type. +type ProtectionContainerRefreshOperationResultsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, operationID string) (result autorest.Response, err error) +} + +var _ ProtectionContainerRefreshOperationResultsClientAPI = (*backup.ProtectionContainerRefreshOperationResultsClient)(nil) + +// ProtectableContainersClientAPI contains the set of methods on the ProtectableContainersClient type. +type ProtectableContainersClientAPI interface { + List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, filter string) (result backup.ProtectableContainerResourceListPage, err error) + ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, filter string) (result backup.ProtectableContainerResourceListIterator, err error) +} + +var _ ProtectableContainersClientAPI = (*backup.ProtectableContainersClient)(nil) + +// ProtectionContainersClientAPI contains the set of methods on the ProtectionContainersClient type. +type ProtectionContainersClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string) (result backup.ProtectionContainerResource, err error) + Inquire(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, filter string) (result autorest.Response, err error) + Refresh(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, filter string) (result autorest.Response, err error) + Register(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, parameters backup.ProtectionContainerResource) (result backup.ProtectionContainerResource, err error) + Unregister(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string) (result autorest.Response, err error) +} + +var _ ProtectionContainersClientAPI = (*backup.ProtectionContainersClient)(nil) + +// WorkloadItemsClientAPI contains the set of methods on the WorkloadItemsClient type. +type WorkloadItemsClientAPI interface { + List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, filter string, skipToken string) (result backup.WorkloadItemResourceListPage, err error) + ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, filter string, skipToken string) (result backup.WorkloadItemResourceListIterator, err error) +} + +var _ WorkloadItemsClientAPI = (*backup.WorkloadItemsClient)(nil) + +// ProtectionContainerOperationResultsClientAPI contains the set of methods on the ProtectionContainerOperationResultsClient type. +type ProtectionContainerOperationResultsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, operationID string) (result backup.ProtectionContainerResource, err error) +} + +var _ ProtectionContainerOperationResultsClientAPI = (*backup.ProtectionContainerOperationResultsClient)(nil) + +// BackupsClientAPI contains the set of methods on the BackupsClient type. +type BackupsClientAPI interface { + Trigger(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters backup.RequestResource) (result autorest.Response, err error) +} + +var _ BackupsClientAPI = (*backup.BackupsClient)(nil) + +// ProtectedItemOperationStatusesClientAPI contains the set of methods on the ProtectedItemOperationStatusesClient type. +type ProtectedItemOperationStatusesClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, operationID string) (result backup.OperationStatus, err error) +} + +var _ ProtectedItemOperationStatusesClientAPI = (*backup.ProtectedItemOperationStatusesClient)(nil) + +// ItemLevelRecoveryConnectionsClientAPI contains the set of methods on the ItemLevelRecoveryConnectionsClient type. +type ItemLevelRecoveryConnectionsClientAPI interface { + Provision(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters backup.ILRRequestResource) (result autorest.Response, err error) + Revoke(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string) (result autorest.Response, err error) +} + +var _ ItemLevelRecoveryConnectionsClientAPI = (*backup.ItemLevelRecoveryConnectionsClient)(nil) + +// OperationResultsClientAPI contains the set of methods on the OperationResultsClient type. +type OperationResultsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result autorest.Response, err error) +} + +var _ OperationResultsClientAPI = (*backup.OperationResultsClient)(nil) + +// OperationStatusesClientAPI contains the set of methods on the OperationStatusesClient type. +type OperationStatusesClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result backup.OperationStatus, err error) +} + +var _ OperationStatusesClientAPI = (*backup.OperationStatusesClient)(nil) + +// ProtectionPolicyOperationStatusesClientAPI contains the set of methods on the ProtectionPolicyOperationStatusesClient type. +type ProtectionPolicyOperationStatusesClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string) (result backup.OperationStatus, err error) +} + +var _ ProtectionPolicyOperationStatusesClientAPI = (*backup.ProtectionPolicyOperationStatusesClient)(nil) + +// ProtectableItemsClientAPI contains the set of methods on the ProtectableItemsClient type. +type ProtectableItemsClientAPI interface { + List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.WorkloadProtectableItemResourceListPage, err error) + ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result backup.WorkloadProtectableItemResourceListIterator, err error) +} + +var _ ProtectableItemsClientAPI = (*backup.ProtectableItemsClient)(nil) + +// ProtectionContainersGroupClientAPI contains the set of methods on the ProtectionContainersGroupClient type. +type ProtectionContainersGroupClientAPI interface { + List(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result backup.ProtectionContainerResourceListPage, err error) + ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result backup.ProtectionContainerResourceListIterator, err error) +} + +var _ ProtectionContainersGroupClientAPI = (*backup.ProtectionContainersGroupClient)(nil) + +// SecurityPINsClientAPI contains the set of methods on the SecurityPINsClient type. +type SecurityPINsClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string, parameters *backup.SecurityPinBase) (result backup.TokenInformation, err error) +} + +var _ SecurityPINsClientAPI = (*backup.SecurityPINsClient)(nil) + +// RecoveryPointsRecommendedForMoveClientAPI contains the set of methods on the RecoveryPointsRecommendedForMoveClient type. +type RecoveryPointsRecommendedForMoveClientAPI interface { + List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters backup.ListRecoveryPointsRecommendedForMoveRequest) (result backup.RecoveryPointResourceListPage, err error) + ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters backup.ListRecoveryPointsRecommendedForMoveRequest) (result backup.RecoveryPointResourceListIterator, err error) +} + +var _ RecoveryPointsRecommendedForMoveClientAPI = (*backup.RecoveryPointsRecommendedForMoveClient)(nil) + +// ResourceGuardProxiesClientAPI contains the set of methods on the ResourceGuardProxiesClient type. +type ResourceGuardProxiesClientAPI interface { + Get(ctx context.Context, vaultName string, resourceGroupName string) (result backup.ResourceGuardProxyBaseResourceListPage, err error) + GetComplete(ctx context.Context, vaultName string, resourceGroupName string) (result backup.ResourceGuardProxyBaseResourceListIterator, err error) +} + +var _ ResourceGuardProxiesClientAPI = (*backup.ResourceGuardProxiesClient)(nil) + +// ResourceGuardProxyClientAPI contains the set of methods on the ResourceGuardProxyClient type. +type ResourceGuardProxyClientAPI interface { + Delete(ctx context.Context, vaultName string, resourceGroupName string, resourceGuardProxyName string) (result autorest.Response, err error) + Get(ctx context.Context, vaultName string, resourceGroupName string, resourceGuardProxyName string) (result backup.ResourceGuardProxyBaseResource, err error) + Put(ctx context.Context, vaultName string, resourceGroupName string, resourceGuardProxyName string) (result backup.ResourceGuardProxyBaseResource, err error) + UnlockDelete(ctx context.Context, vaultName string, resourceGroupName string, resourceGuardProxyName string, parameters backup.UnlockDeleteRequest) (result backup.UnlockDeleteResponse, err error) +} + +var _ ResourceGuardProxyClientAPI = (*backup.ResourceGuardProxyClient)(nil) diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/backups.go b/services/recoveryservices/mgmt/2022-03-01/backup/backups.go similarity index 98% rename from services/recoveryservices/mgmt/2020-02-02/backup/backups.go rename to services/recoveryservices/mgmt/2022-03-01/backup/backups.go index 504816876e30..48706f0528a6 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/backups.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/backups.go @@ -83,7 +83,7 @@ func (client BackupsClient) TriggerPreparer(ctx context.Context, vaultName strin "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -92,7 +92,7 @@ func (client BackupsClient) TriggerPreparer(ctx context.Context, vaultName strin autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/backup", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/backup", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) diff --git a/services/recoveryservices/mgmt/2022-03-01/backup/bmspreparedatamoveoperationresult.go b/services/recoveryservices/mgmt/2022-03-01/backup/bmspreparedatamoveoperationresult.go new file mode 100644 index 000000000000..15f8b71f1399 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-03-01/backup/bmspreparedatamoveoperationresult.go @@ -0,0 +1,110 @@ +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// BMSPrepareDataMoveOperationResultClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type BMSPrepareDataMoveOperationResultClient struct { + BaseClient +} + +// NewBMSPrepareDataMoveOperationResultClient creates an instance of the BMSPrepareDataMoveOperationResultClient +// client. +func NewBMSPrepareDataMoveOperationResultClient(subscriptionID string) BMSPrepareDataMoveOperationResultClient { + return NewBMSPrepareDataMoveOperationResultClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewBMSPrepareDataMoveOperationResultClientWithBaseURI creates an instance of the +// BMSPrepareDataMoveOperationResultClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewBMSPrepareDataMoveOperationResultClientWithBaseURI(baseURI string, subscriptionID string) BMSPrepareDataMoveOperationResultClient { + return BMSPrepareDataMoveOperationResultClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get fetches Operation Result for Prepare Data Move +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +func (client BMSPrepareDataMoveOperationResultClient) Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result VaultStorageConfigOperationResultResponseModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BMSPrepareDataMoveOperationResultClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.BMSPrepareDataMoveOperationResultClient", "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.BMSPrepareDataMoveOperationResultClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.BMSPrepareDataMoveOperationResultClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client BMSPrepareDataMoveOperationResultClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2022-03-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}/backupstorageconfig/vaultstorageconfig/operationResults/{operationId}", 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 BMSPrepareDataMoveOperationResultClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client BMSPrepareDataMoveOperationResultClient) GetResponder(resp *http.Response) (result VaultStorageConfigOperationResultResponseModel, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-03-01/backup/client.go b/services/recoveryservices/mgmt/2022-03-01/backup/client.go new file mode 100644 index 000000000000..449e3e6d8606 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-03-01/backup/client.go @@ -0,0 +1,385 @@ +// Package backup implements the Azure ARM Backup service API version 2022-03-01. +// +// Open API 2.0 Specs for Azure RecoveryServices Backup service +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +const ( + // DefaultBaseURI is the default URI used for the service Backup + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Backup. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} + +// BMSPrepareDataMove prepares source vault for Data Move operation +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// parameters - prepare data move request +func (client BaseClient) BMSPrepareDataMove(ctx context.Context, vaultName string, resourceGroupName string, parameters PrepareDataMoveRequest) (result BMSPrepareDataMoveFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.BMSPrepareDataMove") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.TargetResourceID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.TargetRegion", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("backup.BaseClient", "BMSPrepareDataMove", err.Error()) + } + + req, err := client.BMSPrepareDataMovePreparer(ctx, vaultName, resourceGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.BaseClient", "BMSPrepareDataMove", nil, "Failure preparing request") + return + } + + result, err = client.BMSPrepareDataMoveSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.BaseClient", "BMSPrepareDataMove", result.Response(), "Failure sending request") + return + } + + return +} + +// BMSPrepareDataMovePreparer prepares the BMSPrepareDataMove request. +func (client BaseClient) BMSPrepareDataMovePreparer(ctx context.Context, vaultName string, resourceGroupName string, parameters PrepareDataMoveRequest) (*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 = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/prepareDataMove", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// BMSPrepareDataMoveSender sends the BMSPrepareDataMove request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) BMSPrepareDataMoveSender(req *http.Request) (future BMSPrepareDataMoveFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// BMSPrepareDataMoveResponder handles the response to the BMSPrepareDataMove request. The method always +// closes the http.Response Body. +func (client BaseClient) BMSPrepareDataMoveResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// BMSTriggerDataMove triggers Data Move Operation on target vault +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// parameters - trigger data move request +func (client BaseClient) BMSTriggerDataMove(ctx context.Context, vaultName string, resourceGroupName string, parameters TriggerDataMoveRequest) (result BMSTriggerDataMoveFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.BMSTriggerDataMove") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.SourceResourceID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.SourceRegion", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.CorrelationID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("backup.BaseClient", "BMSTriggerDataMove", err.Error()) + } + + req, err := client.BMSTriggerDataMovePreparer(ctx, vaultName, resourceGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.BaseClient", "BMSTriggerDataMove", nil, "Failure preparing request") + return + } + + result, err = client.BMSTriggerDataMoveSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.BaseClient", "BMSTriggerDataMove", result.Response(), "Failure sending request") + return + } + + return +} + +// BMSTriggerDataMovePreparer prepares the BMSTriggerDataMove request. +func (client BaseClient) BMSTriggerDataMovePreparer(ctx context.Context, vaultName string, resourceGroupName string, parameters TriggerDataMoveRequest) (*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 = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/triggerDataMove", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// BMSTriggerDataMoveSender sends the BMSTriggerDataMove request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) BMSTriggerDataMoveSender(req *http.Request) (future BMSTriggerDataMoveFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// BMSTriggerDataMoveResponder handles the response to the BMSTriggerDataMove request. The method always +// closes the http.Response Body. +func (client BaseClient) BMSTriggerDataMoveResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetOperationStatus fetches operation status for data move operation on vault +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +func (client BaseClient) GetOperationStatus(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetOperationStatus") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetOperationStatusPreparer(ctx, vaultName, resourceGroupName, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.BaseClient", "GetOperationStatus", nil, "Failure preparing request") + return + } + + resp, err := client.GetOperationStatusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.BaseClient", "GetOperationStatus", resp, "Failure sending request") + return + } + + result, err = client.GetOperationStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.BaseClient", "GetOperationStatus", resp, "Failure responding to request") + return + } + + return +} + +// GetOperationStatusPreparer prepares the GetOperationStatus request. +func (client BaseClient) GetOperationStatusPreparer(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2022-03-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}/backupstorageconfig/vaultstorageconfig/operationStatus/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetOperationStatusSender sends the GetOperationStatus request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetOperationStatusSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetOperationStatusResponder handles the response to the GetOperationStatus request. The method always +// closes the http.Response Body. +func (client BaseClient) GetOperationStatusResponder(resp *http.Response) (result OperationStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MoveRecoveryPoint sends the move recovery point request. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// parameters - move Resource Across Tiers Request +func (client BaseClient) MoveRecoveryPoint(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters MoveRPAcrossTiersRequest) (result MoveRecoveryPointFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.MoveRecoveryPoint") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.MoveRecoveryPointPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.BaseClient", "MoveRecoveryPoint", nil, "Failure preparing request") + return + } + + result, err = client.MoveRecoveryPointSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.BaseClient", "MoveRecoveryPoint", result.Response(), "Failure sending request") + return + } + + return +} + +// MoveRecoveryPointPreparer prepares the MoveRecoveryPoint request. +func (client BaseClient) MoveRecoveryPointPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters MoveRPAcrossTiersRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "fabricName": autorest.Encode("path", fabricName), + "protectedItemName": autorest.Encode("path", protectedItemName), + "recoveryPointId": autorest.Encode("path", recoveryPointID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/move", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MoveRecoveryPointSender sends the MoveRecoveryPoint request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) MoveRecoveryPointSender(req *http.Request) (future MoveRecoveryPointFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MoveRecoveryPointResponder handles the response to the MoveRecoveryPoint request. The method always +// closes the http.Response Body. +func (client BaseClient) MoveRecoveryPointResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/engines.go b/services/recoveryservices/mgmt/2022-03-01/backup/engines.go similarity index 97% rename from services/recoveryservices/mgmt/2019-05-13/backup/engines.go rename to services/recoveryservices/mgmt/2022-03-01/backup/engines.go index 786747fdbf96..7ed012debd10 100644 --- a/services/recoveryservices/mgmt/2019-05-13/backup/engines.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/engines.go @@ -79,7 +79,7 @@ func (client EnginesClient) GetPreparer(ctx context.Context, vaultName string, r "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -93,7 +93,7 @@ func (client EnginesClient) GetPreparer(ctx context.Context, vaultName string, r preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEngines/{backupEngineName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEngines/{backupEngineName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -168,7 +168,7 @@ func (client EnginesClient) ListPreparer(ctx context.Context, vaultName string, "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -182,7 +182,7 @@ func (client EnginesClient) ListPreparer(ctx context.Context, vaultName string, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEngines", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEngines", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/recoveryservices/mgmt/2022-03-01/backup/enums.go b/services/recoveryservices/mgmt/2022-03-01/backup/enums.go new file mode 100644 index 000000000000..f7286e1f375f --- /dev/null +++ b/services/recoveryservices/mgmt/2022-03-01/backup/enums.go @@ -0,0 +1,1945 @@ +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// AcquireStorageAccountLock enumerates the values for acquire storage account lock. +type AcquireStorageAccountLock string + +const ( + // Acquire ... + Acquire AcquireStorageAccountLock = "Acquire" + // NotAcquire ... + NotAcquire AcquireStorageAccountLock = "NotAcquire" +) + +// PossibleAcquireStorageAccountLockValues returns an array of possible values for the AcquireStorageAccountLock const type. +func PossibleAcquireStorageAccountLockValues() []AcquireStorageAccountLock { + return []AcquireStorageAccountLock{Acquire, NotAcquire} +} + +// AzureFileShareType enumerates the values for azure file share type. +type AzureFileShareType string + +const ( + // Invalid ... + Invalid AzureFileShareType = "Invalid" + // XSMB ... + XSMB AzureFileShareType = "XSMB" + // XSync ... + XSync AzureFileShareType = "XSync" +) + +// PossibleAzureFileShareTypeValues returns an array of possible values for the AzureFileShareType const type. +func PossibleAzureFileShareTypeValues() []AzureFileShareType { + return []AzureFileShareType{Invalid, XSMB, XSync} +} + +// ContainerType enumerates the values for container type. +type ContainerType string + +const ( + // ContainerTypeAzureBackupServerContainer ... + ContainerTypeAzureBackupServerContainer ContainerType = "AzureBackupServerContainer" + // ContainerTypeAzureSQLContainer ... + ContainerTypeAzureSQLContainer ContainerType = "AzureSqlContainer" + // ContainerTypeCluster ... + ContainerTypeCluster ContainerType = "Cluster" + // ContainerTypeDPMContainer ... + ContainerTypeDPMContainer ContainerType = "DPMContainer" + // ContainerTypeGenericContainer ... + ContainerTypeGenericContainer ContainerType = "GenericContainer" + // ContainerTypeIaasVMContainer ... + ContainerTypeIaasVMContainer ContainerType = "IaasVMContainer" + // ContainerTypeIaasVMServiceContainer ... + ContainerTypeIaasVMServiceContainer ContainerType = "IaasVMServiceContainer" + // ContainerTypeInvalid ... + ContainerTypeInvalid ContainerType = "Invalid" + // ContainerTypeMABContainer ... + ContainerTypeMABContainer ContainerType = "MABContainer" + // ContainerTypeSQLAGWorkLoadContainer ... + ContainerTypeSQLAGWorkLoadContainer ContainerType = "SQLAGWorkLoadContainer" + // ContainerTypeStorageContainer ... + ContainerTypeStorageContainer ContainerType = "StorageContainer" + // ContainerTypeUnknown ... + ContainerTypeUnknown ContainerType = "Unknown" + // ContainerTypeVCenter ... + ContainerTypeVCenter ContainerType = "VCenter" + // ContainerTypeVMAppContainer ... + ContainerTypeVMAppContainer ContainerType = "VMAppContainer" + // ContainerTypeWindows ... + ContainerTypeWindows ContainerType = "Windows" +) + +// PossibleContainerTypeValues returns an array of possible values for the ContainerType const type. +func PossibleContainerTypeValues() []ContainerType { + return []ContainerType{ContainerTypeAzureBackupServerContainer, ContainerTypeAzureSQLContainer, ContainerTypeCluster, ContainerTypeDPMContainer, ContainerTypeGenericContainer, ContainerTypeIaasVMContainer, ContainerTypeIaasVMServiceContainer, ContainerTypeInvalid, ContainerTypeMABContainer, ContainerTypeSQLAGWorkLoadContainer, ContainerTypeStorageContainer, ContainerTypeUnknown, ContainerTypeVCenter, ContainerTypeVMAppContainer, ContainerTypeWindows} +} + +// ContainerTypeBasicProtectionContainer enumerates the values for container type basic protection container. +type ContainerTypeBasicProtectionContainer string + +const ( + // ContainerTypeAzureBackupServerContainer1 ... + ContainerTypeAzureBackupServerContainer1 ContainerTypeBasicProtectionContainer = "AzureBackupServerContainer" + // ContainerTypeAzureSQLContainer1 ... + ContainerTypeAzureSQLContainer1 ContainerTypeBasicProtectionContainer = "AzureSqlContainer" + // ContainerTypeAzureWorkloadContainer ... + ContainerTypeAzureWorkloadContainer ContainerTypeBasicProtectionContainer = "AzureWorkloadContainer" + // ContainerTypeDPMContainer1 ... + ContainerTypeDPMContainer1 ContainerTypeBasicProtectionContainer = "DPMContainer" + // ContainerTypeGenericContainer1 ... + ContainerTypeGenericContainer1 ContainerTypeBasicProtectionContainer = "GenericContainer" + // ContainerTypeIaasVMContainer1 ... + ContainerTypeIaasVMContainer1 ContainerTypeBasicProtectionContainer = "IaasVMContainer" + // ContainerTypeMicrosoftClassicComputevirtualMachines ... + ContainerTypeMicrosoftClassicComputevirtualMachines ContainerTypeBasicProtectionContainer = "Microsoft.ClassicCompute/virtualMachines" + // ContainerTypeMicrosoftComputevirtualMachines ... + ContainerTypeMicrosoftComputevirtualMachines ContainerTypeBasicProtectionContainer = "Microsoft.Compute/virtualMachines" + // ContainerTypeProtectionContainer ... + ContainerTypeProtectionContainer ContainerTypeBasicProtectionContainer = "ProtectionContainer" + // ContainerTypeSQLAGWorkLoadContainer1 ... + ContainerTypeSQLAGWorkLoadContainer1 ContainerTypeBasicProtectionContainer = "SQLAGWorkLoadContainer" + // ContainerTypeStorageContainer1 ... + ContainerTypeStorageContainer1 ContainerTypeBasicProtectionContainer = "StorageContainer" + // ContainerTypeVMAppContainer1 ... + ContainerTypeVMAppContainer1 ContainerTypeBasicProtectionContainer = "VMAppContainer" + // ContainerTypeWindows1 ... + ContainerTypeWindows1 ContainerTypeBasicProtectionContainer = "Windows" +) + +// PossibleContainerTypeBasicProtectionContainerValues returns an array of possible values for the ContainerTypeBasicProtectionContainer const type. +func PossibleContainerTypeBasicProtectionContainerValues() []ContainerTypeBasicProtectionContainer { + return []ContainerTypeBasicProtectionContainer{ContainerTypeAzureBackupServerContainer1, ContainerTypeAzureSQLContainer1, ContainerTypeAzureWorkloadContainer, ContainerTypeDPMContainer1, ContainerTypeGenericContainer1, ContainerTypeIaasVMContainer1, ContainerTypeMicrosoftClassicComputevirtualMachines, ContainerTypeMicrosoftComputevirtualMachines, ContainerTypeProtectionContainer, ContainerTypeSQLAGWorkLoadContainer1, ContainerTypeStorageContainer1, ContainerTypeVMAppContainer1, ContainerTypeWindows1} +} + +// CopyOptions enumerates the values for copy options. +type CopyOptions string + +const ( + // CopyOptionsCreateCopy ... + CopyOptionsCreateCopy CopyOptions = "CreateCopy" + // CopyOptionsFailOnConflict ... + CopyOptionsFailOnConflict CopyOptions = "FailOnConflict" + // CopyOptionsInvalid ... + CopyOptionsInvalid CopyOptions = "Invalid" + // CopyOptionsOverwrite ... + CopyOptionsOverwrite CopyOptions = "Overwrite" + // CopyOptionsSkip ... + CopyOptionsSkip CopyOptions = "Skip" +) + +// PossibleCopyOptionsValues returns an array of possible values for the CopyOptions const type. +func PossibleCopyOptionsValues() []CopyOptions { + return []CopyOptions{CopyOptionsCreateCopy, CopyOptionsFailOnConflict, CopyOptionsInvalid, CopyOptionsOverwrite, CopyOptionsSkip} +} + +// CreateMode enumerates the values for create mode. +type CreateMode string + +const ( + // CreateModeDefault ... + CreateModeDefault CreateMode = "Default" + // CreateModeInvalid ... + CreateModeInvalid CreateMode = "Invalid" + // CreateModeRecover ... + CreateModeRecover CreateMode = "Recover" +) + +// PossibleCreateModeValues returns an array of possible values for the CreateMode const type. +func PossibleCreateModeValues() []CreateMode { + return []CreateMode{CreateModeDefault, CreateModeInvalid, CreateModeRecover} +} + +// DataMoveLevel enumerates the values for data move level. +type DataMoveLevel string + +const ( + // DataMoveLevelContainer ... + DataMoveLevelContainer DataMoveLevel = "Container" + // DataMoveLevelInvalid ... + DataMoveLevelInvalid DataMoveLevel = "Invalid" + // DataMoveLevelVault ... + DataMoveLevelVault DataMoveLevel = "Vault" +) + +// PossibleDataMoveLevelValues returns an array of possible values for the DataMoveLevel const type. +func PossibleDataMoveLevelValues() []DataMoveLevel { + return []DataMoveLevel{DataMoveLevelContainer, DataMoveLevelInvalid, DataMoveLevelVault} +} + +// DataSourceType enumerates the values for data source type. +type DataSourceType string + +const ( + // DataSourceTypeAzureFileShare ... + DataSourceTypeAzureFileShare DataSourceType = "AzureFileShare" + // DataSourceTypeAzureSQLDb ... + DataSourceTypeAzureSQLDb DataSourceType = "AzureSqlDb" + // DataSourceTypeClient ... + DataSourceTypeClient DataSourceType = "Client" + // DataSourceTypeExchange ... + DataSourceTypeExchange DataSourceType = "Exchange" + // DataSourceTypeFileFolder ... + DataSourceTypeFileFolder DataSourceType = "FileFolder" + // DataSourceTypeGenericDataSource ... + DataSourceTypeGenericDataSource DataSourceType = "GenericDataSource" + // DataSourceTypeInvalid ... + DataSourceTypeInvalid DataSourceType = "Invalid" + // DataSourceTypeSAPAseDatabase ... + DataSourceTypeSAPAseDatabase DataSourceType = "SAPAseDatabase" + // DataSourceTypeSAPHanaDatabase ... + DataSourceTypeSAPHanaDatabase DataSourceType = "SAPHanaDatabase" + // DataSourceTypeSharepoint ... + DataSourceTypeSharepoint DataSourceType = "Sharepoint" + // DataSourceTypeSQLDataBase ... + DataSourceTypeSQLDataBase DataSourceType = "SQLDataBase" + // DataSourceTypeSQLDB ... + DataSourceTypeSQLDB DataSourceType = "SQLDB" + // DataSourceTypeSystemState ... + DataSourceTypeSystemState DataSourceType = "SystemState" + // DataSourceTypeVM ... + DataSourceTypeVM DataSourceType = "VM" + // DataSourceTypeVMwareVM ... + DataSourceTypeVMwareVM DataSourceType = "VMwareVM" +) + +// PossibleDataSourceTypeValues returns an array of possible values for the DataSourceType const type. +func PossibleDataSourceTypeValues() []DataSourceType { + return []DataSourceType{DataSourceTypeAzureFileShare, DataSourceTypeAzureSQLDb, DataSourceTypeClient, DataSourceTypeExchange, DataSourceTypeFileFolder, DataSourceTypeGenericDataSource, DataSourceTypeInvalid, DataSourceTypeSAPAseDatabase, DataSourceTypeSAPHanaDatabase, DataSourceTypeSharepoint, DataSourceTypeSQLDataBase, DataSourceTypeSQLDB, DataSourceTypeSystemState, DataSourceTypeVM, DataSourceTypeVMwareVM} +} + +// DayOfWeek enumerates the values for day of week. +type DayOfWeek string + +const ( + // Friday ... + Friday DayOfWeek = "Friday" + // Monday ... + Monday DayOfWeek = "Monday" + // Saturday ... + Saturday DayOfWeek = "Saturday" + // Sunday ... + Sunday DayOfWeek = "Sunday" + // Thursday ... + Thursday DayOfWeek = "Thursday" + // Tuesday ... + Tuesday DayOfWeek = "Tuesday" + // Wednesday ... + Wednesday DayOfWeek = "Wednesday" +) + +// PossibleDayOfWeekValues returns an array of possible values for the DayOfWeek const type. +func PossibleDayOfWeekValues() []DayOfWeek { + return []DayOfWeek{Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday} +} + +// DedupState enumerates the values for dedup state. +type DedupState string + +const ( + // DedupStateDisabled ... + DedupStateDisabled DedupState = "Disabled" + // DedupStateEnabled ... + DedupStateEnabled DedupState = "Enabled" + // DedupStateInvalid ... + DedupStateInvalid DedupState = "Invalid" +) + +// PossibleDedupStateValues returns an array of possible values for the DedupState const type. +func PossibleDedupStateValues() []DedupState { + return []DedupState{DedupStateDisabled, DedupStateEnabled, DedupStateInvalid} +} + +// EncryptionAtRestType enumerates the values for encryption at rest type. +type EncryptionAtRestType string + +const ( + // EncryptionAtRestTypeCustomerManaged ... + EncryptionAtRestTypeCustomerManaged EncryptionAtRestType = "CustomerManaged" + // EncryptionAtRestTypeInvalid ... + EncryptionAtRestTypeInvalid EncryptionAtRestType = "Invalid" + // EncryptionAtRestTypeMicrosoftManaged ... + EncryptionAtRestTypeMicrosoftManaged EncryptionAtRestType = "MicrosoftManaged" +) + +// PossibleEncryptionAtRestTypeValues returns an array of possible values for the EncryptionAtRestType const type. +func PossibleEncryptionAtRestTypeValues() []EncryptionAtRestType { + return []EncryptionAtRestType{EncryptionAtRestTypeCustomerManaged, EncryptionAtRestTypeInvalid, EncryptionAtRestTypeMicrosoftManaged} +} + +// EngineType enumerates the values for engine type. +type EngineType string + +const ( + // BackupEngineTypeAzureBackupServerEngine ... + BackupEngineTypeAzureBackupServerEngine EngineType = "AzureBackupServerEngine" + // BackupEngineTypeBackupEngineBase ... + BackupEngineTypeBackupEngineBase EngineType = "BackupEngineBase" + // BackupEngineTypeDpmBackupEngine ... + BackupEngineTypeDpmBackupEngine EngineType = "DpmBackupEngine" +) + +// PossibleEngineTypeValues returns an array of possible values for the EngineType const type. +func PossibleEngineTypeValues() []EngineType { + return []EngineType{BackupEngineTypeAzureBackupServerEngine, BackupEngineTypeBackupEngineBase, BackupEngineTypeDpmBackupEngine} +} + +// EnhancedSecurityState enumerates the values for enhanced security state. +type EnhancedSecurityState string + +const ( + // EnhancedSecurityStateDisabled ... + EnhancedSecurityStateDisabled EnhancedSecurityState = "Disabled" + // EnhancedSecurityStateEnabled ... + EnhancedSecurityStateEnabled EnhancedSecurityState = "Enabled" + // EnhancedSecurityStateInvalid ... + EnhancedSecurityStateInvalid EnhancedSecurityState = "Invalid" +) + +// PossibleEnhancedSecurityStateValues returns an array of possible values for the EnhancedSecurityState const type. +func PossibleEnhancedSecurityStateValues() []EnhancedSecurityState { + return []EnhancedSecurityState{EnhancedSecurityStateDisabled, EnhancedSecurityStateEnabled, EnhancedSecurityStateInvalid} +} + +// FabricName enumerates the values for fabric name. +type FabricName string + +const ( + // FabricNameAzure ... + FabricNameAzure FabricName = "Azure" + // FabricNameInvalid ... + FabricNameInvalid FabricName = "Invalid" +) + +// PossibleFabricNameValues returns an array of possible values for the FabricName const type. +func PossibleFabricNameValues() []FabricName { + return []FabricName{FabricNameAzure, FabricNameInvalid} +} + +// FeatureType enumerates the values for feature type. +type FeatureType string + +const ( + // FeatureTypeAzureBackupGoals ... + FeatureTypeAzureBackupGoals FeatureType = "AzureBackupGoals" + // FeatureTypeAzureVMResourceBackup ... + FeatureTypeAzureVMResourceBackup FeatureType = "AzureVMResourceBackup" + // FeatureTypeFeatureSupportRequest ... + FeatureTypeFeatureSupportRequest FeatureType = "FeatureSupportRequest" +) + +// PossibleFeatureTypeValues returns an array of possible values for the FeatureType const type. +func PossibleFeatureTypeValues() []FeatureType { + return []FeatureType{FeatureTypeAzureBackupGoals, FeatureTypeAzureVMResourceBackup, FeatureTypeFeatureSupportRequest} +} + +// HealthState enumerates the values for health state. +type HealthState string + +const ( + // HealthStateActionRequired ... + HealthStateActionRequired HealthState = "ActionRequired" + // HealthStateActionSuggested ... + HealthStateActionSuggested HealthState = "ActionSuggested" + // HealthStateInvalid ... + HealthStateInvalid HealthState = "Invalid" + // HealthStatePassed ... + HealthStatePassed HealthState = "Passed" +) + +// PossibleHealthStateValues returns an array of possible values for the HealthState const type. +func PossibleHealthStateValues() []HealthState { + return []HealthState{HealthStateActionRequired, HealthStateActionSuggested, HealthStateInvalid, HealthStatePassed} +} + +// HealthStatus enumerates the values for health status. +type HealthStatus string + +const ( + // HealthStatusActionRequired ... + HealthStatusActionRequired HealthStatus = "ActionRequired" + // HealthStatusActionSuggested ... + HealthStatusActionSuggested HealthStatus = "ActionSuggested" + // HealthStatusInvalid ... + HealthStatusInvalid HealthStatus = "Invalid" + // HealthStatusPassed ... + HealthStatusPassed HealthStatus = "Passed" +) + +// PossibleHealthStatusValues returns an array of possible values for the HealthStatus const type. +func PossibleHealthStatusValues() []HealthStatus { + return []HealthStatus{HealthStatusActionRequired, HealthStatusActionSuggested, HealthStatusInvalid, HealthStatusPassed} +} + +// HTTPStatusCode enumerates the values for http status code. +type HTTPStatusCode string + +const ( + // Accepted ... + Accepted HTTPStatusCode = "Accepted" + // Ambiguous ... + Ambiguous HTTPStatusCode = "Ambiguous" + // BadGateway ... + BadGateway HTTPStatusCode = "BadGateway" + // BadRequest ... + BadRequest HTTPStatusCode = "BadRequest" + // Conflict ... + Conflict HTTPStatusCode = "Conflict" + // Continue ... + Continue HTTPStatusCode = "Continue" + // Created ... + Created HTTPStatusCode = "Created" + // ExpectationFailed ... + ExpectationFailed HTTPStatusCode = "ExpectationFailed" + // Forbidden ... + Forbidden HTTPStatusCode = "Forbidden" + // Found ... + Found HTTPStatusCode = "Found" + // GatewayTimeout ... + GatewayTimeout HTTPStatusCode = "GatewayTimeout" + // Gone ... + Gone HTTPStatusCode = "Gone" + // HTTPVersionNotSupported ... + HTTPVersionNotSupported HTTPStatusCode = "HttpVersionNotSupported" + // InternalServerError ... + InternalServerError HTTPStatusCode = "InternalServerError" + // LengthRequired ... + LengthRequired HTTPStatusCode = "LengthRequired" + // MethodNotAllowed ... + MethodNotAllowed HTTPStatusCode = "MethodNotAllowed" + // Moved ... + Moved HTTPStatusCode = "Moved" + // MovedPermanently ... + MovedPermanently HTTPStatusCode = "MovedPermanently" + // MultipleChoices ... + MultipleChoices HTTPStatusCode = "MultipleChoices" + // NoContent ... + NoContent HTTPStatusCode = "NoContent" + // NonAuthoritativeInformation ... + NonAuthoritativeInformation HTTPStatusCode = "NonAuthoritativeInformation" + // NotAcceptable ... + NotAcceptable HTTPStatusCode = "NotAcceptable" + // NotFound ... + NotFound HTTPStatusCode = "NotFound" + // NotImplemented ... + NotImplemented HTTPStatusCode = "NotImplemented" + // NotModified ... + NotModified HTTPStatusCode = "NotModified" + // OK ... + OK HTTPStatusCode = "OK" + // PartialContent ... + PartialContent HTTPStatusCode = "PartialContent" + // PaymentRequired ... + PaymentRequired HTTPStatusCode = "PaymentRequired" + // PreconditionFailed ... + PreconditionFailed HTTPStatusCode = "PreconditionFailed" + // ProxyAuthenticationRequired ... + ProxyAuthenticationRequired HTTPStatusCode = "ProxyAuthenticationRequired" + // Redirect ... + Redirect HTTPStatusCode = "Redirect" + // RedirectKeepVerb ... + RedirectKeepVerb HTTPStatusCode = "RedirectKeepVerb" + // RedirectMethod ... + RedirectMethod HTTPStatusCode = "RedirectMethod" + // RequestedRangeNotSatisfiable ... + RequestedRangeNotSatisfiable HTTPStatusCode = "RequestedRangeNotSatisfiable" + // RequestEntityTooLarge ... + RequestEntityTooLarge HTTPStatusCode = "RequestEntityTooLarge" + // RequestTimeout ... + RequestTimeout HTTPStatusCode = "RequestTimeout" + // RequestURITooLong ... + RequestURITooLong HTTPStatusCode = "RequestUriTooLong" + // ResetContent ... + ResetContent HTTPStatusCode = "ResetContent" + // SeeOther ... + SeeOther HTTPStatusCode = "SeeOther" + // ServiceUnavailable ... + ServiceUnavailable HTTPStatusCode = "ServiceUnavailable" + // SwitchingProtocols ... + SwitchingProtocols HTTPStatusCode = "SwitchingProtocols" + // TemporaryRedirect ... + TemporaryRedirect HTTPStatusCode = "TemporaryRedirect" + // Unauthorized ... + Unauthorized HTTPStatusCode = "Unauthorized" + // UnsupportedMediaType ... + UnsupportedMediaType HTTPStatusCode = "UnsupportedMediaType" + // Unused ... + Unused HTTPStatusCode = "Unused" + // UpgradeRequired ... + UpgradeRequired HTTPStatusCode = "UpgradeRequired" + // UseProxy ... + UseProxy HTTPStatusCode = "UseProxy" +) + +// PossibleHTTPStatusCodeValues returns an array of possible values for the HTTPStatusCode const type. +func PossibleHTTPStatusCodeValues() []HTTPStatusCode { + 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} +} + +// IAASVMPolicyType enumerates the values for iaasvm policy type. +type IAASVMPolicyType string + +const ( + // IAASVMPolicyTypeInvalid ... + IAASVMPolicyTypeInvalid IAASVMPolicyType = "Invalid" + // IAASVMPolicyTypeV1 ... + IAASVMPolicyTypeV1 IAASVMPolicyType = "V1" + // IAASVMPolicyTypeV2 ... + IAASVMPolicyTypeV2 IAASVMPolicyType = "V2" +) + +// PossibleIAASVMPolicyTypeValues returns an array of possible values for the IAASVMPolicyType const type. +func PossibleIAASVMPolicyTypeValues() []IAASVMPolicyType { + return []IAASVMPolicyType{IAASVMPolicyTypeInvalid, IAASVMPolicyTypeV1, IAASVMPolicyTypeV2} +} + +// InfrastructureEncryptionState enumerates the values for infrastructure encryption state. +type InfrastructureEncryptionState string + +const ( + // InfrastructureEncryptionStateDisabled ... + InfrastructureEncryptionStateDisabled InfrastructureEncryptionState = "Disabled" + // InfrastructureEncryptionStateEnabled ... + InfrastructureEncryptionStateEnabled InfrastructureEncryptionState = "Enabled" + // InfrastructureEncryptionStateInvalid ... + InfrastructureEncryptionStateInvalid InfrastructureEncryptionState = "Invalid" +) + +// PossibleInfrastructureEncryptionStateValues returns an array of possible values for the InfrastructureEncryptionState const type. +func PossibleInfrastructureEncryptionStateValues() []InfrastructureEncryptionState { + return []InfrastructureEncryptionState{InfrastructureEncryptionStateDisabled, InfrastructureEncryptionStateEnabled, InfrastructureEncryptionStateInvalid} +} + +// InquiryStatus enumerates the values for inquiry status. +type InquiryStatus string + +const ( + // InquiryStatusFailed ... + InquiryStatusFailed InquiryStatus = "Failed" + // InquiryStatusInvalid ... + InquiryStatusInvalid InquiryStatus = "Invalid" + // InquiryStatusSuccess ... + InquiryStatusSuccess InquiryStatus = "Success" +) + +// PossibleInquiryStatusValues returns an array of possible values for the InquiryStatus const type. +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 + +const ( + // ItemTypeAzureFileShare ... + ItemTypeAzureFileShare ItemType = "AzureFileShare" + // ItemTypeAzureSQLDb ... + ItemTypeAzureSQLDb ItemType = "AzureSqlDb" + // ItemTypeClient ... + ItemTypeClient ItemType = "Client" + // ItemTypeExchange ... + ItemTypeExchange ItemType = "Exchange" + // ItemTypeFileFolder ... + ItemTypeFileFolder ItemType = "FileFolder" + // ItemTypeGenericDataSource ... + ItemTypeGenericDataSource ItemType = "GenericDataSource" + // ItemTypeInvalid ... + ItemTypeInvalid ItemType = "Invalid" + // ItemTypeSAPAseDatabase ... + ItemTypeSAPAseDatabase ItemType = "SAPAseDatabase" + // ItemTypeSAPHanaDatabase ... + ItemTypeSAPHanaDatabase ItemType = "SAPHanaDatabase" + // ItemTypeSharepoint ... + ItemTypeSharepoint ItemType = "Sharepoint" + // ItemTypeSQLDataBase ... + ItemTypeSQLDataBase ItemType = "SQLDataBase" + // ItemTypeSQLDB ... + ItemTypeSQLDB ItemType = "SQLDB" + // ItemTypeSystemState ... + ItemTypeSystemState ItemType = "SystemState" + // ItemTypeVM ... + ItemTypeVM ItemType = "VM" + // ItemTypeVMwareVM ... + ItemTypeVMwareVM ItemType = "VMwareVM" +) + +// PossibleItemTypeValues returns an array of possible values for the ItemType const type. +func PossibleItemTypeValues() []ItemType { + return []ItemType{ItemTypeAzureFileShare, ItemTypeAzureSQLDb, ItemTypeClient, ItemTypeExchange, ItemTypeFileFolder, ItemTypeGenericDataSource, ItemTypeInvalid, ItemTypeSAPAseDatabase, ItemTypeSAPHanaDatabase, ItemTypeSharepoint, ItemTypeSQLDataBase, ItemTypeSQLDB, ItemTypeSystemState, ItemTypeVM, ItemTypeVMwareVM} +} + +// JobOperationType enumerates the values for job operation type. +type JobOperationType string + +const ( + // JobOperationTypeBackup ... + JobOperationTypeBackup JobOperationType = "Backup" + // JobOperationTypeConfigureBackup ... + JobOperationTypeConfigureBackup JobOperationType = "ConfigureBackup" + // JobOperationTypeCrossRegionRestore ... + JobOperationTypeCrossRegionRestore JobOperationType = "CrossRegionRestore" + // JobOperationTypeDeleteBackupData ... + JobOperationTypeDeleteBackupData JobOperationType = "DeleteBackupData" + // JobOperationTypeDisableBackup ... + JobOperationTypeDisableBackup JobOperationType = "DisableBackup" + // JobOperationTypeInvalid ... + JobOperationTypeInvalid JobOperationType = "Invalid" + // JobOperationTypeRegister ... + JobOperationTypeRegister JobOperationType = "Register" + // JobOperationTypeRestore ... + JobOperationTypeRestore JobOperationType = "Restore" + // JobOperationTypeUndelete ... + JobOperationTypeUndelete JobOperationType = "Undelete" + // JobOperationTypeUnRegister ... + JobOperationTypeUnRegister JobOperationType = "UnRegister" + // JobOperationTypeUpdateCustomerManagedKey ... + JobOperationTypeUpdateCustomerManagedKey JobOperationType = "UpdateCustomerManagedKey" +) + +// PossibleJobOperationTypeValues returns an array of possible values for the JobOperationType const type. +func PossibleJobOperationTypeValues() []JobOperationType { + return []JobOperationType{JobOperationTypeBackup, JobOperationTypeConfigureBackup, JobOperationTypeCrossRegionRestore, JobOperationTypeDeleteBackupData, JobOperationTypeDisableBackup, JobOperationTypeInvalid, JobOperationTypeRegister, JobOperationTypeRestore, JobOperationTypeUndelete, JobOperationTypeUnRegister, JobOperationTypeUpdateCustomerManagedKey} +} + +// JobStatus enumerates the values for job status. +type JobStatus string + +const ( + // JobStatusCancelled ... + JobStatusCancelled JobStatus = "Cancelled" + // JobStatusCancelling ... + JobStatusCancelling JobStatus = "Cancelling" + // JobStatusCompleted ... + JobStatusCompleted JobStatus = "Completed" + // JobStatusCompletedWithWarnings ... + JobStatusCompletedWithWarnings JobStatus = "CompletedWithWarnings" + // JobStatusFailed ... + JobStatusFailed JobStatus = "Failed" + // JobStatusInProgress ... + JobStatusInProgress JobStatus = "InProgress" + // JobStatusInvalid ... + JobStatusInvalid JobStatus = "Invalid" +) + +// PossibleJobStatusValues returns an array of possible values for the JobStatus const type. +func PossibleJobStatusValues() []JobStatus { + return []JobStatus{JobStatusCancelled, JobStatusCancelling, JobStatusCompleted, JobStatusCompletedWithWarnings, JobStatusFailed, JobStatusInProgress, JobStatusInvalid} +} + +// JobSupportedAction enumerates the values for job supported action. +type JobSupportedAction string + +const ( + // JobSupportedActionCancellable ... + JobSupportedActionCancellable JobSupportedAction = "Cancellable" + // JobSupportedActionInvalid ... + JobSupportedActionInvalid JobSupportedAction = "Invalid" + // JobSupportedActionRetriable ... + JobSupportedActionRetriable JobSupportedAction = "Retriable" +) + +// PossibleJobSupportedActionValues returns an array of possible values for the JobSupportedAction const type. +func PossibleJobSupportedActionValues() []JobSupportedAction { + return []JobSupportedAction{JobSupportedActionCancellable, JobSupportedActionInvalid, JobSupportedActionRetriable} +} + +// JobType enumerates the values for job type. +type JobType string + +const ( + // JobTypeAzureIaaSVMJob ... + JobTypeAzureIaaSVMJob JobType = "AzureIaaSVMJob" + // JobTypeAzureIaaSVMJobV2 ... + JobTypeAzureIaaSVMJobV2 JobType = "AzureIaaSVMJobV2" + // JobTypeAzureStorageJob ... + JobTypeAzureStorageJob JobType = "AzureStorageJob" + // JobTypeAzureWorkloadJob ... + JobTypeAzureWorkloadJob JobType = "AzureWorkloadJob" + // JobTypeDpmJob ... + JobTypeDpmJob JobType = "DpmJob" + // JobTypeJob ... + JobTypeJob JobType = "Job" + // JobTypeMabJob ... + JobTypeMabJob JobType = "MabJob" + // JobTypeVaultJob ... + JobTypeVaultJob JobType = "VaultJob" +) + +// PossibleJobTypeValues returns an array of possible values for the JobType const type. +func PossibleJobTypeValues() []JobType { + return []JobType{JobTypeAzureIaaSVMJob, JobTypeAzureIaaSVMJobV2, JobTypeAzureStorageJob, JobTypeAzureWorkloadJob, JobTypeDpmJob, JobTypeJob, JobTypeMabJob, JobTypeVaultJob} +} + +// LastBackupStatus enumerates the values for last backup status. +type LastBackupStatus string + +const ( + // LastBackupStatusHealthy ... + LastBackupStatusHealthy LastBackupStatus = "Healthy" + // LastBackupStatusInvalid ... + LastBackupStatusInvalid LastBackupStatus = "Invalid" + // LastBackupStatusIRPending ... + LastBackupStatusIRPending LastBackupStatus = "IRPending" + // LastBackupStatusUnhealthy ... + LastBackupStatusUnhealthy LastBackupStatus = "Unhealthy" +) + +// PossibleLastBackupStatusValues returns an array of possible values for the LastBackupStatus const type. +func PossibleLastBackupStatusValues() []LastBackupStatus { + return []LastBackupStatus{LastBackupStatusHealthy, LastBackupStatusInvalid, LastBackupStatusIRPending, LastBackupStatusUnhealthy} +} + +// LastUpdateStatus enumerates the values for last update status. +type LastUpdateStatus string + +const ( + // LastUpdateStatusFailed ... + LastUpdateStatusFailed LastUpdateStatus = "Failed" + // LastUpdateStatusFirstInitialization ... + LastUpdateStatusFirstInitialization LastUpdateStatus = "FirstInitialization" + // LastUpdateStatusInitialized ... + LastUpdateStatusInitialized LastUpdateStatus = "Initialized" + // LastUpdateStatusInvalid ... + LastUpdateStatusInvalid LastUpdateStatus = "Invalid" + // LastUpdateStatusNotEnabled ... + LastUpdateStatusNotEnabled LastUpdateStatus = "NotEnabled" + // LastUpdateStatusPartiallyFailed ... + LastUpdateStatusPartiallyFailed LastUpdateStatus = "PartiallyFailed" + // LastUpdateStatusPartiallySucceeded ... + LastUpdateStatusPartiallySucceeded LastUpdateStatus = "PartiallySucceeded" + // LastUpdateStatusSucceeded ... + LastUpdateStatusSucceeded LastUpdateStatus = "Succeeded" +) + +// PossibleLastUpdateStatusValues returns an array of possible values for the LastUpdateStatus const type. +func PossibleLastUpdateStatusValues() []LastUpdateStatus { + return []LastUpdateStatus{LastUpdateStatusFailed, LastUpdateStatusFirstInitialization, LastUpdateStatusInitialized, LastUpdateStatusInvalid, LastUpdateStatusNotEnabled, LastUpdateStatusPartiallyFailed, LastUpdateStatusPartiallySucceeded, LastUpdateStatusSucceeded} +} + +// MabServerType enumerates the values for mab server type. +type MabServerType string + +const ( + // MabServerTypeAzureBackupServerContainer ... + MabServerTypeAzureBackupServerContainer MabServerType = "AzureBackupServerContainer" + // MabServerTypeAzureSQLContainer ... + MabServerTypeAzureSQLContainer MabServerType = "AzureSqlContainer" + // MabServerTypeCluster ... + MabServerTypeCluster MabServerType = "Cluster" + // MabServerTypeDPMContainer ... + MabServerTypeDPMContainer MabServerType = "DPMContainer" + // MabServerTypeGenericContainer ... + MabServerTypeGenericContainer MabServerType = "GenericContainer" + // MabServerTypeIaasVMContainer ... + MabServerTypeIaasVMContainer MabServerType = "IaasVMContainer" + // MabServerTypeIaasVMServiceContainer ... + MabServerTypeIaasVMServiceContainer MabServerType = "IaasVMServiceContainer" + // MabServerTypeInvalid ... + MabServerTypeInvalid MabServerType = "Invalid" + // MabServerTypeMABContainer ... + MabServerTypeMABContainer MabServerType = "MABContainer" + // MabServerTypeSQLAGWorkLoadContainer ... + MabServerTypeSQLAGWorkLoadContainer MabServerType = "SQLAGWorkLoadContainer" + // MabServerTypeStorageContainer ... + MabServerTypeStorageContainer MabServerType = "StorageContainer" + // MabServerTypeUnknown ... + MabServerTypeUnknown MabServerType = "Unknown" + // MabServerTypeVCenter ... + MabServerTypeVCenter MabServerType = "VCenter" + // MabServerTypeVMAppContainer ... + MabServerTypeVMAppContainer MabServerType = "VMAppContainer" + // MabServerTypeWindows ... + MabServerTypeWindows MabServerType = "Windows" +) + +// PossibleMabServerTypeValues returns an array of possible values for the MabServerType const type. +func PossibleMabServerTypeValues() []MabServerType { + return []MabServerType{MabServerTypeAzureBackupServerContainer, MabServerTypeAzureSQLContainer, MabServerTypeCluster, MabServerTypeDPMContainer, MabServerTypeGenericContainer, MabServerTypeIaasVMContainer, MabServerTypeIaasVMServiceContainer, MabServerTypeInvalid, MabServerTypeMABContainer, MabServerTypeSQLAGWorkLoadContainer, MabServerTypeStorageContainer, MabServerTypeUnknown, MabServerTypeVCenter, MabServerTypeVMAppContainer, MabServerTypeWindows} +} + +// ManagementType enumerates the values for management type. +type ManagementType string + +const ( + // ManagementTypeAzureBackupServer ... + ManagementTypeAzureBackupServer ManagementType = "AzureBackupServer" + // ManagementTypeAzureIaasVM ... + ManagementTypeAzureIaasVM ManagementType = "AzureIaasVM" + // ManagementTypeAzureSQL ... + ManagementTypeAzureSQL ManagementType = "AzureSql" + // ManagementTypeAzureStorage ... + ManagementTypeAzureStorage ManagementType = "AzureStorage" + // ManagementTypeAzureWorkload ... + ManagementTypeAzureWorkload ManagementType = "AzureWorkload" + // ManagementTypeDefaultBackup ... + ManagementTypeDefaultBackup ManagementType = "DefaultBackup" + // ManagementTypeDPM ... + ManagementTypeDPM ManagementType = "DPM" + // ManagementTypeInvalid ... + ManagementTypeInvalid ManagementType = "Invalid" + // ManagementTypeMAB ... + ManagementTypeMAB ManagementType = "MAB" +) + +// PossibleManagementTypeValues returns an array of possible values for the ManagementType const type. +func PossibleManagementTypeValues() []ManagementType { + return []ManagementType{ManagementTypeAzureBackupServer, ManagementTypeAzureIaasVM, ManagementTypeAzureSQL, ManagementTypeAzureStorage, ManagementTypeAzureWorkload, ManagementTypeDefaultBackup, ManagementTypeDPM, ManagementTypeInvalid, ManagementTypeMAB} +} + +// ManagementTypeBasicProtectionPolicy enumerates the values for management type basic protection policy. +type ManagementTypeBasicProtectionPolicy string + +const ( + // BackupManagementTypeAzureIaasVM ... + BackupManagementTypeAzureIaasVM ManagementTypeBasicProtectionPolicy = "AzureIaasVM" + // BackupManagementTypeAzureSQL ... + BackupManagementTypeAzureSQL ManagementTypeBasicProtectionPolicy = "AzureSql" + // BackupManagementTypeAzureStorage ... + BackupManagementTypeAzureStorage ManagementTypeBasicProtectionPolicy = "AzureStorage" + // BackupManagementTypeAzureWorkload ... + BackupManagementTypeAzureWorkload ManagementTypeBasicProtectionPolicy = "AzureWorkload" + // BackupManagementTypeGenericProtectionPolicy ... + BackupManagementTypeGenericProtectionPolicy ManagementTypeBasicProtectionPolicy = "GenericProtectionPolicy" + // BackupManagementTypeMAB ... + BackupManagementTypeMAB ManagementTypeBasicProtectionPolicy = "MAB" + // BackupManagementTypeProtectionPolicy ... + BackupManagementTypeProtectionPolicy ManagementTypeBasicProtectionPolicy = "ProtectionPolicy" +) + +// PossibleManagementTypeBasicProtectionPolicyValues returns an array of possible values for the ManagementTypeBasicProtectionPolicy const type. +func PossibleManagementTypeBasicProtectionPolicyValues() []ManagementTypeBasicProtectionPolicy { + return []ManagementTypeBasicProtectionPolicy{BackupManagementTypeAzureIaasVM, BackupManagementTypeAzureSQL, BackupManagementTypeAzureStorage, BackupManagementTypeAzureWorkload, BackupManagementTypeGenericProtectionPolicy, BackupManagementTypeMAB, BackupManagementTypeProtectionPolicy} +} + +// MonthOfYear enumerates the values for month of year. +type MonthOfYear string + +const ( + // MonthOfYearApril ... + MonthOfYearApril MonthOfYear = "April" + // MonthOfYearAugust ... + MonthOfYearAugust MonthOfYear = "August" + // MonthOfYearDecember ... + MonthOfYearDecember MonthOfYear = "December" + // MonthOfYearFebruary ... + MonthOfYearFebruary MonthOfYear = "February" + // MonthOfYearInvalid ... + MonthOfYearInvalid MonthOfYear = "Invalid" + // MonthOfYearJanuary ... + MonthOfYearJanuary MonthOfYear = "January" + // MonthOfYearJuly ... + MonthOfYearJuly MonthOfYear = "July" + // MonthOfYearJune ... + MonthOfYearJune MonthOfYear = "June" + // MonthOfYearMarch ... + MonthOfYearMarch MonthOfYear = "March" + // MonthOfYearMay ... + MonthOfYearMay MonthOfYear = "May" + // MonthOfYearNovember ... + MonthOfYearNovember MonthOfYear = "November" + // MonthOfYearOctober ... + MonthOfYearOctober MonthOfYear = "October" + // MonthOfYearSeptember ... + MonthOfYearSeptember MonthOfYear = "September" +) + +// PossibleMonthOfYearValues returns an array of possible values for the MonthOfYear const type. +func PossibleMonthOfYearValues() []MonthOfYear { + return []MonthOfYear{MonthOfYearApril, MonthOfYearAugust, MonthOfYearDecember, MonthOfYearFebruary, MonthOfYearInvalid, MonthOfYearJanuary, MonthOfYearJuly, MonthOfYearJune, MonthOfYearMarch, MonthOfYearMay, MonthOfYearNovember, MonthOfYearOctober, MonthOfYearSeptember} +} + +// ObjectType enumerates the values for object type. +type ObjectType string + +const ( + // ObjectTypeExportJobsOperationResultInfo ... + ObjectTypeExportJobsOperationResultInfo ObjectType = "ExportJobsOperationResultInfo" + // ObjectTypeOperationResultInfo ... + ObjectTypeOperationResultInfo ObjectType = "OperationResultInfo" + // ObjectTypeOperationResultInfoBase ... + ObjectTypeOperationResultInfoBase ObjectType = "OperationResultInfoBase" +) + +// PossibleObjectTypeValues returns an array of possible values for the ObjectType const type. +func PossibleObjectTypeValues() []ObjectType { + return []ObjectType{ObjectTypeExportJobsOperationResultInfo, ObjectTypeOperationResultInfo, ObjectTypeOperationResultInfoBase} +} + +// ObjectTypeBasicILRRequest enumerates the values for object type basic ilr request. +type ObjectTypeBasicILRRequest string + +const ( + // ObjectTypeAzureFileShareProvisionILRRequest ... + ObjectTypeAzureFileShareProvisionILRRequest ObjectTypeBasicILRRequest = "AzureFileShareProvisionILRRequest" + // ObjectTypeIaasVMILRRegistrationRequest ... + ObjectTypeIaasVMILRRegistrationRequest ObjectTypeBasicILRRequest = "IaasVMILRRegistrationRequest" + // ObjectTypeILRRequest ... + ObjectTypeILRRequest ObjectTypeBasicILRRequest = "ILRRequest" +) + +// PossibleObjectTypeBasicILRRequestValues returns an array of possible values for the ObjectTypeBasicILRRequest const type. +func PossibleObjectTypeBasicILRRequestValues() []ObjectTypeBasicILRRequest { + return []ObjectTypeBasicILRRequest{ObjectTypeAzureFileShareProvisionILRRequest, ObjectTypeIaasVMILRRegistrationRequest, ObjectTypeILRRequest} +} + +// ObjectTypeBasicOperationStatusExtendedInfo enumerates the values for object type basic operation status +// extended info. +type ObjectTypeBasicOperationStatusExtendedInfo string + +const ( + // ObjectTypeOperationStatusExtendedInfo ... + ObjectTypeOperationStatusExtendedInfo ObjectTypeBasicOperationStatusExtendedInfo = "OperationStatusExtendedInfo" + // ObjectTypeOperationStatusJobExtendedInfo ... + ObjectTypeOperationStatusJobExtendedInfo ObjectTypeBasicOperationStatusExtendedInfo = "OperationStatusJobExtendedInfo" + // ObjectTypeOperationStatusJobsExtendedInfo ... + ObjectTypeOperationStatusJobsExtendedInfo ObjectTypeBasicOperationStatusExtendedInfo = "OperationStatusJobsExtendedInfo" + // ObjectTypeOperationStatusProvisionILRExtendedInfo ... + ObjectTypeOperationStatusProvisionILRExtendedInfo ObjectTypeBasicOperationStatusExtendedInfo = "OperationStatusProvisionILRExtendedInfo" + // ObjectTypeOperationStatusValidateOperationExtendedInfo ... + ObjectTypeOperationStatusValidateOperationExtendedInfo ObjectTypeBasicOperationStatusExtendedInfo = "OperationStatusValidateOperationExtendedInfo" +) + +// PossibleObjectTypeBasicOperationStatusExtendedInfoValues returns an array of possible values for the ObjectTypeBasicOperationStatusExtendedInfo const type. +func PossibleObjectTypeBasicOperationStatusExtendedInfoValues() []ObjectTypeBasicOperationStatusExtendedInfo { + return []ObjectTypeBasicOperationStatusExtendedInfo{ObjectTypeOperationStatusExtendedInfo, ObjectTypeOperationStatusJobExtendedInfo, ObjectTypeOperationStatusJobsExtendedInfo, ObjectTypeOperationStatusProvisionILRExtendedInfo, ObjectTypeOperationStatusValidateOperationExtendedInfo} +} + +// ObjectTypeBasicRecoveryPoint enumerates the values for object type basic recovery point. +type ObjectTypeBasicRecoveryPoint string + +const ( + // ObjectTypeAzureFileShareRecoveryPoint ... + ObjectTypeAzureFileShareRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureFileShareRecoveryPoint" + // ObjectTypeAzureWorkloadPointInTimeRecoveryPoint ... + ObjectTypeAzureWorkloadPointInTimeRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadPointInTimeRecoveryPoint" + // ObjectTypeAzureWorkloadRecoveryPoint ... + ObjectTypeAzureWorkloadRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadRecoveryPoint" + // ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint ... + ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadSAPHanaPointInTimeRecoveryPoint" + // ObjectTypeAzureWorkloadSAPHanaRecoveryPoint ... + ObjectTypeAzureWorkloadSAPHanaRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadSAPHanaRecoveryPoint" + // ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint ... + ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadSQLPointInTimeRecoveryPoint" + // ObjectTypeAzureWorkloadSQLRecoveryPoint ... + ObjectTypeAzureWorkloadSQLRecoveryPoint ObjectTypeBasicRecoveryPoint = "AzureWorkloadSQLRecoveryPoint" + // ObjectTypeGenericRecoveryPoint ... + ObjectTypeGenericRecoveryPoint ObjectTypeBasicRecoveryPoint = "GenericRecoveryPoint" + // ObjectTypeIaasVMRecoveryPoint ... + ObjectTypeIaasVMRecoveryPoint ObjectTypeBasicRecoveryPoint = "IaasVMRecoveryPoint" + // ObjectTypeRecoveryPoint ... + ObjectTypeRecoveryPoint ObjectTypeBasicRecoveryPoint = "RecoveryPoint" +) + +// PossibleObjectTypeBasicRecoveryPointValues returns an array of possible values for the ObjectTypeBasicRecoveryPoint const type. +func PossibleObjectTypeBasicRecoveryPointValues() []ObjectTypeBasicRecoveryPoint { + return []ObjectTypeBasicRecoveryPoint{ObjectTypeAzureFileShareRecoveryPoint, ObjectTypeAzureWorkloadPointInTimeRecoveryPoint, ObjectTypeAzureWorkloadRecoveryPoint, ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint, ObjectTypeAzureWorkloadSAPHanaRecoveryPoint, ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint, ObjectTypeAzureWorkloadSQLRecoveryPoint, ObjectTypeGenericRecoveryPoint, ObjectTypeIaasVMRecoveryPoint, ObjectTypeRecoveryPoint} +} + +// ObjectTypeBasicRequest enumerates the values for object type basic request. +type ObjectTypeBasicRequest string + +const ( + // ObjectTypeAzureFileShareBackupRequest ... + ObjectTypeAzureFileShareBackupRequest ObjectTypeBasicRequest = "AzureFileShareBackupRequest" + // ObjectTypeAzureWorkloadBackupRequest ... + ObjectTypeAzureWorkloadBackupRequest ObjectTypeBasicRequest = "AzureWorkloadBackupRequest" + // ObjectTypeBackupRequest ... + ObjectTypeBackupRequest ObjectTypeBasicRequest = "BackupRequest" + // ObjectTypeIaasVMBackupRequest ... + ObjectTypeIaasVMBackupRequest ObjectTypeBasicRequest = "IaasVMBackupRequest" +) + +// PossibleObjectTypeBasicRequestValues returns an array of possible values for the ObjectTypeBasicRequest const type. +func PossibleObjectTypeBasicRequestValues() []ObjectTypeBasicRequest { + return []ObjectTypeBasicRequest{ObjectTypeAzureFileShareBackupRequest, ObjectTypeAzureWorkloadBackupRequest, ObjectTypeBackupRequest, ObjectTypeIaasVMBackupRequest} +} + +// ObjectTypeBasicRestoreRequest enumerates the values for object type basic restore request. +type ObjectTypeBasicRestoreRequest string + +const ( + // ObjectTypeAzureFileShareRestoreRequest ... + ObjectTypeAzureFileShareRestoreRequest ObjectTypeBasicRestoreRequest = "AzureFileShareRestoreRequest" + // ObjectTypeAzureWorkloadPointInTimeRestoreRequest ... + ObjectTypeAzureWorkloadPointInTimeRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadPointInTimeRestoreRequest" + // ObjectTypeAzureWorkloadRestoreRequest ... + ObjectTypeAzureWorkloadRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadRestoreRequest" + // ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest ... + ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadSAPHanaPointInTimeRestoreRequest" + // ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest ... + ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest" + // ObjectTypeAzureWorkloadSAPHanaRestoreRequest ... + ObjectTypeAzureWorkloadSAPHanaRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadSAPHanaRestoreRequest" + // ObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest ... + ObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadSAPHanaRestoreWithRehydrateRequest" + // ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest ... + ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadSQLPointInTimeRestoreRequest" + // ObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest ... + ObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest" + // ObjectTypeAzureWorkloadSQLRestoreRequest ... + ObjectTypeAzureWorkloadSQLRestoreRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadSQLRestoreRequest" + // ObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest ... + ObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest ObjectTypeBasicRestoreRequest = "AzureWorkloadSQLRestoreWithRehydrateRequest" + // ObjectTypeIaasVMRestoreRequest ... + ObjectTypeIaasVMRestoreRequest ObjectTypeBasicRestoreRequest = "IaasVMRestoreRequest" + // ObjectTypeIaasVMRestoreWithRehydrationRequest ... + ObjectTypeIaasVMRestoreWithRehydrationRequest ObjectTypeBasicRestoreRequest = "IaasVMRestoreWithRehydrationRequest" + // ObjectTypeRestoreRequest ... + ObjectTypeRestoreRequest ObjectTypeBasicRestoreRequest = "RestoreRequest" +) + +// PossibleObjectTypeBasicRestoreRequestValues returns an array of possible values for the ObjectTypeBasicRestoreRequest const type. +func PossibleObjectTypeBasicRestoreRequestValues() []ObjectTypeBasicRestoreRequest { + return []ObjectTypeBasicRestoreRequest{ObjectTypeAzureFileShareRestoreRequest, ObjectTypeAzureWorkloadPointInTimeRestoreRequest, ObjectTypeAzureWorkloadRestoreRequest, ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest, ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, ObjectTypeAzureWorkloadSAPHanaRestoreRequest, ObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest, ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest, ObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, ObjectTypeAzureWorkloadSQLRestoreRequest, ObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest, ObjectTypeIaasVMRestoreRequest, ObjectTypeIaasVMRestoreWithRehydrationRequest, ObjectTypeRestoreRequest} +} + +// ObjectTypeBasicValidateOperationRequest enumerates the values for object type basic validate operation +// request. +type ObjectTypeBasicValidateOperationRequest string + +const ( + // ObjectTypeValidateIaasVMRestoreOperationRequest ... + ObjectTypeValidateIaasVMRestoreOperationRequest ObjectTypeBasicValidateOperationRequest = "ValidateIaasVMRestoreOperationRequest" + // ObjectTypeValidateOperationRequest ... + ObjectTypeValidateOperationRequest ObjectTypeBasicValidateOperationRequest = "ValidateOperationRequest" + // ObjectTypeValidateRestoreOperationRequest ... + ObjectTypeValidateRestoreOperationRequest ObjectTypeBasicValidateOperationRequest = "ValidateRestoreOperationRequest" +) + +// PossibleObjectTypeBasicValidateOperationRequestValues returns an array of possible values for the ObjectTypeBasicValidateOperationRequest const type. +func PossibleObjectTypeBasicValidateOperationRequestValues() []ObjectTypeBasicValidateOperationRequest { + return []ObjectTypeBasicValidateOperationRequest{ObjectTypeValidateIaasVMRestoreOperationRequest, ObjectTypeValidateOperationRequest, ObjectTypeValidateRestoreOperationRequest} +} + +// ObjectTypeBasicVaultStorageConfigOperationResultResponse enumerates the values for object type basic vault +// storage config operation result response. +type ObjectTypeBasicVaultStorageConfigOperationResultResponse string + +const ( + // ObjectTypePrepareDataMoveResponse ... + ObjectTypePrepareDataMoveResponse ObjectTypeBasicVaultStorageConfigOperationResultResponse = "PrepareDataMoveResponse" + // ObjectTypeVaultStorageConfigOperationResultResponse ... + ObjectTypeVaultStorageConfigOperationResultResponse ObjectTypeBasicVaultStorageConfigOperationResultResponse = "VaultStorageConfigOperationResultResponse" +) + +// PossibleObjectTypeBasicVaultStorageConfigOperationResultResponseValues returns an array of possible values for the ObjectTypeBasicVaultStorageConfigOperationResultResponse const type. +func PossibleObjectTypeBasicVaultStorageConfigOperationResultResponseValues() []ObjectTypeBasicVaultStorageConfigOperationResultResponse { + return []ObjectTypeBasicVaultStorageConfigOperationResultResponse{ObjectTypePrepareDataMoveResponse, ObjectTypeVaultStorageConfigOperationResultResponse} +} + +// OperationStatusValues enumerates the values for operation status values. +type OperationStatusValues string + +const ( + // OperationStatusValuesCanceled ... + OperationStatusValuesCanceled OperationStatusValues = "Canceled" + // OperationStatusValuesFailed ... + OperationStatusValuesFailed OperationStatusValues = "Failed" + // OperationStatusValuesInProgress ... + OperationStatusValuesInProgress OperationStatusValues = "InProgress" + // OperationStatusValuesInvalid ... + OperationStatusValuesInvalid OperationStatusValues = "Invalid" + // OperationStatusValuesSucceeded ... + OperationStatusValuesSucceeded OperationStatusValues = "Succeeded" +) + +// PossibleOperationStatusValuesValues returns an array of possible values for the OperationStatusValues const type. +func PossibleOperationStatusValuesValues() []OperationStatusValues { + return []OperationStatusValues{OperationStatusValuesCanceled, OperationStatusValuesFailed, OperationStatusValuesInProgress, OperationStatusValuesInvalid, OperationStatusValuesSucceeded} +} + +// OperationType enumerates the values for operation type. +type OperationType string + +const ( + // OperationTypeInvalid ... + OperationTypeInvalid OperationType = "Invalid" + // OperationTypeRegister ... + OperationTypeRegister OperationType = "Register" + // OperationTypeReregister ... + OperationTypeReregister OperationType = "Reregister" +) + +// PossibleOperationTypeValues returns an array of possible values for the OperationType const type. +func PossibleOperationTypeValues() []OperationType { + return []OperationType{OperationTypeInvalid, OperationTypeRegister, OperationTypeReregister} +} + +// OverwriteOptions enumerates the values for overwrite options. +type OverwriteOptions string + +const ( + // OverwriteOptionsFailOnConflict ... + OverwriteOptionsFailOnConflict OverwriteOptions = "FailOnConflict" + // OverwriteOptionsInvalid ... + OverwriteOptionsInvalid OverwriteOptions = "Invalid" + // OverwriteOptionsOverwrite ... + OverwriteOptionsOverwrite OverwriteOptions = "Overwrite" +) + +// PossibleOverwriteOptionsValues returns an array of possible values for the OverwriteOptions const type. +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" + // PolicyTypeIncremental ... + PolicyTypeIncremental PolicyType = "Incremental" + // 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, PolicyTypeIncremental, PolicyTypeInvalid, PolicyTypeLog} +} + +// PrivateEndpointConnectionStatus enumerates the values for private endpoint connection status. +type PrivateEndpointConnectionStatus string + +const ( + // Approved ... + Approved PrivateEndpointConnectionStatus = "Approved" + // Disconnected ... + Disconnected PrivateEndpointConnectionStatus = "Disconnected" + // Pending ... + Pending PrivateEndpointConnectionStatus = "Pending" + // Rejected ... + Rejected PrivateEndpointConnectionStatus = "Rejected" +) + +// PossiblePrivateEndpointConnectionStatusValues returns an array of possible values for the PrivateEndpointConnectionStatus const type. +func PossiblePrivateEndpointConnectionStatusValues() []PrivateEndpointConnectionStatus { + return []PrivateEndpointConnectionStatus{Approved, Disconnected, Pending, Rejected} +} + +// ProtectableContainerType enumerates the values for protectable container type. +type ProtectableContainerType string + +const ( + // ProtectableContainerTypeProtectableContainer ... + ProtectableContainerTypeProtectableContainer ProtectableContainerType = "ProtectableContainer" + // ProtectableContainerTypeStorageContainer ... + ProtectableContainerTypeStorageContainer ProtectableContainerType = "StorageContainer" + // ProtectableContainerTypeVMAppContainer ... + ProtectableContainerTypeVMAppContainer ProtectableContainerType = "VMAppContainer" +) + +// PossibleProtectableContainerTypeValues returns an array of possible values for the ProtectableContainerType const type. +func PossibleProtectableContainerTypeValues() []ProtectableContainerType { + return []ProtectableContainerType{ProtectableContainerTypeProtectableContainer, ProtectableContainerTypeStorageContainer, ProtectableContainerTypeVMAppContainer} +} + +// ProtectableItemType enumerates the values for protectable item type. +type ProtectableItemType string + +const ( + // ProtectableItemTypeAzureFileShare ... + ProtectableItemTypeAzureFileShare ProtectableItemType = "AzureFileShare" + // ProtectableItemTypeAzureVMWorkloadProtectableItem ... + ProtectableItemTypeAzureVMWorkloadProtectableItem ProtectableItemType = "AzureVmWorkloadProtectableItem" + // ProtectableItemTypeIaaSVMProtectableItem ... + ProtectableItemTypeIaaSVMProtectableItem ProtectableItemType = "IaaSVMProtectableItem" + // ProtectableItemTypeMicrosoftClassicComputevirtualMachines ... + ProtectableItemTypeMicrosoftClassicComputevirtualMachines ProtectableItemType = "Microsoft.ClassicCompute/virtualMachines" + // ProtectableItemTypeMicrosoftComputevirtualMachines ... + ProtectableItemTypeMicrosoftComputevirtualMachines ProtectableItemType = "Microsoft.Compute/virtualMachines" + // ProtectableItemTypeSAPAseSystem ... + ProtectableItemTypeSAPAseSystem ProtectableItemType = "SAPAseSystem" + // ProtectableItemTypeSAPHanaDatabase ... + ProtectableItemTypeSAPHanaDatabase ProtectableItemType = "SAPHanaDatabase" + // ProtectableItemTypeSAPHanaSystem ... + ProtectableItemTypeSAPHanaSystem ProtectableItemType = "SAPHanaSystem" + // ProtectableItemTypeSQLAvailabilityGroupContainer ... + ProtectableItemTypeSQLAvailabilityGroupContainer ProtectableItemType = "SQLAvailabilityGroupContainer" + // ProtectableItemTypeSQLDataBase ... + ProtectableItemTypeSQLDataBase ProtectableItemType = "SQLDataBase" + // ProtectableItemTypeSQLInstance ... + ProtectableItemTypeSQLInstance ProtectableItemType = "SQLInstance" + // ProtectableItemTypeWorkloadProtectableItem ... + ProtectableItemTypeWorkloadProtectableItem ProtectableItemType = "WorkloadProtectableItem" +) + +// PossibleProtectableItemTypeValues returns an array of possible values for the ProtectableItemType const type. +func PossibleProtectableItemTypeValues() []ProtectableItemType { + return []ProtectableItemType{ProtectableItemTypeAzureFileShare, ProtectableItemTypeAzureVMWorkloadProtectableItem, ProtectableItemTypeIaaSVMProtectableItem, ProtectableItemTypeMicrosoftClassicComputevirtualMachines, ProtectableItemTypeMicrosoftComputevirtualMachines, ProtectableItemTypeSAPAseSystem, ProtectableItemTypeSAPHanaDatabase, ProtectableItemTypeSAPHanaSystem, ProtectableItemTypeSQLAvailabilityGroupContainer, ProtectableItemTypeSQLDataBase, ProtectableItemTypeSQLInstance, ProtectableItemTypeWorkloadProtectableItem} +} + +// ProtectedItemHealthStatus enumerates the values for protected item health status. +type ProtectedItemHealthStatus string + +const ( + // ProtectedItemHealthStatusHealthy ... + ProtectedItemHealthStatusHealthy ProtectedItemHealthStatus = "Healthy" + // ProtectedItemHealthStatusInvalid ... + ProtectedItemHealthStatusInvalid ProtectedItemHealthStatus = "Invalid" + // ProtectedItemHealthStatusIRPending ... + ProtectedItemHealthStatusIRPending ProtectedItemHealthStatus = "IRPending" + // ProtectedItemHealthStatusNotReachable ... + ProtectedItemHealthStatusNotReachable ProtectedItemHealthStatus = "NotReachable" + // ProtectedItemHealthStatusUnhealthy ... + ProtectedItemHealthStatusUnhealthy ProtectedItemHealthStatus = "Unhealthy" +) + +// PossibleProtectedItemHealthStatusValues returns an array of possible values for the ProtectedItemHealthStatus const type. +func PossibleProtectedItemHealthStatusValues() []ProtectedItemHealthStatus { + return []ProtectedItemHealthStatus{ProtectedItemHealthStatusHealthy, ProtectedItemHealthStatusInvalid, ProtectedItemHealthStatusIRPending, ProtectedItemHealthStatusNotReachable, ProtectedItemHealthStatusUnhealthy} +} + +// ProtectedItemState enumerates the values for protected item state. +type ProtectedItemState string + +const ( + // ProtectedItemStateInvalid ... + ProtectedItemStateInvalid ProtectedItemState = "Invalid" + // ProtectedItemStateIRPending ... + ProtectedItemStateIRPending ProtectedItemState = "IRPending" + // ProtectedItemStateProtected ... + ProtectedItemStateProtected ProtectedItemState = "Protected" + // ProtectedItemStateProtectionError ... + ProtectedItemStateProtectionError ProtectedItemState = "ProtectionError" + // ProtectedItemStateProtectionPaused ... + ProtectedItemStateProtectionPaused ProtectedItemState = "ProtectionPaused" + // ProtectedItemStateProtectionStopped ... + ProtectedItemStateProtectionStopped ProtectedItemState = "ProtectionStopped" +) + +// PossibleProtectedItemStateValues returns an array of possible values for the ProtectedItemState const type. +func PossibleProtectedItemStateValues() []ProtectedItemState { + return []ProtectedItemState{ProtectedItemStateInvalid, ProtectedItemStateIRPending, ProtectedItemStateProtected, ProtectedItemStateProtectionError, ProtectedItemStateProtectionPaused, ProtectedItemStateProtectionStopped} +} + +// ProtectedItemType enumerates the values for protected item type. +type ProtectedItemType string + +const ( + // ProtectedItemTypeAzureFileShareProtectedItem ... + ProtectedItemTypeAzureFileShareProtectedItem ProtectedItemType = "AzureFileShareProtectedItem" + // ProtectedItemTypeAzureIaaSVMProtectedItem ... + ProtectedItemTypeAzureIaaSVMProtectedItem ProtectedItemType = "AzureIaaSVMProtectedItem" + // ProtectedItemTypeAzureVMWorkloadProtectedItem ... + ProtectedItemTypeAzureVMWorkloadProtectedItem ProtectedItemType = "AzureVmWorkloadProtectedItem" + // ProtectedItemTypeAzureVMWorkloadSAPAseDatabase ... + ProtectedItemTypeAzureVMWorkloadSAPAseDatabase ProtectedItemType = "AzureVmWorkloadSAPAseDatabase" + // ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase ... + ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase ProtectedItemType = "AzureVmWorkloadSAPHanaDatabase" + // ProtectedItemTypeAzureVMWorkloadSQLDatabase ... + ProtectedItemTypeAzureVMWorkloadSQLDatabase ProtectedItemType = "AzureVmWorkloadSQLDatabase" + // ProtectedItemTypeDPMProtectedItem ... + ProtectedItemTypeDPMProtectedItem ProtectedItemType = "DPMProtectedItem" + // ProtectedItemTypeGenericProtectedItem ... + ProtectedItemTypeGenericProtectedItem ProtectedItemType = "GenericProtectedItem" + // ProtectedItemTypeMabFileFolderProtectedItem ... + ProtectedItemTypeMabFileFolderProtectedItem ProtectedItemType = "MabFileFolderProtectedItem" + // ProtectedItemTypeMicrosoftClassicComputevirtualMachines ... + ProtectedItemTypeMicrosoftClassicComputevirtualMachines ProtectedItemType = "Microsoft.ClassicCompute/virtualMachines" + // ProtectedItemTypeMicrosoftComputevirtualMachines ... + ProtectedItemTypeMicrosoftComputevirtualMachines ProtectedItemType = "Microsoft.Compute/virtualMachines" + // ProtectedItemTypeMicrosoftSqlserversdatabases ... + ProtectedItemTypeMicrosoftSqlserversdatabases ProtectedItemType = "Microsoft.Sql/servers/databases" + // ProtectedItemTypeProtectedItem ... + ProtectedItemTypeProtectedItem ProtectedItemType = "ProtectedItem" +) + +// PossibleProtectedItemTypeValues returns an array of possible values for the ProtectedItemType const type. +func PossibleProtectedItemTypeValues() []ProtectedItemType { + return []ProtectedItemType{ProtectedItemTypeAzureFileShareProtectedItem, ProtectedItemTypeAzureIaaSVMProtectedItem, ProtectedItemTypeAzureVMWorkloadProtectedItem, ProtectedItemTypeAzureVMWorkloadSAPAseDatabase, ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase, ProtectedItemTypeAzureVMWorkloadSQLDatabase, ProtectedItemTypeDPMProtectedItem, ProtectedItemTypeGenericProtectedItem, ProtectedItemTypeMabFileFolderProtectedItem, ProtectedItemTypeMicrosoftClassicComputevirtualMachines, ProtectedItemTypeMicrosoftComputevirtualMachines, ProtectedItemTypeMicrosoftSqlserversdatabases, ProtectedItemTypeProtectedItem} +} + +// ProtectionIntentItemType enumerates the values for protection intent item type. +type ProtectionIntentItemType string + +const ( + // ProtectionIntentItemTypeAzureResourceItem ... + ProtectionIntentItemTypeAzureResourceItem ProtectionIntentItemType = "AzureResourceItem" + // ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent ... + ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent ProtectionIntentItemType = "AzureWorkloadAutoProtectionIntent" + // ProtectionIntentItemTypeAzureWorkloadContainerAutoProtectionIntent ... + ProtectionIntentItemTypeAzureWorkloadContainerAutoProtectionIntent ProtectionIntentItemType = "AzureWorkloadContainerAutoProtectionIntent" + // ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent ... + ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent ProtectionIntentItemType = "AzureWorkloadSQLAutoProtectionIntent" + // ProtectionIntentItemTypeProtectionIntent ... + ProtectionIntentItemTypeProtectionIntent ProtectionIntentItemType = "ProtectionIntent" + // ProtectionIntentItemTypeRecoveryServiceVaultItem ... + ProtectionIntentItemTypeRecoveryServiceVaultItem ProtectionIntentItemType = "RecoveryServiceVaultItem" +) + +// PossibleProtectionIntentItemTypeValues returns an array of possible values for the ProtectionIntentItemType const type. +func PossibleProtectionIntentItemTypeValues() []ProtectionIntentItemType { + return []ProtectionIntentItemType{ProtectionIntentItemTypeAzureResourceItem, ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent, ProtectionIntentItemTypeAzureWorkloadContainerAutoProtectionIntent, ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent, ProtectionIntentItemTypeProtectionIntent, ProtectionIntentItemTypeRecoveryServiceVaultItem} +} + +// ProtectionState enumerates the values for protection state. +type ProtectionState string + +const ( + // ProtectionStateInvalid ... + ProtectionStateInvalid ProtectionState = "Invalid" + // ProtectionStateIRPending ... + ProtectionStateIRPending ProtectionState = "IRPending" + // ProtectionStateProtected ... + ProtectionStateProtected ProtectionState = "Protected" + // ProtectionStateProtectionError ... + ProtectionStateProtectionError ProtectionState = "ProtectionError" + // ProtectionStateProtectionPaused ... + ProtectionStateProtectionPaused ProtectionState = "ProtectionPaused" + // ProtectionStateProtectionStopped ... + ProtectionStateProtectionStopped ProtectionState = "ProtectionStopped" +) + +// PossibleProtectionStateValues returns an array of possible values for the ProtectionState const type. +func PossibleProtectionStateValues() []ProtectionState { + return []ProtectionState{ProtectionStateInvalid, ProtectionStateIRPending, ProtectionStateProtected, ProtectionStateProtectionError, ProtectionStateProtectionPaused, ProtectionStateProtectionStopped} +} + +// ProtectionStatus enumerates the values for protection status. +type ProtectionStatus string + +const ( + // ProtectionStatusInvalid ... + ProtectionStatusInvalid ProtectionStatus = "Invalid" + // ProtectionStatusNotProtected ... + ProtectionStatusNotProtected ProtectionStatus = "NotProtected" + // ProtectionStatusProtected ... + ProtectionStatusProtected ProtectionStatus = "Protected" + // ProtectionStatusProtecting ... + ProtectionStatusProtecting ProtectionStatus = "Protecting" + // ProtectionStatusProtectionFailed ... + ProtectionStatusProtectionFailed ProtectionStatus = "ProtectionFailed" +) + +// PossibleProtectionStatusValues returns an array of possible values for the ProtectionStatus const type. +func PossibleProtectionStatusValues() []ProtectionStatus { + return []ProtectionStatus{ProtectionStatusInvalid, ProtectionStatusNotProtected, ProtectionStatusProtected, ProtectionStatusProtecting, ProtectionStatusProtectionFailed} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // ProvisioningStateDeleting ... + ProvisioningStateDeleting ProvisioningState = "Deleting" + // ProvisioningStateFailed ... + ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStatePending ... + ProvisioningStatePending ProvisioningState = "Pending" + // ProvisioningStateSucceeded ... + ProvisioningStateSucceeded ProvisioningState = "Succeeded" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStatePending, ProvisioningStateSucceeded} +} + +// RecoveryMode enumerates the values for recovery mode. +type RecoveryMode string + +const ( + // RecoveryModeFileRecovery ... + RecoveryModeFileRecovery RecoveryMode = "FileRecovery" + // RecoveryModeInvalid ... + RecoveryModeInvalid RecoveryMode = "Invalid" + // RecoveryModeWorkloadRecovery ... + RecoveryModeWorkloadRecovery RecoveryMode = "WorkloadRecovery" +) + +// PossibleRecoveryModeValues returns an array of possible values for the RecoveryMode const type. +func PossibleRecoveryModeValues() []RecoveryMode { + return []RecoveryMode{RecoveryModeFileRecovery, RecoveryModeInvalid, RecoveryModeWorkloadRecovery} +} + +// RecoveryPointTierStatus enumerates the values for recovery point tier status. +type RecoveryPointTierStatus string + +const ( + // RecoveryPointTierStatusDeleted ... + RecoveryPointTierStatusDeleted RecoveryPointTierStatus = "Deleted" + // RecoveryPointTierStatusDisabled ... + RecoveryPointTierStatusDisabled RecoveryPointTierStatus = "Disabled" + // RecoveryPointTierStatusInvalid ... + RecoveryPointTierStatusInvalid RecoveryPointTierStatus = "Invalid" + // RecoveryPointTierStatusRehydrated ... + RecoveryPointTierStatusRehydrated RecoveryPointTierStatus = "Rehydrated" + // RecoveryPointTierStatusValid ... + RecoveryPointTierStatusValid RecoveryPointTierStatus = "Valid" +) + +// PossibleRecoveryPointTierStatusValues returns an array of possible values for the RecoveryPointTierStatus const type. +func PossibleRecoveryPointTierStatusValues() []RecoveryPointTierStatus { + return []RecoveryPointTierStatus{RecoveryPointTierStatusDeleted, RecoveryPointTierStatusDisabled, RecoveryPointTierStatusInvalid, RecoveryPointTierStatusRehydrated, RecoveryPointTierStatusValid} +} + +// RecoveryPointTierType enumerates the values for recovery point tier type. +type RecoveryPointTierType string + +const ( + // RecoveryPointTierTypeArchivedRP ... + RecoveryPointTierTypeArchivedRP RecoveryPointTierType = "ArchivedRP" + // RecoveryPointTierTypeHardenedRP ... + RecoveryPointTierTypeHardenedRP RecoveryPointTierType = "HardenedRP" + // RecoveryPointTierTypeInstantRP ... + RecoveryPointTierTypeInstantRP RecoveryPointTierType = "InstantRP" + // RecoveryPointTierTypeInvalid ... + RecoveryPointTierTypeInvalid RecoveryPointTierType = "Invalid" +) + +// PossibleRecoveryPointTierTypeValues returns an array of possible values for the RecoveryPointTierType const type. +func PossibleRecoveryPointTierTypeValues() []RecoveryPointTierType { + return []RecoveryPointTierType{RecoveryPointTierTypeArchivedRP, RecoveryPointTierTypeHardenedRP, RecoveryPointTierTypeInstantRP, RecoveryPointTierTypeInvalid} +} + +// RecoveryType enumerates the values for recovery type. +type RecoveryType string + +const ( + // RecoveryTypeAlternateLocation ... + RecoveryTypeAlternateLocation RecoveryType = "AlternateLocation" + // RecoveryTypeInvalid ... + RecoveryTypeInvalid RecoveryType = "Invalid" + // RecoveryTypeOffline ... + RecoveryTypeOffline RecoveryType = "Offline" + // RecoveryTypeOriginalLocation ... + RecoveryTypeOriginalLocation RecoveryType = "OriginalLocation" + // RecoveryTypeRestoreDisks ... + RecoveryTypeRestoreDisks RecoveryType = "RestoreDisks" +) + +// PossibleRecoveryTypeValues returns an array of possible values for the RecoveryType const type. +func PossibleRecoveryTypeValues() []RecoveryType { + return []RecoveryType{RecoveryTypeAlternateLocation, RecoveryTypeInvalid, RecoveryTypeOffline, RecoveryTypeOriginalLocation, RecoveryTypeRestoreDisks} +} + +// RehydrationPriority enumerates the values for rehydration priority. +type RehydrationPriority string + +const ( + // High ... + High RehydrationPriority = "High" + // Standard ... + Standard RehydrationPriority = "Standard" +) + +// PossibleRehydrationPriorityValues returns an array of possible values for the RehydrationPriority const type. +func PossibleRehydrationPriorityValues() []RehydrationPriority { + return []RehydrationPriority{High, Standard} +} + +// ResourceHealthStatus enumerates the values for resource health status. +type ResourceHealthStatus string + +const ( + // ResourceHealthStatusHealthy ... + ResourceHealthStatusHealthy ResourceHealthStatus = "Healthy" + // ResourceHealthStatusInvalid ... + ResourceHealthStatusInvalid ResourceHealthStatus = "Invalid" + // ResourceHealthStatusPersistentDegraded ... + ResourceHealthStatusPersistentDegraded ResourceHealthStatus = "PersistentDegraded" + // ResourceHealthStatusPersistentUnhealthy ... + ResourceHealthStatusPersistentUnhealthy ResourceHealthStatus = "PersistentUnhealthy" + // ResourceHealthStatusTransientDegraded ... + ResourceHealthStatusTransientDegraded ResourceHealthStatus = "TransientDegraded" + // ResourceHealthStatusTransientUnhealthy ... + ResourceHealthStatusTransientUnhealthy ResourceHealthStatus = "TransientUnhealthy" +) + +// PossibleResourceHealthStatusValues returns an array of possible values for the ResourceHealthStatus const type. +func PossibleResourceHealthStatusValues() []ResourceHealthStatus { + return []ResourceHealthStatus{ResourceHealthStatusHealthy, ResourceHealthStatusInvalid, ResourceHealthStatusPersistentDegraded, ResourceHealthStatusPersistentUnhealthy, ResourceHealthStatusTransientDegraded, ResourceHealthStatusTransientUnhealthy} +} + +// RestorePointQueryType enumerates the values for restore point query type. +type RestorePointQueryType string + +const ( + // RestorePointQueryTypeAll ... + RestorePointQueryTypeAll RestorePointQueryType = "All" + // RestorePointQueryTypeDifferential ... + RestorePointQueryTypeDifferential RestorePointQueryType = "Differential" + // RestorePointQueryTypeFull ... + RestorePointQueryTypeFull RestorePointQueryType = "Full" + // RestorePointQueryTypeFullAndDifferential ... + RestorePointQueryTypeFullAndDifferential RestorePointQueryType = "FullAndDifferential" + // RestorePointQueryTypeIncremental ... + RestorePointQueryTypeIncremental RestorePointQueryType = "Incremental" + // RestorePointQueryTypeInvalid ... + RestorePointQueryTypeInvalid RestorePointQueryType = "Invalid" + // RestorePointQueryTypeLog ... + RestorePointQueryTypeLog RestorePointQueryType = "Log" +) + +// PossibleRestorePointQueryTypeValues returns an array of possible values for the RestorePointQueryType const type. +func PossibleRestorePointQueryTypeValues() []RestorePointQueryType { + return []RestorePointQueryType{RestorePointQueryTypeAll, RestorePointQueryTypeDifferential, RestorePointQueryTypeFull, RestorePointQueryTypeFullAndDifferential, RestorePointQueryTypeIncremental, RestorePointQueryTypeInvalid, RestorePointQueryTypeLog} +} + +// RestorePointType enumerates the values for restore point type. +type RestorePointType string + +const ( + // RestorePointTypeDifferential ... + RestorePointTypeDifferential RestorePointType = "Differential" + // RestorePointTypeFull ... + RestorePointTypeFull RestorePointType = "Full" + // RestorePointTypeIncremental ... + RestorePointTypeIncremental RestorePointType = "Incremental" + // RestorePointTypeInvalid ... + RestorePointTypeInvalid RestorePointType = "Invalid" + // RestorePointTypeLog ... + RestorePointTypeLog RestorePointType = "Log" +) + +// PossibleRestorePointTypeValues returns an array of possible values for the RestorePointType const type. +func PossibleRestorePointTypeValues() []RestorePointType { + return []RestorePointType{RestorePointTypeDifferential, RestorePointTypeFull, RestorePointTypeIncremental, RestorePointTypeInvalid, RestorePointTypeLog} +} + +// RestoreRequestType enumerates the values for restore request type. +type RestoreRequestType string + +const ( + // RestoreRequestTypeFullShareRestore ... + RestoreRequestTypeFullShareRestore RestoreRequestType = "FullShareRestore" + // RestoreRequestTypeInvalid ... + RestoreRequestTypeInvalid RestoreRequestType = "Invalid" + // RestoreRequestTypeItemLevelRestore ... + RestoreRequestTypeItemLevelRestore RestoreRequestType = "ItemLevelRestore" +) + +// PossibleRestoreRequestTypeValues returns an array of possible values for the RestoreRequestType const type. +func PossibleRestoreRequestTypeValues() []RestoreRequestType { + return []RestoreRequestType{RestoreRequestTypeFullShareRestore, RestoreRequestTypeInvalid, RestoreRequestTypeItemLevelRestore} +} + +// RetentionDurationType enumerates the values for retention duration type. +type RetentionDurationType string + +const ( + // RetentionDurationTypeDays ... + RetentionDurationTypeDays RetentionDurationType = "Days" + // RetentionDurationTypeInvalid ... + RetentionDurationTypeInvalid RetentionDurationType = "Invalid" + // RetentionDurationTypeMonths ... + RetentionDurationTypeMonths RetentionDurationType = "Months" + // RetentionDurationTypeWeeks ... + RetentionDurationTypeWeeks RetentionDurationType = "Weeks" + // RetentionDurationTypeYears ... + RetentionDurationTypeYears RetentionDurationType = "Years" +) + +// PossibleRetentionDurationTypeValues returns an array of possible values for the RetentionDurationType const type. +func PossibleRetentionDurationTypeValues() []RetentionDurationType { + return []RetentionDurationType{RetentionDurationTypeDays, RetentionDurationTypeInvalid, RetentionDurationTypeMonths, RetentionDurationTypeWeeks, RetentionDurationTypeYears} +} + +// RetentionPolicyType enumerates the values for retention policy type. +type RetentionPolicyType string + +const ( + // RetentionPolicyTypeLongTermRetentionPolicy ... + RetentionPolicyTypeLongTermRetentionPolicy RetentionPolicyType = "LongTermRetentionPolicy" + // RetentionPolicyTypeRetentionPolicy ... + RetentionPolicyTypeRetentionPolicy RetentionPolicyType = "RetentionPolicy" + // RetentionPolicyTypeSimpleRetentionPolicy ... + RetentionPolicyTypeSimpleRetentionPolicy RetentionPolicyType = "SimpleRetentionPolicy" +) + +// PossibleRetentionPolicyTypeValues returns an array of possible values for the RetentionPolicyType const type. +func PossibleRetentionPolicyTypeValues() []RetentionPolicyType { + return []RetentionPolicyType{RetentionPolicyTypeLongTermRetentionPolicy, RetentionPolicyTypeRetentionPolicy, RetentionPolicyTypeSimpleRetentionPolicy} +} + +// RetentionScheduleFormat enumerates the values for retention schedule format. +type RetentionScheduleFormat string + +const ( + // RetentionScheduleFormatDaily ... + RetentionScheduleFormatDaily RetentionScheduleFormat = "Daily" + // RetentionScheduleFormatInvalid ... + RetentionScheduleFormatInvalid RetentionScheduleFormat = "Invalid" + // RetentionScheduleFormatWeekly ... + RetentionScheduleFormatWeekly RetentionScheduleFormat = "Weekly" +) + +// PossibleRetentionScheduleFormatValues returns an array of possible values for the RetentionScheduleFormat const type. +func PossibleRetentionScheduleFormatValues() []RetentionScheduleFormat { + return []RetentionScheduleFormat{RetentionScheduleFormatDaily, RetentionScheduleFormatInvalid, RetentionScheduleFormatWeekly} +} + +// SchedulePolicyType enumerates the values for schedule policy type. +type SchedulePolicyType string + +const ( + // SchedulePolicyTypeLogSchedulePolicy ... + SchedulePolicyTypeLogSchedulePolicy SchedulePolicyType = "LogSchedulePolicy" + // SchedulePolicyTypeLongTermSchedulePolicy ... + SchedulePolicyTypeLongTermSchedulePolicy SchedulePolicyType = "LongTermSchedulePolicy" + // SchedulePolicyTypeSchedulePolicy ... + SchedulePolicyTypeSchedulePolicy SchedulePolicyType = "SchedulePolicy" + // SchedulePolicyTypeSimpleSchedulePolicy ... + SchedulePolicyTypeSimpleSchedulePolicy SchedulePolicyType = "SimpleSchedulePolicy" + // SchedulePolicyTypeSimpleSchedulePolicyV2 ... + SchedulePolicyTypeSimpleSchedulePolicyV2 SchedulePolicyType = "SimpleSchedulePolicyV2" +) + +// PossibleSchedulePolicyTypeValues returns an array of possible values for the SchedulePolicyType const type. +func PossibleSchedulePolicyTypeValues() []SchedulePolicyType { + return []SchedulePolicyType{SchedulePolicyTypeLogSchedulePolicy, SchedulePolicyTypeLongTermSchedulePolicy, SchedulePolicyTypeSchedulePolicy, SchedulePolicyTypeSimpleSchedulePolicy, SchedulePolicyTypeSimpleSchedulePolicyV2} +} + +// ScheduleRunType enumerates the values for schedule run type. +type ScheduleRunType string + +const ( + // ScheduleRunTypeDaily ... + ScheduleRunTypeDaily ScheduleRunType = "Daily" + // ScheduleRunTypeHourly ... + ScheduleRunTypeHourly ScheduleRunType = "Hourly" + // ScheduleRunTypeInvalid ... + ScheduleRunTypeInvalid ScheduleRunType = "Invalid" + // ScheduleRunTypeWeekly ... + ScheduleRunTypeWeekly ScheduleRunType = "Weekly" +) + +// PossibleScheduleRunTypeValues returns an array of possible values for the ScheduleRunType const type. +func PossibleScheduleRunTypeValues() []ScheduleRunType { + return []ScheduleRunType{ScheduleRunTypeDaily, ScheduleRunTypeHourly, ScheduleRunTypeInvalid, ScheduleRunTypeWeekly} +} + +// SoftDeleteFeatureState enumerates the values for soft delete feature state. +type SoftDeleteFeatureState string + +const ( + // SoftDeleteFeatureStateDisabled ... + SoftDeleteFeatureStateDisabled SoftDeleteFeatureState = "Disabled" + // SoftDeleteFeatureStateEnabled ... + SoftDeleteFeatureStateEnabled SoftDeleteFeatureState = "Enabled" + // SoftDeleteFeatureStateInvalid ... + SoftDeleteFeatureStateInvalid SoftDeleteFeatureState = "Invalid" +) + +// PossibleSoftDeleteFeatureStateValues returns an array of possible values for the SoftDeleteFeatureState const type. +func PossibleSoftDeleteFeatureStateValues() []SoftDeleteFeatureState { + return []SoftDeleteFeatureState{SoftDeleteFeatureStateDisabled, SoftDeleteFeatureStateEnabled, SoftDeleteFeatureStateInvalid} +} + +// SQLDataDirectoryType enumerates the values for sql data directory type. +type SQLDataDirectoryType string + +const ( + // SQLDataDirectoryTypeData ... + SQLDataDirectoryTypeData SQLDataDirectoryType = "Data" + // SQLDataDirectoryTypeInvalid ... + SQLDataDirectoryTypeInvalid SQLDataDirectoryType = "Invalid" + // SQLDataDirectoryTypeLog ... + SQLDataDirectoryTypeLog SQLDataDirectoryType = "Log" +) + +// PossibleSQLDataDirectoryTypeValues returns an array of possible values for the SQLDataDirectoryType const type. +func PossibleSQLDataDirectoryTypeValues() []SQLDataDirectoryType { + return []SQLDataDirectoryType{SQLDataDirectoryTypeData, SQLDataDirectoryTypeInvalid, SQLDataDirectoryTypeLog} +} + +// StorageType enumerates the values for storage type. +type StorageType string + +const ( + // StorageTypeGeoRedundant ... + StorageTypeGeoRedundant StorageType = "GeoRedundant" + // StorageTypeInvalid ... + StorageTypeInvalid StorageType = "Invalid" + // StorageTypeLocallyRedundant ... + StorageTypeLocallyRedundant StorageType = "LocallyRedundant" + // StorageTypeReadAccessGeoZoneRedundant ... + StorageTypeReadAccessGeoZoneRedundant StorageType = "ReadAccessGeoZoneRedundant" + // StorageTypeZoneRedundant ... + StorageTypeZoneRedundant StorageType = "ZoneRedundant" +) + +// PossibleStorageTypeValues returns an array of possible values for the StorageType const type. +func PossibleStorageTypeValues() []StorageType { + return []StorageType{StorageTypeGeoRedundant, StorageTypeInvalid, StorageTypeLocallyRedundant, StorageTypeReadAccessGeoZoneRedundant, StorageTypeZoneRedundant} +} + +// StorageTypeState enumerates the values for storage type state. +type StorageTypeState string + +const ( + // StorageTypeStateInvalid ... + StorageTypeStateInvalid StorageTypeState = "Invalid" + // StorageTypeStateLocked ... + StorageTypeStateLocked StorageTypeState = "Locked" + // StorageTypeStateUnlocked ... + StorageTypeStateUnlocked StorageTypeState = "Unlocked" +) + +// PossibleStorageTypeStateValues returns an array of possible values for the StorageTypeState const type. +func PossibleStorageTypeStateValues() []StorageTypeState { + return []StorageTypeState{StorageTypeStateInvalid, StorageTypeStateLocked, StorageTypeStateUnlocked} +} + +// SupportStatus enumerates the values for support status. +type SupportStatus string + +const ( + // SupportStatusDefaultOFF ... + SupportStatusDefaultOFF SupportStatus = "DefaultOFF" + // SupportStatusDefaultON ... + SupportStatusDefaultON SupportStatus = "DefaultON" + // SupportStatusInvalid ... + SupportStatusInvalid SupportStatus = "Invalid" + // SupportStatusNotSupported ... + SupportStatusNotSupported SupportStatus = "NotSupported" + // SupportStatusSupported ... + SupportStatusSupported SupportStatus = "Supported" +) + +// PossibleSupportStatusValues returns an array of possible values for the SupportStatus const type. +func PossibleSupportStatusValues() []SupportStatus { + return []SupportStatus{SupportStatusDefaultOFF, SupportStatusDefaultON, SupportStatusInvalid, SupportStatusNotSupported, SupportStatusSupported} +} + +// Type enumerates the values for type. +type Type string + +const ( + // TypeBackupProtectedItemCountSummary ... + TypeBackupProtectedItemCountSummary Type = "BackupProtectedItemCountSummary" + // TypeBackupProtectionContainerCountSummary ... + TypeBackupProtectionContainerCountSummary Type = "BackupProtectionContainerCountSummary" + // TypeInvalid ... + TypeInvalid Type = "Invalid" +) + +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{TypeBackupProtectedItemCountSummary, TypeBackupProtectionContainerCountSummary, TypeInvalid} +} + +// TypeEnum enumerates the values for type enum. +type TypeEnum string + +const ( + // TypeEnumCopyOnlyFull ... + TypeEnumCopyOnlyFull TypeEnum = "CopyOnlyFull" + // TypeEnumDifferential ... + TypeEnumDifferential TypeEnum = "Differential" + // TypeEnumFull ... + TypeEnumFull TypeEnum = "Full" + // TypeEnumIncremental ... + TypeEnumIncremental TypeEnum = "Incremental" + // TypeEnumInvalid ... + TypeEnumInvalid TypeEnum = "Invalid" + // TypeEnumLog ... + TypeEnumLog TypeEnum = "Log" +) + +// PossibleTypeEnumValues returns an array of possible values for the TypeEnum const type. +func PossibleTypeEnumValues() []TypeEnum { + return []TypeEnum{TypeEnumCopyOnlyFull, TypeEnumDifferential, TypeEnumFull, TypeEnumIncremental, TypeEnumInvalid, TypeEnumLog} +} + +// UsagesUnit enumerates the values for usages unit. +type UsagesUnit string + +const ( + // Bytes ... + Bytes UsagesUnit = "Bytes" + // BytesPerSecond ... + BytesPerSecond UsagesUnit = "BytesPerSecond" + // Count ... + Count UsagesUnit = "Count" + // CountPerSecond ... + CountPerSecond UsagesUnit = "CountPerSecond" + // Percent ... + Percent UsagesUnit = "Percent" + // Seconds ... + Seconds UsagesUnit = "Seconds" +) + +// PossibleUsagesUnitValues returns an array of possible values for the UsagesUnit const type. +func PossibleUsagesUnitValues() []UsagesUnit { + return []UsagesUnit{Bytes, BytesPerSecond, Count, CountPerSecond, Percent, Seconds} +} + +// ValidationStatus enumerates the values for validation status. +type ValidationStatus string + +const ( + // ValidationStatusFailed ... + ValidationStatusFailed ValidationStatus = "Failed" + // ValidationStatusInvalid ... + ValidationStatusInvalid ValidationStatus = "Invalid" + // ValidationStatusSucceeded ... + ValidationStatusSucceeded ValidationStatus = "Succeeded" +) + +// PossibleValidationStatusValues returns an array of possible values for the ValidationStatus const type. +func PossibleValidationStatusValues() []ValidationStatus { + return []ValidationStatus{ValidationStatusFailed, ValidationStatusInvalid, ValidationStatusSucceeded} +} + +// WeekOfMonth enumerates the values for week of month. +type WeekOfMonth string + +const ( + // WeekOfMonthFirst ... + WeekOfMonthFirst WeekOfMonth = "First" + // WeekOfMonthFourth ... + WeekOfMonthFourth WeekOfMonth = "Fourth" + // WeekOfMonthInvalid ... + WeekOfMonthInvalid WeekOfMonth = "Invalid" + // WeekOfMonthLast ... + WeekOfMonthLast WeekOfMonth = "Last" + // WeekOfMonthSecond ... + WeekOfMonthSecond WeekOfMonth = "Second" + // WeekOfMonthThird ... + WeekOfMonthThird WeekOfMonth = "Third" +) + +// PossibleWeekOfMonthValues returns an array of possible values for the WeekOfMonth const type. +func PossibleWeekOfMonthValues() []WeekOfMonth { + return []WeekOfMonth{WeekOfMonthFirst, WeekOfMonthFourth, WeekOfMonthInvalid, WeekOfMonthLast, WeekOfMonthSecond, WeekOfMonthThird} +} + +// WorkloadItemType enumerates the values for workload item type. +type WorkloadItemType string + +const ( + // WorkloadItemTypeInvalid ... + WorkloadItemTypeInvalid WorkloadItemType = "Invalid" + // WorkloadItemTypeSAPAseDatabase ... + WorkloadItemTypeSAPAseDatabase WorkloadItemType = "SAPAseDatabase" + // WorkloadItemTypeSAPAseSystem ... + WorkloadItemTypeSAPAseSystem WorkloadItemType = "SAPAseSystem" + // WorkloadItemTypeSAPHanaDatabase ... + WorkloadItemTypeSAPHanaDatabase WorkloadItemType = "SAPHanaDatabase" + // WorkloadItemTypeSAPHanaSystem ... + WorkloadItemTypeSAPHanaSystem WorkloadItemType = "SAPHanaSystem" + // WorkloadItemTypeSQLDataBase ... + WorkloadItemTypeSQLDataBase WorkloadItemType = "SQLDataBase" + // WorkloadItemTypeSQLInstance ... + WorkloadItemTypeSQLInstance WorkloadItemType = "SQLInstance" +) + +// PossibleWorkloadItemTypeValues returns an array of possible values for the WorkloadItemType const type. +func PossibleWorkloadItemTypeValues() []WorkloadItemType { + return []WorkloadItemType{WorkloadItemTypeInvalid, WorkloadItemTypeSAPAseDatabase, WorkloadItemTypeSAPAseSystem, WorkloadItemTypeSAPHanaDatabase, WorkloadItemTypeSAPHanaSystem, WorkloadItemTypeSQLDataBase, WorkloadItemTypeSQLInstance} +} + +// WorkloadItemTypeBasicWorkloadItem enumerates the values for workload item type basic workload item. +type WorkloadItemTypeBasicWorkloadItem string + +const ( + // WorkloadItemTypeAzureVMWorkloadItem ... + WorkloadItemTypeAzureVMWorkloadItem WorkloadItemTypeBasicWorkloadItem = "AzureVmWorkloadItem" + // WorkloadItemTypeSAPAseDatabase1 ... + WorkloadItemTypeSAPAseDatabase1 WorkloadItemTypeBasicWorkloadItem = "SAPAseDatabase" + // WorkloadItemTypeSAPAseSystem1 ... + WorkloadItemTypeSAPAseSystem1 WorkloadItemTypeBasicWorkloadItem = "SAPAseSystem" + // WorkloadItemTypeSAPHanaDatabase1 ... + WorkloadItemTypeSAPHanaDatabase1 WorkloadItemTypeBasicWorkloadItem = "SAPHanaDatabase" + // WorkloadItemTypeSAPHanaSystem1 ... + WorkloadItemTypeSAPHanaSystem1 WorkloadItemTypeBasicWorkloadItem = "SAPHanaSystem" + // WorkloadItemTypeSQLDataBase1 ... + WorkloadItemTypeSQLDataBase1 WorkloadItemTypeBasicWorkloadItem = "SQLDataBase" + // WorkloadItemTypeSQLInstance1 ... + WorkloadItemTypeSQLInstance1 WorkloadItemTypeBasicWorkloadItem = "SQLInstance" + // WorkloadItemTypeWorkloadItem ... + WorkloadItemTypeWorkloadItem WorkloadItemTypeBasicWorkloadItem = "WorkloadItem" +) + +// PossibleWorkloadItemTypeBasicWorkloadItemValues returns an array of possible values for the WorkloadItemTypeBasicWorkloadItem const type. +func PossibleWorkloadItemTypeBasicWorkloadItemValues() []WorkloadItemTypeBasicWorkloadItem { + return []WorkloadItemTypeBasicWorkloadItem{WorkloadItemTypeAzureVMWorkloadItem, WorkloadItemTypeSAPAseDatabase1, WorkloadItemTypeSAPAseSystem1, WorkloadItemTypeSAPHanaDatabase1, WorkloadItemTypeSAPHanaSystem1, WorkloadItemTypeSQLDataBase1, WorkloadItemTypeSQLInstance1, WorkloadItemTypeWorkloadItem} +} + +// WorkloadType enumerates the values for workload type. +type WorkloadType string + +const ( + // WorkloadTypeAzureFileShare ... + WorkloadTypeAzureFileShare WorkloadType = "AzureFileShare" + // WorkloadTypeAzureSQLDb ... + WorkloadTypeAzureSQLDb WorkloadType = "AzureSqlDb" + // WorkloadTypeClient ... + WorkloadTypeClient WorkloadType = "Client" + // WorkloadTypeExchange ... + WorkloadTypeExchange WorkloadType = "Exchange" + // WorkloadTypeFileFolder ... + WorkloadTypeFileFolder WorkloadType = "FileFolder" + // WorkloadTypeGenericDataSource ... + WorkloadTypeGenericDataSource WorkloadType = "GenericDataSource" + // WorkloadTypeInvalid ... + WorkloadTypeInvalid WorkloadType = "Invalid" + // WorkloadTypeSAPAseDatabase ... + WorkloadTypeSAPAseDatabase WorkloadType = "SAPAseDatabase" + // WorkloadTypeSAPHanaDatabase ... + WorkloadTypeSAPHanaDatabase WorkloadType = "SAPHanaDatabase" + // WorkloadTypeSharepoint ... + WorkloadTypeSharepoint WorkloadType = "Sharepoint" + // WorkloadTypeSQLDataBase ... + WorkloadTypeSQLDataBase WorkloadType = "SQLDataBase" + // WorkloadTypeSQLDB ... + WorkloadTypeSQLDB WorkloadType = "SQLDB" + // WorkloadTypeSystemState ... + WorkloadTypeSystemState WorkloadType = "SystemState" + // WorkloadTypeVM ... + WorkloadTypeVM WorkloadType = "VM" + // WorkloadTypeVMwareVM ... + WorkloadTypeVMwareVM WorkloadType = "VMwareVM" +) + +// PossibleWorkloadTypeValues returns an array of possible values for the WorkloadType const type. +func PossibleWorkloadTypeValues() []WorkloadType { + return []WorkloadType{WorkloadTypeAzureFileShare, WorkloadTypeAzureSQLDb, WorkloadTypeClient, WorkloadTypeExchange, WorkloadTypeFileFolder, WorkloadTypeGenericDataSource, WorkloadTypeInvalid, WorkloadTypeSAPAseDatabase, WorkloadTypeSAPHanaDatabase, WorkloadTypeSharepoint, WorkloadTypeSQLDataBase, WorkloadTypeSQLDB, WorkloadTypeSystemState, WorkloadTypeVM, WorkloadTypeVMwareVM} +} + +// XcoolState enumerates the values for xcool state. +type XcoolState string + +const ( + // XcoolStateDisabled ... + XcoolStateDisabled XcoolState = "Disabled" + // XcoolStateEnabled ... + XcoolStateEnabled XcoolState = "Enabled" + // XcoolStateInvalid ... + XcoolStateInvalid XcoolState = "Invalid" +) + +// PossibleXcoolStateValues returns an array of possible values for the XcoolState const type. +func PossibleXcoolStateValues() []XcoolState { + return []XcoolState{XcoolStateDisabled, XcoolStateEnabled, XcoolStateInvalid} +} diff --git a/services/recoveryservices/mgmt/2022-03-01/backup/exportjobsoperationresults.go b/services/recoveryservices/mgmt/2022-03-01/backup/exportjobsoperationresults.go new file mode 100644 index 000000000000..61c13a959b07 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-03-01/backup/exportjobsoperationresults.go @@ -0,0 +1,112 @@ +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ExportJobsOperationResultsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ExportJobsOperationResultsClient struct { + BaseClient +} + +// NewExportJobsOperationResultsClient creates an instance of the ExportJobsOperationResultsClient client. +func NewExportJobsOperationResultsClient(subscriptionID string) ExportJobsOperationResultsClient { + return NewExportJobsOperationResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewExportJobsOperationResultsClientWithBaseURI creates an instance of the ExportJobsOperationResultsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewExportJobsOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) ExportJobsOperationResultsClient { + return ExportJobsOperationResultsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets the operation result of operation triggered by Export Jobs API. If the operation is successful, then it +// also +// contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in JSON serialized format. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// operationID - operationID which represents the export job. +func (client ExportJobsOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result OperationResultInfoBaseResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExportJobsOperationResultsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ExportJobsOperationResultsClient", "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.ExportJobsOperationResultsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ExportJobsOperationResultsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ExportJobsOperationResultsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2022-03-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}/backupJobs/operationResults/{operationId}", 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 ExportJobsOperationResultsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ExportJobsOperationResultsClient) GetResponder(resp *http.Response) (result OperationResultInfoBaseResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/featuresupport.go b/services/recoveryservices/mgmt/2022-03-01/backup/featuresupport.go similarity index 99% rename from services/recoveryservices/mgmt/2020-02-02/backup/featuresupport.go rename to services/recoveryservices/mgmt/2022-03-01/backup/featuresupport.go index 89bd19a91d48..5d2d909c84a6 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/featuresupport.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/featuresupport.go @@ -74,7 +74,7 @@ func (client FeatureSupportClient) ValidatePreparer(ctx context.Context, azureRe "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-07-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/itemlevelrecoveryconnections.go b/services/recoveryservices/mgmt/2022-03-01/backup/itemlevelrecoveryconnections.go similarity index 98% rename from services/recoveryservices/mgmt/2020-02-02/backup/itemlevelrecoveryconnections.go rename to services/recoveryservices/mgmt/2022-03-01/backup/itemlevelrecoveryconnections.go index 4e4704664221..ba998bbb241b 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/itemlevelrecoveryconnections.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/itemlevelrecoveryconnections.go @@ -89,7 +89,7 @@ func (client ItemLevelRecoveryConnectionsClient) ProvisionPreparer(ctx context.C "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -98,7 +98,7 @@ func (client ItemLevelRecoveryConnectionsClient) ProvisionPreparer(ctx context.C autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/provisionInstantItemRecovery", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/provisionInstantItemRecovery", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -177,7 +177,7 @@ func (client ItemLevelRecoveryConnectionsClient) RevokePreparer(ctx context.Cont "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -185,7 +185,7 @@ func (client ItemLevelRecoveryConnectionsClient) RevokePreparer(ctx context.Cont preparer := autorest.CreatePreparer( autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/revokeInstantItemRecovery", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/revokeInstantItemRecovery", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/recoveryservices/mgmt/2022-03-01/backup/jobcancellations.go b/services/recoveryservices/mgmt/2022-03-01/backup/jobcancellations.go new file mode 100644 index 000000000000..646654758fb9 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-03-01/backup/jobcancellations.go @@ -0,0 +1,110 @@ +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// JobCancellationsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type JobCancellationsClient struct { + BaseClient +} + +// NewJobCancellationsClient creates an instance of the JobCancellationsClient client. +func NewJobCancellationsClient(subscriptionID string) JobCancellationsClient { + return NewJobCancellationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewJobCancellationsClientWithBaseURI creates an instance of the JobCancellationsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewJobCancellationsClientWithBaseURI(baseURI string, subscriptionID string) JobCancellationsClient { + return JobCancellationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Trigger cancels a job. This is an asynchronous operation. To know the status of the cancellation, call +// GetCancelOperationResult API. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// jobName - name of the job to cancel. +func (client JobCancellationsClient) Trigger(ctx context.Context, vaultName string, resourceGroupName string, jobName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobCancellationsClient.Trigger") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.TriggerPreparer(ctx, vaultName, resourceGroupName, jobName) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.JobCancellationsClient", "Trigger", nil, "Failure preparing request") + return + } + + resp, err := client.TriggerSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "backup.JobCancellationsClient", "Trigger", resp, "Failure sending request") + return + } + + result, err = client.TriggerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.JobCancellationsClient", "Trigger", resp, "Failure responding to request") + return + } + + return +} + +// TriggerPreparer prepares the Trigger request. +func (client JobCancellationsClient) TriggerPreparer(ctx context.Context, vaultName string, resourceGroupName string, jobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}/cancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TriggerSender sends the Trigger request. The method will close the +// http.Response Body if it receives an error. +func (client JobCancellationsClient) TriggerSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// TriggerResponder handles the response to the Trigger request. The method always +// closes the http.Response Body. +func (client JobCancellationsClient) TriggerResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/securitypins.go b/services/recoveryservices/mgmt/2022-03-01/backup/jobdetails.go similarity index 53% rename from services/recoveryservices/mgmt/2020-02-02/backup/securitypins.go rename to services/recoveryservices/mgmt/2022-03-01/backup/jobdetails.go index 824a5f3c8eb4..823b5c848454 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/securitypins.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/jobdetails.go @@ -14,29 +14,30 @@ import ( "net/http" ) -// SecurityPINsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type SecurityPINsClient struct { +// JobDetailsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type JobDetailsClient struct { BaseClient } -// NewSecurityPINsClient creates an instance of the SecurityPINsClient client. -func NewSecurityPINsClient(subscriptionID string) SecurityPINsClient { - return NewSecurityPINsClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewJobDetailsClient creates an instance of the JobDetailsClient client. +func NewJobDetailsClient(subscriptionID string) JobDetailsClient { + return NewJobDetailsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewSecurityPINsClientWithBaseURI creates an instance of the SecurityPINsClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewSecurityPINsClientWithBaseURI(baseURI string, subscriptionID string) SecurityPINsClient { - return SecurityPINsClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewJobDetailsClientWithBaseURI creates an instance of the JobDetailsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewJobDetailsClientWithBaseURI(baseURI string, subscriptionID string) JobDetailsClient { + return JobDetailsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Get get the security PIN. +// Get gets extended information associated with the job. // Parameters: // vaultName - the name of the recovery services vault. // resourceGroupName - the name of the resource group where the recovery services vault is present. -func (client SecurityPINsClient) Get(ctx context.Context, vaultName string, resourceGroupName string) (result TokenInformation, err error) { +// jobName - name of the job whose details are to be fetched. +func (client JobDetailsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, jobName string) (result JobResource, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityPINsClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/JobDetailsClient.Get") defer func() { sc := -1 if result.Response.Response != nil { @@ -45,22 +46,22 @@ func (client SecurityPINsClient) Get(ctx context.Context, vaultName string, reso tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetPreparer(ctx, vaultName, resourceGroupName) + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, jobName) if err != nil { - err = autorest.NewErrorWithError(err, "backup.SecurityPINsClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "backup.JobDetailsClient", "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.SecurityPINsClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "backup.JobDetailsClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "backup.SecurityPINsClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "backup.JobDetailsClient", "Get", resp, "Failure responding to request") return } @@ -68,35 +69,36 @@ func (client SecurityPINsClient) Get(ctx context.Context, vaultName string, reso } // GetPreparer prepares the Get request. -func (client SecurityPINsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string) (*http.Request, error) { +func (client JobDetailsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, jobName string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( - autorest.AsPost(), + autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupSecurityPIN", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}", 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 SecurityPINsClient) GetSender(req *http.Request) (*http.Response, error) { +func (client JobDetailsClient) GetSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client SecurityPINsClient) GetResponder(resp *http.Response) (result TokenInformation, err error) { +func (client JobDetailsClient) GetResponder(resp *http.Response) (result JobResource, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/operationresults.go b/services/recoveryservices/mgmt/2022-03-01/backup/joboperationresults.go similarity index 51% rename from services/recoveryservices/mgmt/2019-05-13/backup/operationresults.go rename to services/recoveryservices/mgmt/2022-03-01/backup/joboperationresults.go index d183574f15b9..de60c01df1d3 100644 --- a/services/recoveryservices/mgmt/2019-05-13/backup/operationresults.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/joboperationresults.go @@ -14,35 +14,32 @@ import ( "net/http" ) -// OperationResultsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type OperationResultsClient struct { +// JobOperationResultsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type JobOperationResultsClient struct { BaseClient } -// NewOperationResultsClient creates an instance of the OperationResultsClient client. -func NewOperationResultsClient(subscriptionID string) OperationResultsClient { - return NewOperationResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewJobOperationResultsClient creates an instance of the JobOperationResultsClient client. +func NewJobOperationResultsClient(subscriptionID string) JobOperationResultsClient { + return NewJobOperationResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewOperationResultsClientWithBaseURI creates an instance of the OperationResultsClient client using a custom +// NewJobOperationResultsClientWithBaseURI creates an instance of the JobOperationResultsClient client using a custom // endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure // stack). -func NewOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) OperationResultsClient { - return OperationResultsClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewJobOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) JobOperationResultsClient { + return JobOperationResultsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Get provides the status of the delete operations such as deleting backed up item. Once the operation has started, -// the -// status code in the response would be Accepted. It will continue to be in this state till it reaches completion. On -// successful completion, the status code will be OK. This method expects OperationID as an argument. OperationID is -// part of the Location header of the operation response. +// Get fetches the result of any operation. // Parameters: // vaultName - the name of the recovery services vault. // resourceGroupName - the name of the resource group where the recovery services vault is present. -// operationID - operationID which represents the operation. -func (client OperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result autorest.Response, err error) { +// jobName - job name whose operation result has to be fetched. +// operationID - operationID which represents the operation whose result has to be fetched. +func (client JobOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, jobName string, operationID string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationResultsClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/JobOperationResultsClient.Get") defer func() { sc := -1 if result.Response != nil { @@ -51,22 +48,22 @@ func (client OperationResultsClient) Get(ctx context.Context, vaultName string, tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, operationID) + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, jobName, operationID) if err != nil { - err = autorest.NewErrorWithError(err, "backup.OperationResultsClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "backup.JobOperationResultsClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "backup.OperationResultsClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "backup.JobOperationResultsClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "backup.OperationResultsClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "backup.JobOperationResultsClient", "Get", resp, "Failure responding to request") return } @@ -74,15 +71,16 @@ func (client OperationResultsClient) Get(ctx context.Context, vaultName string, } // GetPreparer prepares the Get request. -func (client OperationResultsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (*http.Request, error) { +func (client JobOperationResultsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, jobName string, operationID string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "jobName": autorest.Encode("path", jobName), "operationId": autorest.Encode("path", operationID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -90,20 +88,20 @@ func (client OperationResultsClient) GetPreparer(ctx context.Context, vaultName preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperationResults/{operationId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}/operationResults/{operationId}", 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 OperationResultsClient) GetSender(req *http.Request) (*http.Response, error) { +func (client JobOperationResultsClient) GetSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client OperationResultsClient) GetResponder(resp *http.Response) (result autorest.Response, err error) { +func (client JobOperationResultsClient) GetResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), diff --git a/services/recoveryservices/mgmt/2021-01-01/backup/protecteditemscrr.go b/services/recoveryservices/mgmt/2022-03-01/backup/jobs.go similarity index 50% rename from services/recoveryservices/mgmt/2021-01-01/backup/protecteditemscrr.go rename to services/recoveryservices/mgmt/2022-03-01/backup/jobs.go index 74fb6bf3b709..1e8aac5a2371 100644 --- a/services/recoveryservices/mgmt/2021-01-01/backup/protecteditemscrr.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/jobs.go @@ -14,36 +14,35 @@ import ( "net/http" ) -// ProtectedItemsCrrClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type ProtectedItemsCrrClient struct { +// JobsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type JobsClient struct { BaseClient } -// NewProtectedItemsCrrClient creates an instance of the ProtectedItemsCrrClient client. -func NewProtectedItemsCrrClient(subscriptionID string) ProtectedItemsCrrClient { - return NewProtectedItemsCrrClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewJobsClient creates an instance of the JobsClient client. +func NewJobsClient(subscriptionID string) JobsClient { + return NewJobsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewProtectedItemsCrrClientWithBaseURI creates an instance of the ProtectedItemsCrrClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewProtectedItemsCrrClientWithBaseURI(baseURI string, subscriptionID string) ProtectedItemsCrrClient { - return ProtectedItemsCrrClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewJobsClientWithBaseURI creates an instance of the JobsClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewJobsClientWithBaseURI(baseURI string, subscriptionID string) JobsClient { + return JobsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List provides a pageable list of all items that are backed up within a vault. +// List provides a pageable list of jobs. // 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 ProtectedItemsCrrClient) List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result ProtectedItemResourceListPage, err error) { +func (client JobsClient) List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result JobResourceListPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemsCrrClient.List") + ctx = tracing.StartSpan(ctx, fqdn+"/JobsClient.List") defer func() { sc := -1 - if result.pirl.Response.Response != nil { - sc = result.pirl.Response.Response.StatusCode + if result.jrl.Response.Response != nil { + sc = result.jrl.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -51,23 +50,23 @@ func (client ProtectedItemsCrrClient) List(ctx context.Context, vaultName string result.fn = client.listNextResults req, err := client.ListPreparer(ctx, vaultName, resourceGroupName, filter, skipToken) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsCrrClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "backup.JobsClient", "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.ProtectedItemsCrrClient", "List", resp, "Failure sending request") + result.jrl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.JobsClient", "List", resp, "Failure sending request") return } - result.pirl, err = client.ListResponder(resp) + result.jrl, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsCrrClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "backup.JobsClient", "List", resp, "Failure responding to request") return } - if result.pirl.hasNextLink() && result.pirl.IsEmpty() { + if result.jrl.hasNextLink() && result.jrl.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -76,14 +75,14 @@ func (client ProtectedItemsCrrClient) List(ctx context.Context, vaultName string } // ListPreparer prepares the List request. -func (client ProtectedItemsCrrClient) ListPreparer(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (*http.Request, error) { +func (client JobsClient) 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 = "2018-12-20" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -97,20 +96,20 @@ func (client ProtectedItemsCrrClient) ListPreparer(ctx context.Context, vaultNam preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectedItems/", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs", 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 ProtectedItemsCrrClient) ListSender(req *http.Request) (*http.Response, error) { +func (client JobsClient) ListSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client ProtectedItemsCrrClient) ListResponder(resp *http.Response) (result ProtectedItemResourceList, err error) { +func (client JobsClient) ListResponder(resp *http.Response) (result JobResourceList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -121,10 +120,10 @@ func (client ProtectedItemsCrrClient) ListResponder(resp *http.Response) (result } // listNextResults retrieves the next set of results, if any. -func (client ProtectedItemsCrrClient) listNextResults(ctx context.Context, lastResults ProtectedItemResourceList) (result ProtectedItemResourceList, err error) { - req, err := lastResults.protectedItemResourceListPreparer(ctx) +func (client JobsClient) listNextResults(ctx context.Context, lastResults JobResourceList) (result JobResourceList, err error) { + req, err := lastResults.jobResourceListPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "backup.ProtectedItemsCrrClient", "listNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "backup.JobsClient", "listNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -132,19 +131,19 @@ func (client ProtectedItemsCrrClient) listNextResults(ctx context.Context, lastR resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "backup.ProtectedItemsCrrClient", "listNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "backup.JobsClient", "listNextResults", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsCrrClient", "listNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "backup.JobsClient", "listNextResults", resp, "Failure responding to next results request") } return } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ProtectedItemsCrrClient) ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result ProtectedItemResourceListIterator, err error) { +func (client JobsClient) ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result JobResourceListIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemsCrrClient.List") + ctx = tracing.StartSpan(ctx, fqdn+"/JobsClient.List") defer func() { sc := -1 if result.Response().Response.Response != nil { diff --git a/services/recoveryservices/mgmt/2022-03-01/backup/jobsgroup.go b/services/recoveryservices/mgmt/2022-03-01/backup/jobsgroup.go new file mode 100644 index 000000000000..2051503b7211 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-03-01/backup/jobsgroup.go @@ -0,0 +1,110 @@ +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// JobsGroupClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type JobsGroupClient struct { + BaseClient +} + +// NewJobsGroupClient creates an instance of the JobsGroupClient client. +func NewJobsGroupClient(subscriptionID string) JobsGroupClient { + return NewJobsGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewJobsGroupClientWithBaseURI creates an instance of the JobsGroupClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewJobsGroupClientWithBaseURI(baseURI string, subscriptionID string) JobsGroupClient { + return JobsGroupClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Export triggers export of jobs specified by filters and returns an OperationID to track. +// 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. +func (client JobsGroupClient) Export(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobsGroupClient.Export") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ExportPreparer(ctx, vaultName, resourceGroupName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.JobsGroupClient", "Export", nil, "Failure preparing request") + return + } + + resp, err := client.ExportSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "backup.JobsGroupClient", "Export", resp, "Failure sending request") + return + } + + result, err = client.ExportResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.JobsGroupClient", "Export", resp, "Failure responding to request") + return + } + + return +} + +// ExportPreparer prepares the Export request. +func (client JobsGroupClient) ExportPreparer(ctx context.Context, vaultName string, resourceGroupName string, filter 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 = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobsExport", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ExportSender sends the Export request. The method will close the +// http.Response Body if it receives an error. +func (client JobsGroupClient) ExportSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ExportResponder handles the response to the Export request. The method always +// closes the http.Response Body. +func (client JobsGroupClient) ExportResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/recoveryservices/mgmt/2022-03-01/backup/models.go b/services/recoveryservices/mgmt/2022-03-01/backup/models.go new file mode 100644 index 000000000000..1cf19cc54f44 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-03-01/backup/models.go @@ -0,0 +1,23331 @@ +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2022-03-01/backup" + +// AzureBackupGoalFeatureSupportRequest azure backup goal feature specific request. +type AzureBackupGoalFeatureSupportRequest struct { + // FeatureType - Possible values include: 'FeatureTypeFeatureSupportRequest', 'FeatureTypeAzureBackupGoals', 'FeatureTypeAzureVMResourceBackup' + FeatureType FeatureType `json:"featureType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureBackupGoalFeatureSupportRequest. +func (abgfsr AzureBackupGoalFeatureSupportRequest) MarshalJSON() ([]byte, error) { + abgfsr.FeatureType = FeatureTypeAzureBackupGoals + objectMap := make(map[string]interface{}) + if abgfsr.FeatureType != "" { + objectMap["featureType"] = abgfsr.FeatureType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupGoalFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. +func (abgfsr AzureBackupGoalFeatureSupportRequest) AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) { + return &abgfsr, true +} + +// AsAzureVMResourceFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. +func (abgfsr AzureBackupGoalFeatureSupportRequest) AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) { + return nil, false +} + +// AsFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. +func (abgfsr AzureBackupGoalFeatureSupportRequest) AsFeatureSupportRequest() (*FeatureSupportRequest, bool) { + return nil, false +} + +// AsBasicFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureBackupGoalFeatureSupportRequest. +func (abgfsr AzureBackupGoalFeatureSupportRequest) AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) { + return &abgfsr, true +} + +// AzureBackupServerContainer azureBackupServer (DPMVenus) workload-specific protection container. +type AzureBackupServerContainer struct { + // CanReRegister - Specifies whether the container is re-registrable. + CanReRegister *bool `json:"canReRegister,omitempty"` + // ContainerID - ID of container. + ContainerID *string `json:"containerId,omitempty"` + // ProtectedItemCount - Number of protected items in the BackupEngine + ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` + // DpmAgentVersion - Backup engine Agent version + DpmAgentVersion *string `json:"dpmAgentVersion,omitempty"` + // DpmServers - List of BackupEngines protecting the container + DpmServers *[]string `json:"dpmServers,omitempty"` + // UpgradeAvailable - To check if upgrade available + UpgradeAvailable *bool `json:"upgradeAvailable,omitempty"` + // ProtectionStatus - Protection status of the container. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ExtendedInfo - Extended Info of the container. + ExtendedInfo *DPMContainerExtendedInfo `json:"extendedInfo,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ProtectableObjectType - Type of the protectable object associated with this container + ProtectableObjectType *string `json:"protectableObjectType,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaasVMContainer1', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) MarshalJSON() ([]byte, error) { + absc.ContainerType = ContainerTypeAzureBackupServerContainer1 + objectMap := make(map[string]interface{}) + if absc.CanReRegister != nil { + objectMap["canReRegister"] = absc.CanReRegister + } + if absc.ContainerID != nil { + objectMap["containerId"] = absc.ContainerID + } + if absc.ProtectedItemCount != nil { + objectMap["protectedItemCount"] = absc.ProtectedItemCount + } + if absc.DpmAgentVersion != nil { + objectMap["dpmAgentVersion"] = absc.DpmAgentVersion + } + if absc.DpmServers != nil { + objectMap["dpmServers"] = absc.DpmServers + } + if absc.UpgradeAvailable != nil { + objectMap["upgradeAvailable"] = absc.UpgradeAvailable + } + if absc.ProtectionStatus != nil { + objectMap["protectionStatus"] = absc.ProtectionStatus + } + if absc.ExtendedInfo != nil { + objectMap["extendedInfo"] = absc.ExtendedInfo + } + if absc.FriendlyName != nil { + objectMap["friendlyName"] = absc.FriendlyName + } + if absc.BackupManagementType != "" { + objectMap["backupManagementType"] = absc.BackupManagementType + } + if absc.RegistrationStatus != nil { + objectMap["registrationStatus"] = absc.RegistrationStatus + } + if absc.HealthStatus != nil { + objectMap["healthStatus"] = absc.HealthStatus + } + if absc.ProtectableObjectType != nil { + objectMap["protectableObjectType"] = absc.ProtectableObjectType + } + if absc.ContainerType != "" { + objectMap["containerType"] = absc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return &absc, true +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return &absc, true +} + +// AsGenericContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureBackupServerContainer. +func (absc AzureBackupServerContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &absc, true +} + +// AzureBackupServerEngine backup engine type when Azure Backup Server is used to manage the backups. +type AzureBackupServerEngine struct { + // FriendlyName - Friendly name of the backup engine. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Registration status of the backup engine with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // BackupEngineState - Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} + BackupEngineState *string `json:"backupEngineState,omitempty"` + // HealthStatus - Backup status of the backup engine. + HealthStatus *string `json:"healthStatus,omitempty"` + // CanReRegister - Flag indicating if the backup engine be registered, once already registered. + CanReRegister *bool `json:"canReRegister,omitempty"` + // BackupEngineID - ID of the backup engine. + BackupEngineID *string `json:"backupEngineId,omitempty"` + // DpmVersion - Backup engine version + DpmVersion *string `json:"dpmVersion,omitempty"` + // AzureBackupAgentVersion - Backup agent version + AzureBackupAgentVersion *string `json:"azureBackupAgentVersion,omitempty"` + // IsAzureBackupAgentUpgradeAvailable - To check if backup agent upgrade available + IsAzureBackupAgentUpgradeAvailable *bool `json:"isAzureBackupAgentUpgradeAvailable,omitempty"` + // IsDpmUpgradeAvailable - To check if backup engine upgrade available + IsDpmUpgradeAvailable *bool `json:"isDpmUpgradeAvailable,omitempty"` + // ExtendedInfo - Extended info of the backupengine + ExtendedInfo *EngineExtendedInfo `json:"extendedInfo,omitempty"` + // BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine' + BackupEngineType EngineType `json:"backupEngineType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureBackupServerEngine. +func (abse AzureBackupServerEngine) MarshalJSON() ([]byte, error) { + abse.BackupEngineType = BackupEngineTypeAzureBackupServerEngine + objectMap := make(map[string]interface{}) + if abse.FriendlyName != nil { + objectMap["friendlyName"] = abse.FriendlyName + } + if abse.BackupManagementType != "" { + objectMap["backupManagementType"] = abse.BackupManagementType + } + if abse.RegistrationStatus != nil { + objectMap["registrationStatus"] = abse.RegistrationStatus + } + if abse.BackupEngineState != nil { + objectMap["backupEngineState"] = abse.BackupEngineState + } + if abse.HealthStatus != nil { + objectMap["healthStatus"] = abse.HealthStatus + } + if abse.CanReRegister != nil { + objectMap["canReRegister"] = abse.CanReRegister + } + if abse.BackupEngineID != nil { + objectMap["backupEngineId"] = abse.BackupEngineID + } + if abse.DpmVersion != nil { + objectMap["dpmVersion"] = abse.DpmVersion + } + if abse.AzureBackupAgentVersion != nil { + objectMap["azureBackupAgentVersion"] = abse.AzureBackupAgentVersion + } + if abse.IsAzureBackupAgentUpgradeAvailable != nil { + objectMap["isAzureBackupAgentUpgradeAvailable"] = abse.IsAzureBackupAgentUpgradeAvailable + } + if abse.IsDpmUpgradeAvailable != nil { + objectMap["isDpmUpgradeAvailable"] = abse.IsDpmUpgradeAvailable + } + if abse.ExtendedInfo != nil { + objectMap["extendedInfo"] = abse.ExtendedInfo + } + if abse.BackupEngineType != "" { + objectMap["backupEngineType"] = abse.BackupEngineType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerEngine is the BasicEngineBase implementation for AzureBackupServerEngine. +func (abse AzureBackupServerEngine) AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) { + return &abse, true +} + +// AsDpmBackupEngine is the BasicEngineBase implementation for AzureBackupServerEngine. +func (abse AzureBackupServerEngine) AsDpmBackupEngine() (*DpmBackupEngine, bool) { + return nil, false +} + +// AsEngineBase is the BasicEngineBase implementation for AzureBackupServerEngine. +func (abse AzureBackupServerEngine) AsEngineBase() (*EngineBase, bool) { + return nil, false +} + +// AsBasicEngineBase is the BasicEngineBase implementation for AzureBackupServerEngine. +func (abse AzureBackupServerEngine) AsBasicEngineBase() (BasicEngineBase, bool) { + return &abse, true +} + +// AzureFileShareBackupRequest azureFileShare workload-specific backup request. +type AzureFileShareBackupRequest struct { + // RecoveryPointExpiryTimeInUTC - Backup copy will expire after the time specified (UTC). + RecoveryPointExpiryTimeInUTC *date.Time `json:"recoveryPointExpiryTimeInUTC,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' + ObjectType ObjectTypeBasicRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFileShareBackupRequest. +func (afsbr AzureFileShareBackupRequest) MarshalJSON() ([]byte, error) { + afsbr.ObjectType = ObjectTypeAzureFileShareBackupRequest + objectMap := make(map[string]interface{}) + if afsbr.RecoveryPointExpiryTimeInUTC != nil { + objectMap["recoveryPointExpiryTimeInUTC"] = afsbr.RecoveryPointExpiryTimeInUTC + } + if afsbr.ObjectType != "" { + objectMap["objectType"] = afsbr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareBackupRequest is the BasicRequest implementation for AzureFileShareBackupRequest. +func (afsbr AzureFileShareBackupRequest) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { + return &afsbr, true +} + +// AsAzureWorkloadBackupRequest is the BasicRequest implementation for AzureFileShareBackupRequest. +func (afsbr AzureFileShareBackupRequest) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { + return nil, false +} + +// AsIaasVMBackupRequest is the BasicRequest implementation for AzureFileShareBackupRequest. +func (afsbr AzureFileShareBackupRequest) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { + return nil, false +} + +// AsRequest is the BasicRequest implementation for AzureFileShareBackupRequest. +func (afsbr AzureFileShareBackupRequest) AsRequest() (*Request, bool) { + return nil, false +} + +// AsBasicRequest is the BasicRequest implementation for AzureFileShareBackupRequest. +func (afsbr AzureFileShareBackupRequest) AsBasicRequest() (BasicRequest, bool) { + return &afsbr, true +} + +// AzureFileShareProtectableItem protectable item for Azure Fileshare workloads. +type AzureFileShareProtectableItem struct { + // ParentContainerFabricID - Full Fabric ID of container to which this protectable item belongs. For example, ARM ID. + ParentContainerFabricID *string `json:"parentContainerFabricId,omitempty"` + // ParentContainerFriendlyName - Friendly name of container to which this protectable item belongs. + ParentContainerFriendlyName *string `json:"parentContainerFriendlyName,omitempty"` + // AzureFileShareType - File Share type XSync or XSMB. Possible values include: 'Invalid', 'XSMB', 'XSync' + AzureFileShareType AzureFileShareType `json:"azureFileShareType,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) MarshalJSON() ([]byte, error) { + afspi.ProtectableItemType = ProtectableItemTypeAzureFileShare + objectMap := make(map[string]interface{}) + if afspi.ParentContainerFabricID != nil { + objectMap["parentContainerFabricId"] = afspi.ParentContainerFabricID + } + if afspi.ParentContainerFriendlyName != nil { + objectMap["parentContainerFriendlyName"] = afspi.ParentContainerFriendlyName + } + if afspi.AzureFileShareType != "" { + objectMap["azureFileShareType"] = afspi.AzureFileShareType + } + if afspi.BackupManagementType != nil { + objectMap["backupManagementType"] = afspi.BackupManagementType + } + if afspi.WorkloadType != nil { + objectMap["workloadType"] = afspi.WorkloadType + } + if afspi.FriendlyName != nil { + objectMap["friendlyName"] = afspi.FriendlyName + } + if afspi.ProtectionState != "" { + objectMap["protectionState"] = afspi.ProtectionState + } + if afspi.ProtectableItemType != "" { + objectMap["protectableItemType"] = afspi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return &afspi, true +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureFileShareProtectableItem. +func (afspi AzureFileShareProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &afspi, true +} + +// AzureFileshareProtectedItem azure File Share workload-specific backup item. +type AzureFileshareProtectedItem struct { + // FriendlyName - Friendly name of the fileshare represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // KpisHealths - Health details of different KPIs + KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` + // ExtendedInfo - Additional information with this backup item. + ExtendedInfo *AzureFileshareProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ResourceGuardOperationRequests - ResourceGuardOperationRequests on which LAC check will be performed + ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` + // IsArchiveEnabled - Flag to identify whether datasource is protected in archive + IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + // PolicyName - Name of the policy used for protection + PolicyName *string `json:"policyName,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) MarshalJSON() ([]byte, error) { + afpi.ProtectedItemType = ProtectedItemTypeAzureFileShareProtectedItem + objectMap := make(map[string]interface{}) + if afpi.FriendlyName != nil { + objectMap["friendlyName"] = afpi.FriendlyName + } + if afpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = afpi.ProtectionStatus + } + if afpi.ProtectionState != "" { + objectMap["protectionState"] = afpi.ProtectionState + } + if afpi.LastBackupStatus != nil { + objectMap["lastBackupStatus"] = afpi.LastBackupStatus + } + if afpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = afpi.LastBackupTime + } + if afpi.KpisHealths != nil { + objectMap["kpisHealths"] = afpi.KpisHealths + } + if afpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = afpi.ExtendedInfo + } + if afpi.BackupManagementType != "" { + objectMap["backupManagementType"] = afpi.BackupManagementType + } + if afpi.WorkloadType != "" { + objectMap["workloadType"] = afpi.WorkloadType + } + if afpi.ContainerName != nil { + objectMap["containerName"] = afpi.ContainerName + } + if afpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = afpi.SourceResourceID + } + if afpi.PolicyID != nil { + objectMap["policyId"] = afpi.PolicyID + } + if afpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = afpi.LastRecoveryPoint + } + if afpi.BackupSetName != nil { + objectMap["backupSetName"] = afpi.BackupSetName + } + if afpi.CreateMode != "" { + objectMap["createMode"] = afpi.CreateMode + } + if afpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = afpi.DeferredDeleteTimeInUTC + } + if afpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = afpi.IsScheduledForDeferredDelete + } + if afpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = afpi.DeferredDeleteTimeRemaining + } + if afpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = afpi.IsDeferredDeleteScheduleUpcoming + } + if afpi.IsRehydrate != nil { + objectMap["isRehydrate"] = afpi.IsRehydrate + } + if afpi.ResourceGuardOperationRequests != nil { + objectMap["resourceGuardOperationRequests"] = afpi.ResourceGuardOperationRequests + } + if afpi.IsArchiveEnabled != nil { + objectMap["isArchiveEnabled"] = afpi.IsArchiveEnabled + } + if afpi.PolicyName != nil { + objectMap["policyName"] = afpi.PolicyName + } + if afpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = afpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return &afpi, true +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureFileshareProtectedItem. +func (afpi AzureFileshareProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &afpi, true +} + +// AzureFileshareProtectedItemExtendedInfo additional information about Azure File Share backup item. +type AzureFileshareProtectedItemExtendedInfo struct { + // OldestRecoveryPoint - The oldest backup copy available for this item in the service. + OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` + // RecoveryPointCount - Number of available backup copies associated with this backup item. + RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` + // PolicyState - Indicates consistency of policy object and policy applied to this backup item. + PolicyState *string `json:"policyState,omitempty"` + // ResourceState - READ-ONLY; Indicates the state of this resource. Possible values are from enum ResourceState {Invalid, Active, SoftDeleted, Deleted} + ResourceState *string `json:"resourceState,omitempty"` + // ResourceStateSyncTime - READ-ONLY; The resource state sync time for this backup item. + ResourceStateSyncTime *date.Time `json:"resourceStateSyncTime,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFileshareProtectedItemExtendedInfo. +func (afpiei AzureFileshareProtectedItemExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if afpiei.OldestRecoveryPoint != nil { + objectMap["oldestRecoveryPoint"] = afpiei.OldestRecoveryPoint + } + if afpiei.RecoveryPointCount != nil { + objectMap["recoveryPointCount"] = afpiei.RecoveryPointCount + } + if afpiei.PolicyState != nil { + objectMap["policyState"] = afpiei.PolicyState + } + return json.Marshal(objectMap) +} + +// AzureFileShareProtectionPolicy azureStorage backup policy. +type AzureFileShareProtectionPolicy struct { + // 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', 'WorkloadTypeSAPAseDatabase' + 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. + RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` + // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + TimeZone *string `json:"timeZone,omitempty"` + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // ResourceGuardOperationRequests - ResourceGuard Operation Requests + ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) MarshalJSON() ([]byte, error) { + afspp.BackupManagementType = BackupManagementTypeAzureStorage + objectMap := make(map[string]interface{}) + if afspp.WorkLoadType != "" { + objectMap["workLoadType"] = afspp.WorkLoadType + } + objectMap["schedulePolicy"] = afspp.SchedulePolicy + objectMap["retentionPolicy"] = afspp.RetentionPolicy + if afspp.TimeZone != nil { + objectMap["timeZone"] = afspp.TimeZone + } + if afspp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = afspp.ProtectedItemsCount + } + if afspp.ResourceGuardOperationRequests != nil { + objectMap["resourceGuardOperationRequests"] = afspp.ResourceGuardOperationRequests + } + if afspp.BackupManagementType != "" { + objectMap["backupManagementType"] = afspp.BackupManagementType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return nil, false +} + +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { + return &afspp, true +} + +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { + return nil, false +} + +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { + return nil, false +} + +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { + return nil, false +} + +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { + return nil, false +} + +// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { + return nil, false +} + +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureFileShareProtectionPolicy. +func (afspp AzureFileShareProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &afspp, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureFileShareProtectionPolicy struct. +func (afspp *AzureFileShareProtectionPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "workLoadType": + if v != nil { + var workLoadType WorkloadType + err = json.Unmarshal(*v, &workLoadType) + if err != nil { + return err + } + afspp.WorkLoadType = workLoadType + } + case "schedulePolicy": + if v != nil { + schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) + if err != nil { + return err + } + afspp.SchedulePolicy = schedulePolicy + } + case "retentionPolicy": + if v != nil { + retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) + if err != nil { + return err + } + afspp.RetentionPolicy = retentionPolicy + } + case "timeZone": + if v != nil { + var timeZone string + err = json.Unmarshal(*v, &timeZone) + if err != nil { + return err + } + afspp.TimeZone = &timeZone + } + case "protectedItemsCount": + if v != nil { + var protectedItemsCount int32 + err = json.Unmarshal(*v, &protectedItemsCount) + if err != nil { + return err + } + afspp.ProtectedItemsCount = &protectedItemsCount + } + case "resourceGuardOperationRequests": + if v != nil { + var resourceGuardOperationRequests []string + err = json.Unmarshal(*v, &resourceGuardOperationRequests) + if err != nil { + return err + } + afspp.ResourceGuardOperationRequests = &resourceGuardOperationRequests + } + case "backupManagementType": + if v != nil { + var backupManagementType ManagementTypeBasicProtectionPolicy + err = json.Unmarshal(*v, &backupManagementType) + if err != nil { + return err + } + afspp.BackupManagementType = backupManagementType + } + } + } + + return nil +} + +// AzureFileShareProvisionILRRequest update snapshot Uri with the correct friendly Name of the source Azure +// file share. +type AzureFileShareProvisionILRRequest struct { + // RecoveryPointID - Recovery point ID. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // SourceResourceID - Source Storage account ARM Id + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeAzureFileShareProvisionILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest' + ObjectType ObjectTypeBasicILRRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFileShareProvisionILRRequest. +func (afspir AzureFileShareProvisionILRRequest) MarshalJSON() ([]byte, error) { + afspir.ObjectType = ObjectTypeAzureFileShareProvisionILRRequest + objectMap := make(map[string]interface{}) + if afspir.RecoveryPointID != nil { + objectMap["recoveryPointId"] = afspir.RecoveryPointID + } + if afspir.SourceResourceID != nil { + objectMap["sourceResourceId"] = afspir.SourceResourceID + } + if afspir.ObjectType != "" { + objectMap["objectType"] = afspir.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProvisionILRRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. +func (afspir AzureFileShareProvisionILRRequest) AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) { + return &afspir, true +} + +// AsIaasVMILRRegistrationRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. +func (afspir AzureFileShareProvisionILRRequest) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) { + return nil, false +} + +// AsILRRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. +func (afspir AzureFileShareProvisionILRRequest) AsILRRequest() (*ILRRequest, bool) { + return nil, false +} + +// AsBasicILRRequest is the BasicILRRequest implementation for AzureFileShareProvisionILRRequest. +func (afspir AzureFileShareProvisionILRRequest) AsBasicILRRequest() (BasicILRRequest, bool) { + return &afspir, true +} + +// AzureFileShareRecoveryPoint azure File Share workload specific backup copy. +type AzureFileShareRecoveryPoint struct { + // RecoveryPointType - Type of the backup copy. Specifies whether it is a crash consistent backup or app consistent. + RecoveryPointType *string `json:"recoveryPointType,omitempty"` + // RecoveryPointTime - Time at which this backup copy was created. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // FileShareSnapshotURI - Contains Url to the snapshot of fileshare, if applicable + FileShareSnapshotURI *string `json:"fileShareSnapshotUri,omitempty"` + // RecoveryPointSizeInGB - Contains recovery point size + RecoveryPointSizeInGB *int32 `json:"recoveryPointSizeInGB,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) MarshalJSON() ([]byte, error) { + afsrp.ObjectType = ObjectTypeAzureFileShareRecoveryPoint + objectMap := make(map[string]interface{}) + if afsrp.RecoveryPointType != nil { + objectMap["recoveryPointType"] = afsrp.RecoveryPointType + } + if afsrp.RecoveryPointTime != nil { + objectMap["recoveryPointTime"] = afsrp.RecoveryPointTime + } + if afsrp.FileShareSnapshotURI != nil { + objectMap["fileShareSnapshotUri"] = afsrp.FileShareSnapshotURI + } + if afsrp.RecoveryPointSizeInGB != nil { + objectMap["recoveryPointSizeInGB"] = afsrp.RecoveryPointSizeInGB + } + if afsrp.ObjectType != "" { + objectMap["objectType"] = afsrp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return &afsrp, true +} + +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureFileShareRecoveryPoint. +func (afsrp AzureFileShareRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &afsrp, true +} + +// AzureFileShareRestoreRequest azureFileShare Restore Request +type AzureFileShareRestoreRequest struct { + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Source storage account ARM Id + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // CopyOptions - Options to resolve copy conflicts. Possible values include: 'CopyOptionsInvalid', 'CopyOptionsCreateCopy', 'CopyOptionsSkip', 'CopyOptionsOverwrite', 'CopyOptionsFailOnConflict' + CopyOptions CopyOptions `json:"copyOptions,omitempty"` + // RestoreRequestType - Restore Type (FullShareRestore or ItemLevelRestore). Possible values include: 'RestoreRequestTypeInvalid', 'RestoreRequestTypeFullShareRestore', 'RestoreRequestTypeItemLevelRestore' + RestoreRequestType RestoreRequestType `json:"restoreRequestType,omitempty"` + // RestoreFileSpecs - List of Source Files/Folders(which need to recover) and TargetFolderPath details + RestoreFileSpecs *[]RestoreFileSpecs `json:"restoreFileSpecs,omitempty"` + // TargetDetails - Target File Share Details + TargetDetails *TargetAFSRestoreInfo `json:"targetDetails,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest', 'ObjectTypeIaasVMRestoreWithRehydrationRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) MarshalJSON() ([]byte, error) { + afsrr.ObjectType = ObjectTypeAzureFileShareRestoreRequest + objectMap := make(map[string]interface{}) + if afsrr.RecoveryType != "" { + objectMap["recoveryType"] = afsrr.RecoveryType + } + if afsrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = afsrr.SourceResourceID + } + if afsrr.CopyOptions != "" { + objectMap["copyOptions"] = afsrr.CopyOptions + } + if afsrr.RestoreRequestType != "" { + objectMap["restoreRequestType"] = afsrr.RestoreRequestType + } + if afsrr.RestoreFileSpecs != nil { + objectMap["restoreFileSpecs"] = afsrr.RestoreFileSpecs + } + if afsrr.TargetDetails != nil { + objectMap["targetDetails"] = afsrr.TargetDetails + } + if afsrr.ObjectType != "" { + objectMap["objectType"] = afsrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return &afsrr, true +} + +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest() (BasicAzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsBasicAzureWorkloadSQLPointInTimeRestoreRequest() (BasicAzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsBasicIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsBasicIaasVMRestoreRequest() (BasicIaasVMRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsAzureWorkloadSQLRestoreWithRehydrateRequest() (*AzureWorkloadSQLRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreWithRehydrationRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsIaasVMRestoreWithRehydrationRequest() (*IaasVMRestoreWithRehydrationRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureFileShareRestoreRequest. +func (afsrr AzureFileShareRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &afsrr, true +} + +// AzureIaaSClassicComputeVMContainer iaaS VM workload-specific backup item representing a classic virtual +// machine. +type AzureIaaSClassicComputeVMContainer struct { + // VirtualMachineID - Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // VirtualMachineVersion - Specifies whether the container represents a Classic or an Azure Resource Manager VM. + VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` + // ResourceGroup - Resource group name of Recovery Services Vault. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ProtectableObjectType - Type of the protectable object associated with this container + ProtectableObjectType *string `json:"protectableObjectType,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaasVMContainer1', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) MarshalJSON() ([]byte, error) { + aisccvc.ContainerType = ContainerTypeMicrosoftClassicComputevirtualMachines + objectMap := make(map[string]interface{}) + if aisccvc.VirtualMachineID != nil { + objectMap["virtualMachineId"] = aisccvc.VirtualMachineID + } + if aisccvc.VirtualMachineVersion != nil { + objectMap["virtualMachineVersion"] = aisccvc.VirtualMachineVersion + } + if aisccvc.ResourceGroup != nil { + objectMap["resourceGroup"] = aisccvc.ResourceGroup + } + if aisccvc.FriendlyName != nil { + objectMap["friendlyName"] = aisccvc.FriendlyName + } + if aisccvc.BackupManagementType != "" { + objectMap["backupManagementType"] = aisccvc.BackupManagementType + } + if aisccvc.RegistrationStatus != nil { + objectMap["registrationStatus"] = aisccvc.RegistrationStatus + } + if aisccvc.HealthStatus != nil { + objectMap["healthStatus"] = aisccvc.HealthStatus + } + if aisccvc.ProtectableObjectType != nil { + objectMap["protectableObjectType"] = aisccvc.ProtectableObjectType + } + if aisccvc.ContainerType != "" { + objectMap["containerType"] = aisccvc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return &aisccvc, true +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return &aisccvc, true +} + +// AsMabContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer. +func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &aisccvc, true +} + +// AzureIaaSClassicComputeVMProtectableItem iaaS VM workload-specific backup item representing the Classic +// Compute VM. +type AzureIaaSClassicComputeVMProtectableItem struct { + // VirtualMachineID - Fully qualified ARM ID of the virtual machine. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // VirtualMachineVersion - Specifies whether the container represents a Classic or an Azure Resource Manager VM. + VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` + // ResourceGroup - Resource group name of Recovery Services Vault. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) MarshalJSON() ([]byte, error) { + aisccvpi.ProtectableItemType = ProtectableItemTypeMicrosoftClassicComputevirtualMachines + objectMap := make(map[string]interface{}) + if aisccvpi.VirtualMachineID != nil { + objectMap["virtualMachineId"] = aisccvpi.VirtualMachineID + } + if aisccvpi.VirtualMachineVersion != nil { + objectMap["virtualMachineVersion"] = aisccvpi.VirtualMachineVersion + } + if aisccvpi.ResourceGroup != nil { + objectMap["resourceGroup"] = aisccvpi.ResourceGroup + } + if aisccvpi.BackupManagementType != nil { + objectMap["backupManagementType"] = aisccvpi.BackupManagementType + } + if aisccvpi.WorkloadType != nil { + objectMap["workloadType"] = aisccvpi.WorkloadType + } + if aisccvpi.FriendlyName != nil { + objectMap["friendlyName"] = aisccvpi.FriendlyName + } + if aisccvpi.ProtectionState != "" { + objectMap["protectionState"] = aisccvpi.ProtectionState + } + if aisccvpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = aisccvpi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return &aisccvpi, true +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return &aisccvpi, true +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &aisccvpi, true +} + +// AzureIaaSClassicComputeVMProtectedItem iaaS VM workload-specific backup item representing the Classic +// Compute VM. +type AzureIaaSClassicComputeVMProtectedItem struct { + // FriendlyName - Friendly name of the VM represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // VirtualMachineID - Fully qualified ARM ID of the virtual machine represented by this item. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // HealthStatus - Health status of protected item. Possible values include: 'HealthStatusPassed', 'HealthStatusActionRequired', 'HealthStatusActionSuggested', 'HealthStatusInvalid' + HealthStatus HealthStatus `json:"healthStatus,omitempty"` + // HealthDetails - Health details on this backup item. + HealthDetails *[]AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` + // KpisHealths - Health details of different KPIs + KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` + // LastBackupStatus - Last backup operation status. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // ProtectedItemDataID - Data ID of the protected item. + ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ResourceGuardOperationRequests - ResourceGuardOperationRequests on which LAC check will be performed + ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` + // IsArchiveEnabled - Flag to identify whether datasource is protected in archive + IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + // PolicyName - Name of the policy used for protection + PolicyName *string `json:"policyName,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) MarshalJSON() ([]byte, error) { + aisccvpi.ProtectedItemType = ProtectedItemTypeMicrosoftClassicComputevirtualMachines + objectMap := make(map[string]interface{}) + if aisccvpi.FriendlyName != nil { + objectMap["friendlyName"] = aisccvpi.FriendlyName + } + if aisccvpi.VirtualMachineID != nil { + objectMap["virtualMachineId"] = aisccvpi.VirtualMachineID + } + if aisccvpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = aisccvpi.ProtectionStatus + } + if aisccvpi.ProtectionState != "" { + objectMap["protectionState"] = aisccvpi.ProtectionState + } + if aisccvpi.HealthStatus != "" { + objectMap["healthStatus"] = aisccvpi.HealthStatus + } + if aisccvpi.HealthDetails != nil { + objectMap["healthDetails"] = aisccvpi.HealthDetails + } + if aisccvpi.KpisHealths != nil { + objectMap["kpisHealths"] = aisccvpi.KpisHealths + } + if aisccvpi.LastBackupStatus != nil { + objectMap["lastBackupStatus"] = aisccvpi.LastBackupStatus + } + if aisccvpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = aisccvpi.LastBackupTime + } + if aisccvpi.ProtectedItemDataID != nil { + objectMap["protectedItemDataId"] = aisccvpi.ProtectedItemDataID + } + if aisccvpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = aisccvpi.ExtendedInfo + } + if aisccvpi.ExtendedProperties != nil { + objectMap["extendedProperties"] = aisccvpi.ExtendedProperties + } + if aisccvpi.BackupManagementType != "" { + objectMap["backupManagementType"] = aisccvpi.BackupManagementType + } + if aisccvpi.WorkloadType != "" { + objectMap["workloadType"] = aisccvpi.WorkloadType + } + if aisccvpi.ContainerName != nil { + objectMap["containerName"] = aisccvpi.ContainerName + } + if aisccvpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = aisccvpi.SourceResourceID + } + if aisccvpi.PolicyID != nil { + objectMap["policyId"] = aisccvpi.PolicyID + } + if aisccvpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = aisccvpi.LastRecoveryPoint + } + if aisccvpi.BackupSetName != nil { + objectMap["backupSetName"] = aisccvpi.BackupSetName + } + if aisccvpi.CreateMode != "" { + objectMap["createMode"] = aisccvpi.CreateMode + } + if aisccvpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = aisccvpi.DeferredDeleteTimeInUTC + } + if aisccvpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = aisccvpi.IsScheduledForDeferredDelete + } + if aisccvpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = aisccvpi.DeferredDeleteTimeRemaining + } + if aisccvpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = aisccvpi.IsDeferredDeleteScheduleUpcoming + } + if aisccvpi.IsRehydrate != nil { + objectMap["isRehydrate"] = aisccvpi.IsRehydrate + } + if aisccvpi.ResourceGuardOperationRequests != nil { + objectMap["resourceGuardOperationRequests"] = aisccvpi.ResourceGuardOperationRequests + } + if aisccvpi.IsArchiveEnabled != nil { + objectMap["isArchiveEnabled"] = aisccvpi.IsArchiveEnabled + } + if aisccvpi.PolicyName != nil { + objectMap["policyName"] = aisccvpi.PolicyName + } + if aisccvpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = aisccvpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return &aisccvpi, true +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return &aisccvpi, true +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem. +func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &aisccvpi, true +} + +// AzureIaaSComputeVMContainer iaaS VM workload-specific backup item representing an Azure Resource Manager +// virtual machine. +type AzureIaaSComputeVMContainer struct { + // VirtualMachineID - Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // VirtualMachineVersion - Specifies whether the container represents a Classic or an Azure Resource Manager VM. + VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` + // ResourceGroup - Resource group name of Recovery Services Vault. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ProtectableObjectType - Type of the protectable object associated with this container + ProtectableObjectType *string `json:"protectableObjectType,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaasVMContainer1', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) MarshalJSON() ([]byte, error) { + aiscvc.ContainerType = ContainerTypeMicrosoftComputevirtualMachines + objectMap := make(map[string]interface{}) + if aiscvc.VirtualMachineID != nil { + objectMap["virtualMachineId"] = aiscvc.VirtualMachineID + } + if aiscvc.VirtualMachineVersion != nil { + objectMap["virtualMachineVersion"] = aiscvc.VirtualMachineVersion + } + if aiscvc.ResourceGroup != nil { + objectMap["resourceGroup"] = aiscvc.ResourceGroup + } + if aiscvc.FriendlyName != nil { + objectMap["friendlyName"] = aiscvc.FriendlyName + } + if aiscvc.BackupManagementType != "" { + objectMap["backupManagementType"] = aiscvc.BackupManagementType + } + if aiscvc.RegistrationStatus != nil { + objectMap["registrationStatus"] = aiscvc.RegistrationStatus + } + if aiscvc.HealthStatus != nil { + objectMap["healthStatus"] = aiscvc.HealthStatus + } + if aiscvc.ProtectableObjectType != nil { + objectMap["protectableObjectType"] = aiscvc.ProtectableObjectType + } + if aiscvc.ContainerType != "" { + objectMap["containerType"] = aiscvc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return &aiscvc, true +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return &aiscvc, true +} + +// AsMabContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer. +func (aiscvc AzureIaaSComputeVMContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &aiscvc, true +} + +// AzureIaaSComputeVMProtectableItem iaaS VM workload-specific backup item representing the Azure Resource +// Manager VM. +type AzureIaaSComputeVMProtectableItem struct { + // VirtualMachineID - Fully qualified ARM ID of the virtual machine. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // VirtualMachineVersion - Specifies whether the container represents a Classic or an Azure Resource Manager VM. + VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` + // ResourceGroup - Resource group name of Recovery Services Vault. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) MarshalJSON() ([]byte, error) { + aiscvpi.ProtectableItemType = ProtectableItemTypeMicrosoftComputevirtualMachines + objectMap := make(map[string]interface{}) + if aiscvpi.VirtualMachineID != nil { + objectMap["virtualMachineId"] = aiscvpi.VirtualMachineID + } + if aiscvpi.VirtualMachineVersion != nil { + objectMap["virtualMachineVersion"] = aiscvpi.VirtualMachineVersion + } + if aiscvpi.ResourceGroup != nil { + objectMap["resourceGroup"] = aiscvpi.ResourceGroup + } + if aiscvpi.BackupManagementType != nil { + objectMap["backupManagementType"] = aiscvpi.BackupManagementType + } + if aiscvpi.WorkloadType != nil { + objectMap["workloadType"] = aiscvpi.WorkloadType + } + if aiscvpi.FriendlyName != nil { + objectMap["friendlyName"] = aiscvpi.FriendlyName + } + if aiscvpi.ProtectionState != "" { + objectMap["protectionState"] = aiscvpi.ProtectionState + } + if aiscvpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = aiscvpi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return &aiscvpi, true +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return &aiscvpi, true +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem. +func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &aiscvpi, true +} + +// AzureIaaSComputeVMProtectedItem iaaS VM workload-specific backup item representing the Azure Resource +// Manager VM. +type AzureIaaSComputeVMProtectedItem struct { + // FriendlyName - Friendly name of the VM represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // VirtualMachineID - Fully qualified ARM ID of the virtual machine represented by this item. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // HealthStatus - Health status of protected item. Possible values include: 'HealthStatusPassed', 'HealthStatusActionRequired', 'HealthStatusActionSuggested', 'HealthStatusInvalid' + HealthStatus HealthStatus `json:"healthStatus,omitempty"` + // HealthDetails - Health details on this backup item. + HealthDetails *[]AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` + // KpisHealths - Health details of different KPIs + KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` + // LastBackupStatus - Last backup operation status. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // ProtectedItemDataID - Data ID of the protected item. + ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ResourceGuardOperationRequests - ResourceGuardOperationRequests on which LAC check will be performed + ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` + // IsArchiveEnabled - Flag to identify whether datasource is protected in archive + IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + // PolicyName - Name of the policy used for protection + PolicyName *string `json:"policyName,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) MarshalJSON() ([]byte, error) { + aiscvpi.ProtectedItemType = ProtectedItemTypeMicrosoftComputevirtualMachines + objectMap := make(map[string]interface{}) + if aiscvpi.FriendlyName != nil { + objectMap["friendlyName"] = aiscvpi.FriendlyName + } + if aiscvpi.VirtualMachineID != nil { + objectMap["virtualMachineId"] = aiscvpi.VirtualMachineID + } + if aiscvpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = aiscvpi.ProtectionStatus + } + if aiscvpi.ProtectionState != "" { + objectMap["protectionState"] = aiscvpi.ProtectionState + } + if aiscvpi.HealthStatus != "" { + objectMap["healthStatus"] = aiscvpi.HealthStatus + } + if aiscvpi.HealthDetails != nil { + objectMap["healthDetails"] = aiscvpi.HealthDetails + } + if aiscvpi.KpisHealths != nil { + objectMap["kpisHealths"] = aiscvpi.KpisHealths + } + if aiscvpi.LastBackupStatus != nil { + objectMap["lastBackupStatus"] = aiscvpi.LastBackupStatus + } + if aiscvpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = aiscvpi.LastBackupTime + } + if aiscvpi.ProtectedItemDataID != nil { + objectMap["protectedItemDataId"] = aiscvpi.ProtectedItemDataID + } + if aiscvpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = aiscvpi.ExtendedInfo + } + if aiscvpi.ExtendedProperties != nil { + objectMap["extendedProperties"] = aiscvpi.ExtendedProperties + } + if aiscvpi.BackupManagementType != "" { + objectMap["backupManagementType"] = aiscvpi.BackupManagementType + } + if aiscvpi.WorkloadType != "" { + objectMap["workloadType"] = aiscvpi.WorkloadType + } + if aiscvpi.ContainerName != nil { + objectMap["containerName"] = aiscvpi.ContainerName + } + if aiscvpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = aiscvpi.SourceResourceID + } + if aiscvpi.PolicyID != nil { + objectMap["policyId"] = aiscvpi.PolicyID + } + if aiscvpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = aiscvpi.LastRecoveryPoint + } + if aiscvpi.BackupSetName != nil { + objectMap["backupSetName"] = aiscvpi.BackupSetName + } + if aiscvpi.CreateMode != "" { + objectMap["createMode"] = aiscvpi.CreateMode + } + if aiscvpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = aiscvpi.DeferredDeleteTimeInUTC + } + if aiscvpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = aiscvpi.IsScheduledForDeferredDelete + } + if aiscvpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = aiscvpi.DeferredDeleteTimeRemaining + } + if aiscvpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = aiscvpi.IsDeferredDeleteScheduleUpcoming + } + if aiscvpi.IsRehydrate != nil { + objectMap["isRehydrate"] = aiscvpi.IsRehydrate + } + if aiscvpi.ResourceGuardOperationRequests != nil { + objectMap["resourceGuardOperationRequests"] = aiscvpi.ResourceGuardOperationRequests + } + if aiscvpi.IsArchiveEnabled != nil { + objectMap["isArchiveEnabled"] = aiscvpi.IsArchiveEnabled + } + if aiscvpi.PolicyName != nil { + objectMap["policyName"] = aiscvpi.PolicyName + } + if aiscvpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = aiscvpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return &aiscvpi, true +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return &aiscvpi, true +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem. +func (aiscvpi AzureIaaSComputeVMProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &aiscvpi, true +} + +// AzureIaaSVMErrorInfo azure IaaS VM workload-specific error information. +type AzureIaaSVMErrorInfo struct { + // ErrorCode - READ-ONLY; Error code. + ErrorCode *int32 `json:"errorCode,omitempty"` + // ErrorTitle - READ-ONLY; Title: Typically, the entity that the error pertains to. + ErrorTitle *string `json:"errorTitle,omitempty"` + // ErrorString - READ-ONLY; Localized error string. + ErrorString *string `json:"errorString,omitempty"` + // Recommendations - READ-ONLY; List of localized recommendations for above error code. + Recommendations *[]string `json:"recommendations,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSVMErrorInfo. +func (aisei AzureIaaSVMErrorInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// AzureIaaSVMHealthDetails azure IaaS VM workload-specific Health Details. +type AzureIaaSVMHealthDetails struct { + // Code - READ-ONLY; Health Code + Code *int32 `json:"code,omitempty"` + // Title - READ-ONLY; Health Title + Title *string `json:"title,omitempty"` + // Message - READ-ONLY; Health Message + Message *string `json:"message,omitempty"` + // Recommendations - READ-ONLY; Health Recommended Actions + Recommendations *[]string `json:"recommendations,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSVMHealthDetails. +func (aishd AzureIaaSVMHealthDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// AzureIaaSVMJob azure IaaS VM workload-specific job object. +type AzureIaaSVMJob struct { + // Duration - Time elapsed during the execution of this job. + Duration *string `json:"duration,omitempty"` + // ActionsInfo - Gets or sets the state/actions applicable on this job like cancel/retry. + ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` + // ErrorDetails - Error details on execution of this job. + ErrorDetails *[]AzureIaaSVMErrorInfo `json:"errorDetails,omitempty"` + // VirtualMachineVersion - Specifies whether the backup item is a Classic or an Azure Resource Manager VM. + VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` + // ExtendedInfo - Additional information for this job. + ExtendedInfo *AzureIaaSVMJobExtendedInfo `json:"extendedInfo,omitempty"` + // ContainerName - Container name of the entity on which the current job is executing. + ContainerName *string `json:"containerName,omitempty"` + // IsUserTriggered - Indicated that whether the job is adhoc(true) or scheduled(false) + IsUserTriggered *bool `json:"isUserTriggered,omitempty"` + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureIaaSVMJobV2', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob', 'JobTypeVaultJob' + JobType JobType `json:"jobType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSVMJob. +func (aisj AzureIaaSVMJob) MarshalJSON() ([]byte, error) { + aisj.JobType = JobTypeAzureIaaSVMJob + objectMap := make(map[string]interface{}) + if aisj.Duration != nil { + objectMap["duration"] = aisj.Duration + } + if aisj.ActionsInfo != nil { + objectMap["actionsInfo"] = aisj.ActionsInfo + } + if aisj.ErrorDetails != nil { + objectMap["errorDetails"] = aisj.ErrorDetails + } + if aisj.VirtualMachineVersion != nil { + objectMap["virtualMachineVersion"] = aisj.VirtualMachineVersion + } + if aisj.ExtendedInfo != nil { + objectMap["extendedInfo"] = aisj.ExtendedInfo + } + if aisj.ContainerName != nil { + objectMap["containerName"] = aisj.ContainerName + } + if aisj.IsUserTriggered != nil { + objectMap["isUserTriggered"] = aisj.IsUserTriggered + } + if aisj.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = aisj.EntityFriendlyName + } + if aisj.BackupManagementType != "" { + objectMap["backupManagementType"] = aisj.BackupManagementType + } + if aisj.Operation != nil { + objectMap["operation"] = aisj.Operation + } + if aisj.Status != nil { + objectMap["status"] = aisj.Status + } + if aisj.StartTime != nil { + objectMap["startTime"] = aisj.StartTime + } + if aisj.EndTime != nil { + objectMap["endTime"] = aisj.EndTime + } + if aisj.ActivityID != nil { + objectMap["activityId"] = aisj.ActivityID + } + if aisj.JobType != "" { + objectMap["jobType"] = aisj.JobType + } + return json.Marshal(objectMap) +} + +// AsAzureIaaSVMJob is the BasicJob implementation for AzureIaaSVMJob. +func (aisj AzureIaaSVMJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { + return &aisj, true +} + +// AsAzureIaaSVMJobV2 is the BasicJob implementation for AzureIaaSVMJob. +func (aisj AzureIaaSVMJob) AsAzureIaaSVMJobV2() (*AzureIaaSVMJobV2, bool) { + return nil, false +} + +// AsAzureStorageJob is the BasicJob implementation for AzureIaaSVMJob. +func (aisj AzureIaaSVMJob) AsAzureStorageJob() (*AzureStorageJob, bool) { + return nil, false +} + +// AsAzureWorkloadJob is the BasicJob implementation for AzureIaaSVMJob. +func (aisj AzureIaaSVMJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { + return nil, false +} + +// AsDpmJob is the BasicJob implementation for AzureIaaSVMJob. +func (aisj AzureIaaSVMJob) AsDpmJob() (*DpmJob, bool) { + return nil, false +} + +// AsMabJob is the BasicJob implementation for AzureIaaSVMJob. +func (aisj AzureIaaSVMJob) AsMabJob() (*MabJob, bool) { + return nil, false +} + +// AsVaultJob is the BasicJob implementation for AzureIaaSVMJob. +func (aisj AzureIaaSVMJob) AsVaultJob() (*VaultJob, bool) { + return nil, false +} + +// AsJob is the BasicJob implementation for AzureIaaSVMJob. +func (aisj AzureIaaSVMJob) AsJob() (*Job, bool) { + return nil, false +} + +// AsBasicJob is the BasicJob implementation for AzureIaaSVMJob. +func (aisj AzureIaaSVMJob) AsBasicJob() (BasicJob, bool) { + return &aisj, true +} + +// AzureIaaSVMJobExtendedInfo azure IaaS VM workload-specific additional information for job. +type AzureIaaSVMJobExtendedInfo struct { + // TasksList - List of tasks associated with this job. + TasksList *[]AzureIaaSVMJobTaskDetails `json:"tasksList,omitempty"` + // PropertyBag - Job properties. + PropertyBag map[string]*string `json:"propertyBag"` + // InternalPropertyBag - Job internal properties. + InternalPropertyBag map[string]*string `json:"internalPropertyBag"` + // ProgressPercentage - Indicates progress of the job. Null if it has not started or completed. + ProgressPercentage *float64 `json:"progressPercentage,omitempty"` + // EstimatedRemainingDuration - Time remaining for execution of this job. + EstimatedRemainingDuration *string `json:"estimatedRemainingDuration,omitempty"` + // DynamicErrorMessage - Non localized error message on job execution. + DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSVMJobExtendedInfo. +func (aisjei AzureIaaSVMJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aisjei.TasksList != nil { + objectMap["tasksList"] = aisjei.TasksList + } + if aisjei.PropertyBag != nil { + objectMap["propertyBag"] = aisjei.PropertyBag + } + if aisjei.InternalPropertyBag != nil { + objectMap["internalPropertyBag"] = aisjei.InternalPropertyBag + } + if aisjei.ProgressPercentage != nil { + objectMap["progressPercentage"] = aisjei.ProgressPercentage + } + if aisjei.EstimatedRemainingDuration != nil { + objectMap["estimatedRemainingDuration"] = aisjei.EstimatedRemainingDuration + } + if aisjei.DynamicErrorMessage != nil { + objectMap["dynamicErrorMessage"] = aisjei.DynamicErrorMessage + } + return json.Marshal(objectMap) +} + +// AzureIaaSVMJobTaskDetails azure IaaS VM workload-specific job task details. +type AzureIaaSVMJobTaskDetails struct { + // TaskID - The task display name. + TaskID *string `json:"taskId,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // InstanceID - The instanceId. + InstanceID *string `json:"instanceId,omitempty"` + // Duration - Time elapsed for task. + Duration *string `json:"duration,omitempty"` + // Status - The status. + Status *string `json:"status,omitempty"` + // ProgressPercentage - Progress of the task. + ProgressPercentage *float64 `json:"progressPercentage,omitempty"` + // TaskExecutionDetails - Details about execution of the task. + // eg: number of bytes transferred etc + TaskExecutionDetails *string `json:"taskExecutionDetails,omitempty"` +} + +// AzureIaaSVMJobV2 azure IaaS VM workload-specific job object. +type AzureIaaSVMJobV2 struct { + // ActionsInfo - Gets or sets the state/actions applicable on this job like cancel/retry. + ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` + // ContainerName - Container name of the entity on which the current job is executing. + ContainerName *string `json:"containerName,omitempty"` + // Duration - Time elapsed during the execution of this job. + Duration *string `json:"duration,omitempty"` + // ErrorDetails - Error details on execution of this job. + ErrorDetails *[]AzureIaaSVMErrorInfo `json:"errorDetails,omitempty"` + // VirtualMachineVersion - Specifies whether the backup item is a Classic or an Azure Resource Manager VM. + VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` + // ExtendedInfo - Additional information for this job. + ExtendedInfo *AzureIaaSVMJobExtendedInfo `json:"extendedInfo,omitempty"` + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureIaaSVMJobV2', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob', 'JobTypeVaultJob' + JobType JobType `json:"jobType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSVMJobV2. +func (aisjv AzureIaaSVMJobV2) MarshalJSON() ([]byte, error) { + aisjv.JobType = JobTypeAzureIaaSVMJobV2 + objectMap := make(map[string]interface{}) + if aisjv.ActionsInfo != nil { + objectMap["actionsInfo"] = aisjv.ActionsInfo + } + if aisjv.ContainerName != nil { + objectMap["containerName"] = aisjv.ContainerName + } + if aisjv.Duration != nil { + objectMap["duration"] = aisjv.Duration + } + if aisjv.ErrorDetails != nil { + objectMap["errorDetails"] = aisjv.ErrorDetails + } + if aisjv.VirtualMachineVersion != nil { + objectMap["virtualMachineVersion"] = aisjv.VirtualMachineVersion + } + if aisjv.ExtendedInfo != nil { + objectMap["extendedInfo"] = aisjv.ExtendedInfo + } + if aisjv.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = aisjv.EntityFriendlyName + } + if aisjv.BackupManagementType != "" { + objectMap["backupManagementType"] = aisjv.BackupManagementType + } + if aisjv.Operation != nil { + objectMap["operation"] = aisjv.Operation + } + if aisjv.Status != nil { + objectMap["status"] = aisjv.Status + } + if aisjv.StartTime != nil { + objectMap["startTime"] = aisjv.StartTime + } + if aisjv.EndTime != nil { + objectMap["endTime"] = aisjv.EndTime + } + if aisjv.ActivityID != nil { + objectMap["activityId"] = aisjv.ActivityID + } + if aisjv.JobType != "" { + objectMap["jobType"] = aisjv.JobType + } + return json.Marshal(objectMap) +} + +// AsAzureIaaSVMJob is the BasicJob implementation for AzureIaaSVMJobV2. +func (aisjv AzureIaaSVMJobV2) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { + return nil, false +} + +// AsAzureIaaSVMJobV2 is the BasicJob implementation for AzureIaaSVMJobV2. +func (aisjv AzureIaaSVMJobV2) AsAzureIaaSVMJobV2() (*AzureIaaSVMJobV2, bool) { + return &aisjv, true +} + +// AsAzureStorageJob is the BasicJob implementation for AzureIaaSVMJobV2. +func (aisjv AzureIaaSVMJobV2) AsAzureStorageJob() (*AzureStorageJob, bool) { + return nil, false +} + +// AsAzureWorkloadJob is the BasicJob implementation for AzureIaaSVMJobV2. +func (aisjv AzureIaaSVMJobV2) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { + return nil, false +} + +// AsDpmJob is the BasicJob implementation for AzureIaaSVMJobV2. +func (aisjv AzureIaaSVMJobV2) AsDpmJob() (*DpmJob, bool) { + return nil, false +} + +// AsMabJob is the BasicJob implementation for AzureIaaSVMJobV2. +func (aisjv AzureIaaSVMJobV2) AsMabJob() (*MabJob, bool) { + return nil, false +} + +// AsVaultJob is the BasicJob implementation for AzureIaaSVMJobV2. +func (aisjv AzureIaaSVMJobV2) AsVaultJob() (*VaultJob, bool) { + return nil, false +} + +// AsJob is the BasicJob implementation for AzureIaaSVMJobV2. +func (aisjv AzureIaaSVMJobV2) AsJob() (*Job, bool) { + return nil, false +} + +// AsBasicJob is the BasicJob implementation for AzureIaaSVMJobV2. +func (aisjv AzureIaaSVMJobV2) AsBasicJob() (BasicJob, bool) { + return &aisjv, true +} + +// BasicAzureIaaSVMProtectedItem iaaS VM workload-specific backup item. +type BasicAzureIaaSVMProtectedItem interface { + AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) + AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) + AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) +} + +// AzureIaaSVMProtectedItem iaaS VM workload-specific backup item. +type AzureIaaSVMProtectedItem struct { + // FriendlyName - Friendly name of the VM represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // VirtualMachineID - Fully qualified ARM ID of the virtual machine represented by this item. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // HealthStatus - Health status of protected item. Possible values include: 'HealthStatusPassed', 'HealthStatusActionRequired', 'HealthStatusActionSuggested', 'HealthStatusInvalid' + HealthStatus HealthStatus `json:"healthStatus,omitempty"` + // HealthDetails - Health details on this backup item. + HealthDetails *[]AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` + // KpisHealths - Health details of different KPIs + KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` + // LastBackupStatus - Last backup operation status. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // ProtectedItemDataID - Data ID of the protected item. + ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ResourceGuardOperationRequests - ResourceGuardOperationRequests on which LAC check will be performed + ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` + // IsArchiveEnabled - Flag to identify whether datasource is protected in archive + IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + // PolicyName - Name of the policy used for protection + PolicyName *string `json:"policyName,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +func unmarshalBasicAzureIaaSVMProtectedItem(body []byte) (BasicAzureIaaSVMProtectedItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectedItemType"] { + case string(ProtectedItemTypeMicrosoftClassicComputevirtualMachines): + var aisccvpi AzureIaaSClassicComputeVMProtectedItem + err := json.Unmarshal(body, &aisccvpi) + return aisccvpi, err + case string(ProtectedItemTypeMicrosoftComputevirtualMachines): + var aiscvpi AzureIaaSComputeVMProtectedItem + err := json.Unmarshal(body, &aiscvpi) + return aiscvpi, err + default: + var aispi AzureIaaSVMProtectedItem + err := json.Unmarshal(body, &aispi) + return aispi, err + } +} +func unmarshalBasicAzureIaaSVMProtectedItemArray(body []byte) ([]BasicAzureIaaSVMProtectedItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + aispiArray := make([]BasicAzureIaaSVMProtectedItem, len(rawMessages)) + + for index, rawMessage := range rawMessages { + aispi, err := unmarshalBasicAzureIaaSVMProtectedItem(*rawMessage) + if err != nil { + return nil, err + } + aispiArray[index] = aispi + } + return aispiArray, nil +} + +// MarshalJSON is the custom marshaler for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) MarshalJSON() ([]byte, error) { + aispi.ProtectedItemType = ProtectedItemTypeAzureIaaSVMProtectedItem + objectMap := make(map[string]interface{}) + if aispi.FriendlyName != nil { + objectMap["friendlyName"] = aispi.FriendlyName + } + if aispi.VirtualMachineID != nil { + objectMap["virtualMachineId"] = aispi.VirtualMachineID + } + if aispi.ProtectionStatus != nil { + objectMap["protectionStatus"] = aispi.ProtectionStatus + } + if aispi.ProtectionState != "" { + objectMap["protectionState"] = aispi.ProtectionState + } + if aispi.HealthStatus != "" { + objectMap["healthStatus"] = aispi.HealthStatus + } + if aispi.HealthDetails != nil { + objectMap["healthDetails"] = aispi.HealthDetails + } + if aispi.KpisHealths != nil { + objectMap["kpisHealths"] = aispi.KpisHealths + } + if aispi.LastBackupStatus != nil { + objectMap["lastBackupStatus"] = aispi.LastBackupStatus + } + if aispi.LastBackupTime != nil { + objectMap["lastBackupTime"] = aispi.LastBackupTime + } + if aispi.ProtectedItemDataID != nil { + objectMap["protectedItemDataId"] = aispi.ProtectedItemDataID + } + if aispi.ExtendedInfo != nil { + objectMap["extendedInfo"] = aispi.ExtendedInfo + } + if aispi.ExtendedProperties != nil { + objectMap["extendedProperties"] = aispi.ExtendedProperties + } + if aispi.BackupManagementType != "" { + objectMap["backupManagementType"] = aispi.BackupManagementType + } + if aispi.WorkloadType != "" { + objectMap["workloadType"] = aispi.WorkloadType + } + if aispi.ContainerName != nil { + objectMap["containerName"] = aispi.ContainerName + } + if aispi.SourceResourceID != nil { + objectMap["sourceResourceId"] = aispi.SourceResourceID + } + if aispi.PolicyID != nil { + objectMap["policyId"] = aispi.PolicyID + } + if aispi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = aispi.LastRecoveryPoint + } + if aispi.BackupSetName != nil { + objectMap["backupSetName"] = aispi.BackupSetName + } + if aispi.CreateMode != "" { + objectMap["createMode"] = aispi.CreateMode + } + if aispi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = aispi.DeferredDeleteTimeInUTC + } + if aispi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = aispi.IsScheduledForDeferredDelete + } + if aispi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = aispi.DeferredDeleteTimeRemaining + } + if aispi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = aispi.IsDeferredDeleteScheduleUpcoming + } + if aispi.IsRehydrate != nil { + objectMap["isRehydrate"] = aispi.IsRehydrate + } + if aispi.ResourceGuardOperationRequests != nil { + objectMap["resourceGuardOperationRequests"] = aispi.ResourceGuardOperationRequests + } + if aispi.IsArchiveEnabled != nil { + objectMap["isArchiveEnabled"] = aispi.IsArchiveEnabled + } + if aispi.PolicyName != nil { + objectMap["policyName"] = aispi.PolicyName + } + if aispi.ProtectedItemType != "" { + objectMap["protectedItemType"] = aispi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return &aispi, true +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return &aispi, true +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem. +func (aispi AzureIaaSVMProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &aispi, true +} + +// AzureIaaSVMProtectedItemExtendedInfo additional information on Azure IaaS VM specific backup item. +type AzureIaaSVMProtectedItemExtendedInfo struct { + // OldestRecoveryPoint - The oldest backup copy available for this backup item. + OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` + // RecoveryPointCount - Number of backup copies available for this backup item. + RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` + // PolicyInconsistent - Specifies if backup policy associated with the backup item is inconsistent. + PolicyInconsistent *bool `json:"policyInconsistent,omitempty"` +} + +// AzureIaaSVMProtectionPolicy iaaS VM workload-specific backup policy. +type AzureIaaSVMProtectionPolicy struct { + InstantRPDetails *InstantRPAdditionalDetails `json:"instantRPDetails,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. + RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` + // InstantRpRetentionRangeInDays - Instant RP retention policy range in days + InstantRpRetentionRangeInDays *int32 `json:"instantRpRetentionRangeInDays,omitempty"` + // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + TimeZone *string `json:"timeZone,omitempty"` + // PolicyType - Possible values include: 'IAASVMPolicyTypeInvalid', 'IAASVMPolicyTypeV1', 'IAASVMPolicyTypeV2' + PolicyType IAASVMPolicyType `json:"policyType,omitempty"` + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // ResourceGuardOperationRequests - ResourceGuard Operation Requests + ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) MarshalJSON() ([]byte, error) { + aispp.BackupManagementType = BackupManagementTypeAzureIaasVM + objectMap := make(map[string]interface{}) + if aispp.InstantRPDetails != nil { + objectMap["instantRPDetails"] = aispp.InstantRPDetails + } + objectMap["schedulePolicy"] = aispp.SchedulePolicy + objectMap["retentionPolicy"] = aispp.RetentionPolicy + if aispp.InstantRpRetentionRangeInDays != nil { + objectMap["instantRpRetentionRangeInDays"] = aispp.InstantRpRetentionRangeInDays + } + if aispp.TimeZone != nil { + objectMap["timeZone"] = aispp.TimeZone + } + if aispp.PolicyType != "" { + objectMap["policyType"] = aispp.PolicyType + } + if aispp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = aispp.ProtectedItemsCount + } + if aispp.ResourceGuardOperationRequests != nil { + objectMap["resourceGuardOperationRequests"] = aispp.ResourceGuardOperationRequests + } + if aispp.BackupManagementType != "" { + objectMap["backupManagementType"] = aispp.BackupManagementType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return nil, false +} + +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { + return &aispp, true +} + +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { + return nil, false +} + +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { + return nil, false +} + +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { + return nil, false +} + +// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { + return nil, false +} + +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy. +func (aispp AzureIaaSVMProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &aispp, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureIaaSVMProtectionPolicy struct. +func (aispp *AzureIaaSVMProtectionPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "instantRPDetails": + if v != nil { + var instantRPDetails InstantRPAdditionalDetails + err = json.Unmarshal(*v, &instantRPDetails) + if err != nil { + return err + } + aispp.InstantRPDetails = &instantRPDetails + } + case "schedulePolicy": + if v != nil { + schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) + if err != nil { + return err + } + aispp.SchedulePolicy = schedulePolicy + } + case "retentionPolicy": + if v != nil { + retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) + if err != nil { + return err + } + aispp.RetentionPolicy = retentionPolicy + } + case "instantRpRetentionRangeInDays": + if v != nil { + var instantRpRetentionRangeInDays int32 + err = json.Unmarshal(*v, &instantRpRetentionRangeInDays) + if err != nil { + return err + } + aispp.InstantRpRetentionRangeInDays = &instantRpRetentionRangeInDays + } + case "timeZone": + if v != nil { + var timeZone string + err = json.Unmarshal(*v, &timeZone) + if err != nil { + return err + } + aispp.TimeZone = &timeZone + } + case "policyType": + if v != nil { + var policyType IAASVMPolicyType + err = json.Unmarshal(*v, &policyType) + if err != nil { + return err + } + aispp.PolicyType = policyType + } + case "protectedItemsCount": + if v != nil { + var protectedItemsCount int32 + err = json.Unmarshal(*v, &protectedItemsCount) + if err != nil { + return err + } + aispp.ProtectedItemsCount = &protectedItemsCount + } + case "resourceGuardOperationRequests": + if v != nil { + var resourceGuardOperationRequests []string + err = json.Unmarshal(*v, &resourceGuardOperationRequests) + if err != nil { + return err + } + aispp.ResourceGuardOperationRequests = &resourceGuardOperationRequests + } + case "backupManagementType": + if v != nil { + var backupManagementType ManagementTypeBasicProtectionPolicy + err = json.Unmarshal(*v, &backupManagementType) + if err != nil { + return err + } + aispp.BackupManagementType = backupManagementType + } + } + } + + return nil +} + +// BasicAzureRecoveryServiceVaultProtectionIntent azure Recovery Services Vault specific protection intent item. +type BasicAzureRecoveryServiceVaultProtectionIntent interface { + AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) + AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) + AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) + AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) +} + +// AzureRecoveryServiceVaultProtectionIntent azure Recovery Services Vault specific protection intent item. +type AzureRecoveryServiceVaultProtectionIntent struct { + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId + ItemID *string `json:"itemId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadContainerAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' + ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` +} + +func unmarshalBasicAzureRecoveryServiceVaultProtectionIntent(body []byte) (BasicAzureRecoveryServiceVaultProtectionIntent, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectionIntentItemType"] { + case string(ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent): + var awapi AzureWorkloadAutoProtectionIntent + err := json.Unmarshal(body, &awapi) + return awapi, err + case string(ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent): + var awsapi AzureWorkloadSQLAutoProtectionIntent + err := json.Unmarshal(body, &awsapi) + return awsapi, err + default: + var arsvpi AzureRecoveryServiceVaultProtectionIntent + err := json.Unmarshal(body, &arsvpi) + return arsvpi, err + } +} +func unmarshalBasicAzureRecoveryServiceVaultProtectionIntentArray(body []byte) ([]BasicAzureRecoveryServiceVaultProtectionIntent, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + arsvpiArray := make([]BasicAzureRecoveryServiceVaultProtectionIntent, len(rawMessages)) + + for index, rawMessage := range rawMessages { + arsvpi, err := unmarshalBasicAzureRecoveryServiceVaultProtectionIntent(*rawMessage) + if err != nil { + return nil, err + } + arsvpiArray[index] = arsvpi + } + return arsvpiArray, nil +} + +// MarshalJSON is the custom marshaler for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) MarshalJSON() ([]byte, error) { + arsvpi.ProtectionIntentItemType = ProtectionIntentItemTypeRecoveryServiceVaultItem + objectMap := make(map[string]interface{}) + if arsvpi.BackupManagementType != "" { + objectMap["backupManagementType"] = arsvpi.BackupManagementType + } + if arsvpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = arsvpi.SourceResourceID + } + if arsvpi.ItemID != nil { + objectMap["itemId"] = arsvpi.ItemID + } + if arsvpi.PolicyID != nil { + objectMap["policyId"] = arsvpi.PolicyID + } + if arsvpi.ProtectionState != "" { + objectMap["protectionState"] = arsvpi.ProtectionState + } + if arsvpi.ProtectionIntentItemType != "" { + objectMap["protectionIntentItemType"] = arsvpi.ProtectionIntentItemType + } + return json.Marshal(objectMap) +} + +// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { + return &arsvpi, true +} + +// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { + return &arsvpi, true +} + +// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { + return nil, false +} + +// AsAzureWorkloadContainerAutoProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureWorkloadContainerAutoProtectionIntent() (*AzureWorkloadContainerAutoProtectionIntent, bool) { + return nil, false +} + +// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { + return nil, false +} + +// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { + return nil, false +} + +// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { + return nil, false +} + +// AsProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { + return nil, false +} + +// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureRecoveryServiceVaultProtectionIntent. +func (arsvpi AzureRecoveryServiceVaultProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { + return &arsvpi, true +} + +// AzureResourceProtectionIntent iaaS VM specific backup protection intent item. +type AzureResourceProtectionIntent struct { + // FriendlyName - Friendly name of the VM represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId + ItemID *string `json:"itemId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadContainerAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' + ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureResourceProtectionIntent. +func (arpi AzureResourceProtectionIntent) MarshalJSON() ([]byte, error) { + arpi.ProtectionIntentItemType = ProtectionIntentItemTypeAzureResourceItem + objectMap := make(map[string]interface{}) + if arpi.FriendlyName != nil { + objectMap["friendlyName"] = arpi.FriendlyName + } + if arpi.BackupManagementType != "" { + objectMap["backupManagementType"] = arpi.BackupManagementType + } + if arpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = arpi.SourceResourceID + } + if arpi.ItemID != nil { + objectMap["itemId"] = arpi.ItemID + } + if arpi.PolicyID != nil { + objectMap["policyId"] = arpi.PolicyID + } + if arpi.ProtectionState != "" { + objectMap["protectionState"] = arpi.ProtectionState + } + if arpi.ProtectionIntentItemType != "" { + objectMap["protectionIntentItemType"] = arpi.ProtectionIntentItemType + } + return json.Marshal(objectMap) +} + +// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. +func (arpi AzureResourceProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { + return nil, false +} + +// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. +func (arpi AzureResourceProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { + return nil, false +} + +// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. +func (arpi AzureResourceProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { + return &arpi, true +} + +// AsAzureWorkloadContainerAutoProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. +func (arpi AzureResourceProtectionIntent) AsAzureWorkloadContainerAutoProtectionIntent() (*AzureWorkloadContainerAutoProtectionIntent, bool) { + return nil, false +} + +// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. +func (arpi AzureResourceProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { + return nil, false +} + +// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. +func (arpi AzureResourceProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { + return nil, false +} + +// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. +func (arpi AzureResourceProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { + return nil, false +} + +// AsProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. +func (arpi AzureResourceProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { + return nil, false +} + +// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureResourceProtectionIntent. +func (arpi AzureResourceProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { + return &arpi, true +} + +// AzureSQLAGWorkloadContainerProtectionContainer container for SQL workloads under SQL Availability Group. +type AzureSQLAGWorkloadContainerProtectionContainer struct { + // SourceResourceID - ARM ID of the virtual machine represented by this Azure Workload Container + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // LastUpdatedTime - Time stamp when this container was updated. + LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` + // ExtendedInfo - Additional details of a workload container. + ExtendedInfo *AzureWorkloadContainerExtendedInfo `json:"extendedInfo,omitempty"` + // WorkloadType - Workload type for which registration was sent. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` + // OperationType - Re-Do Operation. Possible values include: 'OperationTypeInvalid', 'OperationTypeRegister', 'OperationTypeReregister' + OperationType OperationType `json:"operationType,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ProtectableObjectType - Type of the protectable object associated with this container + ProtectableObjectType *string `json:"protectableObjectType,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaasVMContainer1', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) MarshalJSON() ([]byte, error) { + aswcpc.ContainerType = ContainerTypeSQLAGWorkLoadContainer1 + objectMap := make(map[string]interface{}) + if aswcpc.SourceResourceID != nil { + objectMap["sourceResourceId"] = aswcpc.SourceResourceID + } + if aswcpc.LastUpdatedTime != nil { + objectMap["lastUpdatedTime"] = aswcpc.LastUpdatedTime + } + if aswcpc.ExtendedInfo != nil { + objectMap["extendedInfo"] = aswcpc.ExtendedInfo + } + if aswcpc.WorkloadType != "" { + objectMap["workloadType"] = aswcpc.WorkloadType + } + if aswcpc.OperationType != "" { + objectMap["operationType"] = aswcpc.OperationType + } + if aswcpc.FriendlyName != nil { + objectMap["friendlyName"] = aswcpc.FriendlyName + } + if aswcpc.BackupManagementType != "" { + objectMap["backupManagementType"] = aswcpc.BackupManagementType + } + if aswcpc.RegistrationStatus != nil { + objectMap["registrationStatus"] = aswcpc.RegistrationStatus + } + if aswcpc.HealthStatus != nil { + objectMap["healthStatus"] = aswcpc.HealthStatus + } + if aswcpc.ProtectableObjectType != nil { + objectMap["protectableObjectType"] = aswcpc.ProtectableObjectType + } + if aswcpc.ContainerType != "" { + objectMap["containerType"] = aswcpc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return &aswcpc, true +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return &aswcpc, true +} + +// AsDpmContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureSQLAGWorkloadContainerProtectionContainer. +func (aswcpc AzureSQLAGWorkloadContainerProtectionContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &aswcpc, true +} + +// AzureSQLContainer azure Sql workload-specific container. +type AzureSQLContainer struct { + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ProtectableObjectType - Type of the protectable object associated with this container + ProtectableObjectType *string `json:"protectableObjectType,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaasVMContainer1', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureSQLContainer. +func (asc AzureSQLContainer) MarshalJSON() ([]byte, error) { + asc.ContainerType = ContainerTypeAzureSQLContainer1 + objectMap := make(map[string]interface{}) + if asc.FriendlyName != nil { + objectMap["friendlyName"] = asc.FriendlyName + } + if asc.BackupManagementType != "" { + objectMap["backupManagementType"] = asc.BackupManagementType + } + if asc.RegistrationStatus != nil { + objectMap["registrationStatus"] = asc.RegistrationStatus + } + if asc.HealthStatus != nil { + objectMap["healthStatus"] = asc.HealthStatus + } + if asc.ProtectableObjectType != nil { + objectMap["protectableObjectType"] = asc.ProtectableObjectType + } + if asc.ContainerType != "" { + objectMap["containerType"] = asc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return &asc, true +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer. +func (asc AzureSQLContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &asc, true +} + +// AzureSQLProtectedItem azure SQL workload-specific backup item. +type AzureSQLProtectedItem struct { + // ProtectedItemDataID - Internal ID of a backup item. Used by Azure SQL Backup engine to contact Recovery Services. + ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` + // ProtectionState - Backup state of the backed up item. Possible values include: 'ProtectedItemStateInvalid', 'ProtectedItemStateIRPending', 'ProtectedItemStateProtected', 'ProtectedItemStateProtectionError', 'ProtectedItemStateProtectionStopped', 'ProtectedItemStateProtectionPaused' + ProtectionState ProtectedItemState `json:"protectionState,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureSQLProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ResourceGuardOperationRequests - ResourceGuardOperationRequests on which LAC check will be performed + ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` + // IsArchiveEnabled - Flag to identify whether datasource is protected in archive + IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + // PolicyName - Name of the policy used for protection + PolicyName *string `json:"policyName,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) MarshalJSON() ([]byte, error) { + aspi.ProtectedItemType = ProtectedItemTypeMicrosoftSqlserversdatabases + objectMap := make(map[string]interface{}) + if aspi.ProtectedItemDataID != nil { + objectMap["protectedItemDataId"] = aspi.ProtectedItemDataID + } + if aspi.ProtectionState != "" { + objectMap["protectionState"] = aspi.ProtectionState + } + if aspi.ExtendedInfo != nil { + objectMap["extendedInfo"] = aspi.ExtendedInfo + } + if aspi.BackupManagementType != "" { + objectMap["backupManagementType"] = aspi.BackupManagementType + } + if aspi.WorkloadType != "" { + objectMap["workloadType"] = aspi.WorkloadType + } + if aspi.ContainerName != nil { + objectMap["containerName"] = aspi.ContainerName + } + if aspi.SourceResourceID != nil { + objectMap["sourceResourceId"] = aspi.SourceResourceID + } + if aspi.PolicyID != nil { + objectMap["policyId"] = aspi.PolicyID + } + if aspi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = aspi.LastRecoveryPoint + } + if aspi.BackupSetName != nil { + objectMap["backupSetName"] = aspi.BackupSetName + } + if aspi.CreateMode != "" { + objectMap["createMode"] = aspi.CreateMode + } + if aspi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = aspi.DeferredDeleteTimeInUTC + } + if aspi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = aspi.IsScheduledForDeferredDelete + } + if aspi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = aspi.DeferredDeleteTimeRemaining + } + if aspi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = aspi.IsDeferredDeleteScheduleUpcoming + } + if aspi.IsRehydrate != nil { + objectMap["isRehydrate"] = aspi.IsRehydrate + } + if aspi.ResourceGuardOperationRequests != nil { + objectMap["resourceGuardOperationRequests"] = aspi.ResourceGuardOperationRequests + } + if aspi.IsArchiveEnabled != nil { + objectMap["isArchiveEnabled"] = aspi.IsArchiveEnabled + } + if aspi.PolicyName != nil { + objectMap["policyName"] = aspi.PolicyName + } + if aspi.ProtectedItemType != "" { + objectMap["protectedItemType"] = aspi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return &aspi, true +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem. +func (aspi AzureSQLProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &aspi, true +} + +// AzureSQLProtectedItemExtendedInfo additional information on Azure Sql specific protected item. +type AzureSQLProtectedItemExtendedInfo struct { + // OldestRecoveryPoint - The oldest backup copy available for this item in the service. + OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` + // RecoveryPointCount - Number of available backup copies associated with this backup item. + RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` + // PolicyState - State of the backup policy associated with this backup item. + PolicyState *string `json:"policyState,omitempty"` +} + +// AzureSQLProtectionPolicy azure SQL workload-specific backup policy. +type AzureSQLProtectionPolicy struct { + // RetentionPolicy - Retention policy details. + RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // ResourceGuardOperationRequests - ResourceGuard Operation Requests + ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) MarshalJSON() ([]byte, error) { + aspp.BackupManagementType = BackupManagementTypeAzureSQL + objectMap := make(map[string]interface{}) + objectMap["retentionPolicy"] = aspp.RetentionPolicy + if aspp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = aspp.ProtectedItemsCount + } + if aspp.ResourceGuardOperationRequests != nil { + objectMap["resourceGuardOperationRequests"] = aspp.ResourceGuardOperationRequests + } + if aspp.BackupManagementType != "" { + objectMap["backupManagementType"] = aspp.BackupManagementType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return nil, false +} + +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { + return nil, false +} + +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { + return &aspp, true +} + +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { + return nil, false +} + +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { + return nil, false +} + +// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { + return nil, false +} + +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy. +func (aspp AzureSQLProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &aspp, true +} + +// UnmarshalJSON is the custom unmarshaler for AzureSQLProtectionPolicy struct. +func (aspp *AzureSQLProtectionPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "retentionPolicy": + if v != nil { + retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) + if err != nil { + return err + } + aspp.RetentionPolicy = retentionPolicy + } + case "protectedItemsCount": + if v != nil { + var protectedItemsCount int32 + err = json.Unmarshal(*v, &protectedItemsCount) + if err != nil { + return err + } + aspp.ProtectedItemsCount = &protectedItemsCount + } + case "resourceGuardOperationRequests": + if v != nil { + var resourceGuardOperationRequests []string + err = json.Unmarshal(*v, &resourceGuardOperationRequests) + if err != nil { + return err + } + aspp.ResourceGuardOperationRequests = &resourceGuardOperationRequests + } + case "backupManagementType": + if v != nil { + var backupManagementType ManagementTypeBasicProtectionPolicy + err = json.Unmarshal(*v, &backupManagementType) + if err != nil { + return err + } + aspp.BackupManagementType = backupManagementType + } + } + } + + return nil +} + +// AzureStorageContainer azure Storage Account workload-specific container. +type AzureStorageContainer struct { + // SourceResourceID - Fully qualified ARM url. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // StorageAccountVersion - Storage account version. + StorageAccountVersion *string `json:"storageAccountVersion,omitempty"` + // ResourceGroup - Resource group name of Recovery Services Vault. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // ProtectedItemCount - Number of items backed up in this container. + ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` + // AcquireStorageAccountLock - Whether storage account lock is to be acquired for this container or not. Possible values include: 'Acquire', 'NotAcquire' + AcquireStorageAccountLock AcquireStorageAccountLock `json:"acquireStorageAccountLock,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ProtectableObjectType - Type of the protectable object associated with this container + ProtectableObjectType *string `json:"protectableObjectType,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaasVMContainer1', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureStorageContainer. +func (asc AzureStorageContainer) MarshalJSON() ([]byte, error) { + asc.ContainerType = ContainerTypeStorageContainer1 + objectMap := make(map[string]interface{}) + if asc.SourceResourceID != nil { + objectMap["sourceResourceId"] = asc.SourceResourceID + } + if asc.StorageAccountVersion != nil { + objectMap["storageAccountVersion"] = asc.StorageAccountVersion + } + if asc.ResourceGroup != nil { + objectMap["resourceGroup"] = asc.ResourceGroup + } + if asc.ProtectedItemCount != nil { + objectMap["protectedItemCount"] = asc.ProtectedItemCount + } + if asc.AcquireStorageAccountLock != "" { + objectMap["acquireStorageAccountLock"] = asc.AcquireStorageAccountLock + } + if asc.FriendlyName != nil { + objectMap["friendlyName"] = asc.FriendlyName + } + if asc.BackupManagementType != "" { + objectMap["backupManagementType"] = asc.BackupManagementType + } + if asc.RegistrationStatus != nil { + objectMap["registrationStatus"] = asc.RegistrationStatus + } + if asc.HealthStatus != nil { + objectMap["healthStatus"] = asc.HealthStatus + } + if asc.ProtectableObjectType != nil { + objectMap["protectableObjectType"] = asc.ProtectableObjectType + } + if asc.ContainerType != "" { + objectMap["containerType"] = asc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return &asc, true +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureStorageContainer. +func (asc AzureStorageContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &asc, true +} + +// AzureStorageErrorInfo azure storage specific error information +type AzureStorageErrorInfo struct { + // ErrorCode - Error code. + ErrorCode *int32 `json:"errorCode,omitempty"` + // ErrorString - Localized error string. + ErrorString *string `json:"errorString,omitempty"` + // Recommendations - List of localized recommendations for above error code. + Recommendations *[]string `json:"recommendations,omitempty"` +} + +// AzureStorageJob azure storage specific job. +type AzureStorageJob struct { + // Duration - Time elapsed during the execution of this job. + Duration *string `json:"duration,omitempty"` + // ActionsInfo - Gets or sets the state/actions applicable on this job like cancel/retry. + ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` + // ErrorDetails - Error details on execution of this job. + ErrorDetails *[]AzureStorageErrorInfo `json:"errorDetails,omitempty"` + // StorageAccountName - Specifies friendly name of the storage account. + StorageAccountName *string `json:"storageAccountName,omitempty"` + // StorageAccountVersion - Specifies whether the Storage account is a Classic or an Azure Resource Manager Storage account. + StorageAccountVersion *string `json:"storageAccountVersion,omitempty"` + // ExtendedInfo - Additional information about the job. + ExtendedInfo *AzureStorageJobExtendedInfo `json:"extendedInfo,omitempty"` + // IsUserTriggered - Indicated that whether the job is adhoc(true) or scheduled(false) + IsUserTriggered *bool `json:"isUserTriggered,omitempty"` + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureIaaSVMJobV2', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob', 'JobTypeVaultJob' + JobType JobType `json:"jobType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureStorageJob. +func (asj AzureStorageJob) MarshalJSON() ([]byte, error) { + asj.JobType = JobTypeAzureStorageJob + objectMap := make(map[string]interface{}) + if asj.Duration != nil { + objectMap["duration"] = asj.Duration + } + if asj.ActionsInfo != nil { + objectMap["actionsInfo"] = asj.ActionsInfo + } + if asj.ErrorDetails != nil { + objectMap["errorDetails"] = asj.ErrorDetails + } + if asj.StorageAccountName != nil { + objectMap["storageAccountName"] = asj.StorageAccountName + } + if asj.StorageAccountVersion != nil { + objectMap["storageAccountVersion"] = asj.StorageAccountVersion + } + if asj.ExtendedInfo != nil { + objectMap["extendedInfo"] = asj.ExtendedInfo + } + if asj.IsUserTriggered != nil { + objectMap["isUserTriggered"] = asj.IsUserTriggered + } + if asj.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = asj.EntityFriendlyName + } + if asj.BackupManagementType != "" { + objectMap["backupManagementType"] = asj.BackupManagementType + } + if asj.Operation != nil { + objectMap["operation"] = asj.Operation + } + if asj.Status != nil { + objectMap["status"] = asj.Status + } + if asj.StartTime != nil { + objectMap["startTime"] = asj.StartTime + } + if asj.EndTime != nil { + objectMap["endTime"] = asj.EndTime + } + if asj.ActivityID != nil { + objectMap["activityId"] = asj.ActivityID + } + if asj.JobType != "" { + objectMap["jobType"] = asj.JobType + } + return json.Marshal(objectMap) +} + +// AsAzureIaaSVMJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { + return nil, false +} + +// AsAzureIaaSVMJobV2 is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsAzureIaaSVMJobV2() (*AzureIaaSVMJobV2, bool) { + return nil, false +} + +// AsAzureStorageJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsAzureStorageJob() (*AzureStorageJob, bool) { + return &asj, true +} + +// AsAzureWorkloadJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { + return nil, false +} + +// AsDpmJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsDpmJob() (*DpmJob, bool) { + return nil, false +} + +// AsMabJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsMabJob() (*MabJob, bool) { + return nil, false +} + +// AsVaultJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsVaultJob() (*VaultJob, bool) { + return nil, false +} + +// AsJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsJob() (*Job, bool) { + return nil, false +} + +// AsBasicJob is the BasicJob implementation for AzureStorageJob. +func (asj AzureStorageJob) AsBasicJob() (BasicJob, bool) { + return &asj, true +} + +// AzureStorageJobExtendedInfo azure Storage workload-specific additional information for job. +type AzureStorageJobExtendedInfo struct { + // TasksList - List of tasks for this job + TasksList *[]AzureStorageJobTaskDetails `json:"tasksList,omitempty"` + // PropertyBag - Job properties. + PropertyBag map[string]*string `json:"propertyBag"` + // DynamicErrorMessage - Non localized error message on job execution. + DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureStorageJobExtendedInfo. +func (asjei AzureStorageJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asjei.TasksList != nil { + objectMap["tasksList"] = asjei.TasksList + } + if asjei.PropertyBag != nil { + objectMap["propertyBag"] = asjei.PropertyBag + } + if asjei.DynamicErrorMessage != nil { + objectMap["dynamicErrorMessage"] = asjei.DynamicErrorMessage + } + return json.Marshal(objectMap) +} + +// AzureStorageJobTaskDetails azure storage workload specific job task details. +type AzureStorageJobTaskDetails struct { + // TaskID - The task display name. + TaskID *string `json:"taskId,omitempty"` + // Status - The status. + Status *string `json:"status,omitempty"` +} + +// AzureStorageProtectableContainer azure Storage-specific protectable containers +type AzureStorageProtectableContainer struct { + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerID - Fabric Id of the container such as ARM Id. + ContainerID *string `json:"containerId,omitempty"` + // ProtectableContainerType - Possible values include: 'ProtectableContainerTypeProtectableContainer', 'ProtectableContainerTypeStorageContainer', 'ProtectableContainerTypeVMAppContainer' + ProtectableContainerType ProtectableContainerType `json:"protectableContainerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureStorageProtectableContainer. +func (aspc AzureStorageProtectableContainer) MarshalJSON() ([]byte, error) { + aspc.ProtectableContainerType = ProtectableContainerTypeStorageContainer + objectMap := make(map[string]interface{}) + if aspc.FriendlyName != nil { + objectMap["friendlyName"] = aspc.FriendlyName + } + if aspc.BackupManagementType != "" { + objectMap["backupManagementType"] = aspc.BackupManagementType + } + if aspc.HealthStatus != nil { + objectMap["healthStatus"] = aspc.HealthStatus + } + if aspc.ContainerID != nil { + objectMap["containerId"] = aspc.ContainerID + } + if aspc.ProtectableContainerType != "" { + objectMap["protectableContainerType"] = aspc.ProtectableContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureStorageProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. +func (aspc AzureStorageProtectableContainer) AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) { + return &aspc, true +} + +// AsAzureVMAppContainerProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. +func (aspc AzureStorageProtectableContainer) AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) { + return nil, false +} + +// AsProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. +func (aspc AzureStorageProtectableContainer) AsProtectableContainer() (*ProtectableContainer, bool) { + return nil, false +} + +// AsBasicProtectableContainer is the BasicProtectableContainer implementation for AzureStorageProtectableContainer. +func (aspc AzureStorageProtectableContainer) AsBasicProtectableContainer() (BasicProtectableContainer, bool) { + return &aspc, true +} + +// AzureVMAppContainerProtectableContainer azure workload-specific container +type AzureVMAppContainerProtectableContainer struct { + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerID - Fabric Id of the container such as ARM Id. + ContainerID *string `json:"containerId,omitempty"` + // ProtectableContainerType - Possible values include: 'ProtectableContainerTypeProtectableContainer', 'ProtectableContainerTypeStorageContainer', 'ProtectableContainerTypeVMAppContainer' + ProtectableContainerType ProtectableContainerType `json:"protectableContainerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMAppContainerProtectableContainer. +func (avacpc AzureVMAppContainerProtectableContainer) MarshalJSON() ([]byte, error) { + avacpc.ProtectableContainerType = ProtectableContainerTypeVMAppContainer + objectMap := make(map[string]interface{}) + if avacpc.FriendlyName != nil { + objectMap["friendlyName"] = avacpc.FriendlyName + } + if avacpc.BackupManagementType != "" { + objectMap["backupManagementType"] = avacpc.BackupManagementType + } + if avacpc.HealthStatus != nil { + objectMap["healthStatus"] = avacpc.HealthStatus + } + if avacpc.ContainerID != nil { + objectMap["containerId"] = avacpc.ContainerID + } + if avacpc.ProtectableContainerType != "" { + objectMap["protectableContainerType"] = avacpc.ProtectableContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureStorageProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. +func (avacpc AzureVMAppContainerProtectableContainer) AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. +func (avacpc AzureVMAppContainerProtectableContainer) AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) { + return &avacpc, true +} + +// AsProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. +func (avacpc AzureVMAppContainerProtectableContainer) AsProtectableContainer() (*ProtectableContainer, bool) { + return nil, false +} + +// AsBasicProtectableContainer is the BasicProtectableContainer implementation for AzureVMAppContainerProtectableContainer. +func (avacpc AzureVMAppContainerProtectableContainer) AsBasicProtectableContainer() (BasicProtectableContainer, bool) { + return &avacpc, true +} + +// AzureVMAppContainerProtectionContainer container for SQL workloads under Azure Virtual Machines. +type AzureVMAppContainerProtectionContainer struct { + // SourceResourceID - ARM ID of the virtual machine represented by this Azure Workload Container + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // LastUpdatedTime - Time stamp when this container was updated. + LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` + // ExtendedInfo - Additional details of a workload container. + ExtendedInfo *AzureWorkloadContainerExtendedInfo `json:"extendedInfo,omitempty"` + // WorkloadType - Workload type for which registration was sent. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` + // OperationType - Re-Do Operation. Possible values include: 'OperationTypeInvalid', 'OperationTypeRegister', 'OperationTypeReregister' + OperationType OperationType `json:"operationType,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ProtectableObjectType - Type of the protectable object associated with this container + ProtectableObjectType *string `json:"protectableObjectType,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaasVMContainer1', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) MarshalJSON() ([]byte, error) { + avacpc.ContainerType = ContainerTypeVMAppContainer1 + objectMap := make(map[string]interface{}) + if avacpc.SourceResourceID != nil { + objectMap["sourceResourceId"] = avacpc.SourceResourceID + } + if avacpc.LastUpdatedTime != nil { + objectMap["lastUpdatedTime"] = avacpc.LastUpdatedTime + } + if avacpc.ExtendedInfo != nil { + objectMap["extendedInfo"] = avacpc.ExtendedInfo + } + if avacpc.WorkloadType != "" { + objectMap["workloadType"] = avacpc.WorkloadType + } + if avacpc.OperationType != "" { + objectMap["operationType"] = avacpc.OperationType + } + if avacpc.FriendlyName != nil { + objectMap["friendlyName"] = avacpc.FriendlyName + } + if avacpc.BackupManagementType != "" { + objectMap["backupManagementType"] = avacpc.BackupManagementType + } + if avacpc.RegistrationStatus != nil { + objectMap["registrationStatus"] = avacpc.RegistrationStatus + } + if avacpc.HealthStatus != nil { + objectMap["healthStatus"] = avacpc.HealthStatus + } + if avacpc.ProtectableObjectType != nil { + objectMap["protectableObjectType"] = avacpc.ProtectableObjectType + } + if avacpc.ContainerType != "" { + objectMap["containerType"] = avacpc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return &avacpc, true +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return &avacpc, true +} + +// AsDpmContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureVMAppContainerProtectionContainer. +func (avacpc AzureVMAppContainerProtectionContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &avacpc, true +} + +// AzureVMResourceFeatureSupportRequest azureResource(IaaS VM) Specific feature support request +type AzureVMResourceFeatureSupportRequest struct { + // VMSize - Size of the resource: VM size(A/D series etc) in case of IaasVM + VMSize *string `json:"vmSize,omitempty"` + // VMSku - SKUs (Premium/Managed etc) in case of IaasVM + VMSku *string `json:"vmSku,omitempty"` + // FeatureType - Possible values include: 'FeatureTypeFeatureSupportRequest', 'FeatureTypeAzureBackupGoals', 'FeatureTypeAzureVMResourceBackup' + FeatureType FeatureType `json:"featureType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMResourceFeatureSupportRequest. +func (avrfsr AzureVMResourceFeatureSupportRequest) MarshalJSON() ([]byte, error) { + avrfsr.FeatureType = FeatureTypeAzureVMResourceBackup + objectMap := make(map[string]interface{}) + if avrfsr.VMSize != nil { + objectMap["vmSize"] = avrfsr.VMSize + } + if avrfsr.VMSku != nil { + objectMap["vmSku"] = avrfsr.VMSku + } + if avrfsr.FeatureType != "" { + objectMap["featureType"] = avrfsr.FeatureType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupGoalFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureVMResourceFeatureSupportRequest. +func (avrfsr AzureVMResourceFeatureSupportRequest) AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) { + return nil, false +} + +// AsAzureVMResourceFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureVMResourceFeatureSupportRequest. +func (avrfsr AzureVMResourceFeatureSupportRequest) AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) { + return &avrfsr, true +} + +// AsFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureVMResourceFeatureSupportRequest. +func (avrfsr AzureVMResourceFeatureSupportRequest) AsFeatureSupportRequest() (*FeatureSupportRequest, bool) { + return nil, false +} + +// AsBasicFeatureSupportRequest is the BasicFeatureSupportRequest implementation for AzureVMResourceFeatureSupportRequest. +func (avrfsr AzureVMResourceFeatureSupportRequest) AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) { + return &avrfsr, true +} + +// AzureVMResourceFeatureSupportResponse response for feature support requests for Azure IaasVm +type AzureVMResourceFeatureSupportResponse struct { + autorest.Response `json:"-"` + // SupportStatus - Support status of feature. Possible values include: 'SupportStatusInvalid', 'SupportStatusSupported', 'SupportStatusDefaultOFF', 'SupportStatusDefaultON', 'SupportStatusNotSupported' + SupportStatus SupportStatus `json:"supportStatus,omitempty"` +} + +// BasicAzureVMWorkloadItem azure VM workload-specific workload item. +type BasicAzureVMWorkloadItem interface { + AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) + AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) + AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) + AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) + AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) + AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) + AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) +} + +// AzureVMWorkloadItem azure VM workload-specific workload item. +type AzureVMWorkloadItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if workload item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected + SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +} + +func unmarshalBasicAzureVMWorkloadItem(body []byte) (BasicAzureVMWorkloadItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["workloadItemType"] { + case string(WorkloadItemTypeSAPAseDatabase1): + var avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem + err := json.Unmarshal(body, &avwsadwi) + return avwsadwi, err + case string(WorkloadItemTypeSAPAseSystem1): + var avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem + err := json.Unmarshal(body, &avwsaswi) + return avwsaswi, err + case string(WorkloadItemTypeSAPHanaDatabase1): + var avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem + err := json.Unmarshal(body, &avwshdwi) + return avwshdwi, err + case string(WorkloadItemTypeSAPHanaSystem1): + var avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem + err := json.Unmarshal(body, &avwshswi) + return avwshswi, err + case string(WorkloadItemTypeSQLDataBase1): + var avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem + err := json.Unmarshal(body, &avwsdwi) + return avwsdwi, err + case string(WorkloadItemTypeSQLInstance1): + var avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem + err := json.Unmarshal(body, &avwsiwi) + return avwsiwi, err + default: + var avwi AzureVMWorkloadItem + err := json.Unmarshal(body, &avwi) + return avwi, err + } +} +func unmarshalBasicAzureVMWorkloadItemArray(body []byte) ([]BasicAzureVMWorkloadItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + avwiArray := make([]BasicAzureVMWorkloadItem, len(rawMessages)) + + for index, rawMessage := range rawMessages { + avwi, err := unmarshalBasicAzureVMWorkloadItem(*rawMessage) + if err != nil { + return nil, err + } + avwiArray[index] = avwi + } + return avwiArray, nil +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) MarshalJSON() ([]byte, error) { + avwi.WorkloadItemType = WorkloadItemTypeAzureVMWorkloadItem + objectMap := make(map[string]interface{}) + if avwi.ParentName != nil { + objectMap["parentName"] = avwi.ParentName + } + if avwi.ServerName != nil { + objectMap["serverName"] = avwi.ServerName + } + if avwi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwi.IsAutoProtectable + } + if avwi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwi.Subinquireditemcount + } + if avwi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwi.SubWorkloadItemCount + } + if avwi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwi.BackupManagementType + } + if avwi.WorkloadType != nil { + objectMap["workloadType"] = avwi.WorkloadType + } + if avwi.FriendlyName != nil { + objectMap["friendlyName"] = avwi.FriendlyName + } + if avwi.ProtectionState != "" { + objectMap["protectionState"] = avwi.ProtectionState + } + if avwi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwi.WorkloadItemType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { + return &avwi, true +} + +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwi, true +} + +// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { + return nil, false +} + +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { + return nil, false +} + +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadItem. +func (avwi AzureVMWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwi, true +} + +// BasicAzureVMWorkloadProtectableItem azure VM workload-specific protectable item. +type BasicAzureVMWorkloadProtectableItem interface { + AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) + AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) + AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) + AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) + AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) + AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) + AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) +} + +// AzureVMWorkloadProtectableItem azure VM workload-specific protectable item. +type AzureVMWorkloadProtectableItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent + // Only Applicable for data bases where the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + 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 + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + // Prebackupvalidation - Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +func unmarshalBasicAzureVMWorkloadProtectableItem(body []byte) (BasicAzureVMWorkloadProtectableItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectableItemType"] { + case string(ProtectableItemTypeSAPAseSystem): + var avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem + err := json.Unmarshal(body, &avwsaspi) + return avwsaspi, err + case string(ProtectableItemTypeSAPHanaDatabase): + var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem + err := json.Unmarshal(body, &avwshdpi) + return avwshdpi, err + case string(ProtectableItemTypeSAPHanaSystem): + var avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem + err := json.Unmarshal(body, &avwshspi) + return avwshspi, err + case string(ProtectableItemTypeSQLAvailabilityGroupContainer): + var avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem + err := json.Unmarshal(body, &avwsagpi) + return avwsagpi, err + case string(ProtectableItemTypeSQLDataBase): + var avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem + err := json.Unmarshal(body, &avwsdpi) + return avwsdpi, err + case string(ProtectableItemTypeSQLInstance): + var avwsipi AzureVMWorkloadSQLInstanceProtectableItem + err := json.Unmarshal(body, &avwsipi) + return avwsipi, err + default: + var avwpi AzureVMWorkloadProtectableItem + err := json.Unmarshal(body, &avwpi) + return avwpi, err + } +} +func unmarshalBasicAzureVMWorkloadProtectableItemArray(body []byte) ([]BasicAzureVMWorkloadProtectableItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + avwpiArray := make([]BasicAzureVMWorkloadProtectableItem, len(rawMessages)) + + for index, rawMessage := range rawMessages { + avwpi, err := unmarshalBasicAzureVMWorkloadProtectableItem(*rawMessage) + if err != nil { + return nil, err + } + avwpiArray[index] = avwpi + } + return avwpiArray, nil +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) MarshalJSON() ([]byte, error) { + avwpi.ProtectableItemType = ProtectableItemTypeAzureVMWorkloadProtectableItem + objectMap := make(map[string]interface{}) + if avwpi.ParentName != nil { + objectMap["parentName"] = avwpi.ParentName + } + if avwpi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwpi.ParentUniqueName + } + if avwpi.ServerName != nil { + objectMap["serverName"] = avwpi.ServerName + } + if avwpi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwpi.IsAutoProtectable + } + if avwpi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwpi.IsAutoProtected + } + if avwpi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwpi.Subinquireditemcount + } + if avwpi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwpi.Subprotectableitemcount + } + if avwpi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwpi.Prebackupvalidation + } + if avwpi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwpi.BackupManagementType + } + if avwpi.WorkloadType != nil { + objectMap["workloadType"] = avwpi.WorkloadType + } + if avwpi.FriendlyName != nil { + objectMap["friendlyName"] = avwpi.FriendlyName + } + if avwpi.ProtectionState != "" { + objectMap["protectionState"] = avwpi.ProtectionState + } + if avwpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwpi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return &avwpi, true +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwpi, true +} + +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadProtectableItem. +func (avwpi AzureVMWorkloadProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwpi, true +} + +// BasicAzureVMWorkloadProtectedItem azure VM workload-specific protected item. +type BasicAzureVMWorkloadProtectedItem interface { + AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) + AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) + AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) + AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) +} + +// AzureVMWorkloadProtectedItem azure VM workload-specific protected item. +type AzureVMWorkloadProtectedItem struct { + // FriendlyName - Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // ParentName - Parent name of the DB such as Instance or Availability Group. + ParentName *string `json:"parentName,omitempty"` + // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed + ParentType *string `json:"parentType,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' + LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // LastBackupErrorDetail - Error details in last backup + LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` + // ProtectedItemDataSourceID - Data ID of the protected item. + ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` + // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' + ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // KpisHealths - Health details of different KPIs + KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ResourceGuardOperationRequests - ResourceGuardOperationRequests on which LAC check will be performed + ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` + // IsArchiveEnabled - Flag to identify whether datasource is protected in archive + IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + // PolicyName - Name of the policy used for protection + PolicyName *string `json:"policyName,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +func unmarshalBasicAzureVMWorkloadProtectedItem(body []byte) (BasicAzureVMWorkloadProtectedItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectedItemType"] { + case string(ProtectedItemTypeAzureVMWorkloadSAPAseDatabase): + var avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem + err := json.Unmarshal(body, &avwsadpi) + return avwsadpi, err + case string(ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase): + var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem + err := json.Unmarshal(body, &avwshdpi) + return avwshdpi, err + case string(ProtectedItemTypeAzureVMWorkloadSQLDatabase): + var avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem + err := json.Unmarshal(body, &avwsdpi) + return avwsdpi, err + default: + var avwpi AzureVMWorkloadProtectedItem + err := json.Unmarshal(body, &avwpi) + return avwpi, err + } +} +func unmarshalBasicAzureVMWorkloadProtectedItemArray(body []byte) ([]BasicAzureVMWorkloadProtectedItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + avwpiArray := make([]BasicAzureVMWorkloadProtectedItem, len(rawMessages)) + + for index, rawMessage := range rawMessages { + avwpi, err := unmarshalBasicAzureVMWorkloadProtectedItem(*rawMessage) + if err != nil { + return nil, err + } + avwpiArray[index] = avwpi + } + return avwpiArray, nil +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) MarshalJSON() ([]byte, error) { + avwpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadProtectedItem + objectMap := make(map[string]interface{}) + if avwpi.FriendlyName != nil { + objectMap["friendlyName"] = avwpi.FriendlyName + } + if avwpi.ServerName != nil { + objectMap["serverName"] = avwpi.ServerName + } + if avwpi.ParentName != nil { + objectMap["parentName"] = avwpi.ParentName + } + if avwpi.ParentType != nil { + objectMap["parentType"] = avwpi.ParentType + } + if avwpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = avwpi.ProtectionStatus + } + if avwpi.ProtectionState != "" { + objectMap["protectionState"] = avwpi.ProtectionState + } + if avwpi.LastBackupStatus != "" { + objectMap["lastBackupStatus"] = avwpi.LastBackupStatus + } + if avwpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = avwpi.LastBackupTime + } + if avwpi.LastBackupErrorDetail != nil { + objectMap["lastBackupErrorDetail"] = avwpi.LastBackupErrorDetail + } + if avwpi.ProtectedItemDataSourceID != nil { + objectMap["protectedItemDataSourceId"] = avwpi.ProtectedItemDataSourceID + } + if avwpi.ProtectedItemHealthStatus != "" { + objectMap["protectedItemHealthStatus"] = avwpi.ProtectedItemHealthStatus + } + if avwpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = avwpi.ExtendedInfo + } + if avwpi.KpisHealths != nil { + objectMap["kpisHealths"] = avwpi.KpisHealths + } + if avwpi.BackupManagementType != "" { + objectMap["backupManagementType"] = avwpi.BackupManagementType + } + if avwpi.WorkloadType != "" { + objectMap["workloadType"] = avwpi.WorkloadType + } + if avwpi.ContainerName != nil { + objectMap["containerName"] = avwpi.ContainerName + } + if avwpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = avwpi.SourceResourceID + } + if avwpi.PolicyID != nil { + objectMap["policyId"] = avwpi.PolicyID + } + if avwpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = avwpi.LastRecoveryPoint + } + if avwpi.BackupSetName != nil { + objectMap["backupSetName"] = avwpi.BackupSetName + } + if avwpi.CreateMode != "" { + objectMap["createMode"] = avwpi.CreateMode + } + if avwpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = avwpi.DeferredDeleteTimeInUTC + } + if avwpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = avwpi.IsScheduledForDeferredDelete + } + if avwpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = avwpi.DeferredDeleteTimeRemaining + } + if avwpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = avwpi.IsDeferredDeleteScheduleUpcoming + } + if avwpi.IsRehydrate != nil { + objectMap["isRehydrate"] = avwpi.IsRehydrate + } + if avwpi.ResourceGuardOperationRequests != nil { + objectMap["resourceGuardOperationRequests"] = avwpi.ResourceGuardOperationRequests + } + if avwpi.IsArchiveEnabled != nil { + objectMap["isArchiveEnabled"] = avwpi.IsArchiveEnabled + } + if avwpi.PolicyName != nil { + objectMap["policyName"] = avwpi.PolicyName + } + if avwpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = avwpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return &avwpi, true +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return &avwpi, true +} + +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadProtectedItem. +func (avwpi AzureVMWorkloadProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &avwpi, true +} + +// AzureVMWorkloadProtectedItemExtendedInfo additional information on Azure Workload for SQL specific +// backup item. +type AzureVMWorkloadProtectedItemExtendedInfo struct { + // OldestRecoveryPoint - The oldest backup copy available for this backup item. + OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` + // RecoveryPointCount - Number of backup copies available for this backup item. + RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` + // PolicyState - Indicates consistency of policy object and policy applied to this backup item. + PolicyState *string `json:"policyState,omitempty"` + // RecoveryModel - Indicates consistency of policy object and policy applied to this backup item. + RecoveryModel *string `json:"recoveryModel,omitempty"` +} + +// AzureVMWorkloadProtectionPolicy azure VM (Mercury) workload-specific backup policy. +type AzureVMWorkloadProtectionPolicy struct { + // 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', 'WorkloadTypeSAPAseDatabase' + 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 + SubProtectionPolicy *[]SubProtectionPolicy `json:"subProtectionPolicy,omitempty"` + // MakePolicyConsistent - Fix the policy inconsistency + MakePolicyConsistent *bool `json:"makePolicyConsistent,omitempty"` + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // ResourceGuardOperationRequests - ResourceGuard Operation Requests + ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) MarshalJSON() ([]byte, error) { + avwpp.BackupManagementType = BackupManagementTypeAzureWorkload + objectMap := make(map[string]interface{}) + if avwpp.WorkLoadType != "" { + objectMap["workLoadType"] = avwpp.WorkLoadType + } + if avwpp.Settings != nil { + objectMap["settings"] = avwpp.Settings + } + if avwpp.SubProtectionPolicy != nil { + objectMap["subProtectionPolicy"] = avwpp.SubProtectionPolicy + } + if avwpp.MakePolicyConsistent != nil { + objectMap["makePolicyConsistent"] = avwpp.MakePolicyConsistent + } + if avwpp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = avwpp.ProtectedItemsCount + } + if avwpp.ResourceGuardOperationRequests != nil { + objectMap["resourceGuardOperationRequests"] = avwpp.ResourceGuardOperationRequests + } + if avwpp.BackupManagementType != "" { + objectMap["backupManagementType"] = avwpp.BackupManagementType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return &avwpp, true +} + +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { + return nil, false +} + +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { + return nil, false +} + +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { + return nil, false +} + +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { + return nil, false +} + +// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { + return nil, false +} + +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureVMWorkloadProtectionPolicy. +func (avwpp AzureVMWorkloadProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &avwpp, true +} + +// AzureVMWorkloadSAPAseDatabaseProtectedItem azure VM workload-specific protected item representing SAP +// ASE Database. +type AzureVMWorkloadSAPAseDatabaseProtectedItem struct { + // FriendlyName - Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // ParentName - Parent name of the DB such as Instance or Availability Group. + ParentName *string `json:"parentName,omitempty"` + // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed + ParentType *string `json:"parentType,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' + LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // LastBackupErrorDetail - Error details in last backup + LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` + // ProtectedItemDataSourceID - Data ID of the protected item. + ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` + // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' + ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // KpisHealths - Health details of different KPIs + KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ResourceGuardOperationRequests - ResourceGuardOperationRequests on which LAC check will be performed + ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` + // IsArchiveEnabled - Flag to identify whether datasource is protected in archive + IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + // PolicyName - Name of the policy used for protection + PolicyName *string `json:"policyName,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) MarshalJSON() ([]byte, error) { + avwsadpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadSAPAseDatabase + objectMap := make(map[string]interface{}) + if avwsadpi.FriendlyName != nil { + objectMap["friendlyName"] = avwsadpi.FriendlyName + } + if avwsadpi.ServerName != nil { + objectMap["serverName"] = avwsadpi.ServerName + } + if avwsadpi.ParentName != nil { + objectMap["parentName"] = avwsadpi.ParentName + } + if avwsadpi.ParentType != nil { + objectMap["parentType"] = avwsadpi.ParentType + } + if avwsadpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = avwsadpi.ProtectionStatus + } + if avwsadpi.ProtectionState != "" { + objectMap["protectionState"] = avwsadpi.ProtectionState + } + if avwsadpi.LastBackupStatus != "" { + objectMap["lastBackupStatus"] = avwsadpi.LastBackupStatus + } + if avwsadpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = avwsadpi.LastBackupTime + } + if avwsadpi.LastBackupErrorDetail != nil { + objectMap["lastBackupErrorDetail"] = avwsadpi.LastBackupErrorDetail + } + if avwsadpi.ProtectedItemDataSourceID != nil { + objectMap["protectedItemDataSourceId"] = avwsadpi.ProtectedItemDataSourceID + } + if avwsadpi.ProtectedItemHealthStatus != "" { + objectMap["protectedItemHealthStatus"] = avwsadpi.ProtectedItemHealthStatus + } + if avwsadpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = avwsadpi.ExtendedInfo + } + if avwsadpi.KpisHealths != nil { + objectMap["kpisHealths"] = avwsadpi.KpisHealths + } + if avwsadpi.BackupManagementType != "" { + objectMap["backupManagementType"] = avwsadpi.BackupManagementType + } + if avwsadpi.WorkloadType != "" { + objectMap["workloadType"] = avwsadpi.WorkloadType + } + if avwsadpi.ContainerName != nil { + objectMap["containerName"] = avwsadpi.ContainerName + } + if avwsadpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = avwsadpi.SourceResourceID + } + if avwsadpi.PolicyID != nil { + objectMap["policyId"] = avwsadpi.PolicyID + } + if avwsadpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = avwsadpi.LastRecoveryPoint + } + if avwsadpi.BackupSetName != nil { + objectMap["backupSetName"] = avwsadpi.BackupSetName + } + if avwsadpi.CreateMode != "" { + objectMap["createMode"] = avwsadpi.CreateMode + } + if avwsadpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = avwsadpi.DeferredDeleteTimeInUTC + } + if avwsadpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = avwsadpi.IsScheduledForDeferredDelete + } + if avwsadpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = avwsadpi.DeferredDeleteTimeRemaining + } + if avwsadpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = avwsadpi.IsDeferredDeleteScheduleUpcoming + } + if avwsadpi.IsRehydrate != nil { + objectMap["isRehydrate"] = avwsadpi.IsRehydrate + } + if avwsadpi.ResourceGuardOperationRequests != nil { + objectMap["resourceGuardOperationRequests"] = avwsadpi.ResourceGuardOperationRequests + } + if avwsadpi.IsArchiveEnabled != nil { + objectMap["isArchiveEnabled"] = avwsadpi.IsArchiveEnabled + } + if avwsadpi.PolicyName != nil { + objectMap["policyName"] = avwsadpi.PolicyName + } + if avwsadpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = avwsadpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return &avwsadpi, true +} + +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return &avwsadpi, true +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPAseDatabaseProtectedItem. +func (avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &avwsadpi, true +} + +// AzureVMWorkloadSAPAseDatabaseWorkloadItem azure VM workload-specific workload item representing SAP ASE +// Database. +type AzureVMWorkloadSAPAseDatabaseWorkloadItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if workload item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected + SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { + avwsadwi.WorkloadItemType = WorkloadItemTypeSAPAseDatabase1 + objectMap := make(map[string]interface{}) + if avwsadwi.ParentName != nil { + objectMap["parentName"] = avwsadwi.ParentName + } + if avwsadwi.ServerName != nil { + objectMap["serverName"] = avwsadwi.ServerName + } + if avwsadwi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsadwi.IsAutoProtectable + } + if avwsadwi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsadwi.Subinquireditemcount + } + if avwsadwi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwsadwi.SubWorkloadItemCount + } + if avwsadwi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsadwi.BackupManagementType + } + if avwsadwi.WorkloadType != nil { + objectMap["workloadType"] = avwsadwi.WorkloadType + } + if avwsadwi.FriendlyName != nil { + objectMap["friendlyName"] = avwsadwi.FriendlyName + } + if avwsadwi.ProtectionState != "" { + objectMap["protectionState"] = avwsadwi.ProtectionState + } + if avwsadwi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwsadwi.WorkloadItemType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwsadwi, true +} + +// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { + return &avwsadwi, true +} + +// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { + return nil, false +} + +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { + return nil, false +} + +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseDatabaseWorkloadItem. +func (avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwsadwi, true +} + +// AzureVMWorkloadSAPAseSystemProtectableItem azure VM workload-specific protectable item representing SAP +// ASE System. +type AzureVMWorkloadSAPAseSystemProtectableItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent + // Only Applicable for data bases where the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + 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 + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + // Prebackupvalidation - Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) MarshalJSON() ([]byte, error) { + avwsaspi.ProtectableItemType = ProtectableItemTypeSAPAseSystem + objectMap := make(map[string]interface{}) + if avwsaspi.ParentName != nil { + objectMap["parentName"] = avwsaspi.ParentName + } + if avwsaspi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwsaspi.ParentUniqueName + } + if avwsaspi.ServerName != nil { + objectMap["serverName"] = avwsaspi.ServerName + } + if avwsaspi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsaspi.IsAutoProtectable + } + if avwsaspi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwsaspi.IsAutoProtected + } + if avwsaspi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsaspi.Subinquireditemcount + } + if avwsaspi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwsaspi.Subprotectableitemcount + } + if avwsaspi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwsaspi.Prebackupvalidation + } + if avwsaspi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsaspi.BackupManagementType + } + if avwsaspi.WorkloadType != nil { + objectMap["workloadType"] = avwsaspi.WorkloadType + } + if avwsaspi.FriendlyName != nil { + objectMap["friendlyName"] = avwsaspi.FriendlyName + } + if avwsaspi.ProtectionState != "" { + objectMap["protectionState"] = avwsaspi.ProtectionState + } + if avwsaspi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwsaspi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwsaspi, true +} + +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { + return &avwsaspi, true +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPAseSystemProtectableItem. +func (avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwsaspi, true +} + +// AzureVMWorkloadSAPAseSystemWorkloadItem azure VM workload-specific workload item representing SAP ASE +// System. +type AzureVMWorkloadSAPAseSystemWorkloadItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if workload item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected + SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) MarshalJSON() ([]byte, error) { + avwsaswi.WorkloadItemType = WorkloadItemTypeSAPAseSystem1 + objectMap := make(map[string]interface{}) + if avwsaswi.ParentName != nil { + objectMap["parentName"] = avwsaswi.ParentName + } + if avwsaswi.ServerName != nil { + objectMap["serverName"] = avwsaswi.ServerName + } + if avwsaswi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsaswi.IsAutoProtectable + } + if avwsaswi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsaswi.Subinquireditemcount + } + if avwsaswi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwsaswi.SubWorkloadItemCount + } + if avwsaswi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsaswi.BackupManagementType + } + if avwsaswi.WorkloadType != nil { + objectMap["workloadType"] = avwsaswi.WorkloadType + } + if avwsaswi.FriendlyName != nil { + objectMap["friendlyName"] = avwsaswi.FriendlyName + } + if avwsaswi.ProtectionState != "" { + objectMap["protectionState"] = avwsaswi.ProtectionState + } + if avwsaswi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwsaswi.WorkloadItemType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwsaswi, true +} + +// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { + return &avwsaswi, true +} + +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { + return nil, false +} + +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { + return nil, false +} + +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPAseSystemWorkloadItem. +func (avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwsaswi, true +} + +// AzureVMWorkloadSAPHanaDatabaseProtectableItem azure VM workload-specific protectable item representing +// SAP HANA Database. +type AzureVMWorkloadSAPHanaDatabaseProtectableItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent + // Only Applicable for data bases where the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + 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 + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + // Prebackupvalidation - Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) MarshalJSON() ([]byte, error) { + avwshdpi.ProtectableItemType = ProtectableItemTypeSAPHanaDatabase + objectMap := make(map[string]interface{}) + if avwshdpi.ParentName != nil { + objectMap["parentName"] = avwshdpi.ParentName + } + if avwshdpi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwshdpi.ParentUniqueName + } + if avwshdpi.ServerName != nil { + objectMap["serverName"] = avwshdpi.ServerName + } + if avwshdpi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwshdpi.IsAutoProtectable + } + if avwshdpi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwshdpi.IsAutoProtected + } + if avwshdpi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwshdpi.Subinquireditemcount + } + if avwshdpi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwshdpi.Subprotectableitemcount + } + if avwshdpi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwshdpi.Prebackupvalidation + } + if avwshdpi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwshdpi.BackupManagementType + } + if avwshdpi.WorkloadType != nil { + objectMap["workloadType"] = avwshdpi.WorkloadType + } + if avwshdpi.FriendlyName != nil { + objectMap["friendlyName"] = avwshdpi.FriendlyName + } + if avwshdpi.ProtectionState != "" { + objectMap["protectionState"] = avwshdpi.ProtectionState + } + if avwshdpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwshdpi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwshdpi, true +} + +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return &avwshdpi, true +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwshdpi, true +} + +// AzureVMWorkloadSAPHanaDatabaseProtectedItem azure VM workload-specific protected item representing SAP +// HANA Database. +type AzureVMWorkloadSAPHanaDatabaseProtectedItem struct { + // FriendlyName - Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // ParentName - Parent name of the DB such as Instance or Availability Group. + ParentName *string `json:"parentName,omitempty"` + // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed + ParentType *string `json:"parentType,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' + LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // LastBackupErrorDetail - Error details in last backup + LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` + // ProtectedItemDataSourceID - Data ID of the protected item. + ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` + // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' + ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // KpisHealths - Health details of different KPIs + KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ResourceGuardOperationRequests - ResourceGuardOperationRequests on which LAC check will be performed + ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` + // IsArchiveEnabled - Flag to identify whether datasource is protected in archive + IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + // PolicyName - Name of the policy used for protection + PolicyName *string `json:"policyName,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) MarshalJSON() ([]byte, error) { + avwshdpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase + objectMap := make(map[string]interface{}) + if avwshdpi.FriendlyName != nil { + objectMap["friendlyName"] = avwshdpi.FriendlyName + } + if avwshdpi.ServerName != nil { + objectMap["serverName"] = avwshdpi.ServerName + } + if avwshdpi.ParentName != nil { + objectMap["parentName"] = avwshdpi.ParentName + } + if avwshdpi.ParentType != nil { + objectMap["parentType"] = avwshdpi.ParentType + } + if avwshdpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = avwshdpi.ProtectionStatus + } + if avwshdpi.ProtectionState != "" { + objectMap["protectionState"] = avwshdpi.ProtectionState + } + if avwshdpi.LastBackupStatus != "" { + objectMap["lastBackupStatus"] = avwshdpi.LastBackupStatus + } + if avwshdpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = avwshdpi.LastBackupTime + } + if avwshdpi.LastBackupErrorDetail != nil { + objectMap["lastBackupErrorDetail"] = avwshdpi.LastBackupErrorDetail + } + if avwshdpi.ProtectedItemDataSourceID != nil { + objectMap["protectedItemDataSourceId"] = avwshdpi.ProtectedItemDataSourceID + } + if avwshdpi.ProtectedItemHealthStatus != "" { + objectMap["protectedItemHealthStatus"] = avwshdpi.ProtectedItemHealthStatus + } + if avwshdpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = avwshdpi.ExtendedInfo + } + if avwshdpi.KpisHealths != nil { + objectMap["kpisHealths"] = avwshdpi.KpisHealths + } + if avwshdpi.BackupManagementType != "" { + objectMap["backupManagementType"] = avwshdpi.BackupManagementType + } + if avwshdpi.WorkloadType != "" { + objectMap["workloadType"] = avwshdpi.WorkloadType + } + if avwshdpi.ContainerName != nil { + objectMap["containerName"] = avwshdpi.ContainerName + } + if avwshdpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = avwshdpi.SourceResourceID + } + if avwshdpi.PolicyID != nil { + objectMap["policyId"] = avwshdpi.PolicyID + } + if avwshdpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = avwshdpi.LastRecoveryPoint + } + if avwshdpi.BackupSetName != nil { + objectMap["backupSetName"] = avwshdpi.BackupSetName + } + if avwshdpi.CreateMode != "" { + objectMap["createMode"] = avwshdpi.CreateMode + } + if avwshdpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = avwshdpi.DeferredDeleteTimeInUTC + } + if avwshdpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = avwshdpi.IsScheduledForDeferredDelete + } + if avwshdpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = avwshdpi.DeferredDeleteTimeRemaining + } + if avwshdpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = avwshdpi.IsDeferredDeleteScheduleUpcoming + } + if avwshdpi.IsRehydrate != nil { + objectMap["isRehydrate"] = avwshdpi.IsRehydrate + } + if avwshdpi.ResourceGuardOperationRequests != nil { + objectMap["resourceGuardOperationRequests"] = avwshdpi.ResourceGuardOperationRequests + } + if avwshdpi.IsArchiveEnabled != nil { + objectMap["isArchiveEnabled"] = avwshdpi.IsArchiveEnabled + } + if avwshdpi.PolicyName != nil { + objectMap["policyName"] = avwshdpi.PolicyName + } + if avwshdpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = avwshdpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return &avwshdpi, true +} + +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return &avwshdpi, true +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &avwshdpi, true +} + +// AzureVMWorkloadSAPHanaDatabaseWorkloadItem azure VM workload-specific workload item representing SAP +// HANA Database. +type AzureVMWorkloadSAPHanaDatabaseWorkloadItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if workload item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected + SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { + avwshdwi.WorkloadItemType = WorkloadItemTypeSAPHanaDatabase1 + objectMap := make(map[string]interface{}) + if avwshdwi.ParentName != nil { + objectMap["parentName"] = avwshdwi.ParentName + } + if avwshdwi.ServerName != nil { + objectMap["serverName"] = avwshdwi.ServerName + } + if avwshdwi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwshdwi.IsAutoProtectable + } + if avwshdwi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwshdwi.Subinquireditemcount + } + if avwshdwi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwshdwi.SubWorkloadItemCount + } + if avwshdwi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwshdwi.BackupManagementType + } + if avwshdwi.WorkloadType != nil { + objectMap["workloadType"] = avwshdwi.WorkloadType + } + if avwshdwi.FriendlyName != nil { + objectMap["friendlyName"] = avwshdwi.FriendlyName + } + if avwshdwi.ProtectionState != "" { + objectMap["protectionState"] = avwshdwi.ProtectionState + } + if avwshdwi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwshdwi.WorkloadItemType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwshdwi, true +} + +// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return &avwshdwi, true +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { + return nil, false +} + +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { + return nil, false +} + +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwshdwi, true +} + +// AzureVMWorkloadSAPHanaSystemProtectableItem azure VM workload-specific protectable item representing SAP +// HANA System. +type AzureVMWorkloadSAPHanaSystemProtectableItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent + // Only Applicable for data bases where the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + 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 + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + // Prebackupvalidation - Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) MarshalJSON() ([]byte, error) { + avwshspi.ProtectableItemType = ProtectableItemTypeSAPHanaSystem + objectMap := make(map[string]interface{}) + if avwshspi.ParentName != nil { + objectMap["parentName"] = avwshspi.ParentName + } + if avwshspi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwshspi.ParentUniqueName + } + if avwshspi.ServerName != nil { + objectMap["serverName"] = avwshspi.ServerName + } + if avwshspi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwshspi.IsAutoProtectable + } + if avwshspi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwshspi.IsAutoProtected + } + if avwshspi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwshspi.Subinquireditemcount + } + if avwshspi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwshspi.Subprotectableitemcount + } + if avwshspi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwshspi.Prebackupvalidation + } + if avwshspi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwshspi.BackupManagementType + } + if avwshspi.WorkloadType != nil { + objectMap["workloadType"] = avwshspi.WorkloadType + } + if avwshspi.FriendlyName != nil { + objectMap["friendlyName"] = avwshspi.FriendlyName + } + if avwshspi.ProtectionState != "" { + objectMap["protectionState"] = avwshspi.ProtectionState + } + if avwshspi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwshspi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwshspi, true +} + +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return &avwshspi, true +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSAPHanaSystemProtectableItem. +func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwshspi, true +} + +// AzureVMWorkloadSAPHanaSystemWorkloadItem azure VM workload-specific workload item representing SAP HANA +// System. +type AzureVMWorkloadSAPHanaSystemWorkloadItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if workload item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected + SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) MarshalJSON() ([]byte, error) { + avwshswi.WorkloadItemType = WorkloadItemTypeSAPHanaSystem1 + objectMap := make(map[string]interface{}) + if avwshswi.ParentName != nil { + objectMap["parentName"] = avwshswi.ParentName + } + if avwshswi.ServerName != nil { + objectMap["serverName"] = avwshswi.ServerName + } + if avwshswi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwshswi.IsAutoProtectable + } + if avwshswi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwshswi.Subinquireditemcount + } + if avwshswi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwshswi.SubWorkloadItemCount + } + if avwshswi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwshswi.BackupManagementType + } + if avwshswi.WorkloadType != nil { + objectMap["workloadType"] = avwshswi.WorkloadType + } + if avwshswi.FriendlyName != nil { + objectMap["friendlyName"] = avwshswi.FriendlyName + } + if avwshswi.ProtectionState != "" { + objectMap["protectionState"] = avwshswi.ProtectionState + } + if avwshswi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwshswi.WorkloadItemType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwshswi, true +} + +// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return &avwshswi, true +} + +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { + return nil, false +} + +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { + return nil, false +} + +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwshswi, true +} + +// AzureVMWorkloadSQLAvailabilityGroupProtectableItem azure VM workload-specific protectable item +// representing SQL Availability Group. +type AzureVMWorkloadSQLAvailabilityGroupProtectableItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent + // Only Applicable for data bases where the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + 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 + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + // Prebackupvalidation - Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) MarshalJSON() ([]byte, error) { + avwsagpi.ProtectableItemType = ProtectableItemTypeSQLAvailabilityGroupContainer + objectMap := make(map[string]interface{}) + if avwsagpi.ParentName != nil { + objectMap["parentName"] = avwsagpi.ParentName + } + if avwsagpi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwsagpi.ParentUniqueName + } + if avwsagpi.ServerName != nil { + objectMap["serverName"] = avwsagpi.ServerName + } + if avwsagpi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsagpi.IsAutoProtectable + } + if avwsagpi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwsagpi.IsAutoProtected + } + if avwsagpi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsagpi.Subinquireditemcount + } + if avwsagpi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwsagpi.Subprotectableitemcount + } + if avwsagpi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwsagpi.Prebackupvalidation + } + if avwsagpi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsagpi.BackupManagementType + } + if avwsagpi.WorkloadType != nil { + objectMap["workloadType"] = avwsagpi.WorkloadType + } + if avwsagpi.FriendlyName != nil { + objectMap["friendlyName"] = avwsagpi.FriendlyName + } + if avwsagpi.ProtectionState != "" { + objectMap["protectionState"] = avwsagpi.ProtectionState + } + if avwsagpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwsagpi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwsagpi, true +} + +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return &avwsagpi, true +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwsagpi, true +} + +// AzureVMWorkloadSQLDatabaseProtectableItem azure VM workload-specific protectable item representing SQL +// Database. +type AzureVMWorkloadSQLDatabaseProtectableItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent + // Only Applicable for data bases where the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + 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 + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + // Prebackupvalidation - Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) MarshalJSON() ([]byte, error) { + avwsdpi.ProtectableItemType = ProtectableItemTypeSQLDataBase + objectMap := make(map[string]interface{}) + if avwsdpi.ParentName != nil { + objectMap["parentName"] = avwsdpi.ParentName + } + if avwsdpi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwsdpi.ParentUniqueName + } + if avwsdpi.ServerName != nil { + objectMap["serverName"] = avwsdpi.ServerName + } + if avwsdpi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsdpi.IsAutoProtectable + } + if avwsdpi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwsdpi.IsAutoProtected + } + if avwsdpi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsdpi.Subinquireditemcount + } + if avwsdpi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwsdpi.Subprotectableitemcount + } + if avwsdpi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwsdpi.Prebackupvalidation + } + if avwsdpi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsdpi.BackupManagementType + } + if avwsdpi.WorkloadType != nil { + objectMap["workloadType"] = avwsdpi.WorkloadType + } + if avwsdpi.FriendlyName != nil { + objectMap["friendlyName"] = avwsdpi.FriendlyName + } + if avwsdpi.ProtectionState != "" { + objectMap["protectionState"] = avwsdpi.ProtectionState + } + if avwsdpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwsdpi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwsdpi, true +} + +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return &avwsdpi, true +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLDatabaseProtectableItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwsdpi, true +} + +// AzureVMWorkloadSQLDatabaseProtectedItem azure VM workload-specific protected item representing SQL +// Database. +type AzureVMWorkloadSQLDatabaseProtectedItem struct { + // FriendlyName - Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // ParentName - Parent name of the DB such as Instance or Availability Group. + ParentName *string `json:"parentName,omitempty"` + // ParentType - Parent type of protected item, example: for a DB, standalone server or distributed + ParentType *string `json:"parentType,omitempty"` + // ProtectionStatus - Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // LastBackupStatus - Last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'LastBackupStatusInvalid', 'LastBackupStatusHealthy', 'LastBackupStatusUnhealthy', 'LastBackupStatusIRPending' + LastBackupStatus LastBackupStatus `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // LastBackupErrorDetail - Error details in last backup + LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` + // ProtectedItemDataSourceID - Data ID of the protected item. + ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` + // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'ProtectedItemHealthStatusInvalid', 'ProtectedItemHealthStatusHealthy', 'ProtectedItemHealthStatusUnhealthy', 'ProtectedItemHealthStatusNotReachable', 'ProtectedItemHealthStatusIRPending' + ProtectedItemHealthStatus ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` + // ExtendedInfo - Additional information for this backup item. + ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // KpisHealths - Health details of different KPIs + KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ResourceGuardOperationRequests - ResourceGuardOperationRequests on which LAC check will be performed + ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` + // IsArchiveEnabled - Flag to identify whether datasource is protected in archive + IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + // PolicyName - Name of the policy used for protection + PolicyName *string `json:"policyName,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) MarshalJSON() ([]byte, error) { + avwsdpi.ProtectedItemType = ProtectedItemTypeAzureVMWorkloadSQLDatabase + objectMap := make(map[string]interface{}) + if avwsdpi.FriendlyName != nil { + objectMap["friendlyName"] = avwsdpi.FriendlyName + } + if avwsdpi.ServerName != nil { + objectMap["serverName"] = avwsdpi.ServerName + } + if avwsdpi.ParentName != nil { + objectMap["parentName"] = avwsdpi.ParentName + } + if avwsdpi.ParentType != nil { + objectMap["parentType"] = avwsdpi.ParentType + } + if avwsdpi.ProtectionStatus != nil { + objectMap["protectionStatus"] = avwsdpi.ProtectionStatus + } + if avwsdpi.ProtectionState != "" { + objectMap["protectionState"] = avwsdpi.ProtectionState + } + if avwsdpi.LastBackupStatus != "" { + objectMap["lastBackupStatus"] = avwsdpi.LastBackupStatus + } + if avwsdpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = avwsdpi.LastBackupTime + } + if avwsdpi.LastBackupErrorDetail != nil { + objectMap["lastBackupErrorDetail"] = avwsdpi.LastBackupErrorDetail + } + if avwsdpi.ProtectedItemDataSourceID != nil { + objectMap["protectedItemDataSourceId"] = avwsdpi.ProtectedItemDataSourceID + } + if avwsdpi.ProtectedItemHealthStatus != "" { + objectMap["protectedItemHealthStatus"] = avwsdpi.ProtectedItemHealthStatus + } + if avwsdpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = avwsdpi.ExtendedInfo + } + if avwsdpi.KpisHealths != nil { + objectMap["kpisHealths"] = avwsdpi.KpisHealths + } + if avwsdpi.BackupManagementType != "" { + objectMap["backupManagementType"] = avwsdpi.BackupManagementType + } + if avwsdpi.WorkloadType != "" { + objectMap["workloadType"] = avwsdpi.WorkloadType + } + if avwsdpi.ContainerName != nil { + objectMap["containerName"] = avwsdpi.ContainerName + } + if avwsdpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = avwsdpi.SourceResourceID + } + if avwsdpi.PolicyID != nil { + objectMap["policyId"] = avwsdpi.PolicyID + } + if avwsdpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = avwsdpi.LastRecoveryPoint + } + if avwsdpi.BackupSetName != nil { + objectMap["backupSetName"] = avwsdpi.BackupSetName + } + if avwsdpi.CreateMode != "" { + objectMap["createMode"] = avwsdpi.CreateMode + } + if avwsdpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = avwsdpi.DeferredDeleteTimeInUTC + } + if avwsdpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = avwsdpi.IsScheduledForDeferredDelete + } + if avwsdpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = avwsdpi.DeferredDeleteTimeRemaining + } + if avwsdpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = avwsdpi.IsDeferredDeleteScheduleUpcoming + } + if avwsdpi.IsRehydrate != nil { + objectMap["isRehydrate"] = avwsdpi.IsRehydrate + } + if avwsdpi.ResourceGuardOperationRequests != nil { + objectMap["resourceGuardOperationRequests"] = avwsdpi.ResourceGuardOperationRequests + } + if avwsdpi.IsArchiveEnabled != nil { + objectMap["isArchiveEnabled"] = avwsdpi.IsArchiveEnabled + } + if avwsdpi.PolicyName != nil { + objectMap["policyName"] = avwsdpi.PolicyName + } + if avwsdpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = avwsdpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return &avwsdpi, true +} + +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return &avwsdpi, true +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureVMWorkloadSQLDatabaseProtectedItem. +func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &avwsdpi, true +} + +// AzureVMWorkloadSQLDatabaseWorkloadItem azure VM workload-specific workload item representing SQL +// Database. +type AzureVMWorkloadSQLDatabaseWorkloadItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if workload item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected + SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { + avwsdwi.WorkloadItemType = WorkloadItemTypeSQLDataBase1 + objectMap := make(map[string]interface{}) + if avwsdwi.ParentName != nil { + objectMap["parentName"] = avwsdwi.ParentName + } + if avwsdwi.ServerName != nil { + objectMap["serverName"] = avwsdwi.ServerName + } + if avwsdwi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsdwi.IsAutoProtectable + } + if avwsdwi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsdwi.Subinquireditemcount + } + if avwsdwi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwsdwi.SubWorkloadItemCount + } + if avwsdwi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsdwi.BackupManagementType + } + if avwsdwi.WorkloadType != nil { + objectMap["workloadType"] = avwsdwi.WorkloadType + } + if avwsdwi.FriendlyName != nil { + objectMap["friendlyName"] = avwsdwi.FriendlyName + } + if avwsdwi.ProtectionState != "" { + objectMap["protectionState"] = avwsdwi.ProtectionState + } + if avwsdwi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwsdwi.WorkloadItemType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwsdwi, true +} + +// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { + return &avwsdwi, true +} + +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { + return nil, false +} + +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { + return nil, false +} + +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLDatabaseWorkloadItem. +func (avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwsdwi, true +} + +// AzureVMWorkloadSQLInstanceProtectableItem azure VM workload-specific protectable item representing SQL +// Instance. +type AzureVMWorkloadSQLInstanceProtectableItem struct { + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ParentUniqueName - Parent Unique Name is added to provide the service formatted URI Name of the Parent + // Only Applicable for data bases where the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + 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 + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + // Prebackupvalidation - Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) MarshalJSON() ([]byte, error) { + avwsipi.ProtectableItemType = ProtectableItemTypeSQLInstance + objectMap := make(map[string]interface{}) + if avwsipi.ParentName != nil { + objectMap["parentName"] = avwsipi.ParentName + } + if avwsipi.ParentUniqueName != nil { + objectMap["parentUniqueName"] = avwsipi.ParentUniqueName + } + if avwsipi.ServerName != nil { + objectMap["serverName"] = avwsipi.ServerName + } + if avwsipi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsipi.IsAutoProtectable + } + if avwsipi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwsipi.IsAutoProtected + } + if avwsipi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsipi.Subinquireditemcount + } + if avwsipi.Subprotectableitemcount != nil { + objectMap["subprotectableitemcount"] = avwsipi.Subprotectableitemcount + } + if avwsipi.Prebackupvalidation != nil { + objectMap["prebackupvalidation"] = avwsipi.Prebackupvalidation + } + if avwsipi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsipi.BackupManagementType + } + if avwsipi.WorkloadType != nil { + objectMap["workloadType"] = avwsipi.WorkloadType + } + if avwsipi.FriendlyName != nil { + objectMap["friendlyName"] = avwsipi.FriendlyName + } + if avwsipi.ProtectionState != "" { + objectMap["protectionState"] = avwsipi.ProtectionState + } + if avwsipi.ProtectableItemType != "" { + objectMap["protectableItemType"] = avwsipi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return &avwsipi, true +} + +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return &avwsipi, true +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureVMWorkloadSQLInstanceProtectableItem. +func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &avwsipi, true +} + +// AzureVMWorkloadSQLInstanceWorkloadItem azure VM workload-specific workload item representing SQL +// Instance. +type AzureVMWorkloadSQLInstanceWorkloadItem struct { + // DataDirectoryPaths - Data Directory Paths for default directories + DataDirectoryPaths *[]SQLDataDirectory `json:"dataDirectoryPaths,omitempty"` + // ParentName - Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + // ServerName - Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + // IsAutoProtectable - Indicates if workload item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // Subinquireditemcount - For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + // SubWorkloadItemCount - For instance or AG, indicates number of DB's to be protected + SubWorkloadItemCount *int32 `json:"subWorkloadItemCount,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) MarshalJSON() ([]byte, error) { + avwsiwi.WorkloadItemType = WorkloadItemTypeSQLInstance1 + objectMap := make(map[string]interface{}) + if avwsiwi.DataDirectoryPaths != nil { + objectMap["dataDirectoryPaths"] = avwsiwi.DataDirectoryPaths + } + if avwsiwi.ParentName != nil { + objectMap["parentName"] = avwsiwi.ParentName + } + if avwsiwi.ServerName != nil { + objectMap["serverName"] = avwsiwi.ServerName + } + if avwsiwi.IsAutoProtectable != nil { + objectMap["isAutoProtectable"] = avwsiwi.IsAutoProtectable + } + if avwsiwi.Subinquireditemcount != nil { + objectMap["subinquireditemcount"] = avwsiwi.Subinquireditemcount + } + if avwsiwi.SubWorkloadItemCount != nil { + objectMap["subWorkloadItemCount"] = avwsiwi.SubWorkloadItemCount + } + if avwsiwi.BackupManagementType != nil { + objectMap["backupManagementType"] = avwsiwi.BackupManagementType + } + if avwsiwi.WorkloadType != nil { + objectMap["workloadType"] = avwsiwi.WorkloadType + } + if avwsiwi.FriendlyName != nil { + objectMap["friendlyName"] = avwsiwi.FriendlyName + } + if avwsiwi.ProtectionState != "" { + objectMap["protectionState"] = avwsiwi.ProtectionState + } + if avwsiwi.WorkloadItemType != "" { + objectMap["workloadItemType"] = avwsiwi.WorkloadItemType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return &avwsiwi, true +} + +// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { + return &avwsiwi, true +} + +// AsWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { + return nil, false +} + +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for AzureVMWorkloadSQLInstanceWorkloadItem. +func (avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &avwsiwi, true +} + +// BasicAzureWorkloadAutoProtectionIntent azure Recovery Services Vault specific protection intent item. +type BasicAzureWorkloadAutoProtectionIntent interface { + AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) + AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) +} + +// AzureWorkloadAutoProtectionIntent azure Recovery Services Vault specific protection intent item. +type AzureWorkloadAutoProtectionIntent struct { + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId + ItemID *string `json:"itemId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadContainerAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' + ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` +} + +func unmarshalBasicAzureWorkloadAutoProtectionIntent(body []byte) (BasicAzureWorkloadAutoProtectionIntent, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectionIntentItemType"] { + case string(ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent): + var awsapi AzureWorkloadSQLAutoProtectionIntent + err := json.Unmarshal(body, &awsapi) + return awsapi, err + default: + var awapi AzureWorkloadAutoProtectionIntent + err := json.Unmarshal(body, &awapi) + return awapi, err + } +} +func unmarshalBasicAzureWorkloadAutoProtectionIntentArray(body []byte) ([]BasicAzureWorkloadAutoProtectionIntent, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awapiArray := make([]BasicAzureWorkloadAutoProtectionIntent, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awapi, err := unmarshalBasicAzureWorkloadAutoProtectionIntent(*rawMessage) + if err != nil { + return nil, err + } + awapiArray[index] = awapi + } + return awapiArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) MarshalJSON() ([]byte, error) { + awapi.ProtectionIntentItemType = ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent + objectMap := make(map[string]interface{}) + if awapi.BackupManagementType != "" { + objectMap["backupManagementType"] = awapi.BackupManagementType + } + if awapi.SourceResourceID != nil { + objectMap["sourceResourceId"] = awapi.SourceResourceID + } + if awapi.ItemID != nil { + objectMap["itemId"] = awapi.ItemID + } + if awapi.PolicyID != nil { + objectMap["policyId"] = awapi.PolicyID + } + if awapi.ProtectionState != "" { + objectMap["protectionState"] = awapi.ProtectionState + } + if awapi.ProtectionIntentItemType != "" { + objectMap["protectionIntentItemType"] = awapi.ProtectionIntentItemType + } + return json.Marshal(objectMap) +} + +// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { + return nil, false +} + +// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { + return &awapi, true +} + +// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { + return nil, false +} + +// AsAzureWorkloadContainerAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) AsAzureWorkloadContainerAutoProtectionIntent() (*AzureWorkloadContainerAutoProtectionIntent, bool) { + return nil, false +} + +// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { + return &awapi, true +} + +// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { + return &awapi, true +} + +// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { + return nil, false +} + +// AsProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { + return nil, false +} + +// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadAutoProtectionIntent. +func (awapi AzureWorkloadAutoProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { + return &awapi, true +} + +// AzureWorkloadBackupRequest azureWorkload workload-specific backup request. +type AzureWorkloadBackupRequest struct { + // BackupType - Type of backup, viz. Full, Differential, Log or CopyOnlyFull. Possible values include: 'TypeEnumInvalid', 'TypeEnumFull', 'TypeEnumDifferential', 'TypeEnumLog', 'TypeEnumCopyOnlyFull', 'TypeEnumIncremental' + BackupType TypeEnum `json:"backupType,omitempty"` + // EnableCompression - Bool for Compression setting + EnableCompression *bool `json:"enableCompression,omitempty"` + // RecoveryPointExpiryTimeInUTC - Backup copy will expire after the time specified (UTC). + RecoveryPointExpiryTimeInUTC *date.Time `json:"recoveryPointExpiryTimeInUTC,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' + ObjectType ObjectTypeBasicRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadBackupRequest. +func (awbr AzureWorkloadBackupRequest) MarshalJSON() ([]byte, error) { + awbr.ObjectType = ObjectTypeAzureWorkloadBackupRequest + objectMap := make(map[string]interface{}) + if awbr.BackupType != "" { + objectMap["backupType"] = awbr.BackupType + } + if awbr.EnableCompression != nil { + objectMap["enableCompression"] = awbr.EnableCompression + } + if awbr.RecoveryPointExpiryTimeInUTC != nil { + objectMap["recoveryPointExpiryTimeInUTC"] = awbr.RecoveryPointExpiryTimeInUTC + } + if awbr.ObjectType != "" { + objectMap["objectType"] = awbr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareBackupRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. +func (awbr AzureWorkloadBackupRequest) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { + return nil, false +} + +// AsAzureWorkloadBackupRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. +func (awbr AzureWorkloadBackupRequest) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { + return &awbr, true +} + +// AsIaasVMBackupRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. +func (awbr AzureWorkloadBackupRequest) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { + return nil, false +} + +// AsRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. +func (awbr AzureWorkloadBackupRequest) AsRequest() (*Request, bool) { + return nil, false +} + +// AsBasicRequest is the BasicRequest implementation for AzureWorkloadBackupRequest. +func (awbr AzureWorkloadBackupRequest) AsBasicRequest() (BasicRequest, bool) { + return &awbr, true +} + +// BasicAzureWorkloadContainer container for the workloads running inside Azure Compute or Classic Compute. +type BasicAzureWorkloadContainer interface { + AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) + AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) + AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) +} + +// AzureWorkloadContainer container for the workloads running inside Azure Compute or Classic Compute. +type AzureWorkloadContainer struct { + // SourceResourceID - ARM ID of the virtual machine represented by this Azure Workload Container + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // LastUpdatedTime - Time stamp when this container was updated. + LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` + // ExtendedInfo - Additional details of a workload container. + ExtendedInfo *AzureWorkloadContainerExtendedInfo `json:"extendedInfo,omitempty"` + // WorkloadType - Workload type for which registration was sent. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` + // OperationType - Re-Do Operation. Possible values include: 'OperationTypeInvalid', 'OperationTypeRegister', 'OperationTypeReregister' + OperationType OperationType `json:"operationType,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ProtectableObjectType - Type of the protectable object associated with this container + ProtectableObjectType *string `json:"protectableObjectType,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaasVMContainer1', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +func unmarshalBasicAzureWorkloadContainer(body []byte) (BasicAzureWorkloadContainer, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["containerType"] { + case string(ContainerTypeSQLAGWorkLoadContainer1): + var aswcpc AzureSQLAGWorkloadContainerProtectionContainer + err := json.Unmarshal(body, &aswcpc) + return aswcpc, err + case string(ContainerTypeVMAppContainer1): + var avacpc AzureVMAppContainerProtectionContainer + err := json.Unmarshal(body, &avacpc) + return avacpc, err + default: + var awc AzureWorkloadContainer + err := json.Unmarshal(body, &awc) + return awc, err + } +} +func unmarshalBasicAzureWorkloadContainerArray(body []byte) ([]BasicAzureWorkloadContainer, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awcArray := make([]BasicAzureWorkloadContainer, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awc, err := unmarshalBasicAzureWorkloadContainer(*rawMessage) + if err != nil { + return nil, err + } + awcArray[index] = awc + } + return awcArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) MarshalJSON() ([]byte, error) { + awc.ContainerType = ContainerTypeAzureWorkloadContainer + objectMap := make(map[string]interface{}) + if awc.SourceResourceID != nil { + objectMap["sourceResourceId"] = awc.SourceResourceID + } + if awc.LastUpdatedTime != nil { + objectMap["lastUpdatedTime"] = awc.LastUpdatedTime + } + if awc.ExtendedInfo != nil { + objectMap["extendedInfo"] = awc.ExtendedInfo + } + if awc.WorkloadType != "" { + objectMap["workloadType"] = awc.WorkloadType + } + if awc.OperationType != "" { + objectMap["operationType"] = awc.OperationType + } + if awc.FriendlyName != nil { + objectMap["friendlyName"] = awc.FriendlyName + } + if awc.BackupManagementType != "" { + objectMap["backupManagementType"] = awc.BackupManagementType + } + if awc.RegistrationStatus != nil { + objectMap["registrationStatus"] = awc.RegistrationStatus + } + if awc.HealthStatus != nil { + objectMap["healthStatus"] = awc.HealthStatus + } + if awc.ProtectableObjectType != nil { + objectMap["protectableObjectType"] = awc.ProtectableObjectType + } + if awc.ContainerType != "" { + objectMap["containerType"] = awc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return &awc, true +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return &awc, true +} + +// AsDpmContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsBasicDpmContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureWorkloadContainer. +func (awc AzureWorkloadContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &awc, true +} + +// AzureWorkloadContainerAutoProtectionIntent azure workload specific protection intent item. +type AzureWorkloadContainerAutoProtectionIntent struct { + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId + ItemID *string `json:"itemId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadContainerAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' + ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadContainerAutoProtectionIntent. +func (awcapi AzureWorkloadContainerAutoProtectionIntent) MarshalJSON() ([]byte, error) { + awcapi.ProtectionIntentItemType = ProtectionIntentItemTypeAzureWorkloadContainerAutoProtectionIntent + objectMap := make(map[string]interface{}) + if awcapi.BackupManagementType != "" { + objectMap["backupManagementType"] = awcapi.BackupManagementType + } + if awcapi.SourceResourceID != nil { + objectMap["sourceResourceId"] = awcapi.SourceResourceID + } + if awcapi.ItemID != nil { + objectMap["itemId"] = awcapi.ItemID + } + if awcapi.PolicyID != nil { + objectMap["policyId"] = awcapi.PolicyID + } + if awcapi.ProtectionState != "" { + objectMap["protectionState"] = awcapi.ProtectionState + } + if awcapi.ProtectionIntentItemType != "" { + objectMap["protectionIntentItemType"] = awcapi.ProtectionIntentItemType + } + return json.Marshal(objectMap) +} + +// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadContainerAutoProtectionIntent. +func (awcapi AzureWorkloadContainerAutoProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { + return nil, false +} + +// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadContainerAutoProtectionIntent. +func (awcapi AzureWorkloadContainerAutoProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { + return nil, false +} + +// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadContainerAutoProtectionIntent. +func (awcapi AzureWorkloadContainerAutoProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { + return nil, false +} + +// AsAzureWorkloadContainerAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadContainerAutoProtectionIntent. +func (awcapi AzureWorkloadContainerAutoProtectionIntent) AsAzureWorkloadContainerAutoProtectionIntent() (*AzureWorkloadContainerAutoProtectionIntent, bool) { + return &awcapi, true +} + +// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadContainerAutoProtectionIntent. +func (awcapi AzureWorkloadContainerAutoProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { + return nil, false +} + +// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadContainerAutoProtectionIntent. +func (awcapi AzureWorkloadContainerAutoProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { + return nil, false +} + +// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadContainerAutoProtectionIntent. +func (awcapi AzureWorkloadContainerAutoProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { + return nil, false +} + +// AsProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadContainerAutoProtectionIntent. +func (awcapi AzureWorkloadContainerAutoProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { + return nil, false +} + +// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadContainerAutoProtectionIntent. +func (awcapi AzureWorkloadContainerAutoProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { + return &awcapi, true +} + +// AzureWorkloadContainerExtendedInfo extended information of the container. +type AzureWorkloadContainerExtendedInfo struct { + // HostServerName - Host Os Name in case of Stand Alone and Cluster Name in case of distributed container. + HostServerName *string `json:"hostServerName,omitempty"` + // InquiryInfo - Inquiry Status for the container. + InquiryInfo *InquiryInfo `json:"inquiryInfo,omitempty"` + // NodesList - List of the nodes in case of distributed container. + NodesList *[]DistributedNodesInfo `json:"nodesList,omitempty"` +} + +// AzureWorkloadErrorInfo azure storage specific error information +type AzureWorkloadErrorInfo struct { + // ErrorCode - Error code. + ErrorCode *int32 `json:"errorCode,omitempty"` + // ErrorString - Localized error string. + ErrorString *string `json:"errorString,omitempty"` + // ErrorTitle - Title: Typically, the entity that the error pertains to. + ErrorTitle *string `json:"errorTitle,omitempty"` + // Recommendations - List of localized recommendations for above error code. + Recommendations *[]string `json:"recommendations,omitempty"` + // AdditionalDetails - Additional details for above error code. + AdditionalDetails *string `json:"additionalDetails,omitempty"` +} + +// AzureWorkloadJob azure storage specific job. +type AzureWorkloadJob struct { + // WorkloadType - Workload type of the job + WorkloadType *string `json:"workloadType,omitempty"` + // Duration - Time elapsed during the execution of this job. + Duration *string `json:"duration,omitempty"` + // ActionsInfo - Gets or sets the state/actions applicable on this job like cancel/retry. + ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` + // ErrorDetails - Error details on execution of this job. + ErrorDetails *[]AzureWorkloadErrorInfo `json:"errorDetails,omitempty"` + // ExtendedInfo - Additional information about the job. + ExtendedInfo *AzureWorkloadJobExtendedInfo `json:"extendedInfo,omitempty"` + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureIaaSVMJobV2', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob', 'JobTypeVaultJob' + JobType JobType `json:"jobType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadJob. +func (awj AzureWorkloadJob) MarshalJSON() ([]byte, error) { + awj.JobType = JobTypeAzureWorkloadJob + objectMap := make(map[string]interface{}) + if awj.WorkloadType != nil { + objectMap["workloadType"] = awj.WorkloadType + } + if awj.Duration != nil { + objectMap["duration"] = awj.Duration + } + if awj.ActionsInfo != nil { + objectMap["actionsInfo"] = awj.ActionsInfo + } + if awj.ErrorDetails != nil { + objectMap["errorDetails"] = awj.ErrorDetails + } + if awj.ExtendedInfo != nil { + objectMap["extendedInfo"] = awj.ExtendedInfo + } + if awj.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = awj.EntityFriendlyName + } + if awj.BackupManagementType != "" { + objectMap["backupManagementType"] = awj.BackupManagementType + } + if awj.Operation != nil { + objectMap["operation"] = awj.Operation + } + if awj.Status != nil { + objectMap["status"] = awj.Status + } + if awj.StartTime != nil { + objectMap["startTime"] = awj.StartTime + } + if awj.EndTime != nil { + objectMap["endTime"] = awj.EndTime + } + if awj.ActivityID != nil { + objectMap["activityId"] = awj.ActivityID + } + if awj.JobType != "" { + objectMap["jobType"] = awj.JobType + } + return json.Marshal(objectMap) +} + +// AsAzureIaaSVMJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { + return nil, false +} + +// AsAzureIaaSVMJobV2 is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsAzureIaaSVMJobV2() (*AzureIaaSVMJobV2, bool) { + return nil, false +} + +// AsAzureStorageJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsAzureStorageJob() (*AzureStorageJob, bool) { + return nil, false +} + +// AsAzureWorkloadJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { + return &awj, true +} + +// AsDpmJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsDpmJob() (*DpmJob, bool) { + return nil, false +} + +// AsMabJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsMabJob() (*MabJob, bool) { + return nil, false +} + +// AsVaultJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsVaultJob() (*VaultJob, bool) { + return nil, false +} + +// AsJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsJob() (*Job, bool) { + return nil, false +} + +// AsBasicJob is the BasicJob implementation for AzureWorkloadJob. +func (awj AzureWorkloadJob) AsBasicJob() (BasicJob, bool) { + return &awj, true +} + +// AzureWorkloadJobExtendedInfo azure VM workload-specific additional information for job. +type AzureWorkloadJobExtendedInfo struct { + // TasksList - List of tasks for this job + TasksList *[]AzureWorkloadJobTaskDetails `json:"tasksList,omitempty"` + // PropertyBag - Job properties. + PropertyBag map[string]*string `json:"propertyBag"` + // DynamicErrorMessage - Non localized error message on job execution. + DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadJobExtendedInfo. +func (awjei AzureWorkloadJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if awjei.TasksList != nil { + objectMap["tasksList"] = awjei.TasksList + } + if awjei.PropertyBag != nil { + objectMap["propertyBag"] = awjei.PropertyBag + } + if awjei.DynamicErrorMessage != nil { + objectMap["dynamicErrorMessage"] = awjei.DynamicErrorMessage + } + return json.Marshal(objectMap) +} + +// AzureWorkloadJobTaskDetails azure VM workload specific job task details. +type AzureWorkloadJobTaskDetails struct { + // TaskID - The task display name. + TaskID *string `json:"taskId,omitempty"` + // Status - The status. + Status *string `json:"status,omitempty"` +} + +// BasicAzureWorkloadPointInTimeRecoveryPoint recovery point specific to PointInTime +type BasicAzureWorkloadPointInTimeRecoveryPoint interface { + AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) + AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) +} + +// AzureWorkloadPointInTimeRecoveryPoint recovery point specific to PointInTime +type AzureWorkloadPointInTimeRecoveryPoint struct { + // TimeRanges - List of log ranges + TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` + // RecoveryPointTimeInUTC - UTC time at which recovery point was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' + Type RestorePointType `json:"type,omitempty"` + // RecoveryPointTierDetails - Recovery point tier information. + RecoveryPointTierDetails *[]RecoveryPointTierInformationV2 `json:"recoveryPointTierDetails,omitempty"` + // RecoveryPointMoveReadinessInfo - Eligibility of RP to be moved to another tier + RecoveryPointMoveReadinessInfo map[string]*RecoveryPointMoveReadinessInfo `json:"recoveryPointMoveReadinessInfo"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +func unmarshalBasicAzureWorkloadPointInTimeRecoveryPoint(body []byte) (BasicAzureWorkloadPointInTimeRecoveryPoint, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): + var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awshpitrp) + return awshpitrp, err + default: + var awpitrp AzureWorkloadPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awpitrp) + return awpitrp, err + } +} +func unmarshalBasicAzureWorkloadPointInTimeRecoveryPointArray(body []byte) ([]BasicAzureWorkloadPointInTimeRecoveryPoint, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awpitrpArray := make([]BasicAzureWorkloadPointInTimeRecoveryPoint, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awpitrp, err := unmarshalBasicAzureWorkloadPointInTimeRecoveryPoint(*rawMessage) + if err != nil { + return nil, err + } + awpitrpArray[index] = awpitrp + } + return awpitrpArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { + awpitrp.ObjectType = ObjectTypeAzureWorkloadPointInTimeRecoveryPoint + objectMap := make(map[string]interface{}) + if awpitrp.TimeRanges != nil { + objectMap["timeRanges"] = awpitrp.TimeRanges + } + if awpitrp.RecoveryPointTimeInUTC != nil { + objectMap["recoveryPointTimeInUTC"] = awpitrp.RecoveryPointTimeInUTC + } + if awpitrp.Type != "" { + objectMap["type"] = awpitrp.Type + } + if awpitrp.RecoveryPointTierDetails != nil { + objectMap["recoveryPointTierDetails"] = awpitrp.RecoveryPointTierDetails + } + if awpitrp.RecoveryPointMoveReadinessInfo != nil { + objectMap["recoveryPointMoveReadinessInfo"] = awpitrp.RecoveryPointMoveReadinessInfo + } + if awpitrp.ObjectType != "" { + objectMap["objectType"] = awpitrp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { + return &awpitrp, true +} + +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { + return &awpitrp, true +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return &awpitrp, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadPointInTimeRecoveryPoint. +func (awpitrp AzureWorkloadPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awpitrp, true +} + +// AzureWorkloadPointInTimeRestoreRequest azureWorkload SAP Hana -specific restore. Specifically for +// PointInTime/Log restore +type AzureWorkloadPointInTimeRestoreRequest struct { + // PointInTime - PointInTime value + PointInTime *date.Time `json:"pointInTime,omitempty"` + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // TargetVirtualMachineID - This is the complete ARM Id of the target VM + // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest', 'ObjectTypeIaasVMRestoreWithRehydrationRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { + awpitrr.ObjectType = ObjectTypeAzureWorkloadPointInTimeRestoreRequest + objectMap := make(map[string]interface{}) + if awpitrr.PointInTime != nil { + objectMap["pointInTime"] = awpitrr.PointInTime + } + if awpitrr.RecoveryType != "" { + objectMap["recoveryType"] = awpitrr.RecoveryType + } + if awpitrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awpitrr.SourceResourceID + } + if awpitrr.PropertyBag != nil { + objectMap["propertyBag"] = awpitrr.PropertyBag + } + if awpitrr.TargetInfo != nil { + objectMap["targetInfo"] = awpitrr.TargetInfo + } + if awpitrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awpitrr.RecoveryMode + } + if awpitrr.TargetVirtualMachineID != nil { + objectMap["targetVirtualMachineId"] = awpitrr.TargetVirtualMachineID + } + if awpitrr.ObjectType != "" { + objectMap["objectType"] = awpitrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return &awpitrr, true +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awpitrr, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest() (BasicAzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLPointInTimeRestoreRequest() (BasicAzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsBasicIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicIaasVMRestoreRequest() (BasicIaasVMRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreWithRehydrateRequest() (*AzureWorkloadSQLRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreWithRehydrationRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsIaasVMRestoreWithRehydrationRequest() (*IaasVMRestoreWithRehydrationRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadPointInTimeRestoreRequest. +func (awpitrr AzureWorkloadPointInTimeRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awpitrr, true +} + +// BasicAzureWorkloadRecoveryPoint workload specific recovery point, specifically encapsulates full/diff recovery point +type BasicAzureWorkloadRecoveryPoint interface { + AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) + AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) + AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) + AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) + AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) +} + +// AzureWorkloadRecoveryPoint workload specific recovery point, specifically encapsulates full/diff recovery +// point +type AzureWorkloadRecoveryPoint struct { + // RecoveryPointTimeInUTC - UTC time at which recovery point was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' + Type RestorePointType `json:"type,omitempty"` + // RecoveryPointTierDetails - Recovery point tier information. + RecoveryPointTierDetails *[]RecoveryPointTierInformationV2 `json:"recoveryPointTierDetails,omitempty"` + // RecoveryPointMoveReadinessInfo - Eligibility of RP to be moved to another tier + RecoveryPointMoveReadinessInfo map[string]*RecoveryPointMoveReadinessInfo `json:"recoveryPointMoveReadinessInfo"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +func unmarshalBasicAzureWorkloadRecoveryPoint(body []byte) (BasicAzureWorkloadRecoveryPoint, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadPointInTimeRecoveryPoint): + var awpitrp AzureWorkloadPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awpitrp) + return awpitrp, err + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): + var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awshpitrp) + return awshpitrp, err + case string(ObjectTypeAzureWorkloadSAPHanaRecoveryPoint): + var awshrp AzureWorkloadSAPHanaRecoveryPoint + err := json.Unmarshal(body, &awshrp) + return awshrp, err + case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): + var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awspitrp) + return awspitrp, err + case string(ObjectTypeAzureWorkloadSQLRecoveryPoint): + var awsrp AzureWorkloadSQLRecoveryPoint + err := json.Unmarshal(body, &awsrp) + return awsrp, err + default: + var awrp AzureWorkloadRecoveryPoint + err := json.Unmarshal(body, &awrp) + return awrp, err + } +} +func unmarshalBasicAzureWorkloadRecoveryPointArray(body []byte) ([]BasicAzureWorkloadRecoveryPoint, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awrpArray := make([]BasicAzureWorkloadRecoveryPoint, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awrp, err := unmarshalBasicAzureWorkloadRecoveryPoint(*rawMessage) + if err != nil { + return nil, err + } + awrpArray[index] = awrp + } + return awrpArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) MarshalJSON() ([]byte, error) { + awrp.ObjectType = ObjectTypeAzureWorkloadRecoveryPoint + objectMap := make(map[string]interface{}) + if awrp.RecoveryPointTimeInUTC != nil { + objectMap["recoveryPointTimeInUTC"] = awrp.RecoveryPointTimeInUTC + } + if awrp.Type != "" { + objectMap["type"] = awrp.Type + } + if awrp.RecoveryPointTierDetails != nil { + objectMap["recoveryPointTierDetails"] = awrp.RecoveryPointTierDetails + } + if awrp.RecoveryPointMoveReadinessInfo != nil { + objectMap["recoveryPointMoveReadinessInfo"] = awrp.RecoveryPointMoveReadinessInfo + } + if awrp.ObjectType != "" { + objectMap["objectType"] = awrp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return &awrp, true +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return &awrp, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadRecoveryPoint. +func (awrp AzureWorkloadRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awrp, true +} + +// BasicAzureWorkloadRestoreRequest azureWorkload-specific restore. +type BasicAzureWorkloadRestoreRequest interface { + AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) + AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) + AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest() (BasicAzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) + AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) + AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) + AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) + AsBasicAzureWorkloadSQLPointInTimeRestoreRequest() (BasicAzureWorkloadSQLPointInTimeRestoreRequest, bool) + AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) + AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) + AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, bool) + AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaRestoreWithRehydrateRequest, bool) + AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, bool) + AsAzureWorkloadSQLRestoreWithRehydrateRequest() (*AzureWorkloadSQLRestoreWithRehydrateRequest, bool) + AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) +} + +// AzureWorkloadRestoreRequest azureWorkload-specific restore. +type AzureWorkloadRestoreRequest struct { + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // TargetVirtualMachineID - This is the complete ARM Id of the target VM + // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest', 'ObjectTypeIaasVMRestoreWithRehydrationRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicAzureWorkloadRestoreRequest(body []byte) (BasicAzureWorkloadRestoreRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadPointInTimeRestoreRequest): + var awpitrr AzureWorkloadPointInTimeRestoreRequest + err := json.Unmarshal(body, &awpitrr) + return awpitrr, err + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): + var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest + err := json.Unmarshal(body, &awshpitrr) + return awshpitrr, err + case string(ObjectTypeAzureWorkloadSAPHanaRestoreRequest): + var awshrr AzureWorkloadSAPHanaRestoreRequest + err := json.Unmarshal(body, &awshrr) + return awshrr, err + case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): + var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest + err := json.Unmarshal(body, &awspitrr) + return awspitrr, err + case string(ObjectTypeAzureWorkloadSQLRestoreRequest): + var awsrr AzureWorkloadSQLRestoreRequest + err := json.Unmarshal(body, &awsrr) + return awsrr, err + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest): + var awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest + err := json.Unmarshal(body, &awshpitrwrr) + return awshpitrwrr, err + case string(ObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest): + var awshrwrr AzureWorkloadSAPHanaRestoreWithRehydrateRequest + err := json.Unmarshal(body, &awshrwrr) + return awshrwrr, err + case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest): + var awspitrwrr AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest + err := json.Unmarshal(body, &awspitrwrr) + return awspitrwrr, err + case string(ObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest): + var awsrwrr AzureWorkloadSQLRestoreWithRehydrateRequest + err := json.Unmarshal(body, &awsrwrr) + return awsrwrr, err + default: + var awrr AzureWorkloadRestoreRequest + err := json.Unmarshal(body, &awrr) + return awrr, err + } +} +func unmarshalBasicAzureWorkloadRestoreRequestArray(body []byte) ([]BasicAzureWorkloadRestoreRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awrrArray := make([]BasicAzureWorkloadRestoreRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awrr, err := unmarshalBasicAzureWorkloadRestoreRequest(*rawMessage) + if err != nil { + return nil, err + } + awrrArray[index] = awrr + } + return awrrArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) MarshalJSON() ([]byte, error) { + awrr.ObjectType = ObjectTypeAzureWorkloadRestoreRequest + objectMap := make(map[string]interface{}) + if awrr.RecoveryType != "" { + objectMap["recoveryType"] = awrr.RecoveryType + } + if awrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awrr.SourceResourceID + } + if awrr.PropertyBag != nil { + objectMap["propertyBag"] = awrr.PropertyBag + } + if awrr.TargetInfo != nil { + objectMap["targetInfo"] = awrr.TargetInfo + } + if awrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awrr.RecoveryMode + } + if awrr.TargetVirtualMachineID != nil { + objectMap["targetVirtualMachineId"] = awrr.TargetVirtualMachineID + } + if awrr.ObjectType != "" { + objectMap["objectType"] = awrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return &awrr, true +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awrr, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest() (BasicAzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadSQLPointInTimeRestoreRequest() (BasicAzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsBasicIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsBasicIaasVMRestoreRequest() (BasicIaasVMRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsAzureWorkloadSQLRestoreWithRehydrateRequest() (*AzureWorkloadSQLRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreWithRehydrationRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsIaasVMRestoreWithRehydrationRequest() (*IaasVMRestoreWithRehydrationRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadRestoreRequest. +func (awrr AzureWorkloadRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awrr, true +} + +// AzureWorkloadSAPHanaPointInTimeRecoveryPoint recovery point specific to PointInTime in SAPHana +type AzureWorkloadSAPHanaPointInTimeRecoveryPoint struct { + // TimeRanges - List of log ranges + TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` + // RecoveryPointTimeInUTC - UTC time at which recovery point was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' + Type RestorePointType `json:"type,omitempty"` + // RecoveryPointTierDetails - Recovery point tier information. + RecoveryPointTierDetails *[]RecoveryPointTierInformationV2 `json:"recoveryPointTierDetails,omitempty"` + // RecoveryPointMoveReadinessInfo - Eligibility of RP to be moved to another tier + RecoveryPointMoveReadinessInfo map[string]*RecoveryPointMoveReadinessInfo `json:"recoveryPointMoveReadinessInfo"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { + awshpitrp.ObjectType = ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint + objectMap := make(map[string]interface{}) + if awshpitrp.TimeRanges != nil { + objectMap["timeRanges"] = awshpitrp.TimeRanges + } + if awshpitrp.RecoveryPointTimeInUTC != nil { + objectMap["recoveryPointTimeInUTC"] = awshpitrp.RecoveryPointTimeInUTC + } + if awshpitrp.Type != "" { + objectMap["type"] = awshpitrp.Type + } + if awshpitrp.RecoveryPointTierDetails != nil { + objectMap["recoveryPointTierDetails"] = awshpitrp.RecoveryPointTierDetails + } + if awshpitrp.RecoveryPointMoveReadinessInfo != nil { + objectMap["recoveryPointMoveReadinessInfo"] = awshpitrp.RecoveryPointMoveReadinessInfo + } + if awshpitrp.ObjectType != "" { + objectMap["objectType"] = awshpitrp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { + return &awshpitrp, true +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return &awshpitrp, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return &awshpitrp, true +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awshpitrp, true +} + +// BasicAzureWorkloadSAPHanaPointInTimeRestoreRequest azureWorkload SAP Hana -specific restore. Specifically for +// PointInTime/Log restore +type BasicAzureWorkloadSAPHanaPointInTimeRestoreRequest interface { + AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, bool) + AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) +} + +// AzureWorkloadSAPHanaPointInTimeRestoreRequest azureWorkload SAP Hana -specific restore. Specifically for +// PointInTime/Log restore +type AzureWorkloadSAPHanaPointInTimeRestoreRequest struct { + // PointInTime - PointInTime value + PointInTime *date.Time `json:"pointInTime,omitempty"` + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // TargetVirtualMachineID - This is the complete ARM Id of the target VM + // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest', 'ObjectTypeIaasVMRestoreWithRehydrationRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest(body []byte) (BasicAzureWorkloadSAPHanaPointInTimeRestoreRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest): + var awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest + err := json.Unmarshal(body, &awshpitrwrr) + return awshpitrwrr, err + default: + var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest + err := json.Unmarshal(body, &awshpitrr) + return awshpitrr, err + } +} +func unmarshalBasicAzureWorkloadSAPHanaPointInTimeRestoreRequestArray(body []byte) ([]BasicAzureWorkloadSAPHanaPointInTimeRestoreRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awshpitrrArray := make([]BasicAzureWorkloadSAPHanaPointInTimeRestoreRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awshpitrr, err := unmarshalBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest(*rawMessage) + if err != nil { + return nil, err + } + awshpitrrArray[index] = awshpitrr + } + return awshpitrrArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { + awshpitrr.ObjectType = ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest + objectMap := make(map[string]interface{}) + if awshpitrr.PointInTime != nil { + objectMap["pointInTime"] = awshpitrr.PointInTime + } + if awshpitrr.RecoveryType != "" { + objectMap["recoveryType"] = awshpitrr.RecoveryType + } + if awshpitrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awshpitrr.SourceResourceID + } + if awshpitrr.PropertyBag != nil { + objectMap["propertyBag"] = awshpitrr.PropertyBag + } + if awshpitrr.TargetInfo != nil { + objectMap["targetInfo"] = awshpitrr.TargetInfo + } + if awshpitrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awshpitrr.RecoveryMode + } + if awshpitrr.TargetVirtualMachineID != nil { + objectMap["targetVirtualMachineId"] = awshpitrr.TargetVirtualMachineID + } + if awshpitrr.ObjectType != "" { + objectMap["objectType"] = awshpitrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awshpitrr, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return &awshpitrr, true +} + +// AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest() (BasicAzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return &awshpitrr, true +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return &awshpitrr, true +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLPointInTimeRestoreRequest() (BasicAzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsBasicIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicIaasVMRestoreRequest() (BasicIaasVMRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreWithRehydrateRequest() (*AzureWorkloadSQLRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreWithRehydrationRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsIaasVMRestoreWithRehydrationRequest() (*IaasVMRestoreWithRehydrationRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awshpitrr, true +} + +// AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest azureWorkload SAP Hana-specific restore with +// integrated rehydration of recovery point. +type AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest struct { + // RecoveryPointRehydrationInfo - RP Rehydration Info + RecoveryPointRehydrationInfo *RecoveryPointRehydrationInfo `json:"recoveryPointRehydrationInfo,omitempty"` + // PointInTime - PointInTime value + PointInTime *date.Time `json:"pointInTime,omitempty"` + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // TargetVirtualMachineID - This is the complete ARM Id of the target VM + // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest', 'ObjectTypeIaasVMRestoreWithRehydrationRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. +func (awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) MarshalJSON() ([]byte, error) { + awshpitrwrr.ObjectType = ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest + objectMap := make(map[string]interface{}) + if awshpitrwrr.RecoveryPointRehydrationInfo != nil { + objectMap["recoveryPointRehydrationInfo"] = awshpitrwrr.RecoveryPointRehydrationInfo + } + if awshpitrwrr.PointInTime != nil { + objectMap["pointInTime"] = awshpitrwrr.PointInTime + } + if awshpitrwrr.RecoveryType != "" { + objectMap["recoveryType"] = awshpitrwrr.RecoveryType + } + if awshpitrwrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awshpitrwrr.SourceResourceID + } + if awshpitrwrr.PropertyBag != nil { + objectMap["propertyBag"] = awshpitrwrr.PropertyBag + } + if awshpitrwrr.TargetInfo != nil { + objectMap["targetInfo"] = awshpitrwrr.TargetInfo + } + if awshpitrwrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awshpitrwrr.RecoveryMode + } + if awshpitrwrr.TargetVirtualMachineID != nil { + objectMap["targetVirtualMachineId"] = awshpitrwrr.TargetVirtualMachineID + } + if awshpitrwrr.ObjectType != "" { + objectMap["objectType"] = awshpitrwrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. +func (awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. +func (awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. +func (awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. +func (awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awshpitrwrr, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. +func (awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. +func (awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest() (BasicAzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return &awshpitrwrr, true +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. +func (awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. +func (awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return &awshpitrwrr, true +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. +func (awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. +func (awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) AsBasicAzureWorkloadSQLPointInTimeRestoreRequest() (BasicAzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. +func (awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. +func (awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. +func (awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsBasicIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. +func (awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) AsBasicIaasVMRestoreRequest() (BasicIaasVMRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. +func (awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, bool) { + return &awshpitrwrr, true +} + +// AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. +func (awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. +func (awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. +func (awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) AsAzureWorkloadSQLRestoreWithRehydrateRequest() (*AzureWorkloadSQLRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreWithRehydrationRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. +func (awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) AsIaasVMRestoreWithRehydrationRequest() (*IaasVMRestoreWithRehydrationRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. +func (awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. +func (awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awshpitrwrr, true +} + +// AzureWorkloadSAPHanaRecoveryPoint sAPHana specific recoverypoint, specifically encapsulates full/diff +// recoverypoints +type AzureWorkloadSAPHanaRecoveryPoint struct { + // RecoveryPointTimeInUTC - UTC time at which recovery point was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' + Type RestorePointType `json:"type,omitempty"` + // RecoveryPointTierDetails - Recovery point tier information. + RecoveryPointTierDetails *[]RecoveryPointTierInformationV2 `json:"recoveryPointTierDetails,omitempty"` + // RecoveryPointMoveReadinessInfo - Eligibility of RP to be moved to another tier + RecoveryPointMoveReadinessInfo map[string]*RecoveryPointMoveReadinessInfo `json:"recoveryPointMoveReadinessInfo"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) MarshalJSON() ([]byte, error) { + awshrp.ObjectType = ObjectTypeAzureWorkloadSAPHanaRecoveryPoint + objectMap := make(map[string]interface{}) + if awshrp.RecoveryPointTimeInUTC != nil { + objectMap["recoveryPointTimeInUTC"] = awshrp.RecoveryPointTimeInUTC + } + if awshrp.Type != "" { + objectMap["type"] = awshrp.Type + } + if awshrp.RecoveryPointTierDetails != nil { + objectMap["recoveryPointTierDetails"] = awshrp.RecoveryPointTierDetails + } + if awshrp.RecoveryPointMoveReadinessInfo != nil { + objectMap["recoveryPointMoveReadinessInfo"] = awshrp.RecoveryPointMoveReadinessInfo + } + if awshrp.ObjectType != "" { + objectMap["objectType"] = awshrp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return &awshrp, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return &awshrp, true +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSAPHanaRecoveryPoint. +func (awshrp AzureWorkloadSAPHanaRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awshrp, true +} + +// BasicAzureWorkloadSAPHanaRestoreRequest azureWorkload SAP Hana-specific restore. +type BasicAzureWorkloadSAPHanaRestoreRequest interface { + AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) + AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest() (BasicAzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) + AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, bool) + AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaRestoreWithRehydrateRequest, bool) + AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) +} + +// AzureWorkloadSAPHanaRestoreRequest azureWorkload SAP Hana-specific restore. +type AzureWorkloadSAPHanaRestoreRequest struct { + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // TargetVirtualMachineID - This is the complete ARM Id of the target VM + // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest', 'ObjectTypeIaasVMRestoreWithRehydrationRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicAzureWorkloadSAPHanaRestoreRequest(body []byte) (BasicAzureWorkloadSAPHanaRestoreRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): + var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest + err := json.Unmarshal(body, &awshpitrr) + return awshpitrr, err + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest): + var awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest + err := json.Unmarshal(body, &awshpitrwrr) + return awshpitrwrr, err + case string(ObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest): + var awshrwrr AzureWorkloadSAPHanaRestoreWithRehydrateRequest + err := json.Unmarshal(body, &awshrwrr) + return awshrwrr, err + default: + var awshrr AzureWorkloadSAPHanaRestoreRequest + err := json.Unmarshal(body, &awshrr) + return awshrr, err + } +} +func unmarshalBasicAzureWorkloadSAPHanaRestoreRequestArray(body []byte) ([]BasicAzureWorkloadSAPHanaRestoreRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awshrrArray := make([]BasicAzureWorkloadSAPHanaRestoreRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awshrr, err := unmarshalBasicAzureWorkloadSAPHanaRestoreRequest(*rawMessage) + if err != nil { + return nil, err + } + awshrrArray[index] = awshrr + } + return awshrrArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) MarshalJSON() ([]byte, error) { + awshrr.ObjectType = ObjectTypeAzureWorkloadSAPHanaRestoreRequest + objectMap := make(map[string]interface{}) + if awshrr.RecoveryType != "" { + objectMap["recoveryType"] = awshrr.RecoveryType + } + if awshrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awshrr.SourceResourceID + } + if awshrr.PropertyBag != nil { + objectMap["propertyBag"] = awshrr.PropertyBag + } + if awshrr.TargetInfo != nil { + objectMap["targetInfo"] = awshrr.TargetInfo + } + if awshrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awshrr.RecoveryMode + } + if awshrr.TargetVirtualMachineID != nil { + objectMap["targetVirtualMachineId"] = awshrr.TargetVirtualMachineID + } + if awshrr.ObjectType != "" { + objectMap["objectType"] = awshrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awshrr, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest() (BasicAzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return &awshrr, true +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return &awshrr, true +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadSQLPointInTimeRestoreRequest() (BasicAzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsBasicIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicIaasVMRestoreRequest() (BasicIaasVMRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsAzureWorkloadSQLRestoreWithRehydrateRequest() (*AzureWorkloadSQLRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreWithRehydrationRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsIaasVMRestoreWithRehydrationRequest() (*IaasVMRestoreWithRehydrationRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreRequest. +func (awshrr AzureWorkloadSAPHanaRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awshrr, true +} + +// AzureWorkloadSAPHanaRestoreWithRehydrateRequest azureWorkload SAP Hana-specific restore with integrated +// rehydration of recovery point. +type AzureWorkloadSAPHanaRestoreWithRehydrateRequest struct { + // RecoveryPointRehydrationInfo - RP Rehydration Info + RecoveryPointRehydrationInfo *RecoveryPointRehydrationInfo `json:"recoveryPointRehydrationInfo,omitempty"` + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // TargetVirtualMachineID - This is the complete ARM Id of the target VM + // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest', 'ObjectTypeIaasVMRestoreWithRehydrationRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSAPHanaRestoreWithRehydrateRequest. +func (awshrwrr AzureWorkloadSAPHanaRestoreWithRehydrateRequest) MarshalJSON() ([]byte, error) { + awshrwrr.ObjectType = ObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest + objectMap := make(map[string]interface{}) + if awshrwrr.RecoveryPointRehydrationInfo != nil { + objectMap["recoveryPointRehydrationInfo"] = awshrwrr.RecoveryPointRehydrationInfo + } + if awshrwrr.RecoveryType != "" { + objectMap["recoveryType"] = awshrwrr.RecoveryType + } + if awshrwrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awshrwrr.SourceResourceID + } + if awshrwrr.PropertyBag != nil { + objectMap["propertyBag"] = awshrwrr.PropertyBag + } + if awshrwrr.TargetInfo != nil { + objectMap["targetInfo"] = awshrwrr.TargetInfo + } + if awshrwrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awshrwrr.RecoveryMode + } + if awshrwrr.TargetVirtualMachineID != nil { + objectMap["targetVirtualMachineId"] = awshrwrr.TargetVirtualMachineID + } + if awshrwrr.ObjectType != "" { + objectMap["objectType"] = awshrwrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreWithRehydrateRequest. +func (awshrwrr AzureWorkloadSAPHanaRestoreWithRehydrateRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreWithRehydrateRequest. +func (awshrwrr AzureWorkloadSAPHanaRestoreWithRehydrateRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreWithRehydrateRequest. +func (awshrwrr AzureWorkloadSAPHanaRestoreWithRehydrateRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreWithRehydrateRequest. +func (awshrwrr AzureWorkloadSAPHanaRestoreWithRehydrateRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awshrwrr, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreWithRehydrateRequest. +func (awshrwrr AzureWorkloadSAPHanaRestoreWithRehydrateRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreWithRehydrateRequest. +func (awshrwrr AzureWorkloadSAPHanaRestoreWithRehydrateRequest) AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest() (BasicAzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreWithRehydrateRequest. +func (awshrwrr AzureWorkloadSAPHanaRestoreWithRehydrateRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreWithRehydrateRequest. +func (awshrwrr AzureWorkloadSAPHanaRestoreWithRehydrateRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return &awshrwrr, true +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreWithRehydrateRequest. +func (awshrwrr AzureWorkloadSAPHanaRestoreWithRehydrateRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreWithRehydrateRequest. +func (awshrwrr AzureWorkloadSAPHanaRestoreWithRehydrateRequest) AsBasicAzureWorkloadSQLPointInTimeRestoreRequest() (BasicAzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreWithRehydrateRequest. +func (awshrwrr AzureWorkloadSAPHanaRestoreWithRehydrateRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreWithRehydrateRequest. +func (awshrwrr AzureWorkloadSAPHanaRestoreWithRehydrateRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreWithRehydrateRequest. +func (awshrwrr AzureWorkloadSAPHanaRestoreWithRehydrateRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsBasicIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreWithRehydrateRequest. +func (awshrwrr AzureWorkloadSAPHanaRestoreWithRehydrateRequest) AsBasicIaasVMRestoreRequest() (BasicIaasVMRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreWithRehydrateRequest. +func (awshrwrr AzureWorkloadSAPHanaRestoreWithRehydrateRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreWithRehydrateRequest. +func (awshrwrr AzureWorkloadSAPHanaRestoreWithRehydrateRequest) AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaRestoreWithRehydrateRequest, bool) { + return &awshrwrr, true +} + +// AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreWithRehydrateRequest. +func (awshrwrr AzureWorkloadSAPHanaRestoreWithRehydrateRequest) AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreWithRehydrateRequest. +func (awshrwrr AzureWorkloadSAPHanaRestoreWithRehydrateRequest) AsAzureWorkloadSQLRestoreWithRehydrateRequest() (*AzureWorkloadSQLRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreWithRehydrationRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreWithRehydrateRequest. +func (awshrwrr AzureWorkloadSAPHanaRestoreWithRehydrateRequest) AsIaasVMRestoreWithRehydrationRequest() (*IaasVMRestoreWithRehydrationRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreWithRehydrateRequest. +func (awshrwrr AzureWorkloadSAPHanaRestoreWithRehydrateRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSAPHanaRestoreWithRehydrateRequest. +func (awshrwrr AzureWorkloadSAPHanaRestoreWithRehydrateRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awshrwrr, true +} + +// AzureWorkloadSQLAutoProtectionIntent azure Workload SQL Auto Protection intent item. +type AzureWorkloadSQLAutoProtectionIntent struct { + // WorkloadItemType - Workload item type of the item for which intent is to be set. Possible values include: 'WorkloadItemTypeInvalid', 'WorkloadItemTypeSQLInstance', 'WorkloadItemTypeSQLDataBase', 'WorkloadItemTypeSAPHanaSystem', 'WorkloadItemTypeSAPHanaDatabase', 'WorkloadItemTypeSAPAseSystem', 'WorkloadItemTypeSAPAseDatabase' + WorkloadItemType WorkloadItemType `json:"workloadItemType,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId + ItemID *string `json:"itemId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadContainerAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' + ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) MarshalJSON() ([]byte, error) { + awsapi.ProtectionIntentItemType = ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent + objectMap := make(map[string]interface{}) + if awsapi.WorkloadItemType != "" { + objectMap["workloadItemType"] = awsapi.WorkloadItemType + } + if awsapi.BackupManagementType != "" { + objectMap["backupManagementType"] = awsapi.BackupManagementType + } + if awsapi.SourceResourceID != nil { + objectMap["sourceResourceId"] = awsapi.SourceResourceID + } + if awsapi.ItemID != nil { + objectMap["itemId"] = awsapi.ItemID + } + if awsapi.PolicyID != nil { + objectMap["policyId"] = awsapi.PolicyID + } + if awsapi.ProtectionState != "" { + objectMap["protectionState"] = awsapi.ProtectionState + } + if awsapi.ProtectionIntentItemType != "" { + objectMap["protectionIntentItemType"] = awsapi.ProtectionIntentItemType + } + return json.Marshal(objectMap) +} + +// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { + return nil, false +} + +// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { + return &awsapi, true +} + +// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { + return nil, false +} + +// AsAzureWorkloadContainerAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureWorkloadContainerAutoProtectionIntent() (*AzureWorkloadContainerAutoProtectionIntent, bool) { + return nil, false +} + +// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { + return nil, false +} + +// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { + return &awsapi, true +} + +// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { + return &awsapi, true +} + +// AsProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { + return nil, false +} + +// AsBasicProtectionIntent is the BasicProtectionIntent implementation for AzureWorkloadSQLAutoProtectionIntent. +func (awsapi AzureWorkloadSQLAutoProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { + return &awsapi, true +} + +// AzureWorkloadSQLPointInTimeRecoveryPoint recovery point specific to PointInTime +type AzureWorkloadSQLPointInTimeRecoveryPoint struct { + // TimeRanges - List of log ranges + TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` + // ExtendedInfo - Extended Info that provides data directory details. Will be populated in two cases: + // When a specific recovery point is accessed using GetRecoveryPoint + // Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter + ExtendedInfo *AzureWorkloadSQLRecoveryPointExtendedInfo `json:"extendedInfo,omitempty"` + // RecoveryPointTimeInUTC - UTC time at which recovery point was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' + Type RestorePointType `json:"type,omitempty"` + // RecoveryPointTierDetails - Recovery point tier information. + RecoveryPointTierDetails *[]RecoveryPointTierInformationV2 `json:"recoveryPointTierDetails,omitempty"` + // RecoveryPointMoveReadinessInfo - Eligibility of RP to be moved to another tier + RecoveryPointMoveReadinessInfo map[string]*RecoveryPointMoveReadinessInfo `json:"recoveryPointMoveReadinessInfo"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { + awspitrp.ObjectType = ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint + objectMap := make(map[string]interface{}) + if awspitrp.TimeRanges != nil { + objectMap["timeRanges"] = awspitrp.TimeRanges + } + if awspitrp.ExtendedInfo != nil { + objectMap["extendedInfo"] = awspitrp.ExtendedInfo + } + if awspitrp.RecoveryPointTimeInUTC != nil { + objectMap["recoveryPointTimeInUTC"] = awspitrp.RecoveryPointTimeInUTC + } + if awspitrp.Type != "" { + objectMap["type"] = awspitrp.Type + } + if awspitrp.RecoveryPointTierDetails != nil { + objectMap["recoveryPointTierDetails"] = awspitrp.RecoveryPointTierDetails + } + if awspitrp.RecoveryPointMoveReadinessInfo != nil { + objectMap["recoveryPointMoveReadinessInfo"] = awspitrp.RecoveryPointMoveReadinessInfo + } + if awspitrp.ObjectType != "" { + objectMap["objectType"] = awspitrp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return &awspitrp, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return &awspitrp, true +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return &awspitrp, true +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLPointInTimeRecoveryPoint. +func (awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awspitrp, true +} + +// BasicAzureWorkloadSQLPointInTimeRestoreRequest azureWorkload SQL -specific restore. Specifically for PointInTime/Log +// restore +type BasicAzureWorkloadSQLPointInTimeRestoreRequest interface { + AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, bool) + AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) +} + +// AzureWorkloadSQLPointInTimeRestoreRequest azureWorkload SQL -specific restore. Specifically for +// PointInTime/Log restore +type AzureWorkloadSQLPointInTimeRestoreRequest struct { + // PointInTime - PointInTime value + PointInTime *date.Time `json:"pointInTime,omitempty"` + // ShouldUseAlternateTargetLocation - Default option set to true. If this is set to false, alternate data directory must be provided + ShouldUseAlternateTargetLocation *bool `json:"shouldUseAlternateTargetLocation,omitempty"` + // IsNonRecoverable - SQL specific property where user can chose to set no-recovery when restore operation is tried + IsNonRecoverable *bool `json:"isNonRecoverable,omitempty"` + // AlternateDirectoryPaths - Data directory details + AlternateDirectoryPaths *[]SQLDataDirectoryMapping `json:"alternateDirectoryPaths,omitempty"` + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // TargetVirtualMachineID - This is the complete ARM Id of the target VM + // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest', 'ObjectTypeIaasVMRestoreWithRehydrationRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicAzureWorkloadSQLPointInTimeRestoreRequest(body []byte) (BasicAzureWorkloadSQLPointInTimeRestoreRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest): + var awspitrwrr AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest + err := json.Unmarshal(body, &awspitrwrr) + return awspitrwrr, err + default: + var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest + err := json.Unmarshal(body, &awspitrr) + return awspitrr, err + } +} +func unmarshalBasicAzureWorkloadSQLPointInTimeRestoreRequestArray(body []byte) ([]BasicAzureWorkloadSQLPointInTimeRestoreRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awspitrrArray := make([]BasicAzureWorkloadSQLPointInTimeRestoreRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awspitrr, err := unmarshalBasicAzureWorkloadSQLPointInTimeRestoreRequest(*rawMessage) + if err != nil { + return nil, err + } + awspitrrArray[index] = awspitrr + } + return awspitrrArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { + awspitrr.ObjectType = ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest + objectMap := make(map[string]interface{}) + if awspitrr.PointInTime != nil { + objectMap["pointInTime"] = awspitrr.PointInTime + } + if awspitrr.ShouldUseAlternateTargetLocation != nil { + objectMap["shouldUseAlternateTargetLocation"] = awspitrr.ShouldUseAlternateTargetLocation + } + if awspitrr.IsNonRecoverable != nil { + objectMap["isNonRecoverable"] = awspitrr.IsNonRecoverable + } + if awspitrr.AlternateDirectoryPaths != nil { + objectMap["alternateDirectoryPaths"] = awspitrr.AlternateDirectoryPaths + } + if awspitrr.RecoveryType != "" { + objectMap["recoveryType"] = awspitrr.RecoveryType + } + if awspitrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awspitrr.SourceResourceID + } + if awspitrr.PropertyBag != nil { + objectMap["propertyBag"] = awspitrr.PropertyBag + } + if awspitrr.TargetInfo != nil { + objectMap["targetInfo"] = awspitrr.TargetInfo + } + if awspitrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awspitrr.RecoveryMode + } + if awspitrr.TargetVirtualMachineID != nil { + objectMap["targetVirtualMachineId"] = awspitrr.TargetVirtualMachineID + } + if awspitrr.ObjectType != "" { + objectMap["objectType"] = awspitrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awspitrr, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest() (BasicAzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return &awspitrr, true +} + +// AsBasicAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLPointInTimeRestoreRequest() (BasicAzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return &awspitrr, true +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return &awspitrr, true +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsBasicIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicIaasVMRestoreRequest() (BasicIaasVMRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsAzureWorkloadSQLRestoreWithRehydrateRequest() (*AzureWorkloadSQLRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreWithRehydrationRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsIaasVMRestoreWithRehydrationRequest() (*IaasVMRestoreWithRehydrationRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreRequest. +func (awspitrr AzureWorkloadSQLPointInTimeRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awspitrr, true +} + +// AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest azureWorkload SQL-specific restore with +// integrated rehydration of recovery point. +type AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest struct { + // RecoveryPointRehydrationInfo - RP Rehydration Info + RecoveryPointRehydrationInfo *RecoveryPointRehydrationInfo `json:"recoveryPointRehydrationInfo,omitempty"` + // PointInTime - PointInTime value + PointInTime *date.Time `json:"pointInTime,omitempty"` + // ShouldUseAlternateTargetLocation - Default option set to true. If this is set to false, alternate data directory must be provided + ShouldUseAlternateTargetLocation *bool `json:"shouldUseAlternateTargetLocation,omitempty"` + // IsNonRecoverable - SQL specific property where user can chose to set no-recovery when restore operation is tried + IsNonRecoverable *bool `json:"isNonRecoverable,omitempty"` + // AlternateDirectoryPaths - Data directory details + AlternateDirectoryPaths *[]SQLDataDirectoryMapping `json:"alternateDirectoryPaths,omitempty"` + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // TargetVirtualMachineID - This is the complete ARM Id of the target VM + // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest', 'ObjectTypeIaasVMRestoreWithRehydrationRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. +func (awspitrwrr AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) MarshalJSON() ([]byte, error) { + awspitrwrr.ObjectType = ObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest + objectMap := make(map[string]interface{}) + if awspitrwrr.RecoveryPointRehydrationInfo != nil { + objectMap["recoveryPointRehydrationInfo"] = awspitrwrr.RecoveryPointRehydrationInfo + } + if awspitrwrr.PointInTime != nil { + objectMap["pointInTime"] = awspitrwrr.PointInTime + } + if awspitrwrr.ShouldUseAlternateTargetLocation != nil { + objectMap["shouldUseAlternateTargetLocation"] = awspitrwrr.ShouldUseAlternateTargetLocation + } + if awspitrwrr.IsNonRecoverable != nil { + objectMap["isNonRecoverable"] = awspitrwrr.IsNonRecoverable + } + if awspitrwrr.AlternateDirectoryPaths != nil { + objectMap["alternateDirectoryPaths"] = awspitrwrr.AlternateDirectoryPaths + } + if awspitrwrr.RecoveryType != "" { + objectMap["recoveryType"] = awspitrwrr.RecoveryType + } + if awspitrwrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awspitrwrr.SourceResourceID + } + if awspitrwrr.PropertyBag != nil { + objectMap["propertyBag"] = awspitrwrr.PropertyBag + } + if awspitrwrr.TargetInfo != nil { + objectMap["targetInfo"] = awspitrwrr.TargetInfo + } + if awspitrwrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awspitrwrr.RecoveryMode + } + if awspitrwrr.TargetVirtualMachineID != nil { + objectMap["targetVirtualMachineId"] = awspitrwrr.TargetVirtualMachineID + } + if awspitrwrr.ObjectType != "" { + objectMap["objectType"] = awspitrwrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. +func (awspitrwrr AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. +func (awspitrwrr AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. +func (awspitrwrr AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. +func (awspitrwrr AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awspitrwrr, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. +func (awspitrwrr AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. +func (awspitrwrr AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest() (BasicAzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. +func (awspitrwrr AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. +func (awspitrwrr AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. +func (awspitrwrr AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. +func (awspitrwrr AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) AsBasicAzureWorkloadSQLPointInTimeRestoreRequest() (BasicAzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return &awspitrwrr, true +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. +func (awspitrwrr AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. +func (awspitrwrr AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return &awspitrwrr, true +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. +func (awspitrwrr AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsBasicIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. +func (awspitrwrr AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) AsBasicIaasVMRestoreRequest() (BasicIaasVMRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. +func (awspitrwrr AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. +func (awspitrwrr AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. +func (awspitrwrr AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, bool) { + return &awspitrwrr, true +} + +// AsAzureWorkloadSQLRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. +func (awspitrwrr AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) AsAzureWorkloadSQLRestoreWithRehydrateRequest() (*AzureWorkloadSQLRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreWithRehydrationRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. +func (awspitrwrr AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) AsIaasVMRestoreWithRehydrationRequest() (*IaasVMRestoreWithRehydrationRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. +func (awspitrwrr AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. +func (awspitrwrr AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awspitrwrr, true +} + +// BasicAzureWorkloadSQLRecoveryPoint SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint +// along with extended info +type BasicAzureWorkloadSQLRecoveryPoint interface { + AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) +} + +// AzureWorkloadSQLRecoveryPoint SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint +// along with extended info +type AzureWorkloadSQLRecoveryPoint struct { + // ExtendedInfo - Extended Info that provides data directory details. Will be populated in two cases: + // When a specific recovery point is accessed using GetRecoveryPoint + // Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter + ExtendedInfo *AzureWorkloadSQLRecoveryPointExtendedInfo `json:"extendedInfo,omitempty"` + // RecoveryPointTimeInUTC - UTC time at which recovery point was created + RecoveryPointTimeInUTC *date.Time `json:"recoveryPointTimeInUTC,omitempty"` + // Type - Type of restore point. Possible values include: 'RestorePointTypeInvalid', 'RestorePointTypeFull', 'RestorePointTypeLog', 'RestorePointTypeDifferential', 'RestorePointTypeIncremental' + Type RestorePointType `json:"type,omitempty"` + // RecoveryPointTierDetails - Recovery point tier information. + RecoveryPointTierDetails *[]RecoveryPointTierInformationV2 `json:"recoveryPointTierDetails,omitempty"` + // RecoveryPointMoveReadinessInfo - Eligibility of RP to be moved to another tier + RecoveryPointMoveReadinessInfo map[string]*RecoveryPointMoveReadinessInfo `json:"recoveryPointMoveReadinessInfo"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +func unmarshalBasicAzureWorkloadSQLRecoveryPoint(body []byte) (BasicAzureWorkloadSQLRecoveryPoint, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): + var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awspitrp) + return awspitrp, err + default: + var awsrp AzureWorkloadSQLRecoveryPoint + err := json.Unmarshal(body, &awsrp) + return awsrp, err + } +} +func unmarshalBasicAzureWorkloadSQLRecoveryPointArray(body []byte) ([]BasicAzureWorkloadSQLRecoveryPoint, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awsrpArray := make([]BasicAzureWorkloadSQLRecoveryPoint, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awsrp, err := unmarshalBasicAzureWorkloadSQLRecoveryPoint(*rawMessage) + if err != nil { + return nil, err + } + awsrpArray[index] = awsrp + } + return awsrpArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) MarshalJSON() ([]byte, error) { + awsrp.ObjectType = ObjectTypeAzureWorkloadSQLRecoveryPoint + objectMap := make(map[string]interface{}) + if awsrp.ExtendedInfo != nil { + objectMap["extendedInfo"] = awsrp.ExtendedInfo + } + if awsrp.RecoveryPointTimeInUTC != nil { + objectMap["recoveryPointTimeInUTC"] = awsrp.RecoveryPointTimeInUTC + } + if awsrp.Type != "" { + objectMap["type"] = awsrp.Type + } + if awsrp.RecoveryPointTierDetails != nil { + objectMap["recoveryPointTierDetails"] = awsrp.RecoveryPointTierDetails + } + if awsrp.RecoveryPointMoveReadinessInfo != nil { + objectMap["recoveryPointMoveReadinessInfo"] = awsrp.RecoveryPointMoveReadinessInfo + } + if awsrp.ObjectType != "" { + objectMap["objectType"] = awsrp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return &awsrp, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return &awsrp, true +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return &awsrp, true +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for AzureWorkloadSQLRecoveryPoint. +func (awsrp AzureWorkloadSQLRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &awsrp, true +} + +// AzureWorkloadSQLRecoveryPointExtendedInfo extended info class details +type AzureWorkloadSQLRecoveryPointExtendedInfo struct { + // DataDirectoryTimeInUTC - UTC time at which data directory info was captured + DataDirectoryTimeInUTC *date.Time `json:"dataDirectoryTimeInUTC,omitempty"` + // DataDirectoryPaths - List of data directory paths during restore operation. + DataDirectoryPaths *[]SQLDataDirectory `json:"dataDirectoryPaths,omitempty"` +} + +// BasicAzureWorkloadSQLRestoreRequest azureWorkload SQL -specific restore. Specifically for full/diff restore +type BasicAzureWorkloadSQLRestoreRequest interface { + AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) + AsBasicAzureWorkloadSQLPointInTimeRestoreRequest() (BasicAzureWorkloadSQLPointInTimeRestoreRequest, bool) + AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, bool) + AsAzureWorkloadSQLRestoreWithRehydrateRequest() (*AzureWorkloadSQLRestoreWithRehydrateRequest, bool) + AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) +} + +// AzureWorkloadSQLRestoreRequest azureWorkload SQL -specific restore. Specifically for full/diff restore +type AzureWorkloadSQLRestoreRequest struct { + // ShouldUseAlternateTargetLocation - Default option set to true. If this is set to false, alternate data directory must be provided + ShouldUseAlternateTargetLocation *bool `json:"shouldUseAlternateTargetLocation,omitempty"` + // IsNonRecoverable - SQL specific property where user can chose to set no-recovery when restore operation is tried + IsNonRecoverable *bool `json:"isNonRecoverable,omitempty"` + // AlternateDirectoryPaths - Data directory details + AlternateDirectoryPaths *[]SQLDataDirectoryMapping `json:"alternateDirectoryPaths,omitempty"` + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // TargetVirtualMachineID - This is the complete ARM Id of the target VM + // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest', 'ObjectTypeIaasVMRestoreWithRehydrationRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicAzureWorkloadSQLRestoreRequest(body []byte) (BasicAzureWorkloadSQLRestoreRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): + var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest + err := json.Unmarshal(body, &awspitrr) + return awspitrr, err + case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest): + var awspitrwrr AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest + err := json.Unmarshal(body, &awspitrwrr) + return awspitrwrr, err + case string(ObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest): + var awsrwrr AzureWorkloadSQLRestoreWithRehydrateRequest + err := json.Unmarshal(body, &awsrwrr) + return awsrwrr, err + default: + var awsrr AzureWorkloadSQLRestoreRequest + err := json.Unmarshal(body, &awsrr) + return awsrr, err + } +} +func unmarshalBasicAzureWorkloadSQLRestoreRequestArray(body []byte) ([]BasicAzureWorkloadSQLRestoreRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + awsrrArray := make([]BasicAzureWorkloadSQLRestoreRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + awsrr, err := unmarshalBasicAzureWorkloadSQLRestoreRequest(*rawMessage) + if err != nil { + return nil, err + } + awsrrArray[index] = awsrr + } + return awsrrArray, nil +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) MarshalJSON() ([]byte, error) { + awsrr.ObjectType = ObjectTypeAzureWorkloadSQLRestoreRequest + objectMap := make(map[string]interface{}) + if awsrr.ShouldUseAlternateTargetLocation != nil { + objectMap["shouldUseAlternateTargetLocation"] = awsrr.ShouldUseAlternateTargetLocation + } + if awsrr.IsNonRecoverable != nil { + objectMap["isNonRecoverable"] = awsrr.IsNonRecoverable + } + if awsrr.AlternateDirectoryPaths != nil { + objectMap["alternateDirectoryPaths"] = awsrr.AlternateDirectoryPaths + } + if awsrr.RecoveryType != "" { + objectMap["recoveryType"] = awsrr.RecoveryType + } + if awsrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awsrr.SourceResourceID + } + if awsrr.PropertyBag != nil { + objectMap["propertyBag"] = awsrr.PropertyBag + } + if awsrr.TargetInfo != nil { + objectMap["targetInfo"] = awsrr.TargetInfo + } + if awsrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awsrr.RecoveryMode + } + if awsrr.TargetVirtualMachineID != nil { + objectMap["targetVirtualMachineId"] = awsrr.TargetVirtualMachineID + } + if awsrr.ObjectType != "" { + objectMap["objectType"] = awsrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awsrr, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest() (BasicAzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadSQLPointInTimeRestoreRequest() (BasicAzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return &awsrr, true +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return &awsrr, true +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsBasicIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicIaasVMRestoreRequest() (BasicIaasVMRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsAzureWorkloadSQLRestoreWithRehydrateRequest() (*AzureWorkloadSQLRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreWithRehydrationRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsIaasVMRestoreWithRehydrationRequest() (*IaasVMRestoreWithRehydrationRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreRequest. +func (awsrr AzureWorkloadSQLRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awsrr, true +} + +// AzureWorkloadSQLRestoreWithRehydrateRequest azureWorkload SQL-specific restore with integrated +// rehydration of recovery point +type AzureWorkloadSQLRestoreWithRehydrateRequest struct { + // RecoveryPointRehydrationInfo - RP Rehydration Info + RecoveryPointRehydrationInfo *RecoveryPointRehydrationInfo `json:"recoveryPointRehydrationInfo,omitempty"` + // ShouldUseAlternateTargetLocation - Default option set to true. If this is set to false, alternate data directory must be provided + ShouldUseAlternateTargetLocation *bool `json:"shouldUseAlternateTargetLocation,omitempty"` + // IsNonRecoverable - SQL specific property where user can chose to set no-recovery when restore operation is tried + IsNonRecoverable *bool `json:"isNonRecoverable,omitempty"` + // AlternateDirectoryPaths - Data directory details + AlternateDirectoryPaths *[]SQLDataDirectoryMapping `json:"alternateDirectoryPaths,omitempty"` + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM on which workload that was running is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PropertyBag - Workload specific property bag. + PropertyBag map[string]*string `json:"propertyBag"` + // TargetInfo - Details of target database + TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` + // RecoveryMode - Defines whether the current recovery mode is file restore or database restore. Possible values include: 'RecoveryModeInvalid', 'RecoveryModeFileRecovery', 'RecoveryModeWorkloadRecovery' + RecoveryMode RecoveryMode `json:"recoveryMode,omitempty"` + // TargetVirtualMachineID - This is the complete ARM Id of the target VM + // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest', 'ObjectTypeIaasVMRestoreWithRehydrationRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureWorkloadSQLRestoreWithRehydrateRequest. +func (awsrwrr AzureWorkloadSQLRestoreWithRehydrateRequest) MarshalJSON() ([]byte, error) { + awsrwrr.ObjectType = ObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest + objectMap := make(map[string]interface{}) + if awsrwrr.RecoveryPointRehydrationInfo != nil { + objectMap["recoveryPointRehydrationInfo"] = awsrwrr.RecoveryPointRehydrationInfo + } + if awsrwrr.ShouldUseAlternateTargetLocation != nil { + objectMap["shouldUseAlternateTargetLocation"] = awsrwrr.ShouldUseAlternateTargetLocation + } + if awsrwrr.IsNonRecoverable != nil { + objectMap["isNonRecoverable"] = awsrwrr.IsNonRecoverable + } + if awsrwrr.AlternateDirectoryPaths != nil { + objectMap["alternateDirectoryPaths"] = awsrwrr.AlternateDirectoryPaths + } + if awsrwrr.RecoveryType != "" { + objectMap["recoveryType"] = awsrwrr.RecoveryType + } + if awsrwrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = awsrwrr.SourceResourceID + } + if awsrwrr.PropertyBag != nil { + objectMap["propertyBag"] = awsrwrr.PropertyBag + } + if awsrwrr.TargetInfo != nil { + objectMap["targetInfo"] = awsrwrr.TargetInfo + } + if awsrwrr.RecoveryMode != "" { + objectMap["recoveryMode"] = awsrwrr.RecoveryMode + } + if awsrwrr.TargetVirtualMachineID != nil { + objectMap["targetVirtualMachineId"] = awsrwrr.TargetVirtualMachineID + } + if awsrwrr.ObjectType != "" { + objectMap["objectType"] = awsrwrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreWithRehydrateRequest. +func (awsrwrr AzureWorkloadSQLRestoreWithRehydrateRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreWithRehydrateRequest. +func (awsrwrr AzureWorkloadSQLRestoreWithRehydrateRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreWithRehydrateRequest. +func (awsrwrr AzureWorkloadSQLRestoreWithRehydrateRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreWithRehydrateRequest. +func (awsrwrr AzureWorkloadSQLRestoreWithRehydrateRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return &awsrwrr, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreWithRehydrateRequest. +func (awsrwrr AzureWorkloadSQLRestoreWithRehydrateRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreWithRehydrateRequest. +func (awsrwrr AzureWorkloadSQLRestoreWithRehydrateRequest) AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest() (BasicAzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreWithRehydrateRequest. +func (awsrwrr AzureWorkloadSQLRestoreWithRehydrateRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreWithRehydrateRequest. +func (awsrwrr AzureWorkloadSQLRestoreWithRehydrateRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreWithRehydrateRequest. +func (awsrwrr AzureWorkloadSQLRestoreWithRehydrateRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreWithRehydrateRequest. +func (awsrwrr AzureWorkloadSQLRestoreWithRehydrateRequest) AsBasicAzureWorkloadSQLPointInTimeRestoreRequest() (BasicAzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreWithRehydrateRequest. +func (awsrwrr AzureWorkloadSQLRestoreWithRehydrateRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreWithRehydrateRequest. +func (awsrwrr AzureWorkloadSQLRestoreWithRehydrateRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return &awsrwrr, true +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreWithRehydrateRequest. +func (awsrwrr AzureWorkloadSQLRestoreWithRehydrateRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsBasicIaasVMRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreWithRehydrateRequest. +func (awsrwrr AzureWorkloadSQLRestoreWithRehydrateRequest) AsBasicIaasVMRestoreRequest() (BasicIaasVMRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreWithRehydrateRequest. +func (awsrwrr AzureWorkloadSQLRestoreWithRehydrateRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreWithRehydrateRequest. +func (awsrwrr AzureWorkloadSQLRestoreWithRehydrateRequest) AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreWithRehydrateRequest. +func (awsrwrr AzureWorkloadSQLRestoreWithRehydrateRequest) AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreWithRehydrateRequest. +func (awsrwrr AzureWorkloadSQLRestoreWithRehydrateRequest) AsAzureWorkloadSQLRestoreWithRehydrateRequest() (*AzureWorkloadSQLRestoreWithRehydrateRequest, bool) { + return &awsrwrr, true +} + +// AsIaasVMRestoreWithRehydrationRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreWithRehydrateRequest. +func (awsrwrr AzureWorkloadSQLRestoreWithRehydrateRequest) AsIaasVMRestoreWithRehydrationRequest() (*IaasVMRestoreWithRehydrationRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreWithRehydrateRequest. +func (awsrwrr AzureWorkloadSQLRestoreWithRehydrateRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for AzureWorkloadSQLRestoreWithRehydrateRequest. +func (awsrwrr AzureWorkloadSQLRestoreWithRehydrateRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &awsrwrr, true +} + +// BEKDetails BEK is bitlocker encryption key. +type BEKDetails struct { + // SecretURL - Secret is BEK. + SecretURL *string `json:"secretUrl,omitempty"` + // SecretVaultID - ID of the Key Vault where this Secret is stored. + SecretVaultID *string `json:"secretVaultId,omitempty"` + // SecretData - BEK data. + SecretData *string `json:"secretData,omitempty"` +} + +// BMSBackupEngineQueryObject query parameters to fetch list of backup engines. +type BMSBackupEngineQueryObject struct { + // Expand - attribute to add extended info + Expand *string `json:"expand,omitempty"` +} + +// BMSBackupEnginesQueryObject query parameters to fetch list of backup engines. +type BMSBackupEnginesQueryObject struct { + // BackupManagementType - Backup management type for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // FriendlyName - Friendly name of the backup engine. + FriendlyName *string `json:"friendlyName,omitempty"` + // Expand - Attribute to add extended info. + Expand *string `json:"expand,omitempty"` +} + +// BMSBackupSummariesQueryObject query parameters to fetch backup summaries. +type BMSBackupSummariesQueryObject struct { + // Type - Backup management type for this container. Possible values include: 'TypeInvalid', 'TypeBackupProtectedItemCountSummary', 'TypeBackupProtectionContainerCountSummary' + Type Type `json:"type,omitempty"` +} + +// BMSContainerQueryObject the query filters that can be used with the list containers API. +type BMSContainerQueryObject struct { + // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // ContainerType - Type of container for filter. Possible values include: 'ContainerTypeInvalid', 'ContainerTypeUnknown', 'ContainerTypeIaasVMContainer', 'ContainerTypeIaasVMServiceContainer', 'ContainerTypeDPMContainer', 'ContainerTypeAzureBackupServerContainer', 'ContainerTypeMABContainer', 'ContainerTypeCluster', 'ContainerTypeAzureSQLContainer', 'ContainerTypeWindows', 'ContainerTypeVCenter', 'ContainerTypeVMAppContainer', 'ContainerTypeSQLAGWorkLoadContainer', 'ContainerTypeStorageContainer', 'ContainerTypeGenericContainer' + ContainerType ContainerType `json:"containerType,omitempty"` + // BackupEngineName - Backup engine name + BackupEngineName *string `json:"backupEngineName,omitempty"` + // FabricName - Fabric name for filter + FabricName *string `json:"fabricName,omitempty"` + // Status - Status of registration of this container with the Recovery Services Vault. + Status *string `json:"status,omitempty"` + // FriendlyName - Friendly name of this container. + FriendlyName *string `json:"friendlyName,omitempty"` +} + +// BMSContainersInquiryQueryObject the query filters that can be used with the inquire container API. +type BMSContainersInquiryQueryObject struct { + // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Workload type for this container. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` +} + +// BMSPOQueryObject filters to list items that can be backed up. +type BMSPOQueryObject struct { + // BackupManagementType - Backup management type. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Workload type. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` + // ContainerName - Full name of the container whose Protectable Objects should be returned. + ContainerName *string `json:"containerName,omitempty"` + // Status - Backup status query parameter. + Status *string `json:"status,omitempty"` + // FriendlyName - Friendly name. + FriendlyName *string `json:"friendlyName,omitempty"` +} + +// BMSPrepareDataMoveFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type BMSPrepareDataMoveFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(BaseClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *BMSPrepareDataMoveFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for BMSPrepareDataMoveFuture.Result. +func (future *BMSPrepareDataMoveFuture) result(client BaseClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.BMSPrepareDataMoveFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("backup.BMSPrepareDataMoveFuture") + return + } + ar.Response = future.Response() + return +} + +// BMSRefreshContainersQueryObject the query filters that can be used with the refresh container API. +type BMSRefreshContainersQueryObject struct { + // BackupManagementType - Backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` +} + +// BMSRPQueryObject filters to list backup copies. +type BMSRPQueryObject struct { + // StartDate - Backup copies created after this time. + StartDate *date.Time `json:"startDate,omitempty"` + // EndDate - Backup copies created before this time. + EndDate *date.Time `json:"endDate,omitempty"` + // RestorePointQueryType - RestorePoint type. Possible values include: 'RestorePointQueryTypeInvalid', 'RestorePointQueryTypeFull', 'RestorePointQueryTypeLog', 'RestorePointQueryTypeDifferential', 'RestorePointQueryTypeFullAndDifferential', 'RestorePointQueryTypeAll', 'RestorePointQueryTypeIncremental' + RestorePointQueryType RestorePointQueryType `json:"restorePointQueryType,omitempty"` + // ExtendedInfo - In Get Recovery Point, it tells whether extended information about recovery point is asked. + ExtendedInfo *bool `json:"extendedInfo,omitempty"` + // MoveReadyRPOnly - Whether the RP can be moved to another tier + MoveReadyRPOnly *bool `json:"moveReadyRPOnly,omitempty"` +} + +// BMSTriggerDataMoveFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type BMSTriggerDataMoveFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(BaseClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *BMSTriggerDataMoveFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for BMSTriggerDataMoveFuture.Result. +func (future *BMSTriggerDataMoveFuture) result(client BaseClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.BMSTriggerDataMoveFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("backup.BMSTriggerDataMoveFuture") + return + } + ar.Response = future.Response() + return +} + +// BMSWorkloadItemQueryObject filters to list items that can be backed up. +type BMSWorkloadItemQueryObject struct { + // BackupManagementType - Backup management type. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadItemType - Workload Item type. Possible values include: 'WorkloadItemTypeInvalid', 'WorkloadItemTypeSQLInstance', 'WorkloadItemTypeSQLDataBase', 'WorkloadItemTypeSAPHanaSystem', 'WorkloadItemTypeSAPHanaDatabase', 'WorkloadItemTypeSAPAseSystem', 'WorkloadItemTypeSAPAseDatabase' + WorkloadItemType WorkloadItemType `json:"workloadItemType,omitempty"` + // WorkloadType - Workload type. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` + // ProtectionStatus - Backup status query parameter. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionStatus ProtectionStatus `json:"protectionStatus,omitempty"` +} + +// ClientDiscoveryDisplay localized display information of an operation. +type ClientDiscoveryDisplay struct { + // Provider - Name of the provider for display purposes + Provider *string `json:"provider,omitempty"` + // Resource - ResourceType for which this Operation can be performed. + Resource *string `json:"resource,omitempty"` + // Operation - Operations Name itself. + Operation *string `json:"operation,omitempty"` + // Description - Description of the operation having details of what operation is about. + Description *string `json:"description,omitempty"` +} + +// ClientDiscoveryForLogSpecification class to represent shoebox log specification in json client +// discovery. +type ClientDiscoveryForLogSpecification struct { + // Name - Name for shoebox log specification. + Name *string `json:"name,omitempty"` + // DisplayName - Localized display name + DisplayName *string `json:"displayName,omitempty"` + // BlobDuration - blob duration of shoebox log specification + BlobDuration *string `json:"blobDuration,omitempty"` +} + +// ClientDiscoveryForProperties class to represent shoebox properties in json client discovery. +type ClientDiscoveryForProperties struct { + // ServiceSpecification - Operation properties. + ServiceSpecification *ClientDiscoveryForServiceSpecification `json:"serviceSpecification,omitempty"` +} + +// ClientDiscoveryForServiceSpecification class to represent shoebox service specification in json client +// discovery. +type ClientDiscoveryForServiceSpecification struct { + // LogSpecifications - List of log specifications of this operation. + LogSpecifications *[]ClientDiscoveryForLogSpecification `json:"logSpecifications,omitempty"` +} + +// ClientDiscoveryResponse operations List response which contains list of available APIs. +type ClientDiscoveryResponse struct { + autorest.Response `json:"-"` + // Value - List of available operations. + Value *[]ClientDiscoveryValueForSingleAPI `json:"value,omitempty"` + // NextLink - Link to the next chunk of Response. + NextLink *string `json:"nextLink,omitempty"` +} + +// ClientDiscoveryResponseIterator provides access to a complete listing of +// ClientDiscoveryValueForSingleAPI values. +type ClientDiscoveryResponseIterator struct { + i int + page ClientDiscoveryResponsePage +} + +// NextWithContext 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 *ClientDiscoveryResponseIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClientDiscoveryResponseIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ClientDiscoveryResponseIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ClientDiscoveryResponseIterator) 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 ClientDiscoveryResponseIterator) Response() ClientDiscoveryResponse { + 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 ClientDiscoveryResponseIterator) Value() ClientDiscoveryValueForSingleAPI { + if !iter.page.NotDone() { + return ClientDiscoveryValueForSingleAPI{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ClientDiscoveryResponseIterator type. +func NewClientDiscoveryResponseIterator(page ClientDiscoveryResponsePage) ClientDiscoveryResponseIterator { + return ClientDiscoveryResponseIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (cdr ClientDiscoveryResponse) IsEmpty() bool { + return cdr.Value == nil || len(*cdr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (cdr ClientDiscoveryResponse) hasNextLink() bool { + return cdr.NextLink != nil && len(*cdr.NextLink) != 0 +} + +// clientDiscoveryResponsePreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cdr ClientDiscoveryResponse) clientDiscoveryResponsePreparer(ctx context.Context) (*http.Request, error) { + if !cdr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cdr.NextLink))) +} + +// ClientDiscoveryResponsePage contains a page of ClientDiscoveryValueForSingleAPI values. +type ClientDiscoveryResponsePage struct { + fn func(context.Context, ClientDiscoveryResponse) (ClientDiscoveryResponse, error) + cdr ClientDiscoveryResponse +} + +// NextWithContext 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 *ClientDiscoveryResponsePage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClientDiscoveryResponsePage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.cdr) + if err != nil { + return err + } + page.cdr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *ClientDiscoveryResponsePage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ClientDiscoveryResponsePage) NotDone() bool { + return !page.cdr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ClientDiscoveryResponsePage) Response() ClientDiscoveryResponse { + return page.cdr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ClientDiscoveryResponsePage) Values() []ClientDiscoveryValueForSingleAPI { + if page.cdr.IsEmpty() { + return nil + } + return *page.cdr.Value +} + +// Creates a new instance of the ClientDiscoveryResponsePage type. +func NewClientDiscoveryResponsePage(cur ClientDiscoveryResponse, getNextPage func(context.Context, ClientDiscoveryResponse) (ClientDiscoveryResponse, error)) ClientDiscoveryResponsePage { + return ClientDiscoveryResponsePage{ + fn: getNextPage, + cdr: cur, + } +} + +// ClientDiscoveryValueForSingleAPI available operation details. +type ClientDiscoveryValueForSingleAPI struct { + // Name - Name of the Operation. + Name *string `json:"name,omitempty"` + // Display - Contains the localized display information for this particular operation + Display *ClientDiscoveryDisplay `json:"display,omitempty"` + // Origin - The intended executor of the operation;governs the display of the operation in the RBAC UX and the audit logs UX + Origin *string `json:"origin,omitempty"` + // Properties - ShoeBox properties for the given operation. + Properties *ClientDiscoveryForProperties `json:"properties,omitempty"` +} + +// ClientScriptForConnect client script details for file / folder restore. +type ClientScriptForConnect struct { + // ScriptContent - File content of the client script for file / folder restore. + ScriptContent *string `json:"scriptContent,omitempty"` + // ScriptExtension - File extension of the client script for file / folder restore - .ps1 , .sh , etc. + ScriptExtension *string `json:"scriptExtension,omitempty"` + // OsType - OS type - Windows, Linux etc. for which this file / folder restore client script works. + OsType *string `json:"osType,omitempty"` + // URL - URL of Executable from where to source the content. If this is not null then ScriptContent should not be used + URL *string `json:"url,omitempty"` + // ScriptNameSuffix - Mandatory suffix that should be added to the name of script that is given for download to user. + // If its null or empty then , ignore it. + ScriptNameSuffix *string `json:"scriptNameSuffix,omitempty"` +} + +// CloudError an error response from the Container Instance service. +type CloudError struct { + // Error - The error object. + Error *CloudErrorBody `json:"error,omitempty"` +} + +// CloudErrorBody an error response from the Container Instance service. +type CloudErrorBody struct { + // Code - READ-ONLY; An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; A message describing the error, intended to be suitable for display in a user interface. + Message *string `json:"message,omitempty"` + // Target - READ-ONLY; The target of the particular error. For example, the name of the property in error. + Target *string `json:"target,omitempty"` + // Details - READ-ONLY; A list of additional details about the error. + Details *[]CloudErrorBody `json:"details,omitempty"` + // AdditionalInfo - READ-ONLY; The error additional info. + AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` +} + +// MarshalJSON is the custom marshaler for CloudErrorBody. +func (ceb CloudErrorBody) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ContainerIdentityInfo container identity information +type ContainerIdentityInfo struct { + // UniqueName - Unique name of the container + UniqueName *string `json:"uniqueName,omitempty"` + // AadTenantID - Protection container identity - AAD Tenant + AadTenantID *string `json:"aadTenantId,omitempty"` + // ServicePrincipalClientID - Protection container identity - AAD Service Principal + ServicePrincipalClientID *string `json:"servicePrincipalClientId,omitempty"` + // Audience - Protection container identity - Audience + Audience *string `json:"audience,omitempty"` +} + +// DailyRetentionFormat daily retention format. +type DailyRetentionFormat struct { + // DaysOfTheMonth - List of days of the month. + DaysOfTheMonth *[]Day `json:"daysOfTheMonth,omitempty"` +} + +// DailyRetentionSchedule daily retention schedule. +type DailyRetentionSchedule struct { + // RetentionTimes - Retention times of retention policy. + RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` + // RetentionDuration - Retention duration of retention Policy. + RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` +} + +// DailySchedule ... +type DailySchedule struct { + // ScheduleRunTimes - List of times of day this schedule has to be run. + ScheduleRunTimes *[]date.Time `json:"scheduleRunTimes,omitempty"` +} + +// Day day of the week. +type Day struct { + // Date - Date of the month + Date *int32 `json:"date,omitempty"` + // IsLast - Whether Date is last date of month + IsLast *bool `json:"isLast,omitempty"` +} + +// DiskExclusionProperties ... +type DiskExclusionProperties struct { + // DiskLunList - List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. + DiskLunList *[]int32 `json:"diskLunList,omitempty"` + // IsInclusionList - Flag to indicate whether DiskLunList is to be included/ excluded from backup. + IsInclusionList *bool `json:"isInclusionList,omitempty"` +} + +// DiskInformation disk information +type DiskInformation struct { + Lun *int32 `json:"lun,omitempty"` + Name *string `json:"name,omitempty"` +} + +// DistributedNodesInfo this is used to represent the various nodes of the distributed container. +type DistributedNodesInfo struct { + // NodeName - Name of the node under a distributed container. + NodeName *string `json:"nodeName,omitempty"` + // Status - Status of this Node. + // Failed | Succeeded + Status *string `json:"status,omitempty"` + // ErrorDetail - Error Details if the Status is non-success. + ErrorDetail *ErrorDetail `json:"errorDetail,omitempty"` +} + +// DpmBackupEngine data Protection Manager (DPM) specific backup engine. +type DpmBackupEngine struct { + // FriendlyName - Friendly name of the backup engine. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Registration status of the backup engine with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // BackupEngineState - Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} + BackupEngineState *string `json:"backupEngineState,omitempty"` + // HealthStatus - Backup status of the backup engine. + HealthStatus *string `json:"healthStatus,omitempty"` + // CanReRegister - Flag indicating if the backup engine be registered, once already registered. + CanReRegister *bool `json:"canReRegister,omitempty"` + // BackupEngineID - ID of the backup engine. + BackupEngineID *string `json:"backupEngineId,omitempty"` + // DpmVersion - Backup engine version + DpmVersion *string `json:"dpmVersion,omitempty"` + // AzureBackupAgentVersion - Backup agent version + AzureBackupAgentVersion *string `json:"azureBackupAgentVersion,omitempty"` + // IsAzureBackupAgentUpgradeAvailable - To check if backup agent upgrade available + IsAzureBackupAgentUpgradeAvailable *bool `json:"isAzureBackupAgentUpgradeAvailable,omitempty"` + // IsDpmUpgradeAvailable - To check if backup engine upgrade available + IsDpmUpgradeAvailable *bool `json:"isDpmUpgradeAvailable,omitempty"` + // ExtendedInfo - Extended info of the backupengine + ExtendedInfo *EngineExtendedInfo `json:"extendedInfo,omitempty"` + // BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine' + BackupEngineType EngineType `json:"backupEngineType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DpmBackupEngine. +func (dbe DpmBackupEngine) MarshalJSON() ([]byte, error) { + dbe.BackupEngineType = BackupEngineTypeDpmBackupEngine + objectMap := make(map[string]interface{}) + if dbe.FriendlyName != nil { + objectMap["friendlyName"] = dbe.FriendlyName + } + if dbe.BackupManagementType != "" { + objectMap["backupManagementType"] = dbe.BackupManagementType + } + if dbe.RegistrationStatus != nil { + objectMap["registrationStatus"] = dbe.RegistrationStatus + } + if dbe.BackupEngineState != nil { + objectMap["backupEngineState"] = dbe.BackupEngineState + } + if dbe.HealthStatus != nil { + objectMap["healthStatus"] = dbe.HealthStatus + } + if dbe.CanReRegister != nil { + objectMap["canReRegister"] = dbe.CanReRegister + } + if dbe.BackupEngineID != nil { + objectMap["backupEngineId"] = dbe.BackupEngineID + } + if dbe.DpmVersion != nil { + objectMap["dpmVersion"] = dbe.DpmVersion + } + if dbe.AzureBackupAgentVersion != nil { + objectMap["azureBackupAgentVersion"] = dbe.AzureBackupAgentVersion + } + if dbe.IsAzureBackupAgentUpgradeAvailable != nil { + objectMap["isAzureBackupAgentUpgradeAvailable"] = dbe.IsAzureBackupAgentUpgradeAvailable + } + if dbe.IsDpmUpgradeAvailable != nil { + objectMap["isDpmUpgradeAvailable"] = dbe.IsDpmUpgradeAvailable + } + if dbe.ExtendedInfo != nil { + objectMap["extendedInfo"] = dbe.ExtendedInfo + } + if dbe.BackupEngineType != "" { + objectMap["backupEngineType"] = dbe.BackupEngineType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerEngine is the BasicEngineBase implementation for DpmBackupEngine. +func (dbe DpmBackupEngine) AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) { + return nil, false +} + +// AsDpmBackupEngine is the BasicEngineBase implementation for DpmBackupEngine. +func (dbe DpmBackupEngine) AsDpmBackupEngine() (*DpmBackupEngine, bool) { + return &dbe, true +} + +// AsEngineBase is the BasicEngineBase implementation for DpmBackupEngine. +func (dbe DpmBackupEngine) AsEngineBase() (*EngineBase, bool) { + return nil, false +} + +// AsBasicEngineBase is the BasicEngineBase implementation for DpmBackupEngine. +func (dbe DpmBackupEngine) AsBasicEngineBase() (BasicEngineBase, bool) { + return &dbe, true +} + +// BasicDpmContainer DPM workload-specific protection container. +type BasicDpmContainer interface { + AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) + AsDpmContainer() (*DpmContainer, bool) +} + +// DpmContainer DPM workload-specific protection container. +type DpmContainer struct { + // CanReRegister - Specifies whether the container is re-registrable. + CanReRegister *bool `json:"canReRegister,omitempty"` + // ContainerID - ID of container. + ContainerID *string `json:"containerId,omitempty"` + // ProtectedItemCount - Number of protected items in the BackupEngine + ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` + // DpmAgentVersion - Backup engine Agent version + DpmAgentVersion *string `json:"dpmAgentVersion,omitempty"` + // DpmServers - List of BackupEngines protecting the container + DpmServers *[]string `json:"dpmServers,omitempty"` + // UpgradeAvailable - To check if upgrade available + UpgradeAvailable *bool `json:"upgradeAvailable,omitempty"` + // ProtectionStatus - Protection status of the container. + ProtectionStatus *string `json:"protectionStatus,omitempty"` + // ExtendedInfo - Extended Info of the container. + ExtendedInfo *DPMContainerExtendedInfo `json:"extendedInfo,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ProtectableObjectType - Type of the protectable object associated with this container + ProtectableObjectType *string `json:"protectableObjectType,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaasVMContainer1', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +func unmarshalBasicDpmContainer(body []byte) (BasicDpmContainer, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["containerType"] { + case string(ContainerTypeAzureBackupServerContainer1): + var absc AzureBackupServerContainer + err := json.Unmarshal(body, &absc) + return absc, err + default: + var dc DpmContainer + err := json.Unmarshal(body, &dc) + return dc, err + } +} +func unmarshalBasicDpmContainerArray(body []byte) ([]BasicDpmContainer, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + dcArray := make([]BasicDpmContainer, len(rawMessages)) + + for index, rawMessage := range rawMessages { + dc, err := unmarshalBasicDpmContainer(*rawMessage) + if err != nil { + return nil, err + } + dcArray[index] = dc + } + return dcArray, nil +} + +// MarshalJSON is the custom marshaler for DpmContainer. +func (dc DpmContainer) MarshalJSON() ([]byte, error) { + dc.ContainerType = ContainerTypeDPMContainer1 + objectMap := make(map[string]interface{}) + if dc.CanReRegister != nil { + objectMap["canReRegister"] = dc.CanReRegister + } + if dc.ContainerID != nil { + objectMap["containerId"] = dc.ContainerID + } + if dc.ProtectedItemCount != nil { + objectMap["protectedItemCount"] = dc.ProtectedItemCount + } + if dc.DpmAgentVersion != nil { + objectMap["dpmAgentVersion"] = dc.DpmAgentVersion + } + if dc.DpmServers != nil { + objectMap["dpmServers"] = dc.DpmServers + } + if dc.UpgradeAvailable != nil { + objectMap["upgradeAvailable"] = dc.UpgradeAvailable + } + if dc.ProtectionStatus != nil { + objectMap["protectionStatus"] = dc.ProtectionStatus + } + if dc.ExtendedInfo != nil { + objectMap["extendedInfo"] = dc.ExtendedInfo + } + if dc.FriendlyName != nil { + objectMap["friendlyName"] = dc.FriendlyName + } + if dc.BackupManagementType != "" { + objectMap["backupManagementType"] = dc.BackupManagementType + } + if dc.RegistrationStatus != nil { + objectMap["registrationStatus"] = dc.RegistrationStatus + } + if dc.HealthStatus != nil { + objectMap["healthStatus"] = dc.HealthStatus + } + if dc.ProtectableObjectType != nil { + objectMap["protectableObjectType"] = dc.ProtectableObjectType + } + if dc.ContainerType != "" { + objectMap["containerType"] = dc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsDpmContainer() (*DpmContainer, bool) { + return &dc, true +} + +// AsBasicDpmContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return &dc, true +} + +// AsGenericContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for DpmContainer. +func (dc DpmContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &dc, true +} + +// DPMContainerExtendedInfo additional information of the DPMContainer. +type DPMContainerExtendedInfo struct { + // LastRefreshedAt - Last refresh time of the DPMContainer. + LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` +} + +// DpmErrorInfo DPM workload-specific error information. +type DpmErrorInfo struct { + // ErrorString - Localized error string. + ErrorString *string `json:"errorString,omitempty"` + // Recommendations - List of localized recommendations for above error code. + Recommendations *[]string `json:"recommendations,omitempty"` +} + +// DpmJob DPM workload-specific job object. +type DpmJob struct { + // Duration - Time elapsed for job. + Duration *string `json:"duration,omitempty"` + // DpmServerName - DPM server name managing the backup item or backup job. + DpmServerName *string `json:"dpmServerName,omitempty"` + // ContainerName - Name of cluster/server protecting current backup item, if any. + ContainerName *string `json:"containerName,omitempty"` + // ContainerType - Type of container. + ContainerType *string `json:"containerType,omitempty"` + // WorkloadType - Type of backup item. + WorkloadType *string `json:"workloadType,omitempty"` + // ActionsInfo - The state/actions applicable on this job like cancel/retry. + ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` + // ErrorDetails - The errors. + ErrorDetails *[]DpmErrorInfo `json:"errorDetails,omitempty"` + // ExtendedInfo - Additional information for this job. + ExtendedInfo *DpmJobExtendedInfo `json:"extendedInfo,omitempty"` + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureIaaSVMJobV2', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob', 'JobTypeVaultJob' + JobType JobType `json:"jobType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DpmJob. +func (dj DpmJob) MarshalJSON() ([]byte, error) { + dj.JobType = JobTypeDpmJob + objectMap := make(map[string]interface{}) + if dj.Duration != nil { + objectMap["duration"] = dj.Duration + } + if dj.DpmServerName != nil { + objectMap["dpmServerName"] = dj.DpmServerName + } + if dj.ContainerName != nil { + objectMap["containerName"] = dj.ContainerName + } + if dj.ContainerType != nil { + objectMap["containerType"] = dj.ContainerType + } + if dj.WorkloadType != nil { + objectMap["workloadType"] = dj.WorkloadType + } + if dj.ActionsInfo != nil { + objectMap["actionsInfo"] = dj.ActionsInfo + } + if dj.ErrorDetails != nil { + objectMap["errorDetails"] = dj.ErrorDetails + } + if dj.ExtendedInfo != nil { + objectMap["extendedInfo"] = dj.ExtendedInfo + } + if dj.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = dj.EntityFriendlyName + } + if dj.BackupManagementType != "" { + objectMap["backupManagementType"] = dj.BackupManagementType + } + if dj.Operation != nil { + objectMap["operation"] = dj.Operation + } + if dj.Status != nil { + objectMap["status"] = dj.Status + } + if dj.StartTime != nil { + objectMap["startTime"] = dj.StartTime + } + if dj.EndTime != nil { + objectMap["endTime"] = dj.EndTime + } + if dj.ActivityID != nil { + objectMap["activityId"] = dj.ActivityID + } + if dj.JobType != "" { + objectMap["jobType"] = dj.JobType + } + return json.Marshal(objectMap) +} + +// AsAzureIaaSVMJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { + return nil, false +} + +// AsAzureIaaSVMJobV2 is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsAzureIaaSVMJobV2() (*AzureIaaSVMJobV2, bool) { + return nil, false +} + +// AsAzureStorageJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsAzureStorageJob() (*AzureStorageJob, bool) { + return nil, false +} + +// AsAzureWorkloadJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { + return nil, false +} + +// AsDpmJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsDpmJob() (*DpmJob, bool) { + return &dj, true +} + +// AsMabJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsMabJob() (*MabJob, bool) { + return nil, false +} + +// AsVaultJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsVaultJob() (*VaultJob, bool) { + return nil, false +} + +// AsJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsJob() (*Job, bool) { + return nil, false +} + +// AsBasicJob is the BasicJob implementation for DpmJob. +func (dj DpmJob) AsBasicJob() (BasicJob, bool) { + return &dj, true +} + +// DpmJobExtendedInfo additional information on the DPM workload-specific job. +type DpmJobExtendedInfo struct { + // TasksList - List of tasks associated with this job. + TasksList *[]DpmJobTaskDetails `json:"tasksList,omitempty"` + // PropertyBag - The job properties. + PropertyBag map[string]*string `json:"propertyBag"` + // DynamicErrorMessage - Non localized error message on job execution. + DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` +} + +// MarshalJSON is the custom marshaler for DpmJobExtendedInfo. +func (djei DpmJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if djei.TasksList != nil { + objectMap["tasksList"] = djei.TasksList + } + if djei.PropertyBag != nil { + objectMap["propertyBag"] = djei.PropertyBag + } + if djei.DynamicErrorMessage != nil { + objectMap["dynamicErrorMessage"] = djei.DynamicErrorMessage + } + return json.Marshal(objectMap) +} + +// DpmJobTaskDetails DPM workload-specific job task details. +type DpmJobTaskDetails struct { + // TaskID - The task display name. + TaskID *string `json:"taskId,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // Duration - Time elapsed for task. + Duration *string `json:"duration,omitempty"` + // Status - The status. + Status *string `json:"status,omitempty"` +} + +// DPMProtectedItem additional information on Backup engine specific backup item. +type DPMProtectedItem struct { + // FriendlyName - Friendly name of the managed item + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupEngineName - Backup Management server protecting this backup item + BackupEngineName *string `json:"backupEngineName,omitempty"` + // ProtectionState - Protection state of the backup engine. Possible values include: 'ProtectedItemStateInvalid', 'ProtectedItemStateIRPending', 'ProtectedItemStateProtected', 'ProtectedItemStateProtectionError', 'ProtectedItemStateProtectionStopped', 'ProtectedItemStateProtectionPaused' + ProtectionState ProtectedItemState `json:"protectionState,omitempty"` + // ExtendedInfo - Extended info of the backup item. + ExtendedInfo *DPMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ResourceGuardOperationRequests - ResourceGuardOperationRequests on which LAC check will be performed + ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` + // IsArchiveEnabled - Flag to identify whether datasource is protected in archive + IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + // PolicyName - Name of the policy used for protection + PolicyName *string `json:"policyName,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DPMProtectedItem. +func (dpi DPMProtectedItem) MarshalJSON() ([]byte, error) { + dpi.ProtectedItemType = ProtectedItemTypeDPMProtectedItem + objectMap := make(map[string]interface{}) + if dpi.FriendlyName != nil { + objectMap["friendlyName"] = dpi.FriendlyName + } + if dpi.BackupEngineName != nil { + objectMap["backupEngineName"] = dpi.BackupEngineName + } + if dpi.ProtectionState != "" { + objectMap["protectionState"] = dpi.ProtectionState + } + if dpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = dpi.ExtendedInfo + } + if dpi.BackupManagementType != "" { + objectMap["backupManagementType"] = dpi.BackupManagementType + } + if dpi.WorkloadType != "" { + objectMap["workloadType"] = dpi.WorkloadType + } + if dpi.ContainerName != nil { + objectMap["containerName"] = dpi.ContainerName + } + if dpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = dpi.SourceResourceID + } + if dpi.PolicyID != nil { + objectMap["policyId"] = dpi.PolicyID + } + if dpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = dpi.LastRecoveryPoint + } + if dpi.BackupSetName != nil { + objectMap["backupSetName"] = dpi.BackupSetName + } + if dpi.CreateMode != "" { + objectMap["createMode"] = dpi.CreateMode + } + if dpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = dpi.DeferredDeleteTimeInUTC + } + if dpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = dpi.IsScheduledForDeferredDelete + } + if dpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = dpi.DeferredDeleteTimeRemaining + } + if dpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = dpi.IsDeferredDeleteScheduleUpcoming + } + if dpi.IsRehydrate != nil { + objectMap["isRehydrate"] = dpi.IsRehydrate + } + if dpi.ResourceGuardOperationRequests != nil { + objectMap["resourceGuardOperationRequests"] = dpi.ResourceGuardOperationRequests + } + if dpi.IsArchiveEnabled != nil { + objectMap["isArchiveEnabled"] = dpi.IsArchiveEnabled + } + if dpi.PolicyName != nil { + objectMap["policyName"] = dpi.PolicyName + } + if dpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = dpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return &dpi, true +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for DPMProtectedItem. +func (dpi DPMProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &dpi, true +} + +// DPMProtectedItemExtendedInfo additional information of DPM Protected item. +type DPMProtectedItemExtendedInfo struct { + // ProtectableObjectLoadPath - Attribute to provide information on various DBs. + ProtectableObjectLoadPath map[string]*string `json:"protectableObjectLoadPath"` + // Protected - To check if backup item is disk protected. + Protected *bool `json:"protected,omitempty"` + // IsPresentOnCloud - To check if backup item is cloud protected. + IsPresentOnCloud *bool `json:"isPresentOnCloud,omitempty"` + // LastBackupStatus - Last backup status information on backup item. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` + // LastRefreshedAt - Last refresh time on backup item. + LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` + // OldestRecoveryPoint - Oldest cloud recovery point time. + OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` + // RecoveryPointCount - cloud recovery point count. + RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` + // OnPremiseOldestRecoveryPoint - Oldest disk recovery point time. + OnPremiseOldestRecoveryPoint *date.Time `json:"onPremiseOldestRecoveryPoint,omitempty"` + // OnPremiseLatestRecoveryPoint - latest disk recovery point time. + OnPremiseLatestRecoveryPoint *date.Time `json:"onPremiseLatestRecoveryPoint,omitempty"` + // OnPremiseRecoveryPointCount - disk recovery point count. + OnPremiseRecoveryPointCount *int32 `json:"onPremiseRecoveryPointCount,omitempty"` + // IsCollocated - To check if backup item is collocated. + IsCollocated *bool `json:"isCollocated,omitempty"` + // ProtectionGroupName - Protection group name of the backup item. + ProtectionGroupName *string `json:"protectionGroupName,omitempty"` + // DiskStorageUsedInBytes - Used Disk storage in bytes. + DiskStorageUsedInBytes *string `json:"diskStorageUsedInBytes,omitempty"` + // TotalDiskStorageSizeInBytes - total Disk storage in bytes. + TotalDiskStorageSizeInBytes *string `json:"totalDiskStorageSizeInBytes,omitempty"` +} + +// MarshalJSON is the custom marshaler for DPMProtectedItemExtendedInfo. +func (dpiei DPMProtectedItemExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dpiei.ProtectableObjectLoadPath != nil { + objectMap["protectableObjectLoadPath"] = dpiei.ProtectableObjectLoadPath + } + if dpiei.Protected != nil { + objectMap["protected"] = dpiei.Protected + } + if dpiei.IsPresentOnCloud != nil { + objectMap["isPresentOnCloud"] = dpiei.IsPresentOnCloud + } + if dpiei.LastBackupStatus != nil { + objectMap["lastBackupStatus"] = dpiei.LastBackupStatus + } + if dpiei.LastRefreshedAt != nil { + objectMap["lastRefreshedAt"] = dpiei.LastRefreshedAt + } + if dpiei.OldestRecoveryPoint != nil { + objectMap["oldestRecoveryPoint"] = dpiei.OldestRecoveryPoint + } + if dpiei.RecoveryPointCount != nil { + objectMap["recoveryPointCount"] = dpiei.RecoveryPointCount + } + if dpiei.OnPremiseOldestRecoveryPoint != nil { + objectMap["onPremiseOldestRecoveryPoint"] = dpiei.OnPremiseOldestRecoveryPoint + } + if dpiei.OnPremiseLatestRecoveryPoint != nil { + objectMap["onPremiseLatestRecoveryPoint"] = dpiei.OnPremiseLatestRecoveryPoint + } + if dpiei.OnPremiseRecoveryPointCount != nil { + objectMap["onPremiseRecoveryPointCount"] = dpiei.OnPremiseRecoveryPointCount + } + if dpiei.IsCollocated != nil { + objectMap["isCollocated"] = dpiei.IsCollocated + } + if dpiei.ProtectionGroupName != nil { + objectMap["protectionGroupName"] = dpiei.ProtectionGroupName + } + if dpiei.DiskStorageUsedInBytes != nil { + objectMap["diskStorageUsedInBytes"] = dpiei.DiskStorageUsedInBytes + } + if dpiei.TotalDiskStorageSizeInBytes != nil { + objectMap["totalDiskStorageSizeInBytes"] = dpiei.TotalDiskStorageSizeInBytes + } + return json.Marshal(objectMap) +} + +// EncryptionDetails details needed if the VM was encrypted at the time of backup. +type EncryptionDetails struct { + // EncryptionEnabled - Identifies whether this backup copy represents an encrypted VM at the time of backup. + EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` + // KekURL - Key Url. + KekURL *string `json:"kekUrl,omitempty"` + // SecretKeyURL - Secret Url. + SecretKeyURL *string `json:"secretKeyUrl,omitempty"` + // KekVaultID - ID of Key Vault where KEK is stored. + KekVaultID *string `json:"kekVaultId,omitempty"` + // SecretKeyVaultID - ID of Key Vault where Secret is stored. + SecretKeyVaultID *string `json:"secretKeyVaultId,omitempty"` +} + +// BasicEngineBase the base backup engine class. All workload specific backup engines derive from this class. +type BasicEngineBase interface { + AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) + AsDpmBackupEngine() (*DpmBackupEngine, bool) + AsEngineBase() (*EngineBase, bool) +} + +// EngineBase the base backup engine class. All workload specific backup engines derive from this class. +type EngineBase struct { + // FriendlyName - Friendly name of the backup engine. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Registration status of the backup engine with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // BackupEngineState - Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} + BackupEngineState *string `json:"backupEngineState,omitempty"` + // HealthStatus - Backup status of the backup engine. + HealthStatus *string `json:"healthStatus,omitempty"` + // CanReRegister - Flag indicating if the backup engine be registered, once already registered. + CanReRegister *bool `json:"canReRegister,omitempty"` + // BackupEngineID - ID of the backup engine. + BackupEngineID *string `json:"backupEngineId,omitempty"` + // DpmVersion - Backup engine version + DpmVersion *string `json:"dpmVersion,omitempty"` + // AzureBackupAgentVersion - Backup agent version + AzureBackupAgentVersion *string `json:"azureBackupAgentVersion,omitempty"` + // IsAzureBackupAgentUpgradeAvailable - To check if backup agent upgrade available + IsAzureBackupAgentUpgradeAvailable *bool `json:"isAzureBackupAgentUpgradeAvailable,omitempty"` + // IsDpmUpgradeAvailable - To check if backup engine upgrade available + IsDpmUpgradeAvailable *bool `json:"isDpmUpgradeAvailable,omitempty"` + // ExtendedInfo - Extended info of the backupengine + ExtendedInfo *EngineExtendedInfo `json:"extendedInfo,omitempty"` + // BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine' + BackupEngineType EngineType `json:"backupEngineType,omitempty"` +} + +func unmarshalBasicEngineBase(body []byte) (BasicEngineBase, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["backupEngineType"] { + case string(BackupEngineTypeAzureBackupServerEngine): + var abse AzureBackupServerEngine + err := json.Unmarshal(body, &abse) + return abse, err + case string(BackupEngineTypeDpmBackupEngine): + var dbe DpmBackupEngine + err := json.Unmarshal(body, &dbe) + return dbe, err + default: + var eb EngineBase + err := json.Unmarshal(body, &eb) + return eb, err + } +} +func unmarshalBasicEngineBaseArray(body []byte) ([]BasicEngineBase, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ebArray := make([]BasicEngineBase, len(rawMessages)) + + for index, rawMessage := range rawMessages { + eb, err := unmarshalBasicEngineBase(*rawMessage) + if err != nil { + return nil, err + } + ebArray[index] = eb + } + return ebArray, nil +} + +// MarshalJSON is the custom marshaler for EngineBase. +func (eb EngineBase) MarshalJSON() ([]byte, error) { + eb.BackupEngineType = BackupEngineTypeBackupEngineBase + objectMap := make(map[string]interface{}) + if eb.FriendlyName != nil { + objectMap["friendlyName"] = eb.FriendlyName + } + if eb.BackupManagementType != "" { + objectMap["backupManagementType"] = eb.BackupManagementType + } + if eb.RegistrationStatus != nil { + objectMap["registrationStatus"] = eb.RegistrationStatus + } + if eb.BackupEngineState != nil { + objectMap["backupEngineState"] = eb.BackupEngineState + } + if eb.HealthStatus != nil { + objectMap["healthStatus"] = eb.HealthStatus + } + if eb.CanReRegister != nil { + objectMap["canReRegister"] = eb.CanReRegister + } + if eb.BackupEngineID != nil { + objectMap["backupEngineId"] = eb.BackupEngineID + } + if eb.DpmVersion != nil { + objectMap["dpmVersion"] = eb.DpmVersion + } + if eb.AzureBackupAgentVersion != nil { + objectMap["azureBackupAgentVersion"] = eb.AzureBackupAgentVersion + } + if eb.IsAzureBackupAgentUpgradeAvailable != nil { + objectMap["isAzureBackupAgentUpgradeAvailable"] = eb.IsAzureBackupAgentUpgradeAvailable + } + if eb.IsDpmUpgradeAvailable != nil { + objectMap["isDpmUpgradeAvailable"] = eb.IsDpmUpgradeAvailable + } + if eb.ExtendedInfo != nil { + objectMap["extendedInfo"] = eb.ExtendedInfo + } + if eb.BackupEngineType != "" { + objectMap["backupEngineType"] = eb.BackupEngineType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerEngine is the BasicEngineBase implementation for EngineBase. +func (eb EngineBase) AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) { + return nil, false +} + +// AsDpmBackupEngine is the BasicEngineBase implementation for EngineBase. +func (eb EngineBase) AsDpmBackupEngine() (*DpmBackupEngine, bool) { + return nil, false +} + +// AsEngineBase is the BasicEngineBase implementation for EngineBase. +func (eb EngineBase) AsEngineBase() (*EngineBase, bool) { + return &eb, true +} + +// AsBasicEngineBase is the BasicEngineBase implementation for EngineBase. +func (eb EngineBase) AsBasicEngineBase() (BasicEngineBase, bool) { + return &eb, true +} + +// EngineBaseResource the base backup engine class. All workload specific backup engines derive from this +// class. +type EngineBaseResource struct { + autorest.Response `json:"-"` + // Properties - BackupEngineBaseResource properties + Properties BasicEngineBase `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for EngineBaseResource. +func (ebr EngineBaseResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = ebr.Properties + if ebr.Location != nil { + objectMap["location"] = ebr.Location + } + if ebr.Tags != nil { + objectMap["tags"] = ebr.Tags + } + if ebr.ETag != nil { + objectMap["eTag"] = ebr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for EngineBaseResource struct. +func (ebr *EngineBaseResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicEngineBase(*v) + if err != nil { + return err + } + ebr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ebr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ebr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ebr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ebr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ebr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + ebr.ETag = &eTag + } + } + } + + return nil +} + +// EngineBaseResourceList list of BackupEngineBase resources +type EngineBaseResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]EngineBaseResource `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"` +} + +// EngineBaseResourceListIterator provides access to a complete listing of EngineBaseResource values. +type EngineBaseResourceListIterator struct { + i int + page EngineBaseResourceListPage +} + +// NextWithContext 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 *EngineBaseResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EngineBaseResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *EngineBaseResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter EngineBaseResourceListIterator) 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 EngineBaseResourceListIterator) Response() EngineBaseResourceList { + 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 EngineBaseResourceListIterator) Value() EngineBaseResource { + if !iter.page.NotDone() { + return EngineBaseResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the EngineBaseResourceListIterator type. +func NewEngineBaseResourceListIterator(page EngineBaseResourceListPage) EngineBaseResourceListIterator { + return EngineBaseResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ebrl EngineBaseResourceList) IsEmpty() bool { + return ebrl.Value == nil || len(*ebrl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ebrl EngineBaseResourceList) hasNextLink() bool { + return ebrl.NextLink != nil && len(*ebrl.NextLink) != 0 +} + +// engineBaseResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ebrl EngineBaseResourceList) engineBaseResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !ebrl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ebrl.NextLink))) +} + +// EngineBaseResourceListPage contains a page of EngineBaseResource values. +type EngineBaseResourceListPage struct { + fn func(context.Context, EngineBaseResourceList) (EngineBaseResourceList, error) + ebrl EngineBaseResourceList +} + +// NextWithContext 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 *EngineBaseResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EngineBaseResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ebrl) + if err != nil { + return err + } + page.ebrl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *EngineBaseResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page EngineBaseResourceListPage) NotDone() bool { + return !page.ebrl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page EngineBaseResourceListPage) Response() EngineBaseResourceList { + return page.ebrl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page EngineBaseResourceListPage) Values() []EngineBaseResource { + if page.ebrl.IsEmpty() { + return nil + } + return *page.ebrl.Value +} + +// Creates a new instance of the EngineBaseResourceListPage type. +func NewEngineBaseResourceListPage(cur EngineBaseResourceList, getNextPage func(context.Context, EngineBaseResourceList) (EngineBaseResourceList, error)) EngineBaseResourceListPage { + return EngineBaseResourceListPage{ + fn: getNextPage, + ebrl: cur, + } +} + +// EngineExtendedInfo additional information on backup engine. +type EngineExtendedInfo struct { + // DatabaseName - Database name of backup engine. + DatabaseName *string `json:"databaseName,omitempty"` + // ProtectedItemsCount - Number of protected items in the backup engine. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // ProtectedServersCount - Number of protected servers in the backup engine. + ProtectedServersCount *int32 `json:"protectedServersCount,omitempty"` + // DiskCount - Number of disks in the backup engine. + DiskCount *int32 `json:"diskCount,omitempty"` + // UsedDiskSpace - Disk space used in the backup engine. + UsedDiskSpace *float64 `json:"usedDiskSpace,omitempty"` + // AvailableDiskSpace - Disk space currently available in the backup engine. + AvailableDiskSpace *float64 `json:"availableDiskSpace,omitempty"` + // RefreshedAt - Last refresh time in the backup engine. + RefreshedAt *date.Time `json:"refreshedAt,omitempty"` + // AzureProtectedInstances - Protected instances in the backup engine. + AzureProtectedInstances *int32 `json:"azureProtectedInstances,omitempty"` +} + +// ErrorAdditionalInfo the resource management error additional info. +type ErrorAdditionalInfo struct { + // Type - READ-ONLY; The additional info type. + Type *string `json:"type,omitempty"` + // Info - READ-ONLY; The additional info. + Info interface{} `json:"info,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorAdditionalInfo. +func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ErrorDetail error Detail class which encapsulates Code, Message and Recommendations. +type ErrorDetail struct { + // Code - READ-ONLY; Error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; Error Message related to the Code. + Message *string `json:"message,omitempty"` + // Recommendations - READ-ONLY; List of recommendation strings. + Recommendations *[]string `json:"recommendations,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorDetail. +func (ed ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ExportJobsOperationResultInfo this class is used to send blob details after exporting jobs. +type ExportJobsOperationResultInfo struct { + // BlobURL - URL of the blob into which the serialized string of list of jobs is exported. + BlobURL *string `json:"blobUrl,omitempty"` + // BlobSasKey - SAS key to access the blob. It expires in 15 mins. + BlobSasKey *string `json:"blobSasKey,omitempty"` + // ExcelFileBlobURL - URL of the blob into which the ExcelFile is uploaded. + ExcelFileBlobURL *string `json:"excelFileBlobUrl,omitempty"` + // ExcelFileBlobSasKey - SAS key to access the blob. It expires in 15 mins. + ExcelFileBlobSasKey *string `json:"excelFileBlobSasKey,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeOperationResultInfoBase', 'ObjectTypeExportJobsOperationResultInfo', 'ObjectTypeOperationResultInfo' + ObjectType ObjectType `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExportJobsOperationResultInfo. +func (ejori ExportJobsOperationResultInfo) MarshalJSON() ([]byte, error) { + ejori.ObjectType = ObjectTypeExportJobsOperationResultInfo + objectMap := make(map[string]interface{}) + if ejori.BlobURL != nil { + objectMap["blobUrl"] = ejori.BlobURL + } + if ejori.BlobSasKey != nil { + objectMap["blobSasKey"] = ejori.BlobSasKey + } + if ejori.ExcelFileBlobURL != nil { + objectMap["excelFileBlobUrl"] = ejori.ExcelFileBlobURL + } + if ejori.ExcelFileBlobSasKey != nil { + objectMap["excelFileBlobSasKey"] = ejori.ExcelFileBlobSasKey + } + if ejori.ObjectType != "" { + objectMap["objectType"] = ejori.ObjectType + } + return json.Marshal(objectMap) +} + +// AsExportJobsOperationResultInfo is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. +func (ejori ExportJobsOperationResultInfo) AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) { + return &ejori, true +} + +// AsOperationResultInfo is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. +func (ejori ExportJobsOperationResultInfo) AsOperationResultInfo() (*OperationResultInfo, bool) { + return nil, false +} + +// AsOperationResultInfoBase is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. +func (ejori ExportJobsOperationResultInfo) AsOperationResultInfoBase() (*OperationResultInfoBase, bool) { + return nil, false +} + +// AsBasicOperationResultInfoBase is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo. +func (ejori ExportJobsOperationResultInfo) AsBasicOperationResultInfoBase() (BasicOperationResultInfoBase, bool) { + return &ejori, true +} + +// ExtendedProperties extended Properties for Azure IaasVM Backup. +type ExtendedProperties struct { + // DiskExclusionProperties - Extended Properties for Disk Exclusion. + DiskExclusionProperties *DiskExclusionProperties `json:"diskExclusionProperties,omitempty"` + // LinuxVMApplicationName - Linux VM name + LinuxVMApplicationName *string `json:"linuxVmApplicationName,omitempty"` +} + +// BasicFeatureSupportRequest base class for feature request +type BasicFeatureSupportRequest interface { + AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) + AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) + AsFeatureSupportRequest() (*FeatureSupportRequest, bool) +} + +// FeatureSupportRequest base class for feature request +type FeatureSupportRequest struct { + // FeatureType - Possible values include: 'FeatureTypeFeatureSupportRequest', 'FeatureTypeAzureBackupGoals', 'FeatureTypeAzureVMResourceBackup' + FeatureType FeatureType `json:"featureType,omitempty"` +} + +func unmarshalBasicFeatureSupportRequest(body []byte) (BasicFeatureSupportRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["featureType"] { + case string(FeatureTypeAzureBackupGoals): + var abgfsr AzureBackupGoalFeatureSupportRequest + err := json.Unmarshal(body, &abgfsr) + return abgfsr, err + case string(FeatureTypeAzureVMResourceBackup): + var avrfsr AzureVMResourceFeatureSupportRequest + err := json.Unmarshal(body, &avrfsr) + return avrfsr, err + default: + var fsr FeatureSupportRequest + err := json.Unmarshal(body, &fsr) + return fsr, err + } +} +func unmarshalBasicFeatureSupportRequestArray(body []byte) ([]BasicFeatureSupportRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fsrArray := make([]BasicFeatureSupportRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fsr, err := unmarshalBasicFeatureSupportRequest(*rawMessage) + if err != nil { + return nil, err + } + fsrArray[index] = fsr + } + return fsrArray, nil +} + +// MarshalJSON is the custom marshaler for FeatureSupportRequest. +func (fsr FeatureSupportRequest) MarshalJSON() ([]byte, error) { + fsr.FeatureType = FeatureTypeFeatureSupportRequest + objectMap := make(map[string]interface{}) + if fsr.FeatureType != "" { + objectMap["featureType"] = fsr.FeatureType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupGoalFeatureSupportRequest is the BasicFeatureSupportRequest implementation for FeatureSupportRequest. +func (fsr FeatureSupportRequest) AsAzureBackupGoalFeatureSupportRequest() (*AzureBackupGoalFeatureSupportRequest, bool) { + return nil, false +} + +// AsAzureVMResourceFeatureSupportRequest is the BasicFeatureSupportRequest implementation for FeatureSupportRequest. +func (fsr FeatureSupportRequest) AsAzureVMResourceFeatureSupportRequest() (*AzureVMResourceFeatureSupportRequest, bool) { + return nil, false +} + +// AsFeatureSupportRequest is the BasicFeatureSupportRequest implementation for FeatureSupportRequest. +func (fsr FeatureSupportRequest) AsFeatureSupportRequest() (*FeatureSupportRequest, bool) { + return &fsr, true +} + +// AsBasicFeatureSupportRequest is the BasicFeatureSupportRequest implementation for FeatureSupportRequest. +func (fsr FeatureSupportRequest) AsBasicFeatureSupportRequest() (BasicFeatureSupportRequest, bool) { + return &fsr, true +} + +// GenericContainer base class for generic container of backup items +type GenericContainer struct { + // FabricName - Name of the container's fabric + FabricName *string `json:"fabricName,omitempty"` + // ExtendedInformation - Extended information (not returned in List container API calls) + ExtendedInformation *GenericContainerExtendedInfo `json:"extendedInformation,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ProtectableObjectType - Type of the protectable object associated with this container + ProtectableObjectType *string `json:"protectableObjectType,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaasVMContainer1', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for GenericContainer. +func (gc GenericContainer) MarshalJSON() ([]byte, error) { + gc.ContainerType = ContainerTypeGenericContainer1 + objectMap := make(map[string]interface{}) + if gc.FabricName != nil { + objectMap["fabricName"] = gc.FabricName + } + if gc.ExtendedInformation != nil { + objectMap["extendedInformation"] = gc.ExtendedInformation + } + if gc.FriendlyName != nil { + objectMap["friendlyName"] = gc.FriendlyName + } + if gc.BackupManagementType != "" { + objectMap["backupManagementType"] = gc.BackupManagementType + } + if gc.RegistrationStatus != nil { + objectMap["registrationStatus"] = gc.RegistrationStatus + } + if gc.HealthStatus != nil { + objectMap["healthStatus"] = gc.HealthStatus + } + if gc.ProtectableObjectType != nil { + objectMap["protectableObjectType"] = gc.ProtectableObjectType + } + if gc.ContainerType != "" { + objectMap["containerType"] = gc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsBasicDpmContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsGenericContainer() (*GenericContainer, bool) { + return &gc, true +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for GenericContainer. +func (gc GenericContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &gc, true +} + +// GenericContainerExtendedInfo container extended information +type GenericContainerExtendedInfo struct { + // RawCertData - Public key of container cert + RawCertData *string `json:"rawCertData,omitempty"` + // ContainerIdentityInfo - Container identity information + ContainerIdentityInfo *ContainerIdentityInfo `json:"containerIdentityInfo,omitempty"` + // ServiceEndpoints - Azure Backup Service Endpoints for the container + ServiceEndpoints map[string]*string `json:"serviceEndpoints"` +} + +// MarshalJSON is the custom marshaler for GenericContainerExtendedInfo. +func (gcei GenericContainerExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gcei.RawCertData != nil { + objectMap["rawCertData"] = gcei.RawCertData + } + if gcei.ContainerIdentityInfo != nil { + objectMap["containerIdentityInfo"] = gcei.ContainerIdentityInfo + } + if gcei.ServiceEndpoints != nil { + objectMap["serviceEndpoints"] = gcei.ServiceEndpoints + } + return json.Marshal(objectMap) +} + +// GenericProtectedItem base class for backup items. +type GenericProtectedItem struct { + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // PolicyState - Indicates consistency of policy object and policy applied to this backup item. + PolicyState *string `json:"policyState,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused' + ProtectionState ProtectionState `json:"protectionState,omitempty"` + // ProtectedItemID - Data Plane Service ID of the protected item. + ProtectedItemID *int64 `json:"protectedItemId,omitempty"` + // SourceAssociations - Loosely coupled (type, value) associations (example - parent of a protected item) + SourceAssociations map[string]*string `json:"sourceAssociations"` + // FabricName - Name of this backup item's fabric. + FabricName *string `json:"fabricName,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ResourceGuardOperationRequests - ResourceGuardOperationRequests on which LAC check will be performed + ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` + // IsArchiveEnabled - Flag to identify whether datasource is protected in archive + IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + // PolicyName - Name of the policy used for protection + PolicyName *string `json:"policyName,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for GenericProtectedItem. +func (gpi GenericProtectedItem) MarshalJSON() ([]byte, error) { + gpi.ProtectedItemType = ProtectedItemTypeGenericProtectedItem + objectMap := make(map[string]interface{}) + if gpi.FriendlyName != nil { + objectMap["friendlyName"] = gpi.FriendlyName + } + if gpi.PolicyState != nil { + objectMap["policyState"] = gpi.PolicyState + } + if gpi.ProtectionState != "" { + objectMap["protectionState"] = gpi.ProtectionState + } + if gpi.ProtectedItemID != nil { + objectMap["protectedItemId"] = gpi.ProtectedItemID + } + if gpi.SourceAssociations != nil { + objectMap["sourceAssociations"] = gpi.SourceAssociations + } + if gpi.FabricName != nil { + objectMap["fabricName"] = gpi.FabricName + } + if gpi.BackupManagementType != "" { + objectMap["backupManagementType"] = gpi.BackupManagementType + } + if gpi.WorkloadType != "" { + objectMap["workloadType"] = gpi.WorkloadType + } + if gpi.ContainerName != nil { + objectMap["containerName"] = gpi.ContainerName + } + if gpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = gpi.SourceResourceID + } + if gpi.PolicyID != nil { + objectMap["policyId"] = gpi.PolicyID + } + if gpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = gpi.LastRecoveryPoint + } + if gpi.BackupSetName != nil { + objectMap["backupSetName"] = gpi.BackupSetName + } + if gpi.CreateMode != "" { + objectMap["createMode"] = gpi.CreateMode + } + if gpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = gpi.DeferredDeleteTimeInUTC + } + if gpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = gpi.IsScheduledForDeferredDelete + } + if gpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = gpi.DeferredDeleteTimeRemaining + } + if gpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = gpi.IsDeferredDeleteScheduleUpcoming + } + if gpi.IsRehydrate != nil { + objectMap["isRehydrate"] = gpi.IsRehydrate + } + if gpi.ResourceGuardOperationRequests != nil { + objectMap["resourceGuardOperationRequests"] = gpi.ResourceGuardOperationRequests + } + if gpi.IsArchiveEnabled != nil { + objectMap["isArchiveEnabled"] = gpi.IsArchiveEnabled + } + if gpi.PolicyName != nil { + objectMap["policyName"] = gpi.PolicyName + } + if gpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = gpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return &gpi, true +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for GenericProtectedItem. +func (gpi GenericProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &gpi, true +} + +// GenericProtectionPolicy azure VM (Mercury) workload-specific backup policy. +type GenericProtectionPolicy struct { + // SubProtectionPolicy - List of sub-protection policies which includes schedule and retention + SubProtectionPolicy *[]SubProtectionPolicy `json:"subProtectionPolicy,omitempty"` + // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + TimeZone *string `json:"timeZone,omitempty"` + // FabricName - Name of this policy's fabric. + FabricName *string `json:"fabricName,omitempty"` + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // ResourceGuardOperationRequests - ResourceGuard Operation Requests + ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` +} + +// MarshalJSON is the custom marshaler for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) MarshalJSON() ([]byte, error) { + gpp.BackupManagementType = BackupManagementTypeGenericProtectionPolicy + objectMap := make(map[string]interface{}) + if gpp.SubProtectionPolicy != nil { + objectMap["subProtectionPolicy"] = gpp.SubProtectionPolicy + } + if gpp.TimeZone != nil { + objectMap["timeZone"] = gpp.TimeZone + } + if gpp.FabricName != nil { + objectMap["fabricName"] = gpp.FabricName + } + if gpp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = gpp.ProtectedItemsCount + } + if gpp.ResourceGuardOperationRequests != nil { + objectMap["resourceGuardOperationRequests"] = gpp.ResourceGuardOperationRequests + } + if gpp.BackupManagementType != "" { + objectMap["backupManagementType"] = gpp.BackupManagementType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return nil, false +} + +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { + return nil, false +} + +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { + return nil, false +} + +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { + return &gpp, true +} + +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { + return nil, false +} + +// AsProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { + return nil, false +} + +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for GenericProtectionPolicy. +func (gpp GenericProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &gpp, true +} + +// GenericRecoveryPoint generic backup copy. +type GenericRecoveryPoint struct { + // FriendlyName - Friendly name of the backup copy. + FriendlyName *string `json:"friendlyName,omitempty"` + // RecoveryPointType - Type of the backup copy. + RecoveryPointType *string `json:"recoveryPointType,omitempty"` + // RecoveryPointTime - Time at which this backup copy was created. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // RecoveryPointAdditionalInfo - Additional information associated with this backup copy. + RecoveryPointAdditionalInfo *string `json:"recoveryPointAdditionalInfo,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) MarshalJSON() ([]byte, error) { + grp.ObjectType = ObjectTypeGenericRecoveryPoint + objectMap := make(map[string]interface{}) + if grp.FriendlyName != nil { + objectMap["friendlyName"] = grp.FriendlyName + } + if grp.RecoveryPointType != nil { + objectMap["recoveryPointType"] = grp.RecoveryPointType + } + if grp.RecoveryPointTime != nil { + objectMap["recoveryPointTime"] = grp.RecoveryPointTime + } + if grp.RecoveryPointAdditionalInfo != nil { + objectMap["recoveryPointAdditionalInfo"] = grp.RecoveryPointAdditionalInfo + } + if grp.ObjectType != "" { + objectMap["objectType"] = grp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return &grp, true +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint. +func (grp GenericRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &grp, true +} + +// GetProtectedItemQueryObject filters to list backup items. +type GetProtectedItemQueryObject struct { + // Expand - Specifies if the additional information should be provided for this item. + Expand *string `json:"expand,omitempty"` +} + +// HourlySchedule ... +type HourlySchedule struct { + // Interval - Interval at which backup needs to be triggered. For hourly the value + // can be 4/6/8/12 + Interval *int32 `json:"interval,omitempty"` + // ScheduleWindowStartTime - To specify start time of the backup window + ScheduleWindowStartTime *date.Time `json:"scheduleWindowStartTime,omitempty"` + // ScheduleWindowDuration - To specify duration of the backup window + ScheduleWindowDuration *int32 `json:"scheduleWindowDuration,omitempty"` +} + +// IaasVMBackupRequest iaaS VM workload-specific backup request. +type IaasVMBackupRequest struct { + // RecoveryPointExpiryTimeInUTC - Backup copy will expire after the time specified (UTC). + RecoveryPointExpiryTimeInUTC *date.Time `json:"recoveryPointExpiryTimeInUTC,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' + ObjectType ObjectTypeBasicRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for IaasVMBackupRequest. +func (ivbr IaasVMBackupRequest) MarshalJSON() ([]byte, error) { + ivbr.ObjectType = ObjectTypeIaasVMBackupRequest + objectMap := make(map[string]interface{}) + if ivbr.RecoveryPointExpiryTimeInUTC != nil { + objectMap["recoveryPointExpiryTimeInUTC"] = ivbr.RecoveryPointExpiryTimeInUTC + } + if ivbr.ObjectType != "" { + objectMap["objectType"] = ivbr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareBackupRequest is the BasicRequest implementation for IaasVMBackupRequest. +func (ivbr IaasVMBackupRequest) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { + return nil, false +} + +// AsAzureWorkloadBackupRequest is the BasicRequest implementation for IaasVMBackupRequest. +func (ivbr IaasVMBackupRequest) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { + return nil, false +} + +// AsIaasVMBackupRequest is the BasicRequest implementation for IaasVMBackupRequest. +func (ivbr IaasVMBackupRequest) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { + return &ivbr, true +} + +// AsRequest is the BasicRequest implementation for IaasVMBackupRequest. +func (ivbr IaasVMBackupRequest) AsRequest() (*Request, bool) { + return nil, false +} + +// AsBasicRequest is the BasicRequest implementation for IaasVMBackupRequest. +func (ivbr IaasVMBackupRequest) AsBasicRequest() (BasicRequest, bool) { + return &ivbr, true +} + +// BasicIaaSVMContainer iaaS VM workload-specific container. +type BasicIaaSVMContainer interface { + AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) + AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) + AsIaaSVMContainer() (*IaaSVMContainer, bool) +} + +// IaaSVMContainer iaaS VM workload-specific container. +type IaaSVMContainer struct { + // VirtualMachineID - Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // VirtualMachineVersion - Specifies whether the container represents a Classic or an Azure Resource Manager VM. + VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` + // ResourceGroup - Resource group name of Recovery Services Vault. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ProtectableObjectType - Type of the protectable object associated with this container + ProtectableObjectType *string `json:"protectableObjectType,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaasVMContainer1', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +func unmarshalBasicIaaSVMContainer(body []byte) (BasicIaaSVMContainer, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["containerType"] { + case string(ContainerTypeMicrosoftClassicComputevirtualMachines): + var aisccvc AzureIaaSClassicComputeVMContainer + err := json.Unmarshal(body, &aisccvc) + return aisccvc, err + case string(ContainerTypeMicrosoftComputevirtualMachines): + var aiscvc AzureIaaSComputeVMContainer + err := json.Unmarshal(body, &aiscvc) + return aiscvc, err + default: + var isc IaaSVMContainer + err := json.Unmarshal(body, &isc) + return isc, err + } +} +func unmarshalBasicIaaSVMContainerArray(body []byte) ([]BasicIaaSVMContainer, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + iscArray := make([]BasicIaaSVMContainer, len(rawMessages)) + + for index, rawMessage := range rawMessages { + isc, err := unmarshalBasicIaaSVMContainer(*rawMessage) + if err != nil { + return nil, err + } + iscArray[index] = isc + } + return iscArray, nil +} + +// MarshalJSON is the custom marshaler for IaaSVMContainer. +func (isc IaaSVMContainer) MarshalJSON() ([]byte, error) { + isc.ContainerType = ContainerTypeIaasVMContainer1 + objectMap := make(map[string]interface{}) + if isc.VirtualMachineID != nil { + objectMap["virtualMachineId"] = isc.VirtualMachineID + } + if isc.VirtualMachineVersion != nil { + objectMap["virtualMachineVersion"] = isc.VirtualMachineVersion + } + if isc.ResourceGroup != nil { + objectMap["resourceGroup"] = isc.ResourceGroup + } + if isc.FriendlyName != nil { + objectMap["friendlyName"] = isc.FriendlyName + } + if isc.BackupManagementType != "" { + objectMap["backupManagementType"] = isc.BackupManagementType + } + if isc.RegistrationStatus != nil { + objectMap["registrationStatus"] = isc.RegistrationStatus + } + if isc.HealthStatus != nil { + objectMap["healthStatus"] = isc.HealthStatus + } + if isc.ProtectableObjectType != nil { + objectMap["protectableObjectType"] = isc.ProtectableObjectType + } + if isc.ContainerType != "" { + objectMap["containerType"] = isc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsBasicDpmContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return &isc, true +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return &isc, true +} + +// AsMabContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer. +func (isc IaaSVMContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &isc, true +} + +// IaasVMILRRegistrationRequest restore files/folders from a backup copy of IaaS VM. +type IaasVMILRRegistrationRequest struct { + // RecoveryPointID - ID of the IaaS VM backup copy from where the files/folders have to be restored. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // VirtualMachineID - Fully qualified ARM ID of the virtual machine whose the files / folders have to be restored. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // InitiatorName - iSCSI initiator name. + InitiatorName *string `json:"initiatorName,omitempty"` + // RenewExistingRegistration - Whether to renew existing registration with the iSCSI server. + RenewExistingRegistration *bool `json:"renewExistingRegistration,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeAzureFileShareProvisionILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest' + ObjectType ObjectTypeBasicILRRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for IaasVMILRRegistrationRequest. +func (ivrr IaasVMILRRegistrationRequest) MarshalJSON() ([]byte, error) { + ivrr.ObjectType = ObjectTypeIaasVMILRRegistrationRequest + objectMap := make(map[string]interface{}) + if ivrr.RecoveryPointID != nil { + objectMap["recoveryPointId"] = ivrr.RecoveryPointID + } + if ivrr.VirtualMachineID != nil { + objectMap["virtualMachineId"] = ivrr.VirtualMachineID + } + if ivrr.InitiatorName != nil { + objectMap["initiatorName"] = ivrr.InitiatorName + } + if ivrr.RenewExistingRegistration != nil { + objectMap["renewExistingRegistration"] = ivrr.RenewExistingRegistration + } + if ivrr.ObjectType != "" { + objectMap["objectType"] = ivrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProvisionILRRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. +func (ivrr IaasVMILRRegistrationRequest) AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) { + return nil, false +} + +// AsIaasVMILRRegistrationRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. +func (ivrr IaasVMILRRegistrationRequest) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) { + return &ivrr, true +} + +// AsILRRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. +func (ivrr IaasVMILRRegistrationRequest) AsILRRequest() (*ILRRequest, bool) { + return nil, false +} + +// AsBasicILRRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest. +func (ivrr IaasVMILRRegistrationRequest) AsBasicILRRequest() (BasicILRRequest, bool) { + return &ivrr, true +} + +// BasicIaaSVMProtectableItem iaaS VM workload-specific backup item. +type BasicIaaSVMProtectableItem interface { + AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) + AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) + AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) +} + +// IaaSVMProtectableItem iaaS VM workload-specific backup item. +type IaaSVMProtectableItem struct { + // VirtualMachineID - Fully qualified ARM ID of the virtual machine. + VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // VirtualMachineVersion - Specifies whether the container represents a Classic or an Azure Resource Manager VM. + VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` + // ResourceGroup - Resource group name of Recovery Services Vault. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +func unmarshalBasicIaaSVMProtectableItem(body []byte) (BasicIaaSVMProtectableItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectableItemType"] { + case string(ProtectableItemTypeMicrosoftClassicComputevirtualMachines): + var aisccvpi AzureIaaSClassicComputeVMProtectableItem + err := json.Unmarshal(body, &aisccvpi) + return aisccvpi, err + case string(ProtectableItemTypeMicrosoftComputevirtualMachines): + var aiscvpi AzureIaaSComputeVMProtectableItem + err := json.Unmarshal(body, &aiscvpi) + return aiscvpi, err + default: + var ispi IaaSVMProtectableItem + err := json.Unmarshal(body, &ispi) + return ispi, err + } +} +func unmarshalBasicIaaSVMProtectableItemArray(body []byte) ([]BasicIaaSVMProtectableItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ispiArray := make([]BasicIaaSVMProtectableItem, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ispi, err := unmarshalBasicIaaSVMProtectableItem(*rawMessage) + if err != nil { + return nil, err + } + ispiArray[index] = ispi + } + return ispiArray, nil +} + +// MarshalJSON is the custom marshaler for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) MarshalJSON() ([]byte, error) { + ispi.ProtectableItemType = ProtectableItemTypeIaaSVMProtectableItem + objectMap := make(map[string]interface{}) + if ispi.VirtualMachineID != nil { + objectMap["virtualMachineId"] = ispi.VirtualMachineID + } + if ispi.VirtualMachineVersion != nil { + objectMap["virtualMachineVersion"] = ispi.VirtualMachineVersion + } + if ispi.ResourceGroup != nil { + objectMap["resourceGroup"] = ispi.ResourceGroup + } + if ispi.BackupManagementType != nil { + objectMap["backupManagementType"] = ispi.BackupManagementType + } + if ispi.WorkloadType != nil { + objectMap["workloadType"] = ispi.WorkloadType + } + if ispi.FriendlyName != nil { + objectMap["friendlyName"] = ispi.FriendlyName + } + if ispi.ProtectionState != "" { + objectMap["protectionState"] = ispi.ProtectionState + } + if ispi.ProtectableItemType != "" { + objectMap["protectableItemType"] = ispi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return &ispi, true +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return &ispi, true +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem. +func (ispi IaaSVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &ispi, true +} + +// IaasVMRecoveryPoint iaaS VM workload specific backup copy. +type IaasVMRecoveryPoint struct { + // RecoveryPointType - Type of the backup copy. + RecoveryPointType *string `json:"recoveryPointType,omitempty"` + // RecoveryPointTime - Time at which this backup copy was created. + RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"` + // RecoveryPointAdditionalInfo - Additional information associated with this backup copy. + RecoveryPointAdditionalInfo *string `json:"recoveryPointAdditionalInfo,omitempty"` + // SourceVMStorageType - Storage type of the VM whose backup copy is created. + SourceVMStorageType *string `json:"sourceVMStorageType,omitempty"` + // IsSourceVMEncrypted - Identifies whether the VM was encrypted when the backup copy is created. + IsSourceVMEncrypted *bool `json:"isSourceVMEncrypted,omitempty"` + // KeyAndSecret - Required details for recovering an encrypted VM. Applicable only when IsSourceVMEncrypted is true. + KeyAndSecret *KeyAndSecretDetails `json:"keyAndSecret,omitempty"` + // IsInstantIlrSessionActive - Is the session to recover items from this backup copy still active. + IsInstantIlrSessionActive *bool `json:"isInstantIlrSessionActive,omitempty"` + // RecoveryPointTierDetails - Recovery point tier information. + RecoveryPointTierDetails *[]RecoveryPointTierInformationV2 `json:"recoveryPointTierDetails,omitempty"` + // IsManagedVirtualMachine - Whether VM is with Managed Disks + IsManagedVirtualMachine *bool `json:"isManagedVirtualMachine,omitempty"` + // VirtualMachineSize - Virtual Machine Size + VirtualMachineSize *string `json:"virtualMachineSize,omitempty"` + // OriginalStorageAccountOption - Original Storage Account Option + OriginalStorageAccountOption *bool `json:"originalStorageAccountOption,omitempty"` + // OsType - OS type + OsType *string `json:"osType,omitempty"` + // RecoveryPointDiskConfiguration - Disk configuration + RecoveryPointDiskConfiguration *RecoveryPointDiskConfiguration `json:"recoveryPointDiskConfiguration,omitempty"` + // Zones - Identifies the zone of the VM at the time of backup. Applicable only for zone-pinned Vms + Zones *[]string `json:"zones,omitempty"` + // RecoveryPointMoveReadinessInfo - Eligibility of RP to be moved to another tier + RecoveryPointMoveReadinessInfo map[string]*RecoveryPointMoveReadinessInfo `json:"recoveryPointMoveReadinessInfo"` + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) MarshalJSON() ([]byte, error) { + ivrp.ObjectType = ObjectTypeIaasVMRecoveryPoint + objectMap := make(map[string]interface{}) + if ivrp.RecoveryPointType != nil { + objectMap["recoveryPointType"] = ivrp.RecoveryPointType + } + if ivrp.RecoveryPointTime != nil { + objectMap["recoveryPointTime"] = ivrp.RecoveryPointTime + } + if ivrp.RecoveryPointAdditionalInfo != nil { + objectMap["recoveryPointAdditionalInfo"] = ivrp.RecoveryPointAdditionalInfo + } + if ivrp.SourceVMStorageType != nil { + objectMap["sourceVMStorageType"] = ivrp.SourceVMStorageType + } + if ivrp.IsSourceVMEncrypted != nil { + objectMap["isSourceVMEncrypted"] = ivrp.IsSourceVMEncrypted + } + if ivrp.KeyAndSecret != nil { + objectMap["keyAndSecret"] = ivrp.KeyAndSecret + } + if ivrp.IsInstantIlrSessionActive != nil { + objectMap["isInstantIlrSessionActive"] = ivrp.IsInstantIlrSessionActive + } + if ivrp.RecoveryPointTierDetails != nil { + objectMap["recoveryPointTierDetails"] = ivrp.RecoveryPointTierDetails + } + if ivrp.IsManagedVirtualMachine != nil { + objectMap["isManagedVirtualMachine"] = ivrp.IsManagedVirtualMachine + } + if ivrp.VirtualMachineSize != nil { + objectMap["virtualMachineSize"] = ivrp.VirtualMachineSize + } + if ivrp.OriginalStorageAccountOption != nil { + objectMap["originalStorageAccountOption"] = ivrp.OriginalStorageAccountOption + } + if ivrp.OsType != nil { + objectMap["osType"] = ivrp.OsType + } + if ivrp.RecoveryPointDiskConfiguration != nil { + objectMap["recoveryPointDiskConfiguration"] = ivrp.RecoveryPointDiskConfiguration + } + if ivrp.Zones != nil { + objectMap["zones"] = ivrp.Zones + } + if ivrp.RecoveryPointMoveReadinessInfo != nil { + objectMap["recoveryPointMoveReadinessInfo"] = ivrp.RecoveryPointMoveReadinessInfo + } + if ivrp.ObjectType != "" { + objectMap["objectType"] = ivrp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return &ivrp, true +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return nil, false +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint. +func (ivrp IaasVMRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &ivrp, true +} + +// BasicIaasVMRestoreRequest iaaS VM workload-specific restore. +type BasicIaasVMRestoreRequest interface { + AsIaasVMRestoreWithRehydrationRequest() (*IaasVMRestoreWithRehydrationRequest, bool) + AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) +} + +// IaasVMRestoreRequest iaaS VM workload-specific restore. +type IaasVMRestoreRequest struct { + // RecoveryPointID - ID of the backup copy to be recovered. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM which is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // TargetVirtualMachineID - This is the complete ARM Id of the VM that will be created. + // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` + // TargetResourceGroupID - This is the ARM Id of the resource group that you want to create for this Virtual machine and other artifacts. + // For e.g. /subscriptions/{subId}/resourcegroups/{rg} + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // StorageAccountID - Fully qualified ARM ID of the storage account to which the VM has to be restored. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // VirtualNetworkID - This is the virtual network Id of the vnet that will be attached to the virtual machine. + // User will be validated for join action permissions in the linked access. + VirtualNetworkID *string `json:"virtualNetworkId,omitempty"` + // SubnetID - Subnet ID, is the subnet ID associated with the to be restored VM. For Classic VMs it would be + // {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager VMs it would be ARM resource ID used to represent + // the subnet. + SubnetID *string `json:"subnetId,omitempty"` + // TargetDomainNameID - Fully qualified ARM ID of the domain name to be associated to the VM being restored. This applies only to Classic + // Virtual Machines. + TargetDomainNameID *string `json:"targetDomainNameId,omitempty"` + // Region - Region in which the virtual machine is restored. + Region *string `json:"region,omitempty"` + // AffinityGroup - Affinity group associated to VM to be restored. Used only for Classic Compute Virtual Machines. + AffinityGroup *string `json:"affinityGroup,omitempty"` + // CreateNewCloudService - Should a new cloud service be created while restoring the VM. If this is false, VM will be restored to the same + // cloud service as it was at the time of backup. + CreateNewCloudService *bool `json:"createNewCloudService,omitempty"` + // OriginalStorageAccountOption - Original Storage Account Option + OriginalStorageAccountOption *bool `json:"originalStorageAccountOption,omitempty"` + // EncryptionDetails - Details needed if the VM was encrypted at the time of backup. + EncryptionDetails *EncryptionDetails `json:"encryptionDetails,omitempty"` + // RestoreDiskLunList - List of Disk LUNs for partial restore + RestoreDiskLunList *[]int32 `json:"restoreDiskLunList,omitempty"` + // RestoreWithManagedDisks - Flag to denote of an Unmanaged disk VM should be restored with Managed disks. + RestoreWithManagedDisks *bool `json:"restoreWithManagedDisks,omitempty"` + // DiskEncryptionSetID - DiskEncryptionSet's ID - needed if the VM needs to be encrypted at rest during restore with customer managed key. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // Zones - Target zone where the VM and its disks should be restored. + Zones *[]string `json:"zones,omitempty"` + // IdentityInfo - Managed Identity information required to access customer storage account. + IdentityInfo *IdentityInfo `json:"identityInfo,omitempty"` + // IdentityBasedRestoreDetails - IaaS VM workload specific restore details for restores using managed identity. + IdentityBasedRestoreDetails *IdentityBasedRestoreDetails `json:"identityBasedRestoreDetails,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest', 'ObjectTypeIaasVMRestoreWithRehydrationRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicIaasVMRestoreRequest(body []byte) (BasicIaasVMRestoreRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeIaasVMRestoreWithRehydrationRequest): + var ivrwrr IaasVMRestoreWithRehydrationRequest + err := json.Unmarshal(body, &ivrwrr) + return ivrwrr, err + default: + var ivrr IaasVMRestoreRequest + err := json.Unmarshal(body, &ivrr) + return ivrr, err + } +} +func unmarshalBasicIaasVMRestoreRequestArray(body []byte) ([]BasicIaasVMRestoreRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ivrrArray := make([]BasicIaasVMRestoreRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ivrr, err := unmarshalBasicIaasVMRestoreRequest(*rawMessage) + if err != nil { + return nil, err + } + ivrrArray[index] = ivrr + } + return ivrrArray, nil +} + +// MarshalJSON is the custom marshaler for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) MarshalJSON() ([]byte, error) { + ivrr.ObjectType = ObjectTypeIaasVMRestoreRequest + objectMap := make(map[string]interface{}) + if ivrr.RecoveryPointID != nil { + objectMap["recoveryPointId"] = ivrr.RecoveryPointID + } + if ivrr.RecoveryType != "" { + objectMap["recoveryType"] = ivrr.RecoveryType + } + if ivrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = ivrr.SourceResourceID + } + if ivrr.TargetVirtualMachineID != nil { + objectMap["targetVirtualMachineId"] = ivrr.TargetVirtualMachineID + } + if ivrr.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = ivrr.TargetResourceGroupID + } + if ivrr.StorageAccountID != nil { + objectMap["storageAccountId"] = ivrr.StorageAccountID + } + if ivrr.VirtualNetworkID != nil { + objectMap["virtualNetworkId"] = ivrr.VirtualNetworkID + } + if ivrr.SubnetID != nil { + objectMap["subnetId"] = ivrr.SubnetID + } + if ivrr.TargetDomainNameID != nil { + objectMap["targetDomainNameId"] = ivrr.TargetDomainNameID + } + if ivrr.Region != nil { + objectMap["region"] = ivrr.Region + } + if ivrr.AffinityGroup != nil { + objectMap["affinityGroup"] = ivrr.AffinityGroup + } + if ivrr.CreateNewCloudService != nil { + objectMap["createNewCloudService"] = ivrr.CreateNewCloudService + } + if ivrr.OriginalStorageAccountOption != nil { + objectMap["originalStorageAccountOption"] = ivrr.OriginalStorageAccountOption + } + if ivrr.EncryptionDetails != nil { + objectMap["encryptionDetails"] = ivrr.EncryptionDetails + } + if ivrr.RestoreDiskLunList != nil { + objectMap["restoreDiskLunList"] = ivrr.RestoreDiskLunList + } + if ivrr.RestoreWithManagedDisks != nil { + objectMap["restoreWithManagedDisks"] = ivrr.RestoreWithManagedDisks + } + if ivrr.DiskEncryptionSetID != nil { + objectMap["diskEncryptionSetId"] = ivrr.DiskEncryptionSetID + } + if ivrr.Zones != nil { + objectMap["zones"] = ivrr.Zones + } + if ivrr.IdentityInfo != nil { + objectMap["identityInfo"] = ivrr.IdentityInfo + } + if ivrr.IdentityBasedRestoreDetails != nil { + objectMap["identityBasedRestoreDetails"] = ivrr.IdentityBasedRestoreDetails + } + if ivrr.ObjectType != "" { + objectMap["objectType"] = ivrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest() (BasicAzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadSQLPointInTimeRestoreRequest() (BasicAzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return &ivrr, true +} + +// AsBasicIaasVMRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsBasicIaasVMRestoreRequest() (BasicIaasVMRestoreRequest, bool) { + return &ivrr, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsAzureWorkloadSQLRestoreWithRehydrateRequest() (*AzureWorkloadSQLRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreWithRehydrationRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsIaasVMRestoreWithRehydrationRequest() (*IaasVMRestoreWithRehydrationRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest. +func (ivrr IaasVMRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &ivrr, true +} + +// IaasVMRestoreWithRehydrationRequest iaaS VM workload-specific restore with integrated rehydration of +// recovery point. +type IaasVMRestoreWithRehydrationRequest struct { + // RecoveryPointRehydrationInfo - RP Rehydration Info + RecoveryPointRehydrationInfo *RecoveryPointRehydrationInfo `json:"recoveryPointRehydrationInfo,omitempty"` + // RecoveryPointID - ID of the backup copy to be recovered. + RecoveryPointID *string `json:"recoveryPointId,omitempty"` + // RecoveryType - Type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks', 'RecoveryTypeOffline' + RecoveryType RecoveryType `json:"recoveryType,omitempty"` + // SourceResourceID - Fully qualified ARM ID of the VM which is being recovered. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // TargetVirtualMachineID - This is the complete ARM Id of the VM that will be created. + // For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"` + // TargetResourceGroupID - This is the ARM Id of the resource group that you want to create for this Virtual machine and other artifacts. + // For e.g. /subscriptions/{subId}/resourcegroups/{rg} + TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"` + // StorageAccountID - Fully qualified ARM ID of the storage account to which the VM has to be restored. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // VirtualNetworkID - This is the virtual network Id of the vnet that will be attached to the virtual machine. + // User will be validated for join action permissions in the linked access. + VirtualNetworkID *string `json:"virtualNetworkId,omitempty"` + // SubnetID - Subnet ID, is the subnet ID associated with the to be restored VM. For Classic VMs it would be + // {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager VMs it would be ARM resource ID used to represent + // the subnet. + SubnetID *string `json:"subnetId,omitempty"` + // TargetDomainNameID - Fully qualified ARM ID of the domain name to be associated to the VM being restored. This applies only to Classic + // Virtual Machines. + TargetDomainNameID *string `json:"targetDomainNameId,omitempty"` + // Region - Region in which the virtual machine is restored. + Region *string `json:"region,omitempty"` + // AffinityGroup - Affinity group associated to VM to be restored. Used only for Classic Compute Virtual Machines. + AffinityGroup *string `json:"affinityGroup,omitempty"` + // CreateNewCloudService - Should a new cloud service be created while restoring the VM. If this is false, VM will be restored to the same + // cloud service as it was at the time of backup. + CreateNewCloudService *bool `json:"createNewCloudService,omitempty"` + // OriginalStorageAccountOption - Original Storage Account Option + OriginalStorageAccountOption *bool `json:"originalStorageAccountOption,omitempty"` + // EncryptionDetails - Details needed if the VM was encrypted at the time of backup. + EncryptionDetails *EncryptionDetails `json:"encryptionDetails,omitempty"` + // RestoreDiskLunList - List of Disk LUNs for partial restore + RestoreDiskLunList *[]int32 `json:"restoreDiskLunList,omitempty"` + // RestoreWithManagedDisks - Flag to denote of an Unmanaged disk VM should be restored with Managed disks. + RestoreWithManagedDisks *bool `json:"restoreWithManagedDisks,omitempty"` + // DiskEncryptionSetID - DiskEncryptionSet's ID - needed if the VM needs to be encrypted at rest during restore with customer managed key. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // Zones - Target zone where the VM and its disks should be restored. + Zones *[]string `json:"zones,omitempty"` + // IdentityInfo - Managed Identity information required to access customer storage account. + IdentityInfo *IdentityInfo `json:"identityInfo,omitempty"` + // IdentityBasedRestoreDetails - IaaS VM workload specific restore details for restores using managed identity. + IdentityBasedRestoreDetails *IdentityBasedRestoreDetails `json:"identityBasedRestoreDetails,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest', 'ObjectTypeIaasVMRestoreWithRehydrationRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for IaasVMRestoreWithRehydrationRequest. +func (ivrwrr IaasVMRestoreWithRehydrationRequest) MarshalJSON() ([]byte, error) { + ivrwrr.ObjectType = ObjectTypeIaasVMRestoreWithRehydrationRequest + objectMap := make(map[string]interface{}) + if ivrwrr.RecoveryPointRehydrationInfo != nil { + objectMap["recoveryPointRehydrationInfo"] = ivrwrr.RecoveryPointRehydrationInfo + } + if ivrwrr.RecoveryPointID != nil { + objectMap["recoveryPointId"] = ivrwrr.RecoveryPointID + } + if ivrwrr.RecoveryType != "" { + objectMap["recoveryType"] = ivrwrr.RecoveryType + } + if ivrwrr.SourceResourceID != nil { + objectMap["sourceResourceId"] = ivrwrr.SourceResourceID + } + if ivrwrr.TargetVirtualMachineID != nil { + objectMap["targetVirtualMachineId"] = ivrwrr.TargetVirtualMachineID + } + if ivrwrr.TargetResourceGroupID != nil { + objectMap["targetResourceGroupId"] = ivrwrr.TargetResourceGroupID + } + if ivrwrr.StorageAccountID != nil { + objectMap["storageAccountId"] = ivrwrr.StorageAccountID + } + if ivrwrr.VirtualNetworkID != nil { + objectMap["virtualNetworkId"] = ivrwrr.VirtualNetworkID + } + if ivrwrr.SubnetID != nil { + objectMap["subnetId"] = ivrwrr.SubnetID + } + if ivrwrr.TargetDomainNameID != nil { + objectMap["targetDomainNameId"] = ivrwrr.TargetDomainNameID + } + if ivrwrr.Region != nil { + objectMap["region"] = ivrwrr.Region + } + if ivrwrr.AffinityGroup != nil { + objectMap["affinityGroup"] = ivrwrr.AffinityGroup + } + if ivrwrr.CreateNewCloudService != nil { + objectMap["createNewCloudService"] = ivrwrr.CreateNewCloudService + } + if ivrwrr.OriginalStorageAccountOption != nil { + objectMap["originalStorageAccountOption"] = ivrwrr.OriginalStorageAccountOption + } + if ivrwrr.EncryptionDetails != nil { + objectMap["encryptionDetails"] = ivrwrr.EncryptionDetails + } + if ivrwrr.RestoreDiskLunList != nil { + objectMap["restoreDiskLunList"] = ivrwrr.RestoreDiskLunList + } + if ivrwrr.RestoreWithManagedDisks != nil { + objectMap["restoreWithManagedDisks"] = ivrwrr.RestoreWithManagedDisks + } + if ivrwrr.DiskEncryptionSetID != nil { + objectMap["diskEncryptionSetId"] = ivrwrr.DiskEncryptionSetID + } + if ivrwrr.Zones != nil { + objectMap["zones"] = ivrwrr.Zones + } + if ivrwrr.IdentityInfo != nil { + objectMap["identityInfo"] = ivrwrr.IdentityInfo + } + if ivrwrr.IdentityBasedRestoreDetails != nil { + objectMap["identityBasedRestoreDetails"] = ivrwrr.IdentityBasedRestoreDetails + } + if ivrwrr.ObjectType != "" { + objectMap["objectType"] = ivrwrr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreWithRehydrationRequest. +func (ivrwrr IaasVMRestoreWithRehydrationRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreWithRehydrationRequest. +func (ivrwrr IaasVMRestoreWithRehydrationRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreWithRehydrationRequest. +func (ivrwrr IaasVMRestoreWithRehydrationRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreWithRehydrationRequest. +func (ivrwrr IaasVMRestoreWithRehydrationRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreWithRehydrationRequest. +func (ivrwrr IaasVMRestoreWithRehydrationRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreWithRehydrationRequest. +func (ivrwrr IaasVMRestoreWithRehydrationRequest) AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest() (BasicAzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreWithRehydrationRequest. +func (ivrwrr IaasVMRestoreWithRehydrationRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreWithRehydrationRequest. +func (ivrwrr IaasVMRestoreWithRehydrationRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreWithRehydrationRequest. +func (ivrwrr IaasVMRestoreWithRehydrationRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreWithRehydrationRequest. +func (ivrwrr IaasVMRestoreWithRehydrationRequest) AsBasicAzureWorkloadSQLPointInTimeRestoreRequest() (BasicAzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreWithRehydrationRequest. +func (ivrwrr IaasVMRestoreWithRehydrationRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreWithRehydrationRequest. +func (ivrwrr IaasVMRestoreWithRehydrationRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreWithRehydrationRequest. +func (ivrwrr IaasVMRestoreWithRehydrationRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsBasicIaasVMRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreWithRehydrationRequest. +func (ivrwrr IaasVMRestoreWithRehydrationRequest) AsBasicIaasVMRestoreRequest() (BasicIaasVMRestoreRequest, bool) { + return &ivrwrr, true +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for IaasVMRestoreWithRehydrationRequest. +func (ivrwrr IaasVMRestoreWithRehydrationRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for IaasVMRestoreWithRehydrationRequest. +func (ivrwrr IaasVMRestoreWithRehydrationRequest) AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for IaasVMRestoreWithRehydrationRequest. +func (ivrwrr IaasVMRestoreWithRehydrationRequest) AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for IaasVMRestoreWithRehydrationRequest. +func (ivrwrr IaasVMRestoreWithRehydrationRequest) AsAzureWorkloadSQLRestoreWithRehydrateRequest() (*AzureWorkloadSQLRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreWithRehydrationRequest is the BasicRestoreRequest implementation for IaasVMRestoreWithRehydrationRequest. +func (ivrwrr IaasVMRestoreWithRehydrationRequest) AsIaasVMRestoreWithRehydrationRequest() (*IaasVMRestoreWithRehydrationRequest, bool) { + return &ivrwrr, true +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreWithRehydrationRequest. +func (ivrwrr IaasVMRestoreWithRehydrationRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return nil, false +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreWithRehydrationRequest. +func (ivrwrr IaasVMRestoreWithRehydrationRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &ivrwrr, true +} + +// IdentityBasedRestoreDetails iaaS VM workload specific restore details for restores using managed +// identity +type IdentityBasedRestoreDetails struct { + // ObjectType - Gets the class type. + ObjectType *string `json:"objectType,omitempty"` + // TargetStorageAccountID - Fully qualified ARM ID of the target storage account. + TargetStorageAccountID *string `json:"targetStorageAccountId,omitempty"` +} + +// IdentityInfo encapsulates Managed Identity related information +type IdentityInfo struct { + // IsSystemAssignedIdentity - To differentiate if the managed identity is system assigned or user assigned + IsSystemAssignedIdentity *bool `json:"isSystemAssignedIdentity,omitempty"` + // ManagedIdentityResourceID - Managed Identity Resource Id + // Optional: Might not be required in the case of system assigned managed identity + ManagedIdentityResourceID *string `json:"managedIdentityResourceId,omitempty"` +} + +// BasicILRRequest parameters to Provision ILR API. +type BasicILRRequest interface { + AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) + AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) + AsILRRequest() (*ILRRequest, bool) +} + +// ILRRequest parameters to Provision ILR API. +type ILRRequest struct { + // ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeAzureFileShareProvisionILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest' + ObjectType ObjectTypeBasicILRRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicILRRequest(body []byte) (BasicILRRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureFileShareProvisionILRRequest): + var afspir AzureFileShareProvisionILRRequest + err := json.Unmarshal(body, &afspir) + return afspir, err + case string(ObjectTypeIaasVMILRRegistrationRequest): + var ivrr IaasVMILRRegistrationRequest + err := json.Unmarshal(body, &ivrr) + return ivrr, err + default: + var ir ILRRequest + err := json.Unmarshal(body, &ir) + return ir, err + } +} +func unmarshalBasicILRRequestArray(body []byte) ([]BasicILRRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + irArray := make([]BasicILRRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ir, err := unmarshalBasicILRRequest(*rawMessage) + if err != nil { + return nil, err + } + irArray[index] = ir + } + return irArray, nil +} + +// MarshalJSON is the custom marshaler for ILRRequest. +func (ir ILRRequest) MarshalJSON() ([]byte, error) { + ir.ObjectType = ObjectTypeILRRequest + objectMap := make(map[string]interface{}) + if ir.ObjectType != "" { + objectMap["objectType"] = ir.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProvisionILRRequest is the BasicILRRequest implementation for ILRRequest. +func (ir ILRRequest) AsAzureFileShareProvisionILRRequest() (*AzureFileShareProvisionILRRequest, bool) { + return nil, false +} + +// AsIaasVMILRRegistrationRequest is the BasicILRRequest implementation for ILRRequest. +func (ir ILRRequest) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) { + return nil, false +} + +// AsILRRequest is the BasicILRRequest implementation for ILRRequest. +func (ir ILRRequest) AsILRRequest() (*ILRRequest, bool) { + return &ir, true +} + +// AsBasicILRRequest is the BasicILRRequest implementation for ILRRequest. +func (ir ILRRequest) AsBasicILRRequest() (BasicILRRequest, bool) { + return &ir, true +} + +// ILRRequestResource parameters to Provision ILR API. +type ILRRequestResource struct { + // Properties - ILRRequestResource properties + Properties BasicILRRequest `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ILRRequestResource. +func (irr ILRRequestResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = irr.Properties + if irr.Location != nil { + objectMap["location"] = irr.Location + } + if irr.Tags != nil { + objectMap["tags"] = irr.Tags + } + if irr.ETag != nil { + objectMap["eTag"] = irr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ILRRequestResource struct. +func (irr *ILRRequestResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicILRRequest(*v) + if err != nil { + return err + } + irr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + irr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + irr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + irr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + irr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + irr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + irr.ETag = &eTag + } + } + } + + return nil +} + +// InquiryInfo details about inquired protectable items under a given container. +type InquiryInfo struct { + // Status - Inquiry Status for this container such as + // InProgress | Failed | Succeeded + Status *string `json:"status,omitempty"` + // ErrorDetail - Error Details if the Status is non-success. + ErrorDetail *ErrorDetail `json:"errorDetail,omitempty"` + // InquiryDetails - Inquiry Details which will have workload specific details. + // For e.g. - For SQL and oracle this will contain different details. + InquiryDetails *[]WorkloadInquiryDetails `json:"inquiryDetails,omitempty"` +} + +// InquiryValidation validation for inquired protectable items under a given container. +type InquiryValidation struct { + // Status - Status for the Inquiry Validation. + Status *string `json:"status,omitempty"` + // ErrorDetail - Error Detail in case the status is non-success. + ErrorDetail *ErrorDetail `json:"errorDetail,omitempty"` + // AdditionalDetail - READ-ONLY; Error Additional Detail in case the status is non-success. + AdditionalDetail *string `json:"additionalDetail,omitempty"` +} + +// MarshalJSON is the custom marshaler for InquiryValidation. +func (iv InquiryValidation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if iv.Status != nil { + objectMap["status"] = iv.Status + } + if iv.ErrorDetail != nil { + objectMap["errorDetail"] = iv.ErrorDetail + } + return json.Marshal(objectMap) +} + +// InstantItemRecoveryTarget target details for file / folder restore. +type InstantItemRecoveryTarget struct { + // ClientScripts - List of client scripts. + ClientScripts *[]ClientScriptForConnect `json:"clientScripts,omitempty"` +} + +// InstantRPAdditionalDetails ... +type InstantRPAdditionalDetails struct { + AzureBackupRGNamePrefix *string `json:"azureBackupRGNamePrefix,omitempty"` + AzureBackupRGNameSuffix *string `json:"azureBackupRGNameSuffix,omitempty"` +} + +// BasicJob defines workload agnostic properties for a job. +type BasicJob interface { + AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) + AsAzureIaaSVMJobV2() (*AzureIaaSVMJobV2, bool) + AsAzureStorageJob() (*AzureStorageJob, bool) + AsAzureWorkloadJob() (*AzureWorkloadJob, bool) + AsDpmJob() (*DpmJob, bool) + AsMabJob() (*MabJob, bool) + AsVaultJob() (*VaultJob, bool) + AsJob() (*Job, bool) +} + +// Job defines workload agnostic properties for a job. +type Job struct { + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureIaaSVMJobV2', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob', 'JobTypeVaultJob' + JobType JobType `json:"jobType,omitempty"` +} + +func unmarshalBasicJob(body []byte) (BasicJob, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["jobType"] { + case string(JobTypeAzureIaaSVMJob): + var aisj AzureIaaSVMJob + err := json.Unmarshal(body, &aisj) + return aisj, err + case string(JobTypeAzureIaaSVMJobV2): + var aisjv AzureIaaSVMJobV2 + err := json.Unmarshal(body, &aisjv) + return aisjv, err + case string(JobTypeAzureStorageJob): + var asj AzureStorageJob + err := json.Unmarshal(body, &asj) + return asj, err + case string(JobTypeAzureWorkloadJob): + var awj AzureWorkloadJob + err := json.Unmarshal(body, &awj) + return awj, err + case string(JobTypeDpmJob): + var dj DpmJob + err := json.Unmarshal(body, &dj) + return dj, err + case string(JobTypeMabJob): + var mj MabJob + err := json.Unmarshal(body, &mj) + return mj, err + case string(JobTypeVaultJob): + var vj VaultJob + err := json.Unmarshal(body, &vj) + return vj, err + default: + var j Job + err := json.Unmarshal(body, &j) + return j, err + } +} +func unmarshalBasicJobArray(body []byte) ([]BasicJob, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + jArray := make([]BasicJob, len(rawMessages)) + + for index, rawMessage := range rawMessages { + j, err := unmarshalBasicJob(*rawMessage) + if err != nil { + return nil, err + } + jArray[index] = j + } + return jArray, nil +} + +// MarshalJSON is the custom marshaler for Job. +func (j Job) MarshalJSON() ([]byte, error) { + j.JobType = JobTypeJob + objectMap := make(map[string]interface{}) + if j.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = j.EntityFriendlyName + } + if j.BackupManagementType != "" { + objectMap["backupManagementType"] = j.BackupManagementType + } + if j.Operation != nil { + objectMap["operation"] = j.Operation + } + if j.Status != nil { + objectMap["status"] = j.Status + } + if j.StartTime != nil { + objectMap["startTime"] = j.StartTime + } + if j.EndTime != nil { + objectMap["endTime"] = j.EndTime + } + if j.ActivityID != nil { + objectMap["activityId"] = j.ActivityID + } + if j.JobType != "" { + objectMap["jobType"] = j.JobType + } + return json.Marshal(objectMap) +} + +// AsAzureIaaSVMJob is the BasicJob implementation for Job. +func (j Job) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { + return nil, false +} + +// AsAzureIaaSVMJobV2 is the BasicJob implementation for Job. +func (j Job) AsAzureIaaSVMJobV2() (*AzureIaaSVMJobV2, bool) { + return nil, false +} + +// AsAzureStorageJob is the BasicJob implementation for Job. +func (j Job) AsAzureStorageJob() (*AzureStorageJob, bool) { + return nil, false +} + +// AsAzureWorkloadJob is the BasicJob implementation for Job. +func (j Job) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { + return nil, false +} + +// AsDpmJob is the BasicJob implementation for Job. +func (j Job) AsDpmJob() (*DpmJob, bool) { + return nil, false +} + +// AsMabJob is the BasicJob implementation for Job. +func (j Job) AsMabJob() (*MabJob, bool) { + return nil, false +} + +// AsVaultJob is the BasicJob implementation for Job. +func (j Job) AsVaultJob() (*VaultJob, bool) { + return nil, false +} + +// AsJob is the BasicJob implementation for Job. +func (j Job) AsJob() (*Job, bool) { + return &j, true +} + +// AsBasicJob is the BasicJob implementation for Job. +func (j Job) AsBasicJob() (BasicJob, bool) { + return &j, true +} + +// JobQueryObject filters to list the jobs. +type JobQueryObject struct { + // Status - Status of the job. Possible values include: 'JobStatusInvalid', 'JobStatusInProgress', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusCompletedWithWarnings', 'JobStatusCancelled', 'JobStatusCancelling' + Status JobStatus `json:"status,omitempty"` + // BackupManagementType - Type of backup management for the job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - Type of operation. Possible values include: 'JobOperationTypeInvalid', 'JobOperationTypeRegister', 'JobOperationTypeUnRegister', 'JobOperationTypeConfigureBackup', 'JobOperationTypeBackup', 'JobOperationTypeRestore', 'JobOperationTypeDisableBackup', 'JobOperationTypeDeleteBackupData', 'JobOperationTypeCrossRegionRestore', 'JobOperationTypeUndelete', 'JobOperationTypeUpdateCustomerManagedKey' + Operation JobOperationType `json:"operation,omitempty"` + // JobID - JobID represents the job uniquely. + JobID *string `json:"jobId,omitempty"` + // StartTime - Job has started at this time. Value is in UTC. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Job has ended at this time. Value is in UTC. + EndTime *date.Time `json:"endTime,omitempty"` +} + +// JobResource defines workload agnostic properties for a job. +type JobResource struct { + autorest.Response `json:"-"` + // Properties - JobResource properties + Properties BasicJob `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobResource. +func (jr JobResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = jr.Properties + if jr.Location != nil { + objectMap["location"] = jr.Location + } + if jr.Tags != nil { + objectMap["tags"] = jr.Tags + } + if jr.ETag != nil { + objectMap["eTag"] = jr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for JobResource struct. +func (jr *JobResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicJob(*v) + if err != nil { + return err + } + jr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + jr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + jr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + jr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + jr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + jr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + jr.ETag = &eTag + } + } + } + + return nil +} + +// JobResourceList list of Job resources +type JobResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]JobResource `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"` +} + +// JobResourceListIterator provides access to a complete listing of JobResource values. +type JobResourceListIterator struct { + i int + page JobResourceListPage +} + +// NextWithContext 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 *JobResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *JobResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter JobResourceListIterator) 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 JobResourceListIterator) Response() JobResourceList { + 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 JobResourceListIterator) Value() JobResource { + if !iter.page.NotDone() { + return JobResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the JobResourceListIterator type. +func NewJobResourceListIterator(page JobResourceListPage) JobResourceListIterator { + return JobResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (jrl JobResourceList) IsEmpty() bool { + return jrl.Value == nil || len(*jrl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (jrl JobResourceList) hasNextLink() bool { + return jrl.NextLink != nil && len(*jrl.NextLink) != 0 +} + +// jobResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (jrl JobResourceList) jobResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !jrl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(jrl.NextLink))) +} + +// JobResourceListPage contains a page of JobResource values. +type JobResourceListPage struct { + fn func(context.Context, JobResourceList) (JobResourceList, error) + jrl JobResourceList +} + +// NextWithContext 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 *JobResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.jrl) + if err != nil { + return err + } + page.jrl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *JobResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page JobResourceListPage) NotDone() bool { + return !page.jrl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page JobResourceListPage) Response() JobResourceList { + return page.jrl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page JobResourceListPage) Values() []JobResource { + if page.jrl.IsEmpty() { + return nil + } + return *page.jrl.Value +} + +// Creates a new instance of the JobResourceListPage type. +func NewJobResourceListPage(cur JobResourceList, getNextPage func(context.Context, JobResourceList) (JobResourceList, error)) JobResourceListPage { + return JobResourceListPage{ + fn: getNextPage, + jrl: cur, + } +} + +// KEKDetails KEK is encryption key for BEK. +type KEKDetails struct { + // KeyURL - Key is KEK. + KeyURL *string `json:"keyUrl,omitempty"` + // KeyVaultID - Key Vault ID where this Key is stored. + KeyVaultID *string `json:"keyVaultId,omitempty"` + // KeyBackupData - KEK data. + KeyBackupData *string `json:"keyBackupData,omitempty"` +} + +// KeyAndSecretDetails BEK is bitlocker key. +// KEK is encryption key for BEK +// If the VM was encrypted then we will store following details : +// 1. Secret(BEK) - Url + Backup Data + vaultId. +// 2. Key(KEK) - Url + Backup Data + vaultId. +// 3. EncryptionMechanism +// BEK and KEK can potentially have different vault ids. +type KeyAndSecretDetails struct { + // KekDetails - KEK is encryption key for BEK. + KekDetails *KEKDetails `json:"kekDetails,omitempty"` + // BekDetails - BEK is bitlocker encryption key. + BekDetails *BEKDetails `json:"bekDetails,omitempty"` + // EncryptionMechanism - Encryption mechanism: None/ SinglePass/ DoublePass + EncryptionMechanism *string `json:"encryptionMechanism,omitempty"` +} + +// KPIResourceHealthDetails KPI Resource Health Details +type KPIResourceHealthDetails struct { + // ResourceHealthStatus - Resource Health Status. Possible values include: 'ResourceHealthStatusHealthy', 'ResourceHealthStatusTransientDegraded', 'ResourceHealthStatusPersistentDegraded', 'ResourceHealthStatusTransientUnhealthy', 'ResourceHealthStatusPersistentUnhealthy', 'ResourceHealthStatusInvalid' + ResourceHealthStatus ResourceHealthStatus `json:"resourceHealthStatus,omitempty"` + // ResourceHealthDetails - Resource Health Status + ResourceHealthDetails *[]ResourceHealthDetails `json:"resourceHealthDetails,omitempty"` +} + +// ListRecoveryPointsRecommendedForMoveRequest listRecoveryPointsRecommendedForMoveRequest Request +type ListRecoveryPointsRecommendedForMoveRequest struct { + // ObjectType - Gets the class type. + ObjectType *string `json:"objectType,omitempty"` + // ExcludedRPList - List of Recovery Points excluded from Move + ExcludedRPList *[]string `json:"excludedRPList,omitempty"` +} + +// LogSchedulePolicy log policy schedule. +type LogSchedulePolicy struct { + // ScheduleFrequencyInMins - Frequency of the log schedule operation of this policy in minutes. + ScheduleFrequencyInMins *int32 `json:"scheduleFrequencyInMins,omitempty"` + // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicyV2' + SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` +} + +// MarshalJSON is the custom marshaler for LogSchedulePolicy. +func (lsp LogSchedulePolicy) MarshalJSON() ([]byte, error) { + lsp.SchedulePolicyType = SchedulePolicyTypeLogSchedulePolicy + objectMap := make(map[string]interface{}) + if lsp.ScheduleFrequencyInMins != nil { + objectMap["scheduleFrequencyInMins"] = lsp.ScheduleFrequencyInMins + } + if lsp.SchedulePolicyType != "" { + objectMap["schedulePolicyType"] = lsp.SchedulePolicyType + } + return json.Marshal(objectMap) +} + +// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. +func (lsp LogSchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { + return &lsp, true +} + +// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. +func (lsp LogSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { + return nil, false +} + +// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. +func (lsp LogSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { + return nil, false +} + +// AsSimpleSchedulePolicyV2 is the BasicSchedulePolicy implementation for LogSchedulePolicy. +func (lsp LogSchedulePolicy) AsSimpleSchedulePolicyV2() (*SimpleSchedulePolicyV2, bool) { + return nil, false +} + +// AsSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. +func (lsp LogSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { + return nil, false +} + +// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for LogSchedulePolicy. +func (lsp LogSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { + return &lsp, true +} + +// LongTermRetentionPolicy long term retention policy. +type LongTermRetentionPolicy struct { + // DailySchedule - Daily retention schedule of the protection policy. + DailySchedule *DailyRetentionSchedule `json:"dailySchedule,omitempty"` + // WeeklySchedule - Weekly retention schedule of the protection policy. + WeeklySchedule *WeeklyRetentionSchedule `json:"weeklySchedule,omitempty"` + // MonthlySchedule - Monthly retention schedule of the protection policy. + MonthlySchedule *MonthlyRetentionSchedule `json:"monthlySchedule,omitempty"` + // YearlySchedule - Yearly retention schedule of the protection policy. + YearlySchedule *YearlyRetentionSchedule `json:"yearlySchedule,omitempty"` + // RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy' + RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"` +} + +// MarshalJSON is the custom marshaler for LongTermRetentionPolicy. +func (ltrp LongTermRetentionPolicy) MarshalJSON() ([]byte, error) { + ltrp.RetentionPolicyType = RetentionPolicyTypeLongTermRetentionPolicy + objectMap := make(map[string]interface{}) + if ltrp.DailySchedule != nil { + objectMap["dailySchedule"] = ltrp.DailySchedule + } + if ltrp.WeeklySchedule != nil { + objectMap["weeklySchedule"] = ltrp.WeeklySchedule + } + if ltrp.MonthlySchedule != nil { + objectMap["monthlySchedule"] = ltrp.MonthlySchedule + } + if ltrp.YearlySchedule != nil { + objectMap["yearlySchedule"] = ltrp.YearlySchedule + } + if ltrp.RetentionPolicyType != "" { + objectMap["retentionPolicyType"] = ltrp.RetentionPolicyType + } + return json.Marshal(objectMap) +} + +// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. +func (ltrp LongTermRetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) { + return <rp, true +} + +// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. +func (ltrp LongTermRetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) { + return nil, false +} + +// AsRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. +func (ltrp LongTermRetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) { + return nil, false +} + +// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy. +func (ltrp LongTermRetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) { + return <rp, true +} + +// LongTermSchedulePolicy long term policy schedule. +type LongTermSchedulePolicy struct { + // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicyV2' + SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` +} + +// MarshalJSON is the custom marshaler for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) MarshalJSON() ([]byte, error) { + ltsp.SchedulePolicyType = SchedulePolicyTypeLongTermSchedulePolicy + objectMap := make(map[string]interface{}) + if ltsp.SchedulePolicyType != "" { + objectMap["schedulePolicyType"] = ltsp.SchedulePolicyType + } + return json.Marshal(objectMap) +} + +// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { + return nil, false +} + +// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { + return <sp, true +} + +// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { + return nil, false +} + +// AsSimpleSchedulePolicyV2 is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) AsSimpleSchedulePolicyV2() (*SimpleSchedulePolicyV2, bool) { + return nil, false +} + +// AsSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { + return nil, false +} + +// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy. +func (ltsp LongTermSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { + return <sp, true +} + +// MabContainer container with items backed up using MAB backup engine. +type MabContainer struct { + // CanReRegister - Can the container be registered one more time. + CanReRegister *bool `json:"canReRegister,omitempty"` + // ContainerID - ContainerID represents the container. + ContainerID *int64 `json:"containerId,omitempty"` + // ProtectedItemCount - Number of items backed up in this container. + ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` + // AgentVersion - Agent version of this container. + AgentVersion *string `json:"agentVersion,omitempty"` + // ExtendedInfo - Additional information for this container + ExtendedInfo *MabContainerExtendedInfo `json:"extendedInfo,omitempty"` + // MabContainerHealthDetails - Health details on this mab container. + MabContainerHealthDetails *[]MABContainerHealthDetails `json:"mabContainerHealthDetails,omitempty"` + // ContainerHealthState - Health state of mab container. + ContainerHealthState *string `json:"containerHealthState,omitempty"` + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ProtectableObjectType - Type of the protectable object associated with this container + ProtectableObjectType *string `json:"protectableObjectType,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaasVMContainer1', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for MabContainer. +func (mc MabContainer) MarshalJSON() ([]byte, error) { + mc.ContainerType = ContainerTypeWindows1 + objectMap := make(map[string]interface{}) + if mc.CanReRegister != nil { + objectMap["canReRegister"] = mc.CanReRegister + } + if mc.ContainerID != nil { + objectMap["containerId"] = mc.ContainerID + } + if mc.ProtectedItemCount != nil { + objectMap["protectedItemCount"] = mc.ProtectedItemCount + } + if mc.AgentVersion != nil { + objectMap["agentVersion"] = mc.AgentVersion + } + if mc.ExtendedInfo != nil { + objectMap["extendedInfo"] = mc.ExtendedInfo + } + if mc.MabContainerHealthDetails != nil { + objectMap["mabContainerHealthDetails"] = mc.MabContainerHealthDetails + } + if mc.ContainerHealthState != nil { + objectMap["containerHealthState"] = mc.ContainerHealthState + } + if mc.FriendlyName != nil { + objectMap["friendlyName"] = mc.FriendlyName + } + if mc.BackupManagementType != "" { + objectMap["backupManagementType"] = mc.BackupManagementType + } + if mc.RegistrationStatus != nil { + objectMap["registrationStatus"] = mc.RegistrationStatus + } + if mc.HealthStatus != nil { + objectMap["healthStatus"] = mc.HealthStatus + } + if mc.ProtectableObjectType != nil { + objectMap["protectableObjectType"] = mc.ProtectableObjectType + } + if mc.ContainerType != "" { + objectMap["containerType"] = mc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsBasicDpmContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsMabContainer() (*MabContainer, bool) { + return &mc, true +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return nil, false +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for MabContainer. +func (mc MabContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &mc, true +} + +// MabContainerExtendedInfo additional information of the container. +type MabContainerExtendedInfo struct { + // LastRefreshedAt - Time stamp when this container was refreshed. + LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` + // BackupItemType - Type of backup items associated with this container. Possible values include: 'ItemTypeInvalid', 'ItemTypeVM', 'ItemTypeFileFolder', 'ItemTypeAzureSQLDb', 'ItemTypeSQLDB', 'ItemTypeExchange', 'ItemTypeSharepoint', 'ItemTypeVMwareVM', 'ItemTypeSystemState', 'ItemTypeClient', 'ItemTypeGenericDataSource', 'ItemTypeSQLDataBase', 'ItemTypeAzureFileShare', 'ItemTypeSAPHanaDatabase', 'ItemTypeSAPAseDatabase' + BackupItemType ItemType `json:"backupItemType,omitempty"` + // BackupItems - List of backup items associated with this container. + BackupItems *[]string `json:"backupItems,omitempty"` + // PolicyName - Backup policy associated with this container. + PolicyName *string `json:"policyName,omitempty"` + // LastBackupStatus - Latest backup status of this container. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` +} + +// MABContainerHealthDetails MAB workload-specific Health Details. +type MABContainerHealthDetails struct { + // Code - Health Code + Code *int32 `json:"code,omitempty"` + // Title - Health Title + Title *string `json:"title,omitempty"` + // Message - Health Message + Message *string `json:"message,omitempty"` + // Recommendations - Health Recommended Actions + Recommendations *[]string `json:"recommendations,omitempty"` +} + +// MabErrorInfo MAB workload-specific error information. +type MabErrorInfo struct { + // ErrorString - READ-ONLY; Localized error string. + ErrorString *string `json:"errorString,omitempty"` + // Recommendations - READ-ONLY; List of localized recommendations. + Recommendations *[]string `json:"recommendations,omitempty"` +} + +// MarshalJSON is the custom marshaler for MabErrorInfo. +func (mei MabErrorInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MabFileFolderProtectedItem MAB workload-specific backup item. +type MabFileFolderProtectedItem struct { + // FriendlyName - Friendly name of this backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ComputerName - Name of the computer associated with this backup item. + ComputerName *string `json:"computerName,omitempty"` + // LastBackupStatus - Status of last backup operation. + LastBackupStatus *string `json:"lastBackupStatus,omitempty"` + // LastBackupTime - Timestamp of the last backup operation on this backup item. + LastBackupTime *date.Time `json:"lastBackupTime,omitempty"` + // ProtectionState - Protected, ProtectionStopped, IRPending or ProtectionError + ProtectionState *string `json:"protectionState,omitempty"` + // DeferredDeleteSyncTimeInUTC - Sync time for deferred deletion in UTC + DeferredDeleteSyncTimeInUTC *int64 `json:"deferredDeleteSyncTimeInUTC,omitempty"` + // ExtendedInfo - Additional information with this backup item. + ExtendedInfo *MabFileFolderProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ResourceGuardOperationRequests - ResourceGuardOperationRequests on which LAC check will be performed + ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` + // IsArchiveEnabled - Flag to identify whether datasource is protected in archive + IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + // PolicyName - Name of the policy used for protection + PolicyName *string `json:"policyName,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +// MarshalJSON is the custom marshaler for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) MarshalJSON() ([]byte, error) { + mffpi.ProtectedItemType = ProtectedItemTypeMabFileFolderProtectedItem + objectMap := make(map[string]interface{}) + if mffpi.FriendlyName != nil { + objectMap["friendlyName"] = mffpi.FriendlyName + } + if mffpi.ComputerName != nil { + objectMap["computerName"] = mffpi.ComputerName + } + if mffpi.LastBackupStatus != nil { + objectMap["lastBackupStatus"] = mffpi.LastBackupStatus + } + if mffpi.LastBackupTime != nil { + objectMap["lastBackupTime"] = mffpi.LastBackupTime + } + if mffpi.ProtectionState != nil { + objectMap["protectionState"] = mffpi.ProtectionState + } + if mffpi.DeferredDeleteSyncTimeInUTC != nil { + objectMap["deferredDeleteSyncTimeInUTC"] = mffpi.DeferredDeleteSyncTimeInUTC + } + if mffpi.ExtendedInfo != nil { + objectMap["extendedInfo"] = mffpi.ExtendedInfo + } + if mffpi.BackupManagementType != "" { + objectMap["backupManagementType"] = mffpi.BackupManagementType + } + if mffpi.WorkloadType != "" { + objectMap["workloadType"] = mffpi.WorkloadType + } + if mffpi.ContainerName != nil { + objectMap["containerName"] = mffpi.ContainerName + } + if mffpi.SourceResourceID != nil { + objectMap["sourceResourceId"] = mffpi.SourceResourceID + } + if mffpi.PolicyID != nil { + objectMap["policyId"] = mffpi.PolicyID + } + if mffpi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = mffpi.LastRecoveryPoint + } + if mffpi.BackupSetName != nil { + objectMap["backupSetName"] = mffpi.BackupSetName + } + if mffpi.CreateMode != "" { + objectMap["createMode"] = mffpi.CreateMode + } + if mffpi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = mffpi.DeferredDeleteTimeInUTC + } + if mffpi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = mffpi.IsScheduledForDeferredDelete + } + if mffpi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = mffpi.DeferredDeleteTimeRemaining + } + if mffpi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = mffpi.IsDeferredDeleteScheduleUpcoming + } + if mffpi.IsRehydrate != nil { + objectMap["isRehydrate"] = mffpi.IsRehydrate + } + if mffpi.ResourceGuardOperationRequests != nil { + objectMap["resourceGuardOperationRequests"] = mffpi.ResourceGuardOperationRequests + } + if mffpi.IsArchiveEnabled != nil { + objectMap["isArchiveEnabled"] = mffpi.IsArchiveEnabled + } + if mffpi.PolicyName != nil { + objectMap["policyName"] = mffpi.PolicyName + } + if mffpi.ProtectedItemType != "" { + objectMap["protectedItemType"] = mffpi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return &mffpi, true +} + +// AsProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return nil, false +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem. +func (mffpi MabFileFolderProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &mffpi, true +} + +// MabFileFolderProtectedItemExtendedInfo additional information on the backed up item. +type MabFileFolderProtectedItemExtendedInfo struct { + // LastRefreshedAt - Last time when the agent data synced to service. + LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"` + // OldestRecoveryPoint - The oldest backup copy available. + OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"` + // RecoveryPointCount - Number of backup copies associated with the backup item. + RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"` +} + +// MabJob MAB workload-specific job. +type MabJob struct { + // Duration - Time taken by job to run. + Duration *string `json:"duration,omitempty"` + // ActionsInfo - The state/actions applicable on jobs like cancel/retry. + ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` + // MabServerName - Name of server protecting the DS. + MabServerName *string `json:"mabServerName,omitempty"` + // MabServerType - Server type of MAB container. Possible values include: 'MabServerTypeInvalid', 'MabServerTypeUnknown', 'MabServerTypeIaasVMContainer', 'MabServerTypeIaasVMServiceContainer', 'MabServerTypeDPMContainer', 'MabServerTypeAzureBackupServerContainer', 'MabServerTypeMABContainer', 'MabServerTypeCluster', 'MabServerTypeAzureSQLContainer', 'MabServerTypeWindows', 'MabServerTypeVCenter', 'MabServerTypeVMAppContainer', 'MabServerTypeSQLAGWorkLoadContainer', 'MabServerTypeStorageContainer', 'MabServerTypeGenericContainer' + MabServerType MabServerType `json:"mabServerType,omitempty"` + // WorkloadType - Workload type of backup item. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` + // ErrorDetails - The errors. + ErrorDetails *[]MabErrorInfo `json:"errorDetails,omitempty"` + // ExtendedInfo - Additional information on the job. + ExtendedInfo *MabJobExtendedInfo `json:"extendedInfo,omitempty"` + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureIaaSVMJobV2', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob', 'JobTypeVaultJob' + JobType JobType `json:"jobType,omitempty"` +} + +// MarshalJSON is the custom marshaler for MabJob. +func (mj MabJob) MarshalJSON() ([]byte, error) { + mj.JobType = JobTypeMabJob + objectMap := make(map[string]interface{}) + if mj.Duration != nil { + objectMap["duration"] = mj.Duration + } + if mj.ActionsInfo != nil { + objectMap["actionsInfo"] = mj.ActionsInfo + } + if mj.MabServerName != nil { + objectMap["mabServerName"] = mj.MabServerName + } + if mj.MabServerType != "" { + objectMap["mabServerType"] = mj.MabServerType + } + if mj.WorkloadType != "" { + objectMap["workloadType"] = mj.WorkloadType + } + if mj.ErrorDetails != nil { + objectMap["errorDetails"] = mj.ErrorDetails + } + if mj.ExtendedInfo != nil { + objectMap["extendedInfo"] = mj.ExtendedInfo + } + if mj.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = mj.EntityFriendlyName + } + if mj.BackupManagementType != "" { + objectMap["backupManagementType"] = mj.BackupManagementType + } + if mj.Operation != nil { + objectMap["operation"] = mj.Operation + } + if mj.Status != nil { + objectMap["status"] = mj.Status + } + if mj.StartTime != nil { + objectMap["startTime"] = mj.StartTime + } + if mj.EndTime != nil { + objectMap["endTime"] = mj.EndTime + } + if mj.ActivityID != nil { + objectMap["activityId"] = mj.ActivityID + } + if mj.JobType != "" { + objectMap["jobType"] = mj.JobType + } + return json.Marshal(objectMap) +} + +// AsAzureIaaSVMJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { + return nil, false +} + +// AsAzureIaaSVMJobV2 is the BasicJob implementation for MabJob. +func (mj MabJob) AsAzureIaaSVMJobV2() (*AzureIaaSVMJobV2, bool) { + return nil, false +} + +// AsAzureStorageJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsAzureStorageJob() (*AzureStorageJob, bool) { + return nil, false +} + +// AsAzureWorkloadJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { + return nil, false +} + +// AsDpmJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsDpmJob() (*DpmJob, bool) { + return nil, false +} + +// AsMabJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsMabJob() (*MabJob, bool) { + return &mj, true +} + +// AsVaultJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsVaultJob() (*VaultJob, bool) { + return nil, false +} + +// AsJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsJob() (*Job, bool) { + return nil, false +} + +// AsBasicJob is the BasicJob implementation for MabJob. +func (mj MabJob) AsBasicJob() (BasicJob, bool) { + return &mj, true +} + +// MabJobExtendedInfo additional information for the MAB workload-specific job. +type MabJobExtendedInfo struct { + // TasksList - List of tasks for this job. + TasksList *[]MabJobTaskDetails `json:"tasksList,omitempty"` + // PropertyBag - The job properties. + PropertyBag map[string]*string `json:"propertyBag"` + // DynamicErrorMessage - Non localized error message specific to this job. + DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` +} + +// MarshalJSON is the custom marshaler for MabJobExtendedInfo. +func (mjei MabJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mjei.TasksList != nil { + objectMap["tasksList"] = mjei.TasksList + } + if mjei.PropertyBag != nil { + objectMap["propertyBag"] = mjei.PropertyBag + } + if mjei.DynamicErrorMessage != nil { + objectMap["dynamicErrorMessage"] = mjei.DynamicErrorMessage + } + return json.Marshal(objectMap) +} + +// MabJobTaskDetails MAB workload-specific job task details. +type MabJobTaskDetails struct { + // TaskID - The task display name. + TaskID *string `json:"taskId,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // Duration - Time elapsed for task. + Duration *string `json:"duration,omitempty"` + // Status - The status. + Status *string `json:"status,omitempty"` +} + +// MabProtectionPolicy mab container-specific backup policy. +type MabProtectionPolicy struct { + // SchedulePolicy - Backup schedule of backup policy. + SchedulePolicy BasicSchedulePolicy `json:"schedulePolicy,omitempty"` + // RetentionPolicy - Retention policy details. + RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // ResourceGuardOperationRequests - ResourceGuard Operation Requests + ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` +} + +// MarshalJSON is the custom marshaler for MabProtectionPolicy. +func (mpp MabProtectionPolicy) MarshalJSON() ([]byte, error) { + mpp.BackupManagementType = BackupManagementTypeMAB + objectMap := make(map[string]interface{}) + objectMap["schedulePolicy"] = mpp.SchedulePolicy + objectMap["retentionPolicy"] = mpp.RetentionPolicy + if mpp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = mpp.ProtectedItemsCount + } + if mpp.ResourceGuardOperationRequests != nil { + objectMap["resourceGuardOperationRequests"] = mpp.ResourceGuardOperationRequests + } + if mpp.BackupManagementType != "" { + objectMap["backupManagementType"] = mpp.BackupManagementType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return nil, false +} + +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { + return nil, false +} + +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { + return nil, false +} + +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { + return nil, false +} + +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { + return &mpp, true +} + +// AsProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { + return nil, false +} + +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy. +func (mpp MabProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &mpp, true +} + +// UnmarshalJSON is the custom unmarshaler for MabProtectionPolicy struct. +func (mpp *MabProtectionPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "schedulePolicy": + if v != nil { + schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) + if err != nil { + return err + } + mpp.SchedulePolicy = schedulePolicy + } + case "retentionPolicy": + if v != nil { + retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) + if err != nil { + return err + } + mpp.RetentionPolicy = retentionPolicy + } + case "protectedItemsCount": + if v != nil { + var protectedItemsCount int32 + err = json.Unmarshal(*v, &protectedItemsCount) + if err != nil { + return err + } + mpp.ProtectedItemsCount = &protectedItemsCount + } + case "resourceGuardOperationRequests": + if v != nil { + var resourceGuardOperationRequests []string + err = json.Unmarshal(*v, &resourceGuardOperationRequests) + if err != nil { + return err + } + mpp.ResourceGuardOperationRequests = &resourceGuardOperationRequests + } + case "backupManagementType": + if v != nil { + var backupManagementType ManagementTypeBasicProtectionPolicy + err = json.Unmarshal(*v, &backupManagementType) + if err != nil { + return err + } + mpp.BackupManagementType = backupManagementType + } + } + } + + return nil +} + +// ManagementUsage backup management usages of a vault. +type ManagementUsage struct { + // Unit - Unit of the usage. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond' + Unit UsagesUnit `json:"unit,omitempty"` + // QuotaPeriod - Quota period of usage. + QuotaPeriod *string `json:"quotaPeriod,omitempty"` + // NextResetTime - Next reset time of usage. + NextResetTime *date.Time `json:"nextResetTime,omitempty"` + // CurrentValue - Current value of usage. + CurrentValue *int64 `json:"currentValue,omitempty"` + // Limit - Limit of usage. + Limit *int64 `json:"limit,omitempty"` + // Name - Name of usage. + Name *NameInfo `json:"name,omitempty"` +} + +// ManagementUsageList backup management usage for vault. +type ManagementUsageList struct { + autorest.Response `json:"-"` + // Value - The list of backup management usages for the given vault. + Value *[]ManagementUsage `json:"value,omitempty"` +} + +// MonthlyRetentionSchedule monthly retention schedule. +type MonthlyRetentionSchedule struct { + // RetentionScheduleFormatType - Retention schedule format type for monthly retention policy. Possible values include: 'RetentionScheduleFormatInvalid', 'RetentionScheduleFormatDaily', 'RetentionScheduleFormatWeekly' + RetentionScheduleFormatType RetentionScheduleFormat `json:"retentionScheduleFormatType,omitempty"` + // RetentionScheduleDaily - Daily retention format for monthly retention policy. + RetentionScheduleDaily *DailyRetentionFormat `json:"retentionScheduleDaily,omitempty"` + // RetentionScheduleWeekly - Weekly retention format for monthly retention policy. + RetentionScheduleWeekly *WeeklyRetentionFormat `json:"retentionScheduleWeekly,omitempty"` + // RetentionTimes - Retention times of retention policy. + RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` + // RetentionDuration - Retention duration of retention Policy. + RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` +} + +// MoveRecoveryPointFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type MoveRecoveryPointFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(BaseClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *MoveRecoveryPointFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for MoveRecoveryPointFuture.Result. +func (future *MoveRecoveryPointFuture) result(client BaseClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.MoveRecoveryPointFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("backup.MoveRecoveryPointFuture") + return + } + ar.Response = future.Response() + return +} + +// MoveRPAcrossTiersRequest ... +type MoveRPAcrossTiersRequest struct { + // ObjectType - Gets the class type. + ObjectType *string `json:"objectType,omitempty"` + // SourceTierType - Source tier from where RP needs to be moved. Possible values include: 'RecoveryPointTierTypeInvalid', 'RecoveryPointTierTypeInstantRP', 'RecoveryPointTierTypeHardenedRP', 'RecoveryPointTierTypeArchivedRP' + SourceTierType RecoveryPointTierType `json:"sourceTierType,omitempty"` + // TargetTierType - Target tier where RP needs to be moved. Possible values include: 'RecoveryPointTierTypeInvalid', 'RecoveryPointTierTypeInstantRP', 'RecoveryPointTierTypeHardenedRP', 'RecoveryPointTierTypeArchivedRP' + TargetTierType RecoveryPointTierType `json:"targetTierType,omitempty"` +} + +// NameInfo the name of usage. +type NameInfo struct { + // Value - Value of usage. + Value *string `json:"value,omitempty"` + // LocalizedValue - Localized value of usage. + LocalizedValue *string `json:"localizedValue,omitempty"` +} + +// NewErrorResponse the resource management error response. +type NewErrorResponse struct { + // Error - The error object. + Error *NewErrorResponseError `json:"error,omitempty"` +} + +// NewErrorResponseError the error object. +type NewErrorResponseError struct { + // Code - READ-ONLY; The error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; The error message. + Message *string `json:"message,omitempty"` + // Target - READ-ONLY; The error target. + Target *string `json:"target,omitempty"` + // Details - READ-ONLY; The error details. + Details *[]NewErrorResponse `json:"details,omitempty"` + // AdditionalInfo - READ-ONLY; The error additional info. + AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` +} + +// MarshalJSON is the custom marshaler for NewErrorResponseError. +func (ner NewErrorResponseError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// OperationResultInfo operation result info. +type OperationResultInfo struct { + // JobList - List of jobs created by this operation. + JobList *[]string `json:"jobList,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeOperationResultInfoBase', 'ObjectTypeExportJobsOperationResultInfo', 'ObjectTypeOperationResultInfo' + ObjectType ObjectType `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationResultInfo. +func (ori OperationResultInfo) MarshalJSON() ([]byte, error) { + ori.ObjectType = ObjectTypeOperationResultInfo + objectMap := make(map[string]interface{}) + if ori.JobList != nil { + objectMap["jobList"] = ori.JobList + } + if ori.ObjectType != "" { + objectMap["objectType"] = ori.ObjectType + } + return json.Marshal(objectMap) +} + +// AsExportJobsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfo. +func (ori OperationResultInfo) AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) { + return nil, false +} + +// AsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfo. +func (ori OperationResultInfo) AsOperationResultInfo() (*OperationResultInfo, bool) { + return &ori, true +} + +// AsOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfo. +func (ori OperationResultInfo) AsOperationResultInfoBase() (*OperationResultInfoBase, bool) { + return nil, false +} + +// AsBasicOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfo. +func (ori OperationResultInfo) AsBasicOperationResultInfoBase() (BasicOperationResultInfoBase, bool) { + return &ori, true +} + +// BasicOperationResultInfoBase base class for operation result info. +type BasicOperationResultInfoBase interface { + AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) + AsOperationResultInfo() (*OperationResultInfo, bool) + AsOperationResultInfoBase() (*OperationResultInfoBase, bool) +} + +// OperationResultInfoBase base class for operation result info. +type OperationResultInfoBase struct { + // ObjectType - Possible values include: 'ObjectTypeOperationResultInfoBase', 'ObjectTypeExportJobsOperationResultInfo', 'ObjectTypeOperationResultInfo' + ObjectType ObjectType `json:"objectType,omitempty"` +} + +func unmarshalBasicOperationResultInfoBase(body []byte) (BasicOperationResultInfoBase, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeExportJobsOperationResultInfo): + var ejori ExportJobsOperationResultInfo + err := json.Unmarshal(body, &ejori) + return ejori, err + case string(ObjectTypeOperationResultInfo): + var ori OperationResultInfo + err := json.Unmarshal(body, &ori) + return ori, err + default: + var orib OperationResultInfoBase + err := json.Unmarshal(body, &orib) + return orib, err + } +} +func unmarshalBasicOperationResultInfoBaseArray(body []byte) ([]BasicOperationResultInfoBase, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + oribArray := make([]BasicOperationResultInfoBase, len(rawMessages)) + + for index, rawMessage := range rawMessages { + orib, err := unmarshalBasicOperationResultInfoBase(*rawMessage) + if err != nil { + return nil, err + } + oribArray[index] = orib + } + return oribArray, nil +} + +// MarshalJSON is the custom marshaler for OperationResultInfoBase. +func (orib OperationResultInfoBase) MarshalJSON() ([]byte, error) { + orib.ObjectType = ObjectTypeOperationResultInfoBase + objectMap := make(map[string]interface{}) + if orib.ObjectType != "" { + objectMap["objectType"] = orib.ObjectType + } + return json.Marshal(objectMap) +} + +// AsExportJobsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. +func (orib OperationResultInfoBase) AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) { + return nil, false +} + +// AsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. +func (orib OperationResultInfoBase) AsOperationResultInfo() (*OperationResultInfo, bool) { + return nil, false +} + +// AsOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. +func (orib OperationResultInfoBase) AsOperationResultInfoBase() (*OperationResultInfoBase, bool) { + return &orib, true +} + +// AsBasicOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfoBase. +func (orib OperationResultInfoBase) AsBasicOperationResultInfoBase() (BasicOperationResultInfoBase, bool) { + return &orib, true +} + +// OperationResultInfoBaseResource base class for operation result info. +type OperationResultInfoBaseResource struct { + autorest.Response `json:"-"` + // Operation - OperationResultInfoBaseResource operation + Operation BasicOperationResultInfoBase `json:"operation,omitempty"` + // StatusCode - 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' + StatusCode HTTPStatusCode `json:"statusCode,omitempty"` + // Headers - HTTP headers associated with this operation. + Headers map[string][]string `json:"headers"` +} + +// MarshalJSON is the custom marshaler for OperationResultInfoBaseResource. +func (oribr OperationResultInfoBaseResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["operation"] = oribr.Operation + if oribr.StatusCode != "" { + objectMap["statusCode"] = oribr.StatusCode + } + if oribr.Headers != nil { + objectMap["headers"] = oribr.Headers + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OperationResultInfoBaseResource struct. +func (oribr *OperationResultInfoBaseResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "operation": + if v != nil { + operation, err := unmarshalBasicOperationResultInfoBase(*v) + if err != nil { + return err + } + oribr.Operation = operation + } + case "statusCode": + if v != nil { + var statusCode HTTPStatusCode + err = json.Unmarshal(*v, &statusCode) + if err != nil { + return err + } + oribr.StatusCode = statusCode + } + case "headers": + if v != nil { + var headers map[string][]string + err = json.Unmarshal(*v, &headers) + if err != nil { + return err + } + oribr.Headers = headers + } + } + } + + return nil +} + +// OperationStatus operation status. +type OperationStatus struct { + autorest.Response `json:"-"` + // ID - ID of the operation. + ID *string `json:"id,omitempty"` + // Name - Name of the operation. + Name *string `json:"name,omitempty"` + // Status - Operation status. Possible values include: 'OperationStatusValuesInvalid', 'OperationStatusValuesInProgress', 'OperationStatusValuesSucceeded', 'OperationStatusValuesFailed', 'OperationStatusValuesCanceled' + Status OperationStatusValues `json:"status,omitempty"` + // StartTime - Operation start time. Format: ISO-8601. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Operation end time. Format: ISO-8601. + EndTime *date.Time `json:"endTime,omitempty"` + // Error - Error information related to this operation. + Error *OperationStatusError `json:"error,omitempty"` + // Properties - Additional information associated with this operation. + Properties BasicOperationStatusExtendedInfo `json:"properties,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for OperationStatus struct. +func (osVar *OperationStatus) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + osVar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + osVar.Name = &name + } + case "status": + if v != nil { + var status OperationStatusValues + err = json.Unmarshal(*v, &status) + if err != nil { + return err + } + osVar.Status = status + } + case "startTime": + if v != nil { + var startTime date.Time + err = json.Unmarshal(*v, &startTime) + if err != nil { + return err + } + osVar.StartTime = &startTime + } + case "endTime": + if v != nil { + var endTime date.Time + err = json.Unmarshal(*v, &endTime) + if err != nil { + return err + } + osVar.EndTime = &endTime + } + case "error": + if v != nil { + var errorVar OperationStatusError + err = json.Unmarshal(*v, &errorVar) + if err != nil { + return err + } + osVar.Error = &errorVar + } + case "properties": + if v != nil { + properties, err := unmarshalBasicOperationStatusExtendedInfo(*v) + if err != nil { + return err + } + osVar.Properties = properties + } + } + } + + return nil +} + +// OperationStatusError error information associated with operation status call. +type OperationStatusError struct { + // Code - Error code of the operation failure. + Code *string `json:"code,omitempty"` + // Message - Error message displayed if the operation failure. + Message *string `json:"message,omitempty"` +} + +// BasicOperationStatusExtendedInfo base class for additional information of operation status. +type BasicOperationStatusExtendedInfo interface { + AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) + AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) + AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) + AsOperationStatusValidateOperationExtendedInfo() (*OperationStatusValidateOperationExtendedInfo, bool) + AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) +} + +// OperationStatusExtendedInfo base class for additional information of operation status. +type OperationStatusExtendedInfo struct { + // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo', 'ObjectTypeOperationStatusValidateOperationExtendedInfo' + ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` +} + +func unmarshalBasicOperationStatusExtendedInfo(body []byte) (BasicOperationStatusExtendedInfo, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeOperationStatusJobExtendedInfo): + var osjei OperationStatusJobExtendedInfo + err := json.Unmarshal(body, &osjei) + return osjei, err + case string(ObjectTypeOperationStatusJobsExtendedInfo): + var osjei OperationStatusJobsExtendedInfo + err := json.Unmarshal(body, &osjei) + return osjei, err + case string(ObjectTypeOperationStatusProvisionILRExtendedInfo): + var ospiei OperationStatusProvisionILRExtendedInfo + err := json.Unmarshal(body, &ospiei) + return ospiei, err + case string(ObjectTypeOperationStatusValidateOperationExtendedInfo): + var osvoei OperationStatusValidateOperationExtendedInfo + err := json.Unmarshal(body, &osvoei) + return osvoei, err + default: + var osei OperationStatusExtendedInfo + err := json.Unmarshal(body, &osei) + return osei, err + } +} +func unmarshalBasicOperationStatusExtendedInfoArray(body []byte) ([]BasicOperationStatusExtendedInfo, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + oseiArray := make([]BasicOperationStatusExtendedInfo, len(rawMessages)) + + for index, rawMessage := range rawMessages { + osei, err := unmarshalBasicOperationStatusExtendedInfo(*rawMessage) + if err != nil { + return nil, err + } + oseiArray[index] = osei + } + return oseiArray, nil +} + +// MarshalJSON is the custom marshaler for OperationStatusExtendedInfo. +func (osei OperationStatusExtendedInfo) MarshalJSON() ([]byte, error) { + osei.ObjectType = ObjectTypeOperationStatusExtendedInfo + objectMap := make(map[string]interface{}) + if osei.ObjectType != "" { + objectMap["objectType"] = osei.ObjectType + } + return json.Marshal(objectMap) +} + +// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. +func (osei OperationStatusExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. +func (osei OperationStatusExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. +func (osei OperationStatusExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusValidateOperationExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. +func (osei OperationStatusExtendedInfo) AsOperationStatusValidateOperationExtendedInfo() (*OperationStatusValidateOperationExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. +func (osei OperationStatusExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { + return &osei, true +} + +// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo. +func (osei OperationStatusExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { + return &osei, true +} + +// OperationStatusJobExtendedInfo operation status job extended info. +type OperationStatusJobExtendedInfo struct { + // JobID - ID of the job created for this protected item. + JobID *string `json:"jobId,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo', 'ObjectTypeOperationStatusValidateOperationExtendedInfo' + ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationStatusJobExtendedInfo. +func (osjei OperationStatusJobExtendedInfo) MarshalJSON() ([]byte, error) { + osjei.ObjectType = ObjectTypeOperationStatusJobExtendedInfo + objectMap := make(map[string]interface{}) + if osjei.JobID != nil { + objectMap["jobId"] = osjei.JobID + } + if osjei.ObjectType != "" { + objectMap["objectType"] = osjei.ObjectType + } + return json.Marshal(objectMap) +} + +// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. +func (osjei OperationStatusJobExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { + return &osjei, true +} + +// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. +func (osjei OperationStatusJobExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. +func (osjei OperationStatusJobExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusValidateOperationExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. +func (osjei OperationStatusJobExtendedInfo) AsOperationStatusValidateOperationExtendedInfo() (*OperationStatusValidateOperationExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. +func (osjei OperationStatusJobExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { + return nil, false +} + +// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo. +func (osjei OperationStatusJobExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { + return &osjei, true +} + +// OperationStatusJobsExtendedInfo operation status extended info for list of jobs. +type OperationStatusJobsExtendedInfo struct { + // JobIds - IDs of the jobs created for the protected item. + JobIds *[]string `json:"jobIds,omitempty"` + // FailedJobsError - Stores all the failed jobs along with the corresponding error codes. + FailedJobsError map[string]*string `json:"failedJobsError"` + // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo', 'ObjectTypeOperationStatusValidateOperationExtendedInfo' + ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationStatusJobsExtendedInfo. +func (osjei OperationStatusJobsExtendedInfo) MarshalJSON() ([]byte, error) { + osjei.ObjectType = ObjectTypeOperationStatusJobsExtendedInfo + objectMap := make(map[string]interface{}) + if osjei.JobIds != nil { + objectMap["jobIds"] = osjei.JobIds + } + if osjei.FailedJobsError != nil { + objectMap["failedJobsError"] = osjei.FailedJobsError + } + if osjei.ObjectType != "" { + objectMap["objectType"] = osjei.ObjectType + } + return json.Marshal(objectMap) +} + +// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. +func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. +func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { + return &osjei, true +} + +// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. +func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusValidateOperationExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. +func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusValidateOperationExtendedInfo() (*OperationStatusValidateOperationExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. +func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { + return nil, false +} + +// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo. +func (osjei OperationStatusJobsExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { + return &osjei, true +} + +// OperationStatusProvisionILRExtendedInfo operation status extended info for ILR provision action. +type OperationStatusProvisionILRExtendedInfo struct { + // RecoveryTarget - Target details for file / folder restore. + RecoveryTarget *InstantItemRecoveryTarget `json:"recoveryTarget,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo', 'ObjectTypeOperationStatusValidateOperationExtendedInfo' + ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationStatusProvisionILRExtendedInfo. +func (ospiei OperationStatusProvisionILRExtendedInfo) MarshalJSON() ([]byte, error) { + ospiei.ObjectType = ObjectTypeOperationStatusProvisionILRExtendedInfo + objectMap := make(map[string]interface{}) + if ospiei.RecoveryTarget != nil { + objectMap["recoveryTarget"] = ospiei.RecoveryTarget + } + if ospiei.ObjectType != "" { + objectMap["objectType"] = ospiei.ObjectType + } + return json.Marshal(objectMap) +} + +// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. +func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. +func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. +func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { + return &ospiei, true +} + +// AsOperationStatusValidateOperationExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. +func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusValidateOperationExtendedInfo() (*OperationStatusValidateOperationExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. +func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { + return nil, false +} + +// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo. +func (ospiei OperationStatusProvisionILRExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { + return &ospiei, true +} + +// OperationStatusValidateOperationExtendedInfo operation status extended info for ValidateOperation +// action. +type OperationStatusValidateOperationExtendedInfo struct { + // ValidateOperationResponse - Gets the validation operation response + ValidateOperationResponse *ValidateOperationResponse `json:"validateOperationResponse,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo', 'ObjectTypeOperationStatusValidateOperationExtendedInfo' + ObjectType ObjectTypeBasicOperationStatusExtendedInfo `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationStatusValidateOperationExtendedInfo. +func (osvoei OperationStatusValidateOperationExtendedInfo) MarshalJSON() ([]byte, error) { + osvoei.ObjectType = ObjectTypeOperationStatusValidateOperationExtendedInfo + objectMap := make(map[string]interface{}) + if osvoei.ValidateOperationResponse != nil { + objectMap["validateOperationResponse"] = osvoei.ValidateOperationResponse + } + if osvoei.ObjectType != "" { + objectMap["objectType"] = osvoei.ObjectType + } + return json.Marshal(objectMap) +} + +// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusValidateOperationExtendedInfo. +func (osvoei OperationStatusValidateOperationExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusValidateOperationExtendedInfo. +func (osvoei OperationStatusValidateOperationExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusValidateOperationExtendedInfo. +func (osvoei OperationStatusValidateOperationExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) { + return nil, false +} + +// AsOperationStatusValidateOperationExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusValidateOperationExtendedInfo. +func (osvoei OperationStatusValidateOperationExtendedInfo) AsOperationStatusValidateOperationExtendedInfo() (*OperationStatusValidateOperationExtendedInfo, bool) { + return &osvoei, true +} + +// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusValidateOperationExtendedInfo. +func (osvoei OperationStatusValidateOperationExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) { + return nil, false +} + +// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusValidateOperationExtendedInfo. +func (osvoei OperationStatusValidateOperationExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) { + return &osvoei, true +} + +// OperationWorkerResponse this is the base class for operation result responses. +type OperationWorkerResponse struct { + // StatusCode - 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' + StatusCode HTTPStatusCode `json:"statusCode,omitempty"` + // Headers - HTTP headers associated with this operation. + Headers map[string][]string `json:"headers"` +} + +// MarshalJSON is the custom marshaler for OperationWorkerResponse. +func (owr OperationWorkerResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if owr.StatusCode != "" { + objectMap["statusCode"] = owr.StatusCode + } + if owr.Headers != nil { + objectMap["headers"] = owr.Headers + } + return json.Marshal(objectMap) +} + +// PointInTimeRange provides details for log ranges +type PointInTimeRange struct { + // StartTime - Start time of the time range for log recovery. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - End time of the time range for log recovery. + EndTime *date.Time `json:"endTime,omitempty"` +} + +// PreBackupValidation pre-backup validation for Azure VM Workload provider. +type PreBackupValidation struct { + // Status - Status of protectable item, i.e. InProgress,Succeeded,Failed. Possible values include: 'InquiryStatusInvalid', 'InquiryStatusSuccess', 'InquiryStatusFailed' + Status InquiryStatus `json:"status,omitempty"` + // Code - Error code of protectable item + Code *string `json:"code,omitempty"` + // Message - Message corresponding to the error code for the protectable item + Message *string `json:"message,omitempty"` +} + +// PrepareDataMoveRequest prepare DataMove Request +type PrepareDataMoveRequest struct { + // TargetResourceID - ARM Id of target vault + TargetResourceID *string `json:"targetResourceId,omitempty"` + // TargetRegion - Target Region + TargetRegion *string `json:"targetRegion,omitempty"` + // DataMoveLevel - DataMove Level. Possible values include: 'DataMoveLevelInvalid', 'DataMoveLevelVault', 'DataMoveLevelContainer' + DataMoveLevel DataMoveLevel `json:"dataMoveLevel,omitempty"` + // SourceContainerArmIds - Source Container ArmIds + // This needs to be populated only if DataMoveLevel is set to container + SourceContainerArmIds *[]string `json:"sourceContainerArmIds,omitempty"` + // IgnoreMoved - Ignore the artifacts which are already moved. + IgnoreMoved *bool `json:"ignoreMoved,omitempty"` +} + +// PrepareDataMoveResponse prepare DataMove Response +type PrepareDataMoveResponse struct { + // CorrelationID - Co-relationId for move operation + CorrelationID *string `json:"correlationId,omitempty"` + // SourceVaultProperties - Source Vault Properties + SourceVaultProperties map[string]*string `json:"sourceVaultProperties"` + // ObjectType - Possible values include: 'ObjectTypeVaultStorageConfigOperationResultResponse', 'ObjectTypePrepareDataMoveResponse' + ObjectType ObjectTypeBasicVaultStorageConfigOperationResultResponse `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrepareDataMoveResponse. +func (pdmr PrepareDataMoveResponse) MarshalJSON() ([]byte, error) { + pdmr.ObjectType = ObjectTypePrepareDataMoveResponse + objectMap := make(map[string]interface{}) + if pdmr.CorrelationID != nil { + objectMap["correlationId"] = pdmr.CorrelationID + } + if pdmr.SourceVaultProperties != nil { + objectMap["sourceVaultProperties"] = pdmr.SourceVaultProperties + } + if pdmr.ObjectType != "" { + objectMap["objectType"] = pdmr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsPrepareDataMoveResponse is the BasicVaultStorageConfigOperationResultResponse implementation for PrepareDataMoveResponse. +func (pdmr PrepareDataMoveResponse) AsPrepareDataMoveResponse() (*PrepareDataMoveResponse, bool) { + return &pdmr, true +} + +// AsVaultStorageConfigOperationResultResponse is the BasicVaultStorageConfigOperationResultResponse implementation for PrepareDataMoveResponse. +func (pdmr PrepareDataMoveResponse) AsVaultStorageConfigOperationResultResponse() (*VaultStorageConfigOperationResultResponse, bool) { + return nil, false +} + +// AsBasicVaultStorageConfigOperationResultResponse is the BasicVaultStorageConfigOperationResultResponse implementation for PrepareDataMoveResponse. +func (pdmr PrepareDataMoveResponse) AsBasicVaultStorageConfigOperationResultResponse() (BasicVaultStorageConfigOperationResultResponse, bool) { + return &pdmr, true +} + +// PreValidateEnableBackupRequest contract to validate if backup can be enabled on the given resource in a +// given vault and given configuration. +// It will validate followings +// 1. Vault capacity +// 2. VM is already protected +// 3. Any VM related configuration passed in properties. +type PreValidateEnableBackupRequest struct { + // ResourceType - ProtectedItem Type- VM, SqlDataBase, AzureFileShare etc. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + ResourceType DataSourceType `json:"resourceType,omitempty"` + // ResourceID - ARM Virtual Machine Id + ResourceID *string `json:"resourceId,omitempty"` + // VaultID - ARM id of the Recovery Services Vault + VaultID *string `json:"vaultId,omitempty"` + // Properties - Configuration of VM if any needs to be validated like OS type etc + Properties *string `json:"properties,omitempty"` +} + +// PreValidateEnableBackupResponse response contract for enable backup validation request +type PreValidateEnableBackupResponse struct { + autorest.Response `json:"-"` + // Status - Validation Status. Possible values include: 'ValidationStatusInvalid', 'ValidationStatusSucceeded', 'ValidationStatusFailed' + Status ValidationStatus `json:"status,omitempty"` + // ErrorCode - Response error code + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - Response error message + ErrorMessage *string `json:"errorMessage,omitempty"` + // Recommendation - Recommended action for user + Recommendation *string `json:"recommendation,omitempty"` + // ContainerName - Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is required + // for portal + ContainerName *string `json:"containerName,omitempty"` + // ProtectedItemName - Specifies the product specific ds name. E.g. vm;iaasvmcontainer;rgname;vmname. This is required for portal + ProtectedItemName *string `json:"protectedItemName,omitempty"` +} + +// PrivateEndpoint the Private Endpoint network resource that is linked to the Private Endpoint connection +type PrivateEndpoint struct { + // ID - Gets or sets id + ID *string `json:"id,omitempty"` +} + +// PrivateEndpointConnection private Endpoint Connection Response Properties +type PrivateEndpointConnection struct { + // ProvisioningState - Gets or sets provisioning state of the private endpoint connection. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateDeleting', 'ProvisioningStateFailed', 'ProvisioningStatePending' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // PrivateEndpoint - Gets or sets private endpoint associated with the private endpoint connection + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + // PrivateLinkServiceConnectionState - Gets or sets private link service connection state + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` +} + +// PrivateEndpointConnectionDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type PrivateEndpointConnectionDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateEndpointConnectionClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateEndpointConnectionDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PrivateEndpointConnectionDeleteFuture.Result. +func (future *PrivateEndpointConnectionDeleteFuture) result(client PrivateEndpointConnectionClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.PrivateEndpointConnectionDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("backup.PrivateEndpointConnectionDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// PrivateEndpointConnectionPutFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type PrivateEndpointConnectionPutFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateEndpointConnectionClient) (PrivateEndpointConnectionResource, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateEndpointConnectionPutFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PrivateEndpointConnectionPutFuture.Result. +func (future *PrivateEndpointConnectionPutFuture) result(client PrivateEndpointConnectionClient) (pecr PrivateEndpointConnectionResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.PrivateEndpointConnectionPutFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pecr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("backup.PrivateEndpointConnectionPutFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pecr.Response.Response, err = future.GetResult(sender); err == nil && pecr.Response.Response.StatusCode != http.StatusNoContent { + pecr, err = client.PutResponder(pecr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.PrivateEndpointConnectionPutFuture", "Result", pecr.Response.Response, "Failure responding to request") + } + } + return +} + +// PrivateEndpointConnectionResource private Endpoint Connection Response Properties +type PrivateEndpointConnectionResource struct { + autorest.Response `json:"-"` + // Properties - PrivateEndpointConnectionResource properties + Properties *PrivateEndpointConnection `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnectionResource. +func (pecr PrivateEndpointConnectionResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pecr.Properties != nil { + objectMap["properties"] = pecr.Properties + } + if pecr.Location != nil { + objectMap["location"] = pecr.Location + } + if pecr.Tags != nil { + objectMap["tags"] = pecr.Tags + } + if pecr.ETag != nil { + objectMap["eTag"] = pecr.ETag + } + return json.Marshal(objectMap) +} + +// PrivateLinkServiceConnectionState private Link Service Connection State +type PrivateLinkServiceConnectionState struct { + // Status - Gets or sets the status. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' + Status PrivateEndpointConnectionStatus `json:"status,omitempty"` + // Description - Gets or sets description + Description *string `json:"description,omitempty"` + // ActionRequired - Gets or sets actions required + ActionRequired *string `json:"actionRequired,omitempty"` +} + +// BasicProtectableContainer protectable Container Class. +type BasicProtectableContainer interface { + AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) + AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) + AsProtectableContainer() (*ProtectableContainer, bool) +} + +// ProtectableContainer protectable Container Class. +type ProtectableContainer struct { + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ContainerID - Fabric Id of the container such as ARM Id. + ContainerID *string `json:"containerId,omitempty"` + // ProtectableContainerType - Possible values include: 'ProtectableContainerTypeProtectableContainer', 'ProtectableContainerTypeStorageContainer', 'ProtectableContainerTypeVMAppContainer' + ProtectableContainerType ProtectableContainerType `json:"protectableContainerType,omitempty"` +} + +func unmarshalBasicProtectableContainer(body []byte) (BasicProtectableContainer, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectableContainerType"] { + case string(ProtectableContainerTypeStorageContainer): + var aspc AzureStorageProtectableContainer + err := json.Unmarshal(body, &aspc) + return aspc, err + case string(ProtectableContainerTypeVMAppContainer): + var avacpc AzureVMAppContainerProtectableContainer + err := json.Unmarshal(body, &avacpc) + return avacpc, err + default: + var pc ProtectableContainer + err := json.Unmarshal(body, &pc) + return pc, err + } +} +func unmarshalBasicProtectableContainerArray(body []byte) ([]BasicProtectableContainer, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + pcArray := make([]BasicProtectableContainer, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pc, err := unmarshalBasicProtectableContainer(*rawMessage) + if err != nil { + return nil, err + } + pcArray[index] = pc + } + return pcArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectableContainer. +func (pc ProtectableContainer) MarshalJSON() ([]byte, error) { + pc.ProtectableContainerType = ProtectableContainerTypeProtectableContainer + objectMap := make(map[string]interface{}) + if pc.FriendlyName != nil { + objectMap["friendlyName"] = pc.FriendlyName + } + if pc.BackupManagementType != "" { + objectMap["backupManagementType"] = pc.BackupManagementType + } + if pc.HealthStatus != nil { + objectMap["healthStatus"] = pc.HealthStatus + } + if pc.ContainerID != nil { + objectMap["containerId"] = pc.ContainerID + } + if pc.ProtectableContainerType != "" { + objectMap["protectableContainerType"] = pc.ProtectableContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureStorageProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. +func (pc ProtectableContainer) AsAzureStorageProtectableContainer() (*AzureStorageProtectableContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. +func (pc ProtectableContainer) AsAzureVMAppContainerProtectableContainer() (*AzureVMAppContainerProtectableContainer, bool) { + return nil, false +} + +// AsProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. +func (pc ProtectableContainer) AsProtectableContainer() (*ProtectableContainer, bool) { + return &pc, true +} + +// AsBasicProtectableContainer is the BasicProtectableContainer implementation for ProtectableContainer. +func (pc ProtectableContainer) AsBasicProtectableContainer() (BasicProtectableContainer, bool) { + return &pc, true +} + +// ProtectableContainerResource protectable Container Class. +type ProtectableContainerResource struct { + // Properties - ProtectableContainerResource properties + Properties BasicProtectableContainer `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectableContainerResource. +func (pcr ProtectableContainerResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = pcr.Properties + if pcr.Location != nil { + objectMap["location"] = pcr.Location + } + if pcr.Tags != nil { + objectMap["tags"] = pcr.Tags + } + if pcr.ETag != nil { + objectMap["eTag"] = pcr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ProtectableContainerResource struct. +func (pcr *ProtectableContainerResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicProtectableContainer(*v) + if err != nil { + return err + } + pcr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pcr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pcr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pcr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + pcr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + pcr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + pcr.ETag = &eTag + } + } + } + + return nil +} + +// ProtectableContainerResourceList list of ProtectableContainer resources +type ProtectableContainerResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]ProtectableContainerResource `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"` +} + +// ProtectableContainerResourceListIterator provides access to a complete listing of +// ProtectableContainerResource values. +type ProtectableContainerResourceListIterator struct { + i int + page ProtectableContainerResourceListPage +} + +// NextWithContext 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 *ProtectableContainerResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableContainerResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectableContainerResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectableContainerResourceListIterator) 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 ProtectableContainerResourceListIterator) Response() ProtectableContainerResourceList { + 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 ProtectableContainerResourceListIterator) Value() ProtectableContainerResource { + if !iter.page.NotDone() { + return ProtectableContainerResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectableContainerResourceListIterator type. +func NewProtectableContainerResourceListIterator(page ProtectableContainerResourceListPage) ProtectableContainerResourceListIterator { + return ProtectableContainerResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pcrl ProtectableContainerResourceList) IsEmpty() bool { + return pcrl.Value == nil || len(*pcrl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pcrl ProtectableContainerResourceList) hasNextLink() bool { + return pcrl.NextLink != nil && len(*pcrl.NextLink) != 0 +} + +// protectableContainerResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pcrl ProtectableContainerResourceList) protectableContainerResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !pcrl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pcrl.NextLink))) +} + +// ProtectableContainerResourceListPage contains a page of ProtectableContainerResource values. +type ProtectableContainerResourceListPage struct { + fn func(context.Context, ProtectableContainerResourceList) (ProtectableContainerResourceList, error) + pcrl ProtectableContainerResourceList +} + +// NextWithContext 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 *ProtectableContainerResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectableContainerResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pcrl) + if err != nil { + return err + } + page.pcrl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectableContainerResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectableContainerResourceListPage) NotDone() bool { + return !page.pcrl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectableContainerResourceListPage) Response() ProtectableContainerResourceList { + return page.pcrl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectableContainerResourceListPage) Values() []ProtectableContainerResource { + if page.pcrl.IsEmpty() { + return nil + } + return *page.pcrl.Value +} + +// Creates a new instance of the ProtectableContainerResourceListPage type. +func NewProtectableContainerResourceListPage(cur ProtectableContainerResourceList, getNextPage func(context.Context, ProtectableContainerResourceList) (ProtectableContainerResourceList, error)) ProtectableContainerResourceListPage { + return ProtectableContainerResourceListPage{ + fn: getNextPage, + pcrl: cur, + } +} + +// BasicProtectedItem base class for backup items. +type BasicProtectedItem interface { + AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) + AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) + AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) + AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) + AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) + AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) + AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) + AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) + AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) + AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) + AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) + AsDPMProtectedItem() (*DPMProtectedItem, bool) + AsGenericProtectedItem() (*GenericProtectedItem, bool) + AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) + AsProtectedItem() (*ProtectedItem, bool) +} + +// ProtectedItem base class for backup items. +type ProtectedItem struct { + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload this item represents. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + WorkloadType DataSourceType `json:"workloadType,omitempty"` + // ContainerName - Unique name of container + ContainerName *string `json:"containerName,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // LastRecoveryPoint - Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"` + // BackupSetName - Name of the backup set the backup item belongs to + 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"` + // DeferredDeleteTimeInUTC - Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *date.Time `json:"deferredDeleteTimeInUTC,omitempty"` + // IsScheduledForDeferredDelete - Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + // DeferredDeleteTimeRemaining - Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + // IsDeferredDeleteScheduleUpcoming - Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + // IsRehydrate - Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + // ResourceGuardOperationRequests - ResourceGuardOperationRequests on which LAC check will be performed + ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` + // IsArchiveEnabled - Flag to identify whether datasource is protected in archive + IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + // PolicyName - Name of the policy used for protection + PolicyName *string `json:"policyName,omitempty"` + // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPAseDatabase', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' + ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` +} + +func unmarshalBasicProtectedItem(body []byte) (BasicProtectedItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectedItemType"] { + case string(ProtectedItemTypeAzureFileShareProtectedItem): + var afpi AzureFileshareProtectedItem + err := json.Unmarshal(body, &afpi) + return afpi, err + case string(ProtectedItemTypeMicrosoftClassicComputevirtualMachines): + var aisccvpi AzureIaaSClassicComputeVMProtectedItem + err := json.Unmarshal(body, &aisccvpi) + return aisccvpi, err + case string(ProtectedItemTypeMicrosoftComputevirtualMachines): + var aiscvpi AzureIaaSComputeVMProtectedItem + err := json.Unmarshal(body, &aiscvpi) + return aiscvpi, err + case string(ProtectedItemTypeAzureIaaSVMProtectedItem): + var aispi AzureIaaSVMProtectedItem + err := json.Unmarshal(body, &aispi) + return aispi, err + case string(ProtectedItemTypeMicrosoftSqlserversdatabases): + var aspi AzureSQLProtectedItem + err := json.Unmarshal(body, &aspi) + return aspi, err + case string(ProtectedItemTypeAzureVMWorkloadProtectedItem): + var avwpi AzureVMWorkloadProtectedItem + err := json.Unmarshal(body, &avwpi) + return avwpi, err + case string(ProtectedItemTypeAzureVMWorkloadSAPAseDatabase): + var avwsadpi AzureVMWorkloadSAPAseDatabaseProtectedItem + err := json.Unmarshal(body, &avwsadpi) + return avwsadpi, err + case string(ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase): + var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem + err := json.Unmarshal(body, &avwshdpi) + return avwshdpi, err + case string(ProtectedItemTypeAzureVMWorkloadSQLDatabase): + var avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem + err := json.Unmarshal(body, &avwsdpi) + return avwsdpi, err + case string(ProtectedItemTypeDPMProtectedItem): + var dpi DPMProtectedItem + err := json.Unmarshal(body, &dpi) + return dpi, err + case string(ProtectedItemTypeGenericProtectedItem): + var gpi GenericProtectedItem + err := json.Unmarshal(body, &gpi) + return gpi, err + case string(ProtectedItemTypeMabFileFolderProtectedItem): + var mffpi MabFileFolderProtectedItem + err := json.Unmarshal(body, &mffpi) + return mffpi, err + default: + var pi ProtectedItem + err := json.Unmarshal(body, &pi) + return pi, err + } +} +func unmarshalBasicProtectedItemArray(body []byte) ([]BasicProtectedItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + piArray := make([]BasicProtectedItem, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pi, err := unmarshalBasicProtectedItem(*rawMessage) + if err != nil { + return nil, err + } + piArray[index] = pi + } + return piArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectedItem. +func (pi ProtectedItem) MarshalJSON() ([]byte, error) { + pi.ProtectedItemType = ProtectedItemTypeProtectedItem + objectMap := make(map[string]interface{}) + if pi.BackupManagementType != "" { + objectMap["backupManagementType"] = pi.BackupManagementType + } + if pi.WorkloadType != "" { + objectMap["workloadType"] = pi.WorkloadType + } + if pi.ContainerName != nil { + objectMap["containerName"] = pi.ContainerName + } + if pi.SourceResourceID != nil { + objectMap["sourceResourceId"] = pi.SourceResourceID + } + if pi.PolicyID != nil { + objectMap["policyId"] = pi.PolicyID + } + if pi.LastRecoveryPoint != nil { + objectMap["lastRecoveryPoint"] = pi.LastRecoveryPoint + } + if pi.BackupSetName != nil { + objectMap["backupSetName"] = pi.BackupSetName + } + if pi.CreateMode != "" { + objectMap["createMode"] = pi.CreateMode + } + if pi.DeferredDeleteTimeInUTC != nil { + objectMap["deferredDeleteTimeInUTC"] = pi.DeferredDeleteTimeInUTC + } + if pi.IsScheduledForDeferredDelete != nil { + objectMap["isScheduledForDeferredDelete"] = pi.IsScheduledForDeferredDelete + } + if pi.DeferredDeleteTimeRemaining != nil { + objectMap["deferredDeleteTimeRemaining"] = pi.DeferredDeleteTimeRemaining + } + if pi.IsDeferredDeleteScheduleUpcoming != nil { + objectMap["isDeferredDeleteScheduleUpcoming"] = pi.IsDeferredDeleteScheduleUpcoming + } + if pi.IsRehydrate != nil { + objectMap["isRehydrate"] = pi.IsRehydrate + } + if pi.ResourceGuardOperationRequests != nil { + objectMap["resourceGuardOperationRequests"] = pi.ResourceGuardOperationRequests + } + if pi.IsArchiveEnabled != nil { + objectMap["isArchiveEnabled"] = pi.IsArchiveEnabled + } + if pi.PolicyName != nil { + objectMap["policyName"] = pi.PolicyName + } + if pi.ProtectedItemType != "" { + objectMap["protectedItemType"] = pi.ProtectedItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileshareProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureFileshareProtectedItem() (*AzureFileshareProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) { + return nil, false +} + +// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureVMWorkloadProtectedItem() (*AzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsBasicAzureVMWorkloadProtectedItem() (BasicAzureVMWorkloadProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureVMWorkloadSAPAseDatabaseProtectedItem() (*AzureVMWorkloadSAPAseDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureVMWorkloadSAPHanaDatabaseProtectedItem() (*AzureVMWorkloadSAPHanaDatabaseProtectedItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsAzureVMWorkloadSQLDatabaseProtectedItem() (*AzureVMWorkloadSQLDatabaseProtectedItem, bool) { + return nil, false +} + +// AsDPMProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsDPMProtectedItem() (*DPMProtectedItem, bool) { + return nil, false +} + +// AsGenericProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsGenericProtectedItem() (*GenericProtectedItem, bool) { + return nil, false +} + +// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) { + return nil, false +} + +// AsProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsProtectedItem() (*ProtectedItem, bool) { + return &pi, true +} + +// AsBasicProtectedItem is the BasicProtectedItem implementation for ProtectedItem. +func (pi ProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) { + return &pi, true +} + +// ProtectedItemQueryObject filters to list backup items. +type ProtectedItemQueryObject struct { + // HealthState - Health State for the backed up item. Possible values include: 'HealthStatePassed', 'HealthStateActionRequired', 'HealthStateActionSuggested', 'HealthStateInvalid' + HealthState HealthState `json:"healthState,omitempty"` + // 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: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + ItemType DataSourceType `json:"itemType,omitempty"` + // PolicyName - Backup policy name associated with the backup item. + PolicyName *string `json:"policyName,omitempty"` + // ContainerName - Name of the container. + ContainerName *string `json:"containerName,omitempty"` + // BackupEngineName - Backup Engine name + BackupEngineName *string `json:"backupEngineName,omitempty"` + // FriendlyName - Friendly name of protected item + FriendlyName *string `json:"friendlyName,omitempty"` + // FabricName - Name of the fabric. + FabricName *string `json:"fabricName,omitempty"` + // BackupSetName - Name of the backup set. + BackupSetName *string `json:"backupSetName,omitempty"` +} + +// ProtectedItemResource base class for backup items. +type ProtectedItemResource struct { + autorest.Response `json:"-"` + // Properties - ProtectedItemResource properties + Properties BasicProtectedItem `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectedItemResource. +func (pir ProtectedItemResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = pir.Properties + if pir.Location != nil { + objectMap["location"] = pir.Location + } + if pir.Tags != nil { + objectMap["tags"] = pir.Tags + } + if pir.ETag != nil { + objectMap["eTag"] = pir.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ProtectedItemResource struct. +func (pir *ProtectedItemResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicProtectedItem(*v) + if err != nil { + return err + } + pir.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pir.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pir.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pir.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + pir.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + pir.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + pir.ETag = &eTag + } + } + } + + return nil +} + +// ProtectedItemResourceList list of ProtectedItem resources +type ProtectedItemResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]ProtectedItemResource `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"` +} + +// ProtectedItemResourceListIterator provides access to a complete listing of ProtectedItemResource values. +type ProtectedItemResourceListIterator struct { + i int + page ProtectedItemResourceListPage +} + +// NextWithContext 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 *ProtectedItemResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectedItemResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectedItemResourceListIterator) 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 ProtectedItemResourceListIterator) Response() ProtectedItemResourceList { + 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 ProtectedItemResourceListIterator) Value() ProtectedItemResource { + if !iter.page.NotDone() { + return ProtectedItemResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectedItemResourceListIterator type. +func NewProtectedItemResourceListIterator(page ProtectedItemResourceListPage) ProtectedItemResourceListIterator { + return ProtectedItemResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pirl ProtectedItemResourceList) IsEmpty() bool { + return pirl.Value == nil || len(*pirl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pirl ProtectedItemResourceList) hasNextLink() bool { + return pirl.NextLink != nil && len(*pirl.NextLink) != 0 +} + +// protectedItemResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pirl ProtectedItemResourceList) protectedItemResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !pirl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pirl.NextLink))) +} + +// ProtectedItemResourceListPage contains a page of ProtectedItemResource values. +type ProtectedItemResourceListPage struct { + fn func(context.Context, ProtectedItemResourceList) (ProtectedItemResourceList, error) + pirl ProtectedItemResourceList +} + +// NextWithContext 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 *ProtectedItemResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pirl) + if err != nil { + return err + } + page.pirl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectedItemResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectedItemResourceListPage) NotDone() bool { + return !page.pirl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectedItemResourceListPage) Response() ProtectedItemResourceList { + return page.pirl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectedItemResourceListPage) Values() []ProtectedItemResource { + if page.pirl.IsEmpty() { + return nil + } + return *page.pirl.Value +} + +// Creates a new instance of the ProtectedItemResourceListPage type. +func NewProtectedItemResourceListPage(cur ProtectedItemResourceList, getNextPage func(context.Context, ProtectedItemResourceList) (ProtectedItemResourceList, error)) ProtectedItemResourceListPage { + return ProtectedItemResourceListPage{ + fn: getNextPage, + pirl: cur, + } +} + +// BasicProtectionContainer base class for container with backup items. Containers with specific workloads are derived +// from this class. +type BasicProtectionContainer interface { + AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) + AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) + AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) + AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) + AsAzureSQLContainer() (*AzureSQLContainer, bool) + AsAzureStorageContainer() (*AzureStorageContainer, bool) + AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) + AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) + AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) + AsDpmContainer() (*DpmContainer, bool) + AsBasicDpmContainer() (BasicDpmContainer, bool) + AsGenericContainer() (*GenericContainer, bool) + AsIaaSVMContainer() (*IaaSVMContainer, bool) + AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) + AsMabContainer() (*MabContainer, bool) + AsProtectionContainer() (*ProtectionContainer, bool) +} + +// ProtectionContainer base class for container with backup items. Containers with specific workloads are +// derived from this class. +type ProtectionContainer struct { + // FriendlyName - Friendly name of the container. + FriendlyName *string `json:"friendlyName,omitempty"` + // BackupManagementType - Type of backup management for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // RegistrationStatus - Status of registration of the container with the Recovery Services Vault. + RegistrationStatus *string `json:"registrationStatus,omitempty"` + // HealthStatus - Status of health of the container. + HealthStatus *string `json:"healthStatus,omitempty"` + // ProtectableObjectType - Type of the protectable object associated with this container + ProtectableObjectType *string `json:"protectableObjectType,omitempty"` + // ContainerType - Possible values include: 'ContainerTypeProtectionContainer', 'ContainerTypeAzureBackupServerContainer1', 'ContainerTypeMicrosoftClassicComputevirtualMachines', 'ContainerTypeMicrosoftComputevirtualMachines', 'ContainerTypeSQLAGWorkLoadContainer1', 'ContainerTypeAzureSQLContainer1', 'ContainerTypeStorageContainer1', 'ContainerTypeVMAppContainer1', 'ContainerTypeAzureWorkloadContainer', 'ContainerTypeDPMContainer1', 'ContainerTypeGenericContainer1', 'ContainerTypeIaasVMContainer1', 'ContainerTypeWindows1' + ContainerType ContainerTypeBasicProtectionContainer `json:"containerType,omitempty"` +} + +func unmarshalBasicProtectionContainer(body []byte) (BasicProtectionContainer, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["containerType"] { + case string(ContainerTypeAzureBackupServerContainer1): + var absc AzureBackupServerContainer + err := json.Unmarshal(body, &absc) + return absc, err + case string(ContainerTypeMicrosoftClassicComputevirtualMachines): + var aisccvc AzureIaaSClassicComputeVMContainer + err := json.Unmarshal(body, &aisccvc) + return aisccvc, err + case string(ContainerTypeMicrosoftComputevirtualMachines): + var aiscvc AzureIaaSComputeVMContainer + err := json.Unmarshal(body, &aiscvc) + return aiscvc, err + case string(ContainerTypeSQLAGWorkLoadContainer1): + var aswcpc AzureSQLAGWorkloadContainerProtectionContainer + err := json.Unmarshal(body, &aswcpc) + return aswcpc, err + case string(ContainerTypeAzureSQLContainer1): + var asc AzureSQLContainer + err := json.Unmarshal(body, &asc) + return asc, err + case string(ContainerTypeStorageContainer1): + var asc AzureStorageContainer + err := json.Unmarshal(body, &asc) + return asc, err + case string(ContainerTypeVMAppContainer1): + var avacpc AzureVMAppContainerProtectionContainer + err := json.Unmarshal(body, &avacpc) + return avacpc, err + case string(ContainerTypeAzureWorkloadContainer): + var awc AzureWorkloadContainer + err := json.Unmarshal(body, &awc) + return awc, err + case string(ContainerTypeDPMContainer1): + var dc DpmContainer + err := json.Unmarshal(body, &dc) + return dc, err + case string(ContainerTypeGenericContainer1): + var gc GenericContainer + err := json.Unmarshal(body, &gc) + return gc, err + case string(ContainerTypeIaasVMContainer1): + var isc IaaSVMContainer + err := json.Unmarshal(body, &isc) + return isc, err + case string(ContainerTypeWindows1): + var mc MabContainer + err := json.Unmarshal(body, &mc) + return mc, err + default: + var pc ProtectionContainer + err := json.Unmarshal(body, &pc) + return pc, err + } +} +func unmarshalBasicProtectionContainerArray(body []byte) ([]BasicProtectionContainer, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + pcArray := make([]BasicProtectionContainer, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pc, err := unmarshalBasicProtectionContainer(*rawMessage) + if err != nil { + return nil, err + } + pcArray[index] = pc + } + return pcArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectionContainer. +func (pc ProtectionContainer) MarshalJSON() ([]byte, error) { + pc.ContainerType = ContainerTypeProtectionContainer + objectMap := make(map[string]interface{}) + if pc.FriendlyName != nil { + objectMap["friendlyName"] = pc.FriendlyName + } + if pc.BackupManagementType != "" { + objectMap["backupManagementType"] = pc.BackupManagementType + } + if pc.RegistrationStatus != nil { + objectMap["registrationStatus"] = pc.RegistrationStatus + } + if pc.HealthStatus != nil { + objectMap["healthStatus"] = pc.HealthStatus + } + if pc.ProtectableObjectType != nil { + objectMap["protectableObjectType"] = pc.ProtectableObjectType + } + if pc.ContainerType != "" { + objectMap["containerType"] = pc.ContainerType + } + return json.Marshal(objectMap) +} + +// AsAzureBackupServerContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureBackupServerContainer() (*AzureBackupServerContainer, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) { + return nil, false +} + +// AsAzureSQLAGWorkloadContainerProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureSQLAGWorkloadContainerProtectionContainer() (*AzureSQLAGWorkloadContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureSQLContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) { + return nil, false +} + +// AsAzureStorageContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureStorageContainer() (*AzureStorageContainer, bool) { + return nil, false +} + +// AsAzureVMAppContainerProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureVMAppContainerProtectionContainer() (*AzureVMAppContainerProtectionContainer, bool) { + return nil, false +} + +// AsAzureWorkloadContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsAzureWorkloadContainer() (*AzureWorkloadContainer, bool) { + return nil, false +} + +// AsBasicAzureWorkloadContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsBasicAzureWorkloadContainer() (BasicAzureWorkloadContainer, bool) { + return nil, false +} + +// AsDpmContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsDpmContainer() (*DpmContainer, bool) { + return nil, false +} + +// AsBasicDpmContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsBasicDpmContainer() (BasicDpmContainer, bool) { + return nil, false +} + +// AsGenericContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsGenericContainer() (*GenericContainer, bool) { + return nil, false +} + +// AsIaaSVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) { + return nil, false +} + +// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) { + return nil, false +} + +// AsMabContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsMabContainer() (*MabContainer, bool) { + return nil, false +} + +// AsProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsProtectionContainer() (*ProtectionContainer, bool) { + return &pc, true +} + +// AsBasicProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer. +func (pc ProtectionContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) { + return &pc, true +} + +// ProtectionContainerResource base class for container with backup items. Containers with specific +// workloads are derived from this class. +type ProtectionContainerResource struct { + autorest.Response `json:"-"` + // Properties - ProtectionContainerResource properties + Properties BasicProtectionContainer `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionContainerResource. +func (pcr ProtectionContainerResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = pcr.Properties + if pcr.Location != nil { + objectMap["location"] = pcr.Location + } + if pcr.Tags != nil { + objectMap["tags"] = pcr.Tags + } + if pcr.ETag != nil { + objectMap["eTag"] = pcr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ProtectionContainerResource struct. +func (pcr *ProtectionContainerResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicProtectionContainer(*v) + if err != nil { + return err + } + pcr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pcr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pcr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pcr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + pcr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + pcr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + pcr.ETag = &eTag + } + } + } + + return nil +} + +// ProtectionContainerResourceList list of ProtectionContainer resources +type ProtectionContainerResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]ProtectionContainerResource `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"` +} + +// ProtectionContainerResourceListIterator provides access to a complete listing of +// ProtectionContainerResource values. +type ProtectionContainerResourceListIterator struct { + i int + page ProtectionContainerResourceListPage +} + +// NextWithContext 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 *ProtectionContainerResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectionContainerResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectionContainerResourceListIterator) 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 ProtectionContainerResourceListIterator) Response() ProtectionContainerResourceList { + 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 ProtectionContainerResourceListIterator) Value() ProtectionContainerResource { + if !iter.page.NotDone() { + return ProtectionContainerResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectionContainerResourceListIterator type. +func NewProtectionContainerResourceListIterator(page ProtectionContainerResourceListPage) ProtectionContainerResourceListIterator { + return ProtectionContainerResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pcrl ProtectionContainerResourceList) IsEmpty() bool { + return pcrl.Value == nil || len(*pcrl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pcrl ProtectionContainerResourceList) hasNextLink() bool { + return pcrl.NextLink != nil && len(*pcrl.NextLink) != 0 +} + +// protectionContainerResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pcrl ProtectionContainerResourceList) protectionContainerResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !pcrl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pcrl.NextLink))) +} + +// ProtectionContainerResourceListPage contains a page of ProtectionContainerResource values. +type ProtectionContainerResourceListPage struct { + fn func(context.Context, ProtectionContainerResourceList) (ProtectionContainerResourceList, error) + pcrl ProtectionContainerResourceList +} + +// NextWithContext 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 *ProtectionContainerResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionContainerResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pcrl) + if err != nil { + return err + } + page.pcrl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectionContainerResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectionContainerResourceListPage) NotDone() bool { + return !page.pcrl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectionContainerResourceListPage) Response() ProtectionContainerResourceList { + return page.pcrl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectionContainerResourceListPage) Values() []ProtectionContainerResource { + if page.pcrl.IsEmpty() { + return nil + } + return *page.pcrl.Value +} + +// Creates a new instance of the ProtectionContainerResourceListPage type. +func NewProtectionContainerResourceListPage(cur ProtectionContainerResourceList, getNextPage func(context.Context, ProtectionContainerResourceList) (ProtectionContainerResourceList, error)) ProtectionContainerResourceListPage { + return ProtectionContainerResourceListPage{ + fn: getNextPage, + pcrl: cur, + } +} + +// BasicProtectionIntent base class for backup ProtectionIntent. +type BasicProtectionIntent interface { + AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) + AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) + AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) + AsAzureWorkloadContainerAutoProtectionIntent() (*AzureWorkloadContainerAutoProtectionIntent, bool) + AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) + AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) + AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) + AsProtectionIntent() (*ProtectionIntent, bool) +} + +// ProtectionIntent base class for backup ProtectionIntent. +type ProtectionIntent struct { + // BackupManagementType - Type of backup management for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // SourceResourceID - ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // ItemID - ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId + ItemID *string `json:"itemId,omitempty"` + // PolicyID - ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + // ProtectionState - Backup state of this backup item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectionIntentItemType - Possible values include: 'ProtectionIntentItemTypeProtectionIntent', 'ProtectionIntentItemTypeRecoveryServiceVaultItem', 'ProtectionIntentItemTypeAzureResourceItem', 'ProtectionIntentItemTypeAzureWorkloadContainerAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent', 'ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent' + ProtectionIntentItemType ProtectionIntentItemType `json:"protectionIntentItemType,omitempty"` +} + +func unmarshalBasicProtectionIntent(body []byte) (BasicProtectionIntent, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectionIntentItemType"] { + case string(ProtectionIntentItemTypeRecoveryServiceVaultItem): + var arsvpi AzureRecoveryServiceVaultProtectionIntent + err := json.Unmarshal(body, &arsvpi) + return arsvpi, err + case string(ProtectionIntentItemTypeAzureResourceItem): + var arpi AzureResourceProtectionIntent + err := json.Unmarshal(body, &arpi) + return arpi, err + case string(ProtectionIntentItemTypeAzureWorkloadContainerAutoProtectionIntent): + var awcapi AzureWorkloadContainerAutoProtectionIntent + err := json.Unmarshal(body, &awcapi) + return awcapi, err + case string(ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent): + var awapi AzureWorkloadAutoProtectionIntent + err := json.Unmarshal(body, &awapi) + return awapi, err + case string(ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent): + var awsapi AzureWorkloadSQLAutoProtectionIntent + err := json.Unmarshal(body, &awsapi) + return awsapi, err + default: + var pi ProtectionIntent + err := json.Unmarshal(body, &pi) + return pi, err + } +} +func unmarshalBasicProtectionIntentArray(body []byte) ([]BasicProtectionIntent, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + piArray := make([]BasicProtectionIntent, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pi, err := unmarshalBasicProtectionIntent(*rawMessage) + if err != nil { + return nil, err + } + piArray[index] = pi + } + return piArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectionIntent. +func (pi ProtectionIntent) MarshalJSON() ([]byte, error) { + pi.ProtectionIntentItemType = ProtectionIntentItemTypeProtectionIntent + objectMap := make(map[string]interface{}) + if pi.BackupManagementType != "" { + objectMap["backupManagementType"] = pi.BackupManagementType + } + if pi.SourceResourceID != nil { + objectMap["sourceResourceId"] = pi.SourceResourceID + } + if pi.ItemID != nil { + objectMap["itemId"] = pi.ItemID + } + if pi.PolicyID != nil { + objectMap["policyId"] = pi.PolicyID + } + if pi.ProtectionState != "" { + objectMap["protectionState"] = pi.ProtectionState + } + if pi.ProtectionIntentItemType != "" { + objectMap["protectionIntentItemType"] = pi.ProtectionIntentItemType + } + return json.Marshal(objectMap) +} + +// AsAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. +func (pi ProtectionIntent) AsAzureRecoveryServiceVaultProtectionIntent() (*AzureRecoveryServiceVaultProtectionIntent, bool) { + return nil, false +} + +// AsBasicAzureRecoveryServiceVaultProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. +func (pi ProtectionIntent) AsBasicAzureRecoveryServiceVaultProtectionIntent() (BasicAzureRecoveryServiceVaultProtectionIntent, bool) { + return nil, false +} + +// AsAzureResourceProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. +func (pi ProtectionIntent) AsAzureResourceProtectionIntent() (*AzureResourceProtectionIntent, bool) { + return nil, false +} + +// AsAzureWorkloadContainerAutoProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. +func (pi ProtectionIntent) AsAzureWorkloadContainerAutoProtectionIntent() (*AzureWorkloadContainerAutoProtectionIntent, bool) { + return nil, false +} + +// AsAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. +func (pi ProtectionIntent) AsAzureWorkloadAutoProtectionIntent() (*AzureWorkloadAutoProtectionIntent, bool) { + return nil, false +} + +// AsBasicAzureWorkloadAutoProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. +func (pi ProtectionIntent) AsBasicAzureWorkloadAutoProtectionIntent() (BasicAzureWorkloadAutoProtectionIntent, bool) { + return nil, false +} + +// AsAzureWorkloadSQLAutoProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. +func (pi ProtectionIntent) AsAzureWorkloadSQLAutoProtectionIntent() (*AzureWorkloadSQLAutoProtectionIntent, bool) { + return nil, false +} + +// AsProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. +func (pi ProtectionIntent) AsProtectionIntent() (*ProtectionIntent, bool) { + return &pi, true +} + +// AsBasicProtectionIntent is the BasicProtectionIntent implementation for ProtectionIntent. +func (pi ProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, bool) { + 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:"-"` + // Properties - ProtectionIntentResource properties + Properties BasicProtectionIntent `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionIntentResource. +func (pir ProtectionIntentResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = pir.Properties + if pir.Location != nil { + objectMap["location"] = pir.Location + } + if pir.Tags != nil { + objectMap["tags"] = pir.Tags + } + if pir.ETag != nil { + objectMap["eTag"] = pir.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ProtectionIntentResource struct. +func (pir *ProtectionIntentResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicProtectionIntent(*v) + if err != nil { + return err + } + pir.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pir.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pir.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pir.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + pir.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + pir.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + pir.ETag = &eTag + } + } + } + + 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 +} + +// NextWithContext 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) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionIntentResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectionIntentResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// 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] +} + +// Creates a new instance of the ProtectionIntentResourceListIterator type. +func NewProtectionIntentResourceListIterator(page ProtectionIntentResourceListPage) ProtectionIntentResourceListIterator { + return ProtectionIntentResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pirl ProtectionIntentResourceList) IsEmpty() bool { + return pirl.Value == nil || len(*pirl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pirl ProtectionIntentResourceList) hasNextLink() bool { + return pirl.NextLink != nil && len(*pirl.NextLink) != 0 +} + +// protectionIntentResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pirl ProtectionIntentResourceList) protectionIntentResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !pirl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pirl.NextLink))) +} + +// ProtectionIntentResourceListPage contains a page of ProtectionIntentResource values. +type ProtectionIntentResourceListPage struct { + fn func(context.Context, ProtectionIntentResourceList) (ProtectionIntentResourceList, error) + pirl ProtectionIntentResourceList +} + +// NextWithContext 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) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionIntentResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pirl) + if err != nil { + return err + } + page.pirl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectionIntentResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// 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 +} + +// Creates a new instance of the ProtectionIntentResourceListPage type. +func NewProtectionIntentResourceListPage(cur ProtectionIntentResourceList, getNextPage func(context.Context, ProtectionIntentResourceList) (ProtectionIntentResourceList, error)) ProtectionIntentResourceListPage { + return ProtectionIntentResourceListPage{ + fn: getNextPage, + pirl: cur, + } +} + +// ProtectionPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ProtectionPoliciesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ProtectionPoliciesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ProtectionPoliciesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ProtectionPoliciesDeleteFuture.Result. +func (future *ProtectionPoliciesDeleteFuture) result(client ProtectionPoliciesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("backup.ProtectionPoliciesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// BasicProtectionPolicy base class for backup policy. Workload-specific backup policies are derived from this class. +type BasicProtectionPolicy interface { + AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) + AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) + AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) + AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) + AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) + AsMabProtectionPolicy() (*MabProtectionPolicy, bool) + AsProtectionPolicy() (*ProtectionPolicy, bool) +} + +// ProtectionPolicy base class for backup policy. Workload-specific backup policies are derived from this +// class. +type ProtectionPolicy struct { + // ProtectedItemsCount - Number of items associated with this policy. + ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"` + // ResourceGuardOperationRequests - ResourceGuard Operation Requests + ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` + // BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureWorkload', 'BackupManagementTypeAzureStorage', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeAzureSQL', 'BackupManagementTypeGenericProtectionPolicy', 'BackupManagementTypeMAB' + BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"` +} + +func unmarshalBasicProtectionPolicy(body []byte) (BasicProtectionPolicy, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["backupManagementType"] { + case string(BackupManagementTypeAzureWorkload): + var avwpp AzureVMWorkloadProtectionPolicy + err := json.Unmarshal(body, &avwpp) + return avwpp, err + case string(BackupManagementTypeAzureStorage): + var afspp AzureFileShareProtectionPolicy + err := json.Unmarshal(body, &afspp) + return afspp, err + case string(BackupManagementTypeAzureIaasVM): + var aispp AzureIaaSVMProtectionPolicy + err := json.Unmarshal(body, &aispp) + return aispp, err + case string(BackupManagementTypeAzureSQL): + var aspp AzureSQLProtectionPolicy + err := json.Unmarshal(body, &aspp) + return aspp, err + case string(BackupManagementTypeGenericProtectionPolicy): + var gpp GenericProtectionPolicy + err := json.Unmarshal(body, &gpp) + return gpp, err + case string(BackupManagementTypeMAB): + var mpp MabProtectionPolicy + err := json.Unmarshal(body, &mpp) + return mpp, err + default: + var pp ProtectionPolicy + err := json.Unmarshal(body, &pp) + return pp, err + } +} +func unmarshalBasicProtectionPolicyArray(body []byte) ([]BasicProtectionPolicy, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ppArray := make([]BasicProtectionPolicy, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pp, err := unmarshalBasicProtectionPolicy(*rawMessage) + if err != nil { + return nil, err + } + ppArray[index] = pp + } + return ppArray, nil +} + +// MarshalJSON is the custom marshaler for ProtectionPolicy. +func (pp ProtectionPolicy) MarshalJSON() ([]byte, error) { + pp.BackupManagementType = BackupManagementTypeProtectionPolicy + objectMap := make(map[string]interface{}) + if pp.ProtectedItemsCount != nil { + objectMap["protectedItemsCount"] = pp.ProtectedItemsCount + } + if pp.ResourceGuardOperationRequests != nil { + objectMap["resourceGuardOperationRequests"] = pp.ResourceGuardOperationRequests + } + if pp.BackupManagementType != "" { + objectMap["backupManagementType"] = pp.BackupManagementType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsAzureVMWorkloadProtectionPolicy() (*AzureVMWorkloadProtectionPolicy, bool) { + return nil, false +} + +// AsAzureFileShareProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) { + return nil, false +} + +// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) { + return nil, false +} + +// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) { + return nil, false +} + +// AsGenericProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsGenericProtectionPolicy() (*GenericProtectionPolicy, bool) { + return nil, false +} + +// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) { + return nil, false +} + +// AsProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) { + return &pp, true +} + +// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy. +func (pp ProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) { + return &pp, true +} + +// ProtectionPolicyQueryObject filters the list backup policies API. +type ProtectionPolicyQueryObject struct { + // BackupManagementType - Backup management type for the backup policy. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // FabricName - Fabric name for filter + FabricName *string `json:"fabricName,omitempty"` + // WorkloadType - Workload type for the backup policy. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase', 'WorkloadTypeSAPAseDatabase' + WorkloadType WorkloadType `json:"workloadType,omitempty"` +} + +// ProtectionPolicyResource base class for backup policy. Workload-specific backup policies are derived +// from this class. +type ProtectionPolicyResource struct { + autorest.Response `json:"-"` + // Properties - ProtectionPolicyResource properties + Properties BasicProtectionPolicy `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProtectionPolicyResource. +func (ppr ProtectionPolicyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = ppr.Properties + if ppr.Location != nil { + objectMap["location"] = ppr.Location + } + if ppr.Tags != nil { + objectMap["tags"] = ppr.Tags + } + if ppr.ETag != nil { + objectMap["eTag"] = ppr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ProtectionPolicyResource struct. +func (ppr *ProtectionPolicyResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicProtectionPolicy(*v) + if err != nil { + return err + } + ppr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ppr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ppr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ppr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ppr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ppr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + ppr.ETag = &eTag + } + } + } + + return nil +} + +// ProtectionPolicyResourceList list of ProtectionPolicy resources +type ProtectionPolicyResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]ProtectionPolicyResource `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"` +} + +// ProtectionPolicyResourceListIterator provides access to a complete listing of ProtectionPolicyResource +// values. +type ProtectionPolicyResourceListIterator struct { + i int + page ProtectionPolicyResourceListPage +} + +// NextWithContext 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 *ProtectionPolicyResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionPolicyResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProtectionPolicyResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectionPolicyResourceListIterator) 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 ProtectionPolicyResourceListIterator) Response() ProtectionPolicyResourceList { + 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 ProtectionPolicyResourceListIterator) Value() ProtectionPolicyResource { + if !iter.page.NotDone() { + return ProtectionPolicyResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProtectionPolicyResourceListIterator type. +func NewProtectionPolicyResourceListIterator(page ProtectionPolicyResourceListPage) ProtectionPolicyResourceListIterator { + return ProtectionPolicyResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pprl ProtectionPolicyResourceList) IsEmpty() bool { + return pprl.Value == nil || len(*pprl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pprl ProtectionPolicyResourceList) hasNextLink() bool { + return pprl.NextLink != nil && len(*pprl.NextLink) != 0 +} + +// protectionPolicyResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pprl ProtectionPolicyResourceList) protectionPolicyResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !pprl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pprl.NextLink))) +} + +// ProtectionPolicyResourceListPage contains a page of ProtectionPolicyResource values. +type ProtectionPolicyResourceListPage struct { + fn func(context.Context, ProtectionPolicyResourceList) (ProtectionPolicyResourceList, error) + pprl ProtectionPolicyResourceList +} + +// NextWithContext 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 *ProtectionPolicyResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionPolicyResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pprl) + if err != nil { + return err + } + page.pprl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *ProtectionPolicyResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectionPolicyResourceListPage) NotDone() bool { + return !page.pprl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectionPolicyResourceListPage) Response() ProtectionPolicyResourceList { + return page.pprl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectionPolicyResourceListPage) Values() []ProtectionPolicyResource { + if page.pprl.IsEmpty() { + return nil + } + return *page.pprl.Value +} + +// Creates a new instance of the ProtectionPolicyResourceListPage type. +func NewProtectionPolicyResourceListPage(cur ProtectionPolicyResourceList, getNextPage func(context.Context, ProtectionPolicyResourceList) (ProtectionPolicyResourceList, error)) ProtectionPolicyResourceListPage { + return ProtectionPolicyResourceListPage{ + fn: getNextPage, + pprl: cur, + } +} + +// BasicRecoveryPoint base class for backup copies. Workload-specific backup copies are derived from this class. +type BasicRecoveryPoint interface { + AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) + AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) + AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) + AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) + AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) + AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) + AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) + AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) + AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) + AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) + AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) + AsRecoveryPoint() (*RecoveryPoint, bool) +} + +// RecoveryPoint base class for backup copies. Workload-specific backup copies are derived from this class. +type RecoveryPoint struct { + // ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeAzureFileShareRecoveryPoint', 'ObjectTypeAzureWorkloadPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSAPHanaRecoveryPoint', 'ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint', 'ObjectTypeAzureWorkloadSQLRecoveryPoint', 'ObjectTypeGenericRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint' + ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"` +} + +func unmarshalBasicRecoveryPoint(body []byte) (BasicRecoveryPoint, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureFileShareRecoveryPoint): + var afsrp AzureFileShareRecoveryPoint + err := json.Unmarshal(body, &afsrp) + return afsrp, err + case string(ObjectTypeAzureWorkloadPointInTimeRecoveryPoint): + var awpitrp AzureWorkloadPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awpitrp) + return awpitrp, err + case string(ObjectTypeAzureWorkloadRecoveryPoint): + var awrp AzureWorkloadRecoveryPoint + err := json.Unmarshal(body, &awrp) + return awrp, err + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRecoveryPoint): + var awshpitrp AzureWorkloadSAPHanaPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awshpitrp) + return awshpitrp, err + case string(ObjectTypeAzureWorkloadSAPHanaRecoveryPoint): + var awshrp AzureWorkloadSAPHanaRecoveryPoint + err := json.Unmarshal(body, &awshrp) + return awshrp, err + case string(ObjectTypeAzureWorkloadSQLPointInTimeRecoveryPoint): + var awspitrp AzureWorkloadSQLPointInTimeRecoveryPoint + err := json.Unmarshal(body, &awspitrp) + return awspitrp, err + case string(ObjectTypeAzureWorkloadSQLRecoveryPoint): + var awsrp AzureWorkloadSQLRecoveryPoint + err := json.Unmarshal(body, &awsrp) + return awsrp, err + case string(ObjectTypeGenericRecoveryPoint): + var grp GenericRecoveryPoint + err := json.Unmarshal(body, &grp) + return grp, err + case string(ObjectTypeIaasVMRecoveryPoint): + var ivrp IaasVMRecoveryPoint + err := json.Unmarshal(body, &ivrp) + return ivrp, err + default: + var rp RecoveryPoint + err := json.Unmarshal(body, &rp) + return rp, err + } +} +func unmarshalBasicRecoveryPointArray(body []byte) ([]BasicRecoveryPoint, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpArray := make([]BasicRecoveryPoint, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rp, err := unmarshalBasicRecoveryPoint(*rawMessage) + if err != nil { + return nil, err + } + rpArray[index] = rp + } + return rpArray, nil +} + +// MarshalJSON is the custom marshaler for RecoveryPoint. +func (rp RecoveryPoint) MarshalJSON() ([]byte, error) { + rp.ObjectType = ObjectTypeRecoveryPoint + objectMap := make(map[string]interface{}) + if rp.ObjectType != "" { + objectMap["objectType"] = rp.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureFileShareRecoveryPoint() (*AzureFileShareRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadPointInTimeRecoveryPoint() (*AzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsBasicAzureWorkloadPointInTimeRecoveryPoint() (BasicAzureWorkloadPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadRecoveryPoint() (*AzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsBasicAzureWorkloadRecoveryPoint() (BasicAzureWorkloadRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadSAPHanaPointInTimeRecoveryPoint() (*AzureWorkloadSAPHanaPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadSAPHanaRecoveryPoint() (*AzureWorkloadSAPHanaRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadSQLPointInTimeRecoveryPoint() (*AzureWorkloadSQLPointInTimeRecoveryPoint, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsAzureWorkloadSQLRecoveryPoint() (*AzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsBasicAzureWorkloadSQLRecoveryPoint() (BasicAzureWorkloadSQLRecoveryPoint, bool) { + return nil, false +} + +// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) { + return nil, false +} + +// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) { + return nil, false +} + +// AsRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) { + return &rp, true +} + +// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint. +func (rp RecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) { + return &rp, true +} + +// RecoveryPointDiskConfiguration disk configuration +type RecoveryPointDiskConfiguration struct { + // NumberOfDisksIncludedInBackup - Number of disks included in backup + NumberOfDisksIncludedInBackup *int32 `json:"numberOfDisksIncludedInBackup,omitempty"` + // NumberOfDisksAttachedToVM - Number of disks attached to the VM + NumberOfDisksAttachedToVM *int32 `json:"numberOfDisksAttachedToVm,omitempty"` + // IncludedDiskList - Information of disks included in backup + IncludedDiskList *[]DiskInformation `json:"includedDiskList,omitempty"` + // ExcludedDiskList - Information of disks excluded from backup + ExcludedDiskList *[]DiskInformation `json:"excludedDiskList,omitempty"` +} + +// RecoveryPointMoveReadinessInfo ... +type RecoveryPointMoveReadinessInfo struct { + IsReadyForMove *bool `json:"isReadyForMove,omitempty"` + AdditionalInfo *string `json:"additionalInfo,omitempty"` +} + +// RecoveryPointRehydrationInfo RP Rehydration Info +type RecoveryPointRehydrationInfo struct { + // RehydrationRetentionDuration - How long the rehydrated RP should be kept + // Should be ISO8601 Duration format e.g. "P7D" + RehydrationRetentionDuration *string `json:"rehydrationRetentionDuration,omitempty"` + // RehydrationPriority - Rehydration Priority. Possible values include: 'Standard', 'High' + RehydrationPriority RehydrationPriority `json:"rehydrationPriority,omitempty"` +} + +// RecoveryPointResource base class for backup copies. Workload-specific backup copies are derived from +// this class. +type RecoveryPointResource struct { + autorest.Response `json:"-"` + // Properties - RecoveryPointResource properties + Properties BasicRecoveryPoint `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryPointResource. +func (rpr RecoveryPointResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = rpr.Properties + if rpr.Location != nil { + objectMap["location"] = rpr.Location + } + if rpr.Tags != nil { + objectMap["tags"] = rpr.Tags + } + if rpr.ETag != nil { + objectMap["eTag"] = rpr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RecoveryPointResource struct. +func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicRecoveryPoint(*v) + if err != nil { + return err + } + rpr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rpr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rpr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rpr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rpr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rpr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + rpr.ETag = &eTag + } + } + } + + return nil +} + +// RecoveryPointResourceList list of RecoveryPoint resources +type RecoveryPointResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]RecoveryPointResource `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"` +} + +// RecoveryPointResourceListIterator provides access to a complete listing of RecoveryPointResource values. +type RecoveryPointResourceListIterator struct { + i int + page RecoveryPointResourceListPage +} + +// NextWithContext 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 *RecoveryPointResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecoveryPointResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecoveryPointResourceListIterator) 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 RecoveryPointResourceListIterator) Response() RecoveryPointResourceList { + 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 RecoveryPointResourceListIterator) Value() RecoveryPointResource { + if !iter.page.NotDone() { + return RecoveryPointResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecoveryPointResourceListIterator type. +func NewRecoveryPointResourceListIterator(page RecoveryPointResourceListPage) RecoveryPointResourceListIterator { + return RecoveryPointResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rprl RecoveryPointResourceList) IsEmpty() bool { + return rprl.Value == nil || len(*rprl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rprl RecoveryPointResourceList) hasNextLink() bool { + return rprl.NextLink != nil && len(*rprl.NextLink) != 0 +} + +// recoveryPointResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rprl RecoveryPointResourceList) recoveryPointResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !rprl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rprl.NextLink))) +} + +// RecoveryPointResourceListPage contains a page of RecoveryPointResource values. +type RecoveryPointResourceListPage struct { + fn func(context.Context, RecoveryPointResourceList) (RecoveryPointResourceList, error) + rprl RecoveryPointResourceList +} + +// NextWithContext 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 *RecoveryPointResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rprl) + if err != nil { + return err + } + page.rprl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *RecoveryPointResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecoveryPointResourceListPage) NotDone() bool { + return !page.rprl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecoveryPointResourceListPage) Response() RecoveryPointResourceList { + return page.rprl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecoveryPointResourceListPage) Values() []RecoveryPointResource { + if page.rprl.IsEmpty() { + return nil + } + return *page.rprl.Value +} + +// Creates a new instance of the RecoveryPointResourceListPage type. +func NewRecoveryPointResourceListPage(cur RecoveryPointResourceList, getNextPage func(context.Context, RecoveryPointResourceList) (RecoveryPointResourceList, error)) RecoveryPointResourceListPage { + return RecoveryPointResourceListPage{ + fn: getNextPage, + rprl: cur, + } +} + +// RecoveryPointTierInformation recovery point tier information. +type RecoveryPointTierInformation struct { + // Type - Recovery point tier type. Possible values include: 'RecoveryPointTierTypeInvalid', 'RecoveryPointTierTypeInstantRP', 'RecoveryPointTierTypeHardenedRP', 'RecoveryPointTierTypeArchivedRP' + Type RecoveryPointTierType `json:"type,omitempty"` + // Status - Recovery point tier status. Possible values include: 'RecoveryPointTierStatusInvalid', 'RecoveryPointTierStatusValid', 'RecoveryPointTierStatusDisabled', 'RecoveryPointTierStatusDeleted', 'RecoveryPointTierStatusRehydrated' + Status RecoveryPointTierStatus `json:"status,omitempty"` + // ExtendedInfo - Recovery point tier status. + ExtendedInfo map[string]*string `json:"extendedInfo"` +} + +// MarshalJSON is the custom marshaler for RecoveryPointTierInformation. +func (rpti RecoveryPointTierInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpti.Type != "" { + objectMap["type"] = rpti.Type + } + if rpti.Status != "" { + objectMap["status"] = rpti.Status + } + if rpti.ExtendedInfo != nil { + objectMap["extendedInfo"] = rpti.ExtendedInfo + } + return json.Marshal(objectMap) +} + +// RecoveryPointTierInformationV2 recoveryPoint Tier Information V2 +type RecoveryPointTierInformationV2 struct { + // Type - Recovery point tier type. Possible values include: 'RecoveryPointTierTypeInvalid', 'RecoveryPointTierTypeInstantRP', 'RecoveryPointTierTypeHardenedRP', 'RecoveryPointTierTypeArchivedRP' + Type RecoveryPointTierType `json:"type,omitempty"` + // Status - Recovery point tier status. Possible values include: 'RecoveryPointTierStatusInvalid', 'RecoveryPointTierStatusValid', 'RecoveryPointTierStatusDisabled', 'RecoveryPointTierStatusDeleted', 'RecoveryPointTierStatusRehydrated' + Status RecoveryPointTierStatus `json:"status,omitempty"` + // ExtendedInfo - Recovery point tier status. + ExtendedInfo map[string]*string `json:"extendedInfo"` +} + +// MarshalJSON is the custom marshaler for RecoveryPointTierInformationV2. +func (rptiv RecoveryPointTierInformationV2) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rptiv.Type != "" { + objectMap["type"] = rptiv.Type + } + if rptiv.Status != "" { + objectMap["status"] = rptiv.Status + } + if rptiv.ExtendedInfo != nil { + objectMap["extendedInfo"] = rptiv.ExtendedInfo + } + return json.Marshal(objectMap) +} + +// BasicRequest base class for backup request. Workload-specific backup requests are derived from this class. +type BasicRequest interface { + AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) + AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) + AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) + AsRequest() (*Request, bool) +} + +// Request base class for backup request. Workload-specific backup requests are derived from this class. +type Request struct { + // ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeAzureFileShareBackupRequest', 'ObjectTypeAzureWorkloadBackupRequest', 'ObjectTypeIaasVMBackupRequest' + ObjectType ObjectTypeBasicRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicRequest(body []byte) (BasicRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureFileShareBackupRequest): + var afsbr AzureFileShareBackupRequest + err := json.Unmarshal(body, &afsbr) + return afsbr, err + case string(ObjectTypeAzureWorkloadBackupRequest): + var awbr AzureWorkloadBackupRequest + err := json.Unmarshal(body, &awbr) + return awbr, err + case string(ObjectTypeIaasVMBackupRequest): + var ivbr IaasVMBackupRequest + err := json.Unmarshal(body, &ivbr) + return ivbr, err + default: + var r Request + err := json.Unmarshal(body, &r) + return r, err + } +} +func unmarshalBasicRequestArray(body []byte) ([]BasicRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rArray := make([]BasicRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + r, err := unmarshalBasicRequest(*rawMessage) + if err != nil { + return nil, err + } + rArray[index] = r + } + return rArray, nil +} + +// MarshalJSON is the custom marshaler for Request. +func (r Request) MarshalJSON() ([]byte, error) { + r.ObjectType = ObjectTypeBackupRequest + objectMap := make(map[string]interface{}) + if r.ObjectType != "" { + objectMap["objectType"] = r.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareBackupRequest is the BasicRequest implementation for Request. +func (r Request) AsAzureFileShareBackupRequest() (*AzureFileShareBackupRequest, bool) { + return nil, false +} + +// AsAzureWorkloadBackupRequest is the BasicRequest implementation for Request. +func (r Request) AsAzureWorkloadBackupRequest() (*AzureWorkloadBackupRequest, bool) { + return nil, false +} + +// AsIaasVMBackupRequest is the BasicRequest implementation for Request. +func (r Request) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) { + return nil, false +} + +// AsRequest is the BasicRequest implementation for Request. +func (r Request) AsRequest() (*Request, bool) { + return &r, true +} + +// AsBasicRequest is the BasicRequest implementation for Request. +func (r Request) AsBasicRequest() (BasicRequest, bool) { + return &r, true +} + +// RequestResource base class for backup request. Workload-specific backup requests are derived from this +// class. +type RequestResource struct { + // Properties - BackupRequestResource properties + Properties BasicRequest `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for RequestResource. +func (rr RequestResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = rr.Properties + if rr.Location != nil { + objectMap["location"] = rr.Location + } + if rr.Tags != nil { + objectMap["tags"] = rr.Tags + } + if rr.ETag != nil { + objectMap["eTag"] = rr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RequestResource struct. +func (rr *RequestResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicRequest(*v) + if err != nil { + return err + } + rr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + rr.ETag = &eTag + } + } + } + + return nil +} + +// Resource ARM Resource. +type Resource struct { + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + if r.ETag != nil { + objectMap["eTag"] = r.ETag + } + return json.Marshal(objectMap) +} + +// ResourceConfig the resource storage details. +type ResourceConfig struct { + // StorageModelType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant', 'StorageTypeZoneRedundant', 'StorageTypeReadAccessGeoZoneRedundant' + StorageModelType StorageType `json:"storageModelType,omitempty"` + // StorageType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant', 'StorageTypeZoneRedundant', 'StorageTypeReadAccessGeoZoneRedundant' + StorageType StorageType `json:"storageType,omitempty"` + // StorageTypeState - Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. Possible values include: 'StorageTypeStateInvalid', 'StorageTypeStateLocked', 'StorageTypeStateUnlocked' + StorageTypeState StorageTypeState `json:"storageTypeState,omitempty"` + // CrossRegionRestoreFlag - Opt in details of Cross Region Restore feature. + CrossRegionRestoreFlag *bool `json:"crossRegionRestoreFlag,omitempty"` + // DedupState - Vault Dedup state. Possible values include: 'DedupStateInvalid', 'DedupStateEnabled', 'DedupStateDisabled' + DedupState DedupState `json:"dedupState,omitempty"` + // XcoolState - Vault x-cool state. Possible values include: 'XcoolStateInvalid', 'XcoolStateEnabled', 'XcoolStateDisabled' + XcoolState XcoolState `json:"xcoolState,omitempty"` +} + +// ResourceConfigResource the resource storage details. +type ResourceConfigResource struct { + autorest.Response `json:"-"` + // Properties - BackupResourceConfigResource properties + Properties *ResourceConfig `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceConfigResource. +func (rcr ResourceConfigResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rcr.Properties != nil { + objectMap["properties"] = rcr.Properties + } + if rcr.Location != nil { + objectMap["location"] = rcr.Location + } + if rcr.Tags != nil { + objectMap["tags"] = rcr.Tags + } + if rcr.ETag != nil { + objectMap["eTag"] = rcr.ETag + } + return json.Marshal(objectMap) +} + +// ResourceEncryptionConfig ... +type ResourceEncryptionConfig struct { + // EncryptionAtRestType - Encryption At Rest Type. Possible values include: 'EncryptionAtRestTypeInvalid', 'EncryptionAtRestTypeMicrosoftManaged', 'EncryptionAtRestTypeCustomerManaged' + EncryptionAtRestType EncryptionAtRestType `json:"encryptionAtRestType,omitempty"` + // KeyURI - Key Vault Key URI + KeyURI *string `json:"keyUri,omitempty"` + // SubscriptionID - Key Vault Subscription Id + SubscriptionID *string `json:"subscriptionId,omitempty"` + // LastUpdateStatus - Possible values include: 'LastUpdateStatusInvalid', 'LastUpdateStatusNotEnabled', 'LastUpdateStatusPartiallySucceeded', 'LastUpdateStatusPartiallyFailed', 'LastUpdateStatusFailed', 'LastUpdateStatusSucceeded', 'LastUpdateStatusInitialized', 'LastUpdateStatusFirstInitialization' + LastUpdateStatus LastUpdateStatus `json:"lastUpdateStatus,omitempty"` + // InfrastructureEncryptionState - Possible values include: 'InfrastructureEncryptionStateInvalid', 'InfrastructureEncryptionStateDisabled', 'InfrastructureEncryptionStateEnabled' + InfrastructureEncryptionState InfrastructureEncryptionState `json:"infrastructureEncryptionState,omitempty"` +} + +// ResourceEncryptionConfigExtended ... +type ResourceEncryptionConfigExtended struct { + // UserAssignedIdentity - User Assigned Identity Id + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` + // UseSystemAssignedIdentity - bool to indicate whether to use system Assigned Identity or not + UseSystemAssignedIdentity *bool `json:"useSystemAssignedIdentity,omitempty"` + // EncryptionAtRestType - Encryption At Rest Type. Possible values include: 'EncryptionAtRestTypeInvalid', 'EncryptionAtRestTypeMicrosoftManaged', 'EncryptionAtRestTypeCustomerManaged' + EncryptionAtRestType EncryptionAtRestType `json:"encryptionAtRestType,omitempty"` + // KeyURI - Key Vault Key URI + KeyURI *string `json:"keyUri,omitempty"` + // SubscriptionID - Key Vault Subscription Id + SubscriptionID *string `json:"subscriptionId,omitempty"` + // LastUpdateStatus - Possible values include: 'LastUpdateStatusInvalid', 'LastUpdateStatusNotEnabled', 'LastUpdateStatusPartiallySucceeded', 'LastUpdateStatusPartiallyFailed', 'LastUpdateStatusFailed', 'LastUpdateStatusSucceeded', 'LastUpdateStatusInitialized', 'LastUpdateStatusFirstInitialization' + LastUpdateStatus LastUpdateStatus `json:"lastUpdateStatus,omitempty"` + // InfrastructureEncryptionState - Possible values include: 'InfrastructureEncryptionStateInvalid', 'InfrastructureEncryptionStateDisabled', 'InfrastructureEncryptionStateEnabled' + InfrastructureEncryptionState InfrastructureEncryptionState `json:"infrastructureEncryptionState,omitempty"` +} + +// ResourceEncryptionConfigExtendedResource ... +type ResourceEncryptionConfigExtendedResource struct { + autorest.Response `json:"-"` + // Properties - BackupResourceEncryptionConfigExtendedResource properties + Properties *ResourceEncryptionConfigExtended `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceEncryptionConfigExtendedResource. +func (recer ResourceEncryptionConfigExtendedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if recer.Properties != nil { + objectMap["properties"] = recer.Properties + } + if recer.Location != nil { + objectMap["location"] = recer.Location + } + if recer.Tags != nil { + objectMap["tags"] = recer.Tags + } + if recer.ETag != nil { + objectMap["eTag"] = recer.ETag + } + return json.Marshal(objectMap) +} + +// ResourceEncryptionConfigResource ... +type ResourceEncryptionConfigResource struct { + // Properties - BackupResourceEncryptionConfigResource properties + Properties *ResourceEncryptionConfig `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceEncryptionConfigResource. +func (recr ResourceEncryptionConfigResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if recr.Properties != nil { + objectMap["properties"] = recr.Properties + } + if recr.Location != nil { + objectMap["location"] = recr.Location + } + if recr.Tags != nil { + objectMap["tags"] = recr.Tags + } + if recr.ETag != nil { + objectMap["eTag"] = recr.ETag + } + return json.Marshal(objectMap) +} + +// ResourceGuardOperationDetail ... +type ResourceGuardOperationDetail struct { + VaultCriticalOperation *string `json:"vaultCriticalOperation,omitempty"` + DefaultResourceRequest *string `json:"defaultResourceRequest,omitempty"` +} + +// ResourceGuardProxyBase ... +type ResourceGuardProxyBase struct { + ResourceGuardResourceID *string `json:"resourceGuardResourceId,omitempty"` + ResourceGuardOperationDetails *[]ResourceGuardOperationDetail `json:"resourceGuardOperationDetails,omitempty"` + LastUpdatedTime *string `json:"lastUpdatedTime,omitempty"` + Description *string `json:"description,omitempty"` +} + +// ResourceGuardProxyBaseResource ... +type ResourceGuardProxyBaseResource struct { + autorest.Response `json:"-"` + // Properties - ResourceGuardProxyBaseResource properties + Properties *ResourceGuardProxyBase `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceGuardProxyBaseResource. +func (rgpbr ResourceGuardProxyBaseResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rgpbr.Properties != nil { + objectMap["properties"] = rgpbr.Properties + } + if rgpbr.Location != nil { + objectMap["location"] = rgpbr.Location + } + if rgpbr.Tags != nil { + objectMap["tags"] = rgpbr.Tags + } + if rgpbr.ETag != nil { + objectMap["eTag"] = rgpbr.ETag + } + return json.Marshal(objectMap) +} + +// ResourceGuardProxyBaseResourceList list of ResourceGuardProxyBase resources +type ResourceGuardProxyBaseResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]ResourceGuardProxyBaseResource `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"` +} + +// ResourceGuardProxyBaseResourceListIterator provides access to a complete listing of +// ResourceGuardProxyBaseResource values. +type ResourceGuardProxyBaseResourceListIterator struct { + i int + page ResourceGuardProxyBaseResourceListPage +} + +// NextWithContext 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 *ResourceGuardProxyBaseResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceGuardProxyBaseResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ResourceGuardProxyBaseResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ResourceGuardProxyBaseResourceListIterator) 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 ResourceGuardProxyBaseResourceListIterator) Response() ResourceGuardProxyBaseResourceList { + 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 ResourceGuardProxyBaseResourceListIterator) Value() ResourceGuardProxyBaseResource { + if !iter.page.NotDone() { + return ResourceGuardProxyBaseResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ResourceGuardProxyBaseResourceListIterator type. +func NewResourceGuardProxyBaseResourceListIterator(page ResourceGuardProxyBaseResourceListPage) ResourceGuardProxyBaseResourceListIterator { + return ResourceGuardProxyBaseResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rgpbrl ResourceGuardProxyBaseResourceList) IsEmpty() bool { + return rgpbrl.Value == nil || len(*rgpbrl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rgpbrl ResourceGuardProxyBaseResourceList) hasNextLink() bool { + return rgpbrl.NextLink != nil && len(*rgpbrl.NextLink) != 0 +} + +// resourceGuardProxyBaseResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rgpbrl ResourceGuardProxyBaseResourceList) resourceGuardProxyBaseResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !rgpbrl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rgpbrl.NextLink))) +} + +// ResourceGuardProxyBaseResourceListPage contains a page of ResourceGuardProxyBaseResource values. +type ResourceGuardProxyBaseResourceListPage struct { + fn func(context.Context, ResourceGuardProxyBaseResourceList) (ResourceGuardProxyBaseResourceList, error) + rgpbrl ResourceGuardProxyBaseResourceList +} + +// NextWithContext 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 *ResourceGuardProxyBaseResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceGuardProxyBaseResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rgpbrl) + if err != nil { + return err + } + page.rgpbrl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *ResourceGuardProxyBaseResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ResourceGuardProxyBaseResourceListPage) NotDone() bool { + return !page.rgpbrl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ResourceGuardProxyBaseResourceListPage) Response() ResourceGuardProxyBaseResourceList { + return page.rgpbrl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ResourceGuardProxyBaseResourceListPage) Values() []ResourceGuardProxyBaseResource { + if page.rgpbrl.IsEmpty() { + return nil + } + return *page.rgpbrl.Value +} + +// Creates a new instance of the ResourceGuardProxyBaseResourceListPage type. +func NewResourceGuardProxyBaseResourceListPage(cur ResourceGuardProxyBaseResourceList, getNextPage func(context.Context, ResourceGuardProxyBaseResourceList) (ResourceGuardProxyBaseResourceList, error)) ResourceGuardProxyBaseResourceListPage { + return ResourceGuardProxyBaseResourceListPage{ + fn: getNextPage, + rgpbrl: cur, + } +} + +// ResourceHealthDetails health Details for backup items. +type ResourceHealthDetails struct { + // Code - READ-ONLY; Health Code + Code *int32 `json:"code,omitempty"` + // Title - READ-ONLY; Health Title + Title *string `json:"title,omitempty"` + // Message - READ-ONLY; Health Message + Message *string `json:"message,omitempty"` + // Recommendations - READ-ONLY; Health Recommended Actions + Recommendations *[]string `json:"recommendations,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceHealthDetails. +func (rhd ResourceHealthDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResourceList base for all lists of resources. +type ResourceList struct { + // NextLink - The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// ResourceVaultConfig backup resource vault config details. +type ResourceVaultConfig struct { + // StorageModelType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant', 'StorageTypeZoneRedundant', 'StorageTypeReadAccessGeoZoneRedundant' + StorageModelType StorageType `json:"storageModelType,omitempty"` + // StorageType - Storage type. Possible values include: 'StorageTypeInvalid', 'StorageTypeGeoRedundant', 'StorageTypeLocallyRedundant', 'StorageTypeZoneRedundant', 'StorageTypeReadAccessGeoZoneRedundant' + StorageType StorageType `json:"storageType,omitempty"` + // StorageTypeState - Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. Possible values include: 'StorageTypeStateInvalid', 'StorageTypeStateLocked', 'StorageTypeStateUnlocked' + StorageTypeState StorageTypeState `json:"storageTypeState,omitempty"` + // EnhancedSecurityState - Enabled or Disabled. Possible values include: 'EnhancedSecurityStateInvalid', 'EnhancedSecurityStateEnabled', 'EnhancedSecurityStateDisabled' + EnhancedSecurityState EnhancedSecurityState `json:"enhancedSecurityState,omitempty"` + // SoftDeleteFeatureState - Soft Delete feature state. Possible values include: 'SoftDeleteFeatureStateInvalid', 'SoftDeleteFeatureStateEnabled', 'SoftDeleteFeatureStateDisabled' + SoftDeleteFeatureState SoftDeleteFeatureState `json:"softDeleteFeatureState,omitempty"` + // ResourceGuardOperationRequests - ResourceGuard Operation Requests + ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` + // IsSoftDeleteFeatureStateEditable - Is soft delete feature state editable + IsSoftDeleteFeatureStateEditable *bool `json:"isSoftDeleteFeatureStateEditable,omitempty"` +} + +// ResourceVaultConfigResource backup resource vault config details. +type ResourceVaultConfigResource struct { + autorest.Response `json:"-"` + // Properties - BackupResourceVaultConfigResource properties + Properties *ResourceVaultConfig `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceVaultConfigResource. +func (rvcr ResourceVaultConfigResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rvcr.Properties != nil { + objectMap["properties"] = rvcr.Properties + } + if rvcr.Location != nil { + objectMap["location"] = rvcr.Location + } + if rvcr.Tags != nil { + objectMap["tags"] = rvcr.Tags + } + if rvcr.ETag != nil { + objectMap["eTag"] = rvcr.ETag + } + return json.Marshal(objectMap) +} + +// RestoreFileSpecs restore file specs like file path, type and target folder path info. +type RestoreFileSpecs struct { + // Path - Source File/Folder path + Path *string `json:"path,omitempty"` + // FileSpecType - Indicates what the Path variable stands for + FileSpecType *string `json:"fileSpecType,omitempty"` + // TargetFolderPath - Destination folder path in target FileShare + TargetFolderPath *string `json:"targetFolderPath,omitempty"` +} + +// BasicRestoreRequest base class for restore request. Workload-specific restore requests are derived from this class. +type BasicRestoreRequest interface { + AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) + AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) + AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) + AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) + AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) + AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest() (BasicAzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) + AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) + AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) + AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) + AsBasicAzureWorkloadSQLPointInTimeRestoreRequest() (BasicAzureWorkloadSQLPointInTimeRestoreRequest, bool) + AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) + AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) + AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) + AsBasicIaasVMRestoreRequest() (BasicIaasVMRestoreRequest, bool) + AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, bool) + AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaRestoreWithRehydrateRequest, bool) + AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, bool) + AsAzureWorkloadSQLRestoreWithRehydrateRequest() (*AzureWorkloadSQLRestoreWithRehydrateRequest, bool) + AsIaasVMRestoreWithRehydrationRequest() (*IaasVMRestoreWithRehydrationRequest, bool) + AsRestoreRequest() (*RestoreRequest, bool) +} + +// RestoreRequest base class for restore request. Workload-specific restore requests are derived from this +// class. +type RestoreRequest struct { + // ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeAzureFileShareRestoreRequest', 'ObjectTypeAzureWorkloadPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest', 'ObjectTypeAzureWorkloadSQLRestoreRequest', 'ObjectTypeIaasVMRestoreRequest', 'ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest', 'ObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest', 'ObjectTypeIaasVMRestoreWithRehydrationRequest' + ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicRestoreRequest(body []byte) (BasicRestoreRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeAzureFileShareRestoreRequest): + var afsrr AzureFileShareRestoreRequest + err := json.Unmarshal(body, &afsrr) + return afsrr, err + case string(ObjectTypeAzureWorkloadPointInTimeRestoreRequest): + var awpitrr AzureWorkloadPointInTimeRestoreRequest + err := json.Unmarshal(body, &awpitrr) + return awpitrr, err + case string(ObjectTypeAzureWorkloadRestoreRequest): + var awrr AzureWorkloadRestoreRequest + err := json.Unmarshal(body, &awrr) + return awrr, err + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreRequest): + var awshpitrr AzureWorkloadSAPHanaPointInTimeRestoreRequest + err := json.Unmarshal(body, &awshpitrr) + return awshpitrr, err + case string(ObjectTypeAzureWorkloadSAPHanaRestoreRequest): + var awshrr AzureWorkloadSAPHanaRestoreRequest + err := json.Unmarshal(body, &awshrr) + return awshrr, err + case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreRequest): + var awspitrr AzureWorkloadSQLPointInTimeRestoreRequest + err := json.Unmarshal(body, &awspitrr) + return awspitrr, err + case string(ObjectTypeAzureWorkloadSQLRestoreRequest): + var awsrr AzureWorkloadSQLRestoreRequest + err := json.Unmarshal(body, &awsrr) + return awsrr, err + case string(ObjectTypeIaasVMRestoreRequest): + var ivrr IaasVMRestoreRequest + err := json.Unmarshal(body, &ivrr) + return ivrr, err + case string(ObjectTypeAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest): + var awshpitrwrr AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest + err := json.Unmarshal(body, &awshpitrwrr) + return awshpitrwrr, err + case string(ObjectTypeAzureWorkloadSAPHanaRestoreWithRehydrateRequest): + var awshrwrr AzureWorkloadSAPHanaRestoreWithRehydrateRequest + err := json.Unmarshal(body, &awshrwrr) + return awshrwrr, err + case string(ObjectTypeAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest): + var awspitrwrr AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest + err := json.Unmarshal(body, &awspitrwrr) + return awspitrwrr, err + case string(ObjectTypeAzureWorkloadSQLRestoreWithRehydrateRequest): + var awsrwrr AzureWorkloadSQLRestoreWithRehydrateRequest + err := json.Unmarshal(body, &awsrwrr) + return awsrwrr, err + case string(ObjectTypeIaasVMRestoreWithRehydrationRequest): + var ivrwrr IaasVMRestoreWithRehydrationRequest + err := json.Unmarshal(body, &ivrwrr) + return ivrwrr, err + default: + var rr RestoreRequest + err := json.Unmarshal(body, &rr) + return rr, err + } +} +func unmarshalBasicRestoreRequestArray(body []byte) ([]BasicRestoreRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rrArray := make([]BasicRestoreRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rr, err := unmarshalBasicRestoreRequest(*rawMessage) + if err != nil { + return nil, err + } + rrArray[index] = rr + } + return rrArray, nil +} + +// MarshalJSON is the custom marshaler for RestoreRequest. +func (rr RestoreRequest) MarshalJSON() ([]byte, error) { + rr.ObjectType = ObjectTypeRestoreRequest + objectMap := make(map[string]interface{}) + if rr.ObjectType != "" { + objectMap["objectType"] = rr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureFileShareRestoreRequest() (*AzureFileShareRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadPointInTimeRestoreRequest() (*AzureWorkloadPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadRestoreRequest() (*AzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsBasicAzureWorkloadRestoreRequest() (BasicAzureWorkloadRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsBasicAzureWorkloadSAPHanaPointInTimeRestoreRequest() (BasicAzureWorkloadSAPHanaPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadSAPHanaRestoreRequest() (*AzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSAPHanaRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsBasicAzureWorkloadSAPHanaRestoreRequest() (BasicAzureWorkloadSAPHanaRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreRequest() (*AzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLPointInTimeRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsBasicAzureWorkloadSQLPointInTimeRestoreRequest() (BasicAzureWorkloadSQLPointInTimeRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadSQLRestoreRequest() (*AzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsBasicAzureWorkloadSQLRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsBasicAzureWorkloadSQLRestoreRequest() (BasicAzureWorkloadSQLRestoreRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) { + return nil, false +} + +// AsBasicIaasVMRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsBasicIaasVMRestoreRequest() (BasicIaasVMRestoreRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadSAPHanaRestoreWithRehydrateRequest() (*AzureWorkloadSAPHanaRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest() (*AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsAzureWorkloadSQLRestoreWithRehydrateRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsAzureWorkloadSQLRestoreWithRehydrateRequest() (*AzureWorkloadSQLRestoreWithRehydrateRequest, bool) { + return nil, false +} + +// AsIaasVMRestoreWithRehydrationRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsIaasVMRestoreWithRehydrationRequest() (*IaasVMRestoreWithRehydrationRequest, bool) { + return nil, false +} + +// AsRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) { + return &rr, true +} + +// AsBasicRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest. +func (rr RestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) { + return &rr, true +} + +// RestoreRequestResource base class for restore request. Workload-specific restore requests are derived +// from this class. +type RestoreRequestResource struct { + // Properties - RestoreRequestResource properties + Properties BasicRestoreRequest `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestoreRequestResource. +func (rrr RestoreRequestResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = rrr.Properties + if rrr.Location != nil { + objectMap["location"] = rrr.Location + } + if rrr.Tags != nil { + objectMap["tags"] = rrr.Tags + } + if rrr.ETag != nil { + objectMap["eTag"] = rrr.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RestoreRequestResource struct. +func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicRestoreRequest(*v) + if err != nil { + return err + } + rrr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rrr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rrr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rrr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rrr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rrr.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + rrr.ETag = &eTag + } + } + } + + return nil +} + +// RestoresTriggerFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RestoresTriggerFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RestoresClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RestoresTriggerFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RestoresTriggerFuture.Result. +func (future *RestoresTriggerFuture) result(client RestoresClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.RestoresTriggerFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("backup.RestoresTriggerFuture") + return + } + ar.Response = future.Response() + return +} + +// RetentionDuration retention duration. +type RetentionDuration struct { + // Count - Count of duration types. Retention duration is obtained by the counting the duration type Count times. + // For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks. + Count *int32 `json:"count,omitempty"` + // DurationType - Retention duration type of retention policy. Possible values include: 'RetentionDurationTypeInvalid', 'RetentionDurationTypeDays', 'RetentionDurationTypeWeeks', 'RetentionDurationTypeMonths', 'RetentionDurationTypeYears' + DurationType RetentionDurationType `json:"durationType,omitempty"` +} + +// BasicRetentionPolicy base class for retention policy. +type BasicRetentionPolicy interface { + AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) + AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) + AsRetentionPolicy() (*RetentionPolicy, bool) +} + +// RetentionPolicy base class for retention policy. +type RetentionPolicy struct { + // RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy' + RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"` +} + +func unmarshalBasicRetentionPolicy(body []byte) (BasicRetentionPolicy, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["retentionPolicyType"] { + case string(RetentionPolicyTypeLongTermRetentionPolicy): + var ltrp LongTermRetentionPolicy + err := json.Unmarshal(body, <rp) + return ltrp, err + case string(RetentionPolicyTypeSimpleRetentionPolicy): + var srp SimpleRetentionPolicy + err := json.Unmarshal(body, &srp) + return srp, err + default: + var rp RetentionPolicy + err := json.Unmarshal(body, &rp) + return rp, err + } +} +func unmarshalBasicRetentionPolicyArray(body []byte) ([]BasicRetentionPolicy, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rpArray := make([]BasicRetentionPolicy, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rp, err := unmarshalBasicRetentionPolicy(*rawMessage) + if err != nil { + return nil, err + } + rpArray[index] = rp + } + return rpArray, nil +} + +// MarshalJSON is the custom marshaler for RetentionPolicy. +func (rp RetentionPolicy) MarshalJSON() ([]byte, error) { + rp.RetentionPolicyType = RetentionPolicyTypeRetentionPolicy + objectMap := make(map[string]interface{}) + if rp.RetentionPolicyType != "" { + objectMap["retentionPolicyType"] = rp.RetentionPolicyType + } + return json.Marshal(objectMap) +} + +// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. +func (rp RetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) { + return nil, false +} + +// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. +func (rp RetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) { + return nil, false +} + +// AsRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. +func (rp RetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) { + return &rp, true +} + +// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy. +func (rp RetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) { + return &rp, true +} + +// BasicSchedulePolicy base class for backup schedule. +type BasicSchedulePolicy interface { + AsLogSchedulePolicy() (*LogSchedulePolicy, bool) + AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) + AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) + AsSimpleSchedulePolicyV2() (*SimpleSchedulePolicyV2, bool) + AsSchedulePolicy() (*SchedulePolicy, bool) +} + +// SchedulePolicy base class for backup schedule. +type SchedulePolicy struct { + // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicyV2' + SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` +} + +func unmarshalBasicSchedulePolicy(body []byte) (BasicSchedulePolicy, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["schedulePolicyType"] { + case string(SchedulePolicyTypeLogSchedulePolicy): + var lsp LogSchedulePolicy + err := json.Unmarshal(body, &lsp) + return lsp, err + case string(SchedulePolicyTypeLongTermSchedulePolicy): + var ltsp LongTermSchedulePolicy + err := json.Unmarshal(body, <sp) + return ltsp, err + case string(SchedulePolicyTypeSimpleSchedulePolicy): + var ssp SimpleSchedulePolicy + err := json.Unmarshal(body, &ssp) + return ssp, err + case string(SchedulePolicyTypeSimpleSchedulePolicyV2): + var sspv SimpleSchedulePolicyV2 + err := json.Unmarshal(body, &sspv) + return sspv, err + default: + var sp SchedulePolicy + err := json.Unmarshal(body, &sp) + return sp, err + } +} +func unmarshalBasicSchedulePolicyArray(body []byte) ([]BasicSchedulePolicy, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + spArray := make([]BasicSchedulePolicy, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sp, err := unmarshalBasicSchedulePolicy(*rawMessage) + if err != nil { + return nil, err + } + spArray[index] = sp + } + return spArray, nil +} + +// MarshalJSON is the custom marshaler for SchedulePolicy. +func (sp SchedulePolicy) MarshalJSON() ([]byte, error) { + sp.SchedulePolicyType = SchedulePolicyTypeSchedulePolicy + objectMap := make(map[string]interface{}) + if sp.SchedulePolicyType != "" { + objectMap["schedulePolicyType"] = sp.SchedulePolicyType + } + return json.Marshal(objectMap) +} + +// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. +func (sp SchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { + return nil, false +} + +// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. +func (sp SchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { + return nil, false +} + +// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. +func (sp SchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { + return nil, false +} + +// AsSimpleSchedulePolicyV2 is the BasicSchedulePolicy implementation for SchedulePolicy. +func (sp SchedulePolicy) AsSimpleSchedulePolicyV2() (*SimpleSchedulePolicyV2, bool) { + return nil, false +} + +// AsSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. +func (sp SchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { + return &sp, true +} + +// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy. +func (sp SchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { + return &sp, true +} + +// SecurityPinBase base class for get security pin request body +type SecurityPinBase struct { + // ResourceGuardOperationRequests - ResourceGuard Operation Requests + ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` +} + +// Settings common settings field for backup management +type Settings struct { + // TimeZone - TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + TimeZone *string `json:"timeZone,omitempty"` + // Issqlcompression - SQL compression flag + Issqlcompression *bool `json:"issqlcompression,omitempty"` + // IsCompression - Workload compression flag. This has been added so that 'isSqlCompression' + // will be deprecated once clients upgrade to consider this flag. + IsCompression *bool `json:"isCompression,omitempty"` +} + +// SimpleRetentionPolicy simple policy retention. +type SimpleRetentionPolicy struct { + // RetentionDuration - Retention duration of the protection policy. + RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` + // RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy' + RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SimpleRetentionPolicy. +func (srp SimpleRetentionPolicy) MarshalJSON() ([]byte, error) { + srp.RetentionPolicyType = RetentionPolicyTypeSimpleRetentionPolicy + objectMap := make(map[string]interface{}) + if srp.RetentionDuration != nil { + objectMap["retentionDuration"] = srp.RetentionDuration + } + if srp.RetentionPolicyType != "" { + objectMap["retentionPolicyType"] = srp.RetentionPolicyType + } + return json.Marshal(objectMap) +} + +// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. +func (srp SimpleRetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) { + return nil, false +} + +// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. +func (srp SimpleRetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) { + return &srp, true +} + +// AsRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. +func (srp SimpleRetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) { + return nil, false +} + +// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy. +func (srp SimpleRetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) { + return &srp, true +} + +// SimpleSchedulePolicy simple policy schedule. +type SimpleSchedulePolicy struct { + // ScheduleRunFrequency - Frequency of the schedule operation of this policy. Possible values include: 'ScheduleRunTypeInvalid', 'ScheduleRunTypeDaily', 'ScheduleRunTypeWeekly', 'ScheduleRunTypeHourly' + ScheduleRunFrequency ScheduleRunType `json:"scheduleRunFrequency,omitempty"` + // ScheduleRunDays - List of days of week this schedule has to be run. + ScheduleRunDays *[]DayOfWeek `json:"scheduleRunDays,omitempty"` + // ScheduleRunTimes - List of times of day this schedule has to be run. + ScheduleRunTimes *[]date.Time `json:"scheduleRunTimes,omitempty"` + // HourlySchedule - Hourly Schedule of this Policy + HourlySchedule *HourlySchedule `json:"hourlySchedule,omitempty"` + // ScheduleWeeklyFrequency - At every number weeks this schedule has to be run. + ScheduleWeeklyFrequency *int32 `json:"scheduleWeeklyFrequency,omitempty"` + // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicyV2' + SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) MarshalJSON() ([]byte, error) { + ssp.SchedulePolicyType = SchedulePolicyTypeSimpleSchedulePolicy + objectMap := make(map[string]interface{}) + if ssp.ScheduleRunFrequency != "" { + objectMap["scheduleRunFrequency"] = ssp.ScheduleRunFrequency + } + if ssp.ScheduleRunDays != nil { + objectMap["scheduleRunDays"] = ssp.ScheduleRunDays + } + if ssp.ScheduleRunTimes != nil { + objectMap["scheduleRunTimes"] = ssp.ScheduleRunTimes + } + if ssp.HourlySchedule != nil { + objectMap["hourlySchedule"] = ssp.HourlySchedule + } + if ssp.ScheduleWeeklyFrequency != nil { + objectMap["scheduleWeeklyFrequency"] = ssp.ScheduleWeeklyFrequency + } + if ssp.SchedulePolicyType != "" { + objectMap["schedulePolicyType"] = ssp.SchedulePolicyType + } + return json.Marshal(objectMap) +} + +// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { + return nil, false +} + +// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { + return nil, false +} + +// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { + return &ssp, true +} + +// AsSimpleSchedulePolicyV2 is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) AsSimpleSchedulePolicyV2() (*SimpleSchedulePolicyV2, bool) { + return nil, false +} + +// AsSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) { + return nil, false +} + +// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy. +func (ssp SimpleSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { + return &ssp, true +} + +// SimpleSchedulePolicyV2 the V2 policy schedule for IaaS that supports hourly backups. +type SimpleSchedulePolicyV2 struct { + // ScheduleRunFrequency - Frequency of the schedule operation of this policy. Possible values include: 'ScheduleRunTypeInvalid', 'ScheduleRunTypeDaily', 'ScheduleRunTypeWeekly', 'ScheduleRunTypeHourly' + ScheduleRunFrequency ScheduleRunType `json:"scheduleRunFrequency,omitempty"` + // HourlySchedule - hourly schedule of this policy + HourlySchedule *HourlySchedule `json:"hourlySchedule,omitempty"` + // DailySchedule - Daily schedule of this policy + DailySchedule *DailySchedule `json:"dailySchedule,omitempty"` + // WeeklySchedule - Weekly schedule of this policy + WeeklySchedule *WeeklySchedule `json:"weeklySchedule,omitempty"` + // SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLogSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicyV2' + SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SimpleSchedulePolicyV2. +func (sspv SimpleSchedulePolicyV2) MarshalJSON() ([]byte, error) { + sspv.SchedulePolicyType = SchedulePolicyTypeSimpleSchedulePolicyV2 + objectMap := make(map[string]interface{}) + if sspv.ScheduleRunFrequency != "" { + objectMap["scheduleRunFrequency"] = sspv.ScheduleRunFrequency + } + if sspv.HourlySchedule != nil { + objectMap["hourlySchedule"] = sspv.HourlySchedule + } + if sspv.DailySchedule != nil { + objectMap["dailySchedule"] = sspv.DailySchedule + } + if sspv.WeeklySchedule != nil { + objectMap["weeklySchedule"] = sspv.WeeklySchedule + } + if sspv.SchedulePolicyType != "" { + objectMap["schedulePolicyType"] = sspv.SchedulePolicyType + } + return json.Marshal(objectMap) +} + +// AsLogSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicyV2. +func (sspv SimpleSchedulePolicyV2) AsLogSchedulePolicy() (*LogSchedulePolicy, bool) { + return nil, false +} + +// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicyV2. +func (sspv SimpleSchedulePolicyV2) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) { + return nil, false +} + +// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicyV2. +func (sspv SimpleSchedulePolicyV2) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) { + return nil, false +} + +// AsSimpleSchedulePolicyV2 is the BasicSchedulePolicy implementation for SimpleSchedulePolicyV2. +func (sspv SimpleSchedulePolicyV2) AsSimpleSchedulePolicyV2() (*SimpleSchedulePolicyV2, bool) { + return &sspv, true +} + +// AsSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicyV2. +func (sspv SimpleSchedulePolicyV2) AsSchedulePolicy() (*SchedulePolicy, bool) { + return nil, false +} + +// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicyV2. +func (sspv SimpleSchedulePolicyV2) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) { + return &sspv, true +} + +// SQLDataDirectory sQLDataDirectory info +type SQLDataDirectory struct { + // Type - Type of data directory mapping. Possible values include: 'SQLDataDirectoryTypeInvalid', 'SQLDataDirectoryTypeData', 'SQLDataDirectoryTypeLog' + Type SQLDataDirectoryType `json:"type,omitempty"` + // Path - File path + Path *string `json:"path,omitempty"` + // LogicalName - Logical name of the file + LogicalName *string `json:"logicalName,omitempty"` +} + +// SQLDataDirectoryMapping encapsulates information regarding data directory +type SQLDataDirectoryMapping struct { + // MappingType - Type of data directory mapping. Possible values include: 'SQLDataDirectoryTypeInvalid', 'SQLDataDirectoryTypeData', 'SQLDataDirectoryTypeLog' + MappingType SQLDataDirectoryType `json:"mappingType,omitempty"` + // SourceLogicalName - Restore source logical name path + SourceLogicalName *string `json:"sourceLogicalName,omitempty"` + // SourcePath - Restore source path + SourcePath *string `json:"sourcePath,omitempty"` + // TargetPath - Target path + TargetPath *string `json:"targetPath,omitempty"` +} + +// StatusRequest backupStatus request. +type StatusRequest struct { + // ResourceType - Container Type - VM, SQLPaaS, DPM, AzureFileShare. Possible values include: 'DataSourceTypeInvalid', 'DataSourceTypeVM', 'DataSourceTypeFileFolder', 'DataSourceTypeAzureSQLDb', 'DataSourceTypeSQLDB', 'DataSourceTypeExchange', 'DataSourceTypeSharepoint', 'DataSourceTypeVMwareVM', 'DataSourceTypeSystemState', 'DataSourceTypeClient', 'DataSourceTypeGenericDataSource', 'DataSourceTypeSQLDataBase', 'DataSourceTypeAzureFileShare', 'DataSourceTypeSAPHanaDatabase', 'DataSourceTypeSAPAseDatabase' + ResourceType DataSourceType `json:"resourceType,omitempty"` + // ResourceID - Entire ARM resource id of the resource + ResourceID *string `json:"resourceId,omitempty"` + // PoLogicalName - Protectable Item Logical Name + PoLogicalName *string `json:"poLogicalName,omitempty"` +} + +// StatusResponse backupStatus response. +type StatusResponse struct { + autorest.Response `json:"-"` + // ProtectionStatus - Specifies whether the container is registered or not. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionStatus ProtectionStatus `json:"protectionStatus,omitempty"` + // VaultID - Specifies the arm resource id of the vault + VaultID *string `json:"vaultId,omitempty"` + // FabricName - Specifies the fabric name - Azure or AD. Possible values include: 'FabricNameInvalid', 'FabricNameAzure' + FabricName FabricName `json:"fabricName,omitempty"` + // ContainerName - Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;csname;vmname. + ContainerName *string `json:"containerName,omitempty"` + // ProtectedItemName - Specifies the product specific ds name. E.g. vm;iaasvmcontainer;csname;vmname. + ProtectedItemName *string `json:"protectedItemName,omitempty"` + // ErrorCode - ErrorCode in case of intent failed + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - ErrorMessage in case of intent failed. + ErrorMessage *string `json:"errorMessage,omitempty"` + // PolicyName - Specifies the policy name which is used for protection + PolicyName *string `json:"policyName,omitempty"` + // RegistrationStatus - Container registration status + RegistrationStatus *string `json:"registrationStatus,omitempty"` +} + +// SubProtectionPolicy sub-protection policy which includes schedule and retention +type SubProtectionPolicy struct { + // PolicyType - Type of backup policy type. Possible values include: 'PolicyTypeInvalid', 'PolicyTypeFull', 'PolicyTypeDifferential', 'PolicyTypeLog', 'PolicyTypeCopyOnlyFull', 'PolicyTypeIncremental' + 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. + RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SubProtectionPolicy struct. +func (spp *SubProtectionPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "policyType": + if v != nil { + var policyType PolicyType + err = json.Unmarshal(*v, &policyType) + if err != nil { + return err + } + spp.PolicyType = policyType + } + case "schedulePolicy": + if v != nil { + schedulePolicy, err := unmarshalBasicSchedulePolicy(*v) + if err != nil { + return err + } + spp.SchedulePolicy = schedulePolicy + } + case "retentionPolicy": + if v != nil { + retentionPolicy, err := unmarshalBasicRetentionPolicy(*v) + if err != nil { + return err + } + spp.RetentionPolicy = retentionPolicy + } + } + } + + return nil +} + +// TargetAFSRestoreInfo target Azure File Share Info. +type TargetAFSRestoreInfo struct { + // Name - File share name + Name *string `json:"name,omitempty"` + // TargetResourceID - Target file share resource ARM ID + TargetResourceID *string `json:"targetResourceId,omitempty"` +} + +// TargetRestoreInfo details about target workload during restore operation. +type TargetRestoreInfo struct { + // OverwriteOption - Can Overwrite if Target DataBase already exists. Possible values include: 'OverwriteOptionsInvalid', 'OverwriteOptionsFailOnConflict', 'OverwriteOptionsOverwrite' + OverwriteOption OverwriteOptions `json:"overwriteOption,omitempty"` + // ContainerID - Resource Id name of the container in which Target DataBase resides + ContainerID *string `json:"containerId,omitempty"` + // DatabaseName - Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana + DatabaseName *string `json:"databaseName,omitempty"` + // TargetDirectoryForFileRestore - Target directory location for restore as files. + TargetDirectoryForFileRestore *string `json:"targetDirectoryForFileRestore,omitempty"` +} + +// TokenInformation the token information details. +type TokenInformation struct { + autorest.Response `json:"-"` + // Token - Token value. + Token *string `json:"token,omitempty"` + // ExpiryTimeInUtcTicks - Expiry time of token. + ExpiryTimeInUtcTicks *int64 `json:"expiryTimeInUtcTicks,omitempty"` + // SecurityPIN - Security PIN + SecurityPIN *string `json:"securityPIN,omitempty"` +} + +// TriggerDataMoveRequest trigger DataMove Request +type TriggerDataMoveRequest struct { + // SourceResourceID - ARM Id of source vault + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // SourceRegion - Source Region + SourceRegion *string `json:"sourceRegion,omitempty"` + // DataMoveLevel - DataMove Level. Possible values include: 'DataMoveLevelInvalid', 'DataMoveLevelVault', 'DataMoveLevelContainer' + DataMoveLevel DataMoveLevel `json:"dataMoveLevel,omitempty"` + // CorrelationID - Correlation Id + CorrelationID *string `json:"correlationId,omitempty"` + // SourceContainerArmIds - Source Container ArmIds + SourceContainerArmIds *[]string `json:"sourceContainerArmIds,omitempty"` + // PauseGC - Pause GC + PauseGC *bool `json:"pauseGC,omitempty"` +} + +// UnlockDeleteRequest request body of unlock delete API. +type UnlockDeleteRequest struct { + ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` + ResourceToBeDeleted *string `json:"resourceToBeDeleted,omitempty"` +} + +// UnlockDeleteResponse response of Unlock Delete API. +type UnlockDeleteResponse struct { + autorest.Response `json:"-"` + // UnlockDeleteExpiryTime - This is the time when unlock delete privileges will get expired. + UnlockDeleteExpiryTime *string `json:"unlockDeleteExpiryTime,omitempty"` +} + +// ValidateIaasVMRestoreOperationRequest azureRestoreValidation request. +type ValidateIaasVMRestoreOperationRequest struct { + // RestoreRequest - Sets restore request to be validated + RestoreRequest BasicRestoreRequest `json:"restoreRequest,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeValidateOperationRequest', 'ObjectTypeValidateIaasVMRestoreOperationRequest', 'ObjectTypeValidateRestoreOperationRequest' + ObjectType ObjectTypeBasicValidateOperationRequest `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ValidateIaasVMRestoreOperationRequest. +func (vivror ValidateIaasVMRestoreOperationRequest) MarshalJSON() ([]byte, error) { + vivror.ObjectType = ObjectTypeValidateIaasVMRestoreOperationRequest + objectMap := make(map[string]interface{}) + objectMap["restoreRequest"] = vivror.RestoreRequest + if vivror.ObjectType != "" { + objectMap["objectType"] = vivror.ObjectType + } + return json.Marshal(objectMap) +} + +// AsValidateIaasVMRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. +func (vivror ValidateIaasVMRestoreOperationRequest) AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) { + return &vivror, true +} + +// AsValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. +func (vivror ValidateIaasVMRestoreOperationRequest) AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) { + return nil, false +} + +// AsBasicValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. +func (vivror ValidateIaasVMRestoreOperationRequest) AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) { + return &vivror, true +} + +// AsValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. +func (vivror ValidateIaasVMRestoreOperationRequest) AsValidateOperationRequest() (*ValidateOperationRequest, bool) { + return nil, false +} + +// AsBasicValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateIaasVMRestoreOperationRequest. +func (vivror ValidateIaasVMRestoreOperationRequest) AsBasicValidateOperationRequest() (BasicValidateOperationRequest, bool) { + return &vivror, true +} + +// UnmarshalJSON is the custom unmarshaler for ValidateIaasVMRestoreOperationRequest struct. +func (vivror *ValidateIaasVMRestoreOperationRequest) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "restoreRequest": + if v != nil { + restoreRequest, err := unmarshalBasicRestoreRequest(*v) + if err != nil { + return err + } + vivror.RestoreRequest = restoreRequest + } + case "objectType": + if v != nil { + var objectType ObjectTypeBasicValidateOperationRequest + err = json.Unmarshal(*v, &objectType) + if err != nil { + return err + } + vivror.ObjectType = objectType + } + } + } + + return nil +} + +// BasicValidateOperationRequest base class for validate operation request. +type BasicValidateOperationRequest interface { + AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) + AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) + AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) + AsValidateOperationRequest() (*ValidateOperationRequest, bool) +} + +// ValidateOperationRequest base class for validate operation request. +type ValidateOperationRequest struct { + // ObjectType - Possible values include: 'ObjectTypeValidateOperationRequest', 'ObjectTypeValidateIaasVMRestoreOperationRequest', 'ObjectTypeValidateRestoreOperationRequest' + ObjectType ObjectTypeBasicValidateOperationRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicValidateOperationRequest(body []byte) (BasicValidateOperationRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeValidateIaasVMRestoreOperationRequest): + var vivror ValidateIaasVMRestoreOperationRequest + err := json.Unmarshal(body, &vivror) + return vivror, err + case string(ObjectTypeValidateRestoreOperationRequest): + var vror ValidateRestoreOperationRequest + err := json.Unmarshal(body, &vror) + return vror, err + default: + var vor ValidateOperationRequest + err := json.Unmarshal(body, &vor) + return vor, err + } +} +func unmarshalBasicValidateOperationRequestArray(body []byte) ([]BasicValidateOperationRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + vorArray := make([]BasicValidateOperationRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + vor, err := unmarshalBasicValidateOperationRequest(*rawMessage) + if err != nil { + return nil, err + } + vorArray[index] = vor + } + return vorArray, nil +} + +// MarshalJSON is the custom marshaler for ValidateOperationRequest. +func (vor ValidateOperationRequest) MarshalJSON() ([]byte, error) { + vor.ObjectType = ObjectTypeValidateOperationRequest + objectMap := make(map[string]interface{}) + if vor.ObjectType != "" { + objectMap["objectType"] = vor.ObjectType + } + return json.Marshal(objectMap) +} + +// AsValidateIaasVMRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. +func (vor ValidateOperationRequest) AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) { + return nil, false +} + +// AsValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. +func (vor ValidateOperationRequest) AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) { + return nil, false +} + +// AsBasicValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. +func (vor ValidateOperationRequest) AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) { + return nil, false +} + +// AsValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. +func (vor ValidateOperationRequest) AsValidateOperationRequest() (*ValidateOperationRequest, bool) { + return &vor, true +} + +// AsBasicValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateOperationRequest. +func (vor ValidateOperationRequest) AsBasicValidateOperationRequest() (BasicValidateOperationRequest, bool) { + return &vor, true +} + +// ValidateOperationResponse base class for validate operation response. +type ValidateOperationResponse struct { + // ValidationResults - Gets the validation result + ValidationResults *[]ErrorDetail `json:"validationResults,omitempty"` +} + +// ValidateOperationsResponse ... +type ValidateOperationsResponse struct { + autorest.Response `json:"-"` + ValidateOperationResponse *ValidateOperationResponse `json:"validateOperationResponse,omitempty"` +} + +// ValidateOperationTriggerFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ValidateOperationTriggerFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ValidateOperationClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ValidateOperationTriggerFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ValidateOperationTriggerFuture.Result. +func (future *ValidateOperationTriggerFuture) result(client ValidateOperationClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ValidateOperationTriggerFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("backup.ValidateOperationTriggerFuture") + return + } + ar.Response = future.Response() + return +} + +// BasicValidateRestoreOperationRequest azureRestoreValidation request. +type BasicValidateRestoreOperationRequest interface { + AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) + AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) +} + +// ValidateRestoreOperationRequest azureRestoreValidation request. +type ValidateRestoreOperationRequest struct { + // RestoreRequest - Sets restore request to be validated + RestoreRequest BasicRestoreRequest `json:"restoreRequest,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeValidateOperationRequest', 'ObjectTypeValidateIaasVMRestoreOperationRequest', 'ObjectTypeValidateRestoreOperationRequest' + ObjectType ObjectTypeBasicValidateOperationRequest `json:"objectType,omitempty"` +} + +func unmarshalBasicValidateRestoreOperationRequest(body []byte) (BasicValidateRestoreOperationRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeValidateIaasVMRestoreOperationRequest): + var vivror ValidateIaasVMRestoreOperationRequest + err := json.Unmarshal(body, &vivror) + return vivror, err + default: + var vror ValidateRestoreOperationRequest + err := json.Unmarshal(body, &vror) + return vror, err + } +} +func unmarshalBasicValidateRestoreOperationRequestArray(body []byte) ([]BasicValidateRestoreOperationRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + vrorArray := make([]BasicValidateRestoreOperationRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + vror, err := unmarshalBasicValidateRestoreOperationRequest(*rawMessage) + if err != nil { + return nil, err + } + vrorArray[index] = vror + } + return vrorArray, nil +} + +// MarshalJSON is the custom marshaler for ValidateRestoreOperationRequest. +func (vror ValidateRestoreOperationRequest) MarshalJSON() ([]byte, error) { + vror.ObjectType = ObjectTypeValidateRestoreOperationRequest + objectMap := make(map[string]interface{}) + objectMap["restoreRequest"] = vror.RestoreRequest + if vror.ObjectType != "" { + objectMap["objectType"] = vror.ObjectType + } + return json.Marshal(objectMap) +} + +// AsValidateIaasVMRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. +func (vror ValidateRestoreOperationRequest) AsValidateIaasVMRestoreOperationRequest() (*ValidateIaasVMRestoreOperationRequest, bool) { + return nil, false +} + +// AsValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. +func (vror ValidateRestoreOperationRequest) AsValidateRestoreOperationRequest() (*ValidateRestoreOperationRequest, bool) { + return &vror, true +} + +// AsBasicValidateRestoreOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. +func (vror ValidateRestoreOperationRequest) AsBasicValidateRestoreOperationRequest() (BasicValidateRestoreOperationRequest, bool) { + return &vror, true +} + +// AsValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. +func (vror ValidateRestoreOperationRequest) AsValidateOperationRequest() (*ValidateOperationRequest, bool) { + return nil, false +} + +// AsBasicValidateOperationRequest is the BasicValidateOperationRequest implementation for ValidateRestoreOperationRequest. +func (vror ValidateRestoreOperationRequest) AsBasicValidateOperationRequest() (BasicValidateOperationRequest, bool) { + return &vror, true +} + +// UnmarshalJSON is the custom unmarshaler for ValidateRestoreOperationRequest struct. +func (vror *ValidateRestoreOperationRequest) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "restoreRequest": + if v != nil { + restoreRequest, err := unmarshalBasicRestoreRequest(*v) + if err != nil { + return err + } + vror.RestoreRequest = restoreRequest + } + case "objectType": + if v != nil { + var objectType ObjectTypeBasicValidateOperationRequest + err = json.Unmarshal(*v, &objectType) + if err != nil { + return err + } + vror.ObjectType = objectType + } + } + } + + return nil +} + +// VaultJob vault level Job +type VaultJob struct { + // Duration - Time elapsed during the execution of this job. + Duration *string `json:"duration,omitempty"` + // ActionsInfo - Gets or sets the state/actions applicable on this job like cancel/retry. + ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` + // ErrorDetails - Error details on execution of this job. + ErrorDetails *[]VaultJobErrorInfo `json:"errorDetails,omitempty"` + // ExtendedInfo - Additional information about the job. + ExtendedInfo *VaultJobExtendedInfo `json:"extendedInfo,omitempty"` + // EntityFriendlyName - Friendly name of the entity on which the current job is executing. + EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` + // BackupManagementType - Backup management type to execute the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // Operation - The operation name. + Operation *string `json:"operation,omitempty"` + // Status - Job status. + Status *string `json:"status,omitempty"` + // StartTime - The start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time. + EndTime *date.Time `json:"endTime,omitempty"` + // ActivityID - ActivityId of job. + ActivityID *string `json:"activityId,omitempty"` + // JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeAzureIaaSVMJobV2', 'JobTypeAzureStorageJob', 'JobTypeAzureWorkloadJob', 'JobTypeDpmJob', 'JobTypeMabJob', 'JobTypeVaultJob' + JobType JobType `json:"jobType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VaultJob. +func (vj VaultJob) MarshalJSON() ([]byte, error) { + vj.JobType = JobTypeVaultJob + objectMap := make(map[string]interface{}) + if vj.Duration != nil { + objectMap["duration"] = vj.Duration + } + if vj.ActionsInfo != nil { + objectMap["actionsInfo"] = vj.ActionsInfo + } + if vj.ErrorDetails != nil { + objectMap["errorDetails"] = vj.ErrorDetails + } + if vj.ExtendedInfo != nil { + objectMap["extendedInfo"] = vj.ExtendedInfo + } + if vj.EntityFriendlyName != nil { + objectMap["entityFriendlyName"] = vj.EntityFriendlyName + } + if vj.BackupManagementType != "" { + objectMap["backupManagementType"] = vj.BackupManagementType + } + if vj.Operation != nil { + objectMap["operation"] = vj.Operation + } + if vj.Status != nil { + objectMap["status"] = vj.Status + } + if vj.StartTime != nil { + objectMap["startTime"] = vj.StartTime + } + if vj.EndTime != nil { + objectMap["endTime"] = vj.EndTime + } + if vj.ActivityID != nil { + objectMap["activityId"] = vj.ActivityID + } + if vj.JobType != "" { + objectMap["jobType"] = vj.JobType + } + return json.Marshal(objectMap) +} + +// AsAzureIaaSVMJob is the BasicJob implementation for VaultJob. +func (vj VaultJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) { + return nil, false +} + +// AsAzureIaaSVMJobV2 is the BasicJob implementation for VaultJob. +func (vj VaultJob) AsAzureIaaSVMJobV2() (*AzureIaaSVMJobV2, bool) { + return nil, false +} + +// AsAzureStorageJob is the BasicJob implementation for VaultJob. +func (vj VaultJob) AsAzureStorageJob() (*AzureStorageJob, bool) { + return nil, false +} + +// AsAzureWorkloadJob is the BasicJob implementation for VaultJob. +func (vj VaultJob) AsAzureWorkloadJob() (*AzureWorkloadJob, bool) { + return nil, false +} + +// AsDpmJob is the BasicJob implementation for VaultJob. +func (vj VaultJob) AsDpmJob() (*DpmJob, bool) { + return nil, false +} + +// AsMabJob is the BasicJob implementation for VaultJob. +func (vj VaultJob) AsMabJob() (*MabJob, bool) { + return nil, false +} + +// AsVaultJob is the BasicJob implementation for VaultJob. +func (vj VaultJob) AsVaultJob() (*VaultJob, bool) { + return &vj, true +} + +// AsJob is the BasicJob implementation for VaultJob. +func (vj VaultJob) AsJob() (*Job, bool) { + return nil, false +} + +// AsBasicJob is the BasicJob implementation for VaultJob. +func (vj VaultJob) AsBasicJob() (BasicJob, bool) { + return &vj, true +} + +// VaultJobErrorInfo vault Job specific error information +type VaultJobErrorInfo struct { + // ErrorCode - Error code. + ErrorCode *int32 `json:"errorCode,omitempty"` + // ErrorString - Localized error string. + ErrorString *string `json:"errorString,omitempty"` + // Recommendations - List of localized recommendations for above error code. + Recommendations *[]string `json:"recommendations,omitempty"` +} + +// VaultJobExtendedInfo vault Job for CMK - has CMK specific info. +type VaultJobExtendedInfo struct { + // PropertyBag - Job properties. + PropertyBag map[string]*string `json:"propertyBag"` +} + +// MarshalJSON is the custom marshaler for VaultJobExtendedInfo. +func (vjei VaultJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vjei.PropertyBag != nil { + objectMap["propertyBag"] = vjei.PropertyBag + } + return json.Marshal(objectMap) +} + +// BasicVaultStorageConfigOperationResultResponse operation result response for Vault Storage Config +type BasicVaultStorageConfigOperationResultResponse interface { + AsPrepareDataMoveResponse() (*PrepareDataMoveResponse, bool) + AsVaultStorageConfigOperationResultResponse() (*VaultStorageConfigOperationResultResponse, bool) +} + +// VaultStorageConfigOperationResultResponse operation result response for Vault Storage Config +type VaultStorageConfigOperationResultResponse struct { + autorest.Response `json:"-"` + // ObjectType - Possible values include: 'ObjectTypeVaultStorageConfigOperationResultResponse', 'ObjectTypePrepareDataMoveResponse' + ObjectType ObjectTypeBasicVaultStorageConfigOperationResultResponse `json:"objectType,omitempty"` +} + +func unmarshalBasicVaultStorageConfigOperationResultResponse(body []byte) (BasicVaultStorageConfigOperationResultResponse, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypePrepareDataMoveResponse): + var pdmr PrepareDataMoveResponse + err := json.Unmarshal(body, &pdmr) + return pdmr, err + default: + var vscorr VaultStorageConfigOperationResultResponse + err := json.Unmarshal(body, &vscorr) + return vscorr, err + } +} +func unmarshalBasicVaultStorageConfigOperationResultResponseArray(body []byte) ([]BasicVaultStorageConfigOperationResultResponse, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + vscorrArray := make([]BasicVaultStorageConfigOperationResultResponse, len(rawMessages)) + + for index, rawMessage := range rawMessages { + vscorr, err := unmarshalBasicVaultStorageConfigOperationResultResponse(*rawMessage) + if err != nil { + return nil, err + } + vscorrArray[index] = vscorr + } + return vscorrArray, nil +} + +// MarshalJSON is the custom marshaler for VaultStorageConfigOperationResultResponse. +func (vscorr VaultStorageConfigOperationResultResponse) MarshalJSON() ([]byte, error) { + vscorr.ObjectType = ObjectTypeVaultStorageConfigOperationResultResponse + objectMap := make(map[string]interface{}) + if vscorr.ObjectType != "" { + objectMap["objectType"] = vscorr.ObjectType + } + return json.Marshal(objectMap) +} + +// AsPrepareDataMoveResponse is the BasicVaultStorageConfigOperationResultResponse implementation for VaultStorageConfigOperationResultResponse. +func (vscorr VaultStorageConfigOperationResultResponse) AsPrepareDataMoveResponse() (*PrepareDataMoveResponse, bool) { + return nil, false +} + +// AsVaultStorageConfigOperationResultResponse is the BasicVaultStorageConfigOperationResultResponse implementation for VaultStorageConfigOperationResultResponse. +func (vscorr VaultStorageConfigOperationResultResponse) AsVaultStorageConfigOperationResultResponse() (*VaultStorageConfigOperationResultResponse, bool) { + return &vscorr, true +} + +// AsBasicVaultStorageConfigOperationResultResponse is the BasicVaultStorageConfigOperationResultResponse implementation for VaultStorageConfigOperationResultResponse. +func (vscorr VaultStorageConfigOperationResultResponse) AsBasicVaultStorageConfigOperationResultResponse() (BasicVaultStorageConfigOperationResultResponse, bool) { + return &vscorr, true +} + +// VaultStorageConfigOperationResultResponseModel ... +type VaultStorageConfigOperationResultResponseModel struct { + autorest.Response `json:"-"` + Value BasicVaultStorageConfigOperationResultResponse `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for VaultStorageConfigOperationResultResponseModel struct. +func (vscorrm *VaultStorageConfigOperationResultResponseModel) UnmarshalJSON(body []byte) error { + vscorr, err := unmarshalBasicVaultStorageConfigOperationResultResponse(body) + if err != nil { + return err + } + vscorrm.Value = vscorr + + return nil +} + +// WeeklyRetentionFormat weekly retention format. +type WeeklyRetentionFormat struct { + // DaysOfTheWeek - List of days of the week. + DaysOfTheWeek *[]DayOfWeek `json:"daysOfTheWeek,omitempty"` + // WeeksOfTheMonth - List of weeks of month. + WeeksOfTheMonth *[]WeekOfMonth `json:"weeksOfTheMonth,omitempty"` +} + +// WeeklyRetentionSchedule weekly retention schedule. +type WeeklyRetentionSchedule struct { + // DaysOfTheWeek - List of days of week for weekly retention policy. + DaysOfTheWeek *[]DayOfWeek `json:"daysOfTheWeek,omitempty"` + // RetentionTimes - Retention times of retention policy. + RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` + // RetentionDuration - Retention duration of retention Policy. + RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` +} + +// WeeklySchedule ... +type WeeklySchedule struct { + ScheduleRunDays *[]DayOfWeek `json:"scheduleRunDays,omitempty"` + // ScheduleRunTimes - List of times of day this schedule has to be run. + ScheduleRunTimes *[]date.Time `json:"scheduleRunTimes,omitempty"` +} + +// WorkloadInquiryDetails details of an inquired protectable item. +type WorkloadInquiryDetails struct { + // Type - Type of the Workload such as SQL, Oracle etc. + Type *string `json:"type,omitempty"` + // ItemCount - Contains the protectable item Count inside this Container. + ItemCount *int64 `json:"itemCount,omitempty"` + // InquiryValidation - Inquiry validation such as permissions and other backup validations. + InquiryValidation *InquiryValidation `json:"inquiryValidation,omitempty"` +} + +// BasicWorkloadItem base class for backup item. Workload-specific backup items are derived from this class. +type BasicWorkloadItem interface { + AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) + AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) + AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) + AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) + AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) + AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) + AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) + AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) + AsWorkloadItem() (*WorkloadItem, bool) +} + +// WorkloadItem base class for backup item. Workload-specific backup items are derived from this class. +type WorkloadItem struct { + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // WorkloadItemType - Possible values include: 'WorkloadItemTypeWorkloadItem', 'WorkloadItemTypeAzureVMWorkloadItem', 'WorkloadItemTypeSAPAseDatabase1', 'WorkloadItemTypeSAPAseSystem1', 'WorkloadItemTypeSAPHanaDatabase1', 'WorkloadItemTypeSAPHanaSystem1', 'WorkloadItemTypeSQLDataBase1', 'WorkloadItemTypeSQLInstance1' + WorkloadItemType WorkloadItemTypeBasicWorkloadItem `json:"workloadItemType,omitempty"` +} + +func unmarshalBasicWorkloadItem(body []byte) (BasicWorkloadItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["workloadItemType"] { + case string(WorkloadItemTypeAzureVMWorkloadItem): + var avwi AzureVMWorkloadItem + err := json.Unmarshal(body, &avwi) + return avwi, err + case string(WorkloadItemTypeSAPAseDatabase1): + var avwsadwi AzureVMWorkloadSAPAseDatabaseWorkloadItem + err := json.Unmarshal(body, &avwsadwi) + return avwsadwi, err + case string(WorkloadItemTypeSAPAseSystem1): + var avwsaswi AzureVMWorkloadSAPAseSystemWorkloadItem + err := json.Unmarshal(body, &avwsaswi) + return avwsaswi, err + case string(WorkloadItemTypeSAPHanaDatabase1): + var avwshdwi AzureVMWorkloadSAPHanaDatabaseWorkloadItem + err := json.Unmarshal(body, &avwshdwi) + return avwshdwi, err + case string(WorkloadItemTypeSAPHanaSystem1): + var avwshswi AzureVMWorkloadSAPHanaSystemWorkloadItem + err := json.Unmarshal(body, &avwshswi) + return avwshswi, err + case string(WorkloadItemTypeSQLDataBase1): + var avwsdwi AzureVMWorkloadSQLDatabaseWorkloadItem + err := json.Unmarshal(body, &avwsdwi) + return avwsdwi, err + case string(WorkloadItemTypeSQLInstance1): + var avwsiwi AzureVMWorkloadSQLInstanceWorkloadItem + err := json.Unmarshal(body, &avwsiwi) + return avwsiwi, err + default: + var wi WorkloadItem + err := json.Unmarshal(body, &wi) + return wi, err + } +} +func unmarshalBasicWorkloadItemArray(body []byte) ([]BasicWorkloadItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + wiArray := make([]BasicWorkloadItem, len(rawMessages)) + + for index, rawMessage := range rawMessages { + wi, err := unmarshalBasicWorkloadItem(*rawMessage) + if err != nil { + return nil, err + } + wiArray[index] = wi + } + return wiArray, nil +} + +// MarshalJSON is the custom marshaler for WorkloadItem. +func (wi WorkloadItem) MarshalJSON() ([]byte, error) { + wi.WorkloadItemType = WorkloadItemTypeWorkloadItem + objectMap := make(map[string]interface{}) + if wi.BackupManagementType != nil { + objectMap["backupManagementType"] = wi.BackupManagementType + } + if wi.WorkloadType != nil { + objectMap["workloadType"] = wi.WorkloadType + } + if wi.FriendlyName != nil { + objectMap["friendlyName"] = wi.FriendlyName + } + if wi.ProtectionState != "" { + objectMap["protectionState"] = wi.ProtectionState + } + if wi.WorkloadItemType != "" { + objectMap["workloadItemType"] = wi.WorkloadItemType + } + return json.Marshal(objectMap) +} + +// AsAzureVMWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsAzureVMWorkloadItem() (*AzureVMWorkloadItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsBasicAzureVMWorkloadItem() (BasicAzureVMWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseDatabaseWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsAzureVMWorkloadSAPAseDatabaseWorkloadItem() (*AzureVMWorkloadSAPAseDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseSystemWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsAzureVMWorkloadSAPAseSystemWorkloadItem() (*AzureVMWorkloadSAPAseSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsAzureVMWorkloadSAPHanaDatabaseWorkloadItem() (*AzureVMWorkloadSAPHanaDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsAzureVMWorkloadSAPHanaSystemWorkloadItem() (*AzureVMWorkloadSAPHanaSystemWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsAzureVMWorkloadSQLDatabaseWorkloadItem() (*AzureVMWorkloadSQLDatabaseWorkloadItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsAzureVMWorkloadSQLInstanceWorkloadItem() (*AzureVMWorkloadSQLInstanceWorkloadItem, bool) { + return nil, false +} + +// AsWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsWorkloadItem() (*WorkloadItem, bool) { + return &wi, true +} + +// AsBasicWorkloadItem is the BasicWorkloadItem implementation for WorkloadItem. +func (wi WorkloadItem) AsBasicWorkloadItem() (BasicWorkloadItem, bool) { + return &wi, true +} + +// WorkloadItemResource base class for backup item. Workload-specific backup items are derived from this +// class. +type WorkloadItemResource struct { + // Properties - WorkloadItemResource properties + Properties BasicWorkloadItem `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for WorkloadItemResource. +func (wir WorkloadItemResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = wir.Properties + if wir.Location != nil { + objectMap["location"] = wir.Location + } + if wir.Tags != nil { + objectMap["tags"] = wir.Tags + } + if wir.ETag != nil { + objectMap["eTag"] = wir.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WorkloadItemResource struct. +func (wir *WorkloadItemResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicWorkloadItem(*v) + if err != nil { + return err + } + wir.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + wir.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wir.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + wir.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + wir.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + wir.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + wir.ETag = &eTag + } + } + } + + return nil +} + +// WorkloadItemResourceList list of WorkloadItem resources +type WorkloadItemResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]WorkloadItemResource `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"` +} + +// WorkloadItemResourceListIterator provides access to a complete listing of WorkloadItemResource values. +type WorkloadItemResourceListIterator struct { + i int + page WorkloadItemResourceListPage +} + +// NextWithContext 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 *WorkloadItemResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadItemResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *WorkloadItemResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WorkloadItemResourceListIterator) 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 WorkloadItemResourceListIterator) Response() WorkloadItemResourceList { + 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 WorkloadItemResourceListIterator) Value() WorkloadItemResource { + if !iter.page.NotDone() { + return WorkloadItemResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the WorkloadItemResourceListIterator type. +func NewWorkloadItemResourceListIterator(page WorkloadItemResourceListPage) WorkloadItemResourceListIterator { + return WorkloadItemResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (wirl WorkloadItemResourceList) IsEmpty() bool { + return wirl.Value == nil || len(*wirl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (wirl WorkloadItemResourceList) hasNextLink() bool { + return wirl.NextLink != nil && len(*wirl.NextLink) != 0 +} + +// workloadItemResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wirl WorkloadItemResourceList) workloadItemResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !wirl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(wirl.NextLink))) +} + +// WorkloadItemResourceListPage contains a page of WorkloadItemResource values. +type WorkloadItemResourceListPage struct { + fn func(context.Context, WorkloadItemResourceList) (WorkloadItemResourceList, error) + wirl WorkloadItemResourceList +} + +// NextWithContext 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 *WorkloadItemResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadItemResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.wirl) + if err != nil { + return err + } + page.wirl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *WorkloadItemResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WorkloadItemResourceListPage) NotDone() bool { + return !page.wirl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WorkloadItemResourceListPage) Response() WorkloadItemResourceList { + return page.wirl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WorkloadItemResourceListPage) Values() []WorkloadItemResource { + if page.wirl.IsEmpty() { + return nil + } + return *page.wirl.Value +} + +// Creates a new instance of the WorkloadItemResourceListPage type. +func NewWorkloadItemResourceListPage(cur WorkloadItemResourceList, getNextPage func(context.Context, WorkloadItemResourceList) (WorkloadItemResourceList, error)) WorkloadItemResourceListPage { + return WorkloadItemResourceListPage{ + fn: getNextPage, + wirl: cur, + } +} + +// BasicWorkloadProtectableItem base class for backup item. Workload-specific backup items are derived from this class. +type BasicWorkloadProtectableItem interface { + AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) + AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) + AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) + AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) + AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) + AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) + AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) + AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) + AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) + AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) + AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) + AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) + AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) + AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) +} + +// WorkloadProtectableItem base class for backup item. Workload-specific backup items are derived from this +// class. +type WorkloadProtectableItem struct { + // BackupManagementType - Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + // WorkloadType - Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` + // FriendlyName - Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + // ProtectionState - State of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected', 'ProtectionStatusProtectionFailed' + ProtectionState ProtectionStatus `json:"protectionState,omitempty"` + // ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeAzureFileShare', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeAzureVMWorkloadProtectableItem', 'ProtectableItemTypeSAPAseSystem', 'ProtectableItemTypeSAPHanaDatabase', 'ProtectableItemTypeSAPHanaSystem', 'ProtectableItemTypeSQLAvailabilityGroupContainer', 'ProtectableItemTypeSQLDataBase', 'ProtectableItemTypeSQLInstance', 'ProtectableItemTypeIaaSVMProtectableItem' + ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"` +} + +func unmarshalBasicWorkloadProtectableItem(body []byte) (BasicWorkloadProtectableItem, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["protectableItemType"] { + case string(ProtectableItemTypeAzureFileShare): + var afspi AzureFileShareProtectableItem + err := json.Unmarshal(body, &afspi) + return afspi, err + case string(ProtectableItemTypeMicrosoftClassicComputevirtualMachines): + var aisccvpi AzureIaaSClassicComputeVMProtectableItem + err := json.Unmarshal(body, &aisccvpi) + return aisccvpi, err + case string(ProtectableItemTypeMicrosoftComputevirtualMachines): + var aiscvpi AzureIaaSComputeVMProtectableItem + err := json.Unmarshal(body, &aiscvpi) + return aiscvpi, err + case string(ProtectableItemTypeAzureVMWorkloadProtectableItem): + var avwpi AzureVMWorkloadProtectableItem + err := json.Unmarshal(body, &avwpi) + return avwpi, err + case string(ProtectableItemTypeSAPAseSystem): + var avwsaspi AzureVMWorkloadSAPAseSystemProtectableItem + err := json.Unmarshal(body, &avwsaspi) + return avwsaspi, err + case string(ProtectableItemTypeSAPHanaDatabase): + var avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem + err := json.Unmarshal(body, &avwshdpi) + return avwshdpi, err + case string(ProtectableItemTypeSAPHanaSystem): + var avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem + err := json.Unmarshal(body, &avwshspi) + return avwshspi, err + case string(ProtectableItemTypeSQLAvailabilityGroupContainer): + var avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem + err := json.Unmarshal(body, &avwsagpi) + return avwsagpi, err + case string(ProtectableItemTypeSQLDataBase): + var avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem + err := json.Unmarshal(body, &avwsdpi) + return avwsdpi, err + case string(ProtectableItemTypeSQLInstance): + var avwsipi AzureVMWorkloadSQLInstanceProtectableItem + err := json.Unmarshal(body, &avwsipi) + return avwsipi, err + case string(ProtectableItemTypeIaaSVMProtectableItem): + var ispi IaaSVMProtectableItem + err := json.Unmarshal(body, &ispi) + return ispi, err + default: + var wpi WorkloadProtectableItem + err := json.Unmarshal(body, &wpi) + return wpi, err + } +} +func unmarshalBasicWorkloadProtectableItemArray(body []byte) ([]BasicWorkloadProtectableItem, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + wpiArray := make([]BasicWorkloadProtectableItem, len(rawMessages)) + + for index, rawMessage := range rawMessages { + wpi, err := unmarshalBasicWorkloadProtectableItem(*rawMessage) + if err != nil { + return nil, err + } + wpiArray[index] = wpi + } + return wpiArray, nil +} + +// MarshalJSON is the custom marshaler for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) MarshalJSON() ([]byte, error) { + wpi.ProtectableItemType = ProtectableItemTypeWorkloadProtectableItem + objectMap := make(map[string]interface{}) + if wpi.BackupManagementType != nil { + objectMap["backupManagementType"] = wpi.BackupManagementType + } + if wpi.WorkloadType != nil { + objectMap["workloadType"] = wpi.WorkloadType + } + if wpi.FriendlyName != nil { + objectMap["friendlyName"] = wpi.FriendlyName + } + if wpi.ProtectionState != "" { + objectMap["protectionState"] = wpi.ProtectionState + } + if wpi.ProtectableItemType != "" { + objectMap["protectableItemType"] = wpi.ProtectableItemType + } + return json.Marshal(objectMap) +} + +// AsAzureFileShareProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureFileShareProtectableItem() (*AzureFileShareProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureVMWorkloadProtectableItem() (*AzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsBasicAzureVMWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsBasicAzureVMWorkloadProtectableItem() (BasicAzureVMWorkloadProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPAseSystemProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSAPAseSystemProtectableItem() (*AzureVMWorkloadSAPAseSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSAPHanaDatabaseProtectableItem() (*AzureVMWorkloadSAPHanaDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSAPHanaSystemProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSAPHanaSystemProtectableItem() (*AzureVMWorkloadSAPHanaSystemProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSQLAvailabilityGroupProtectableItem() (*AzureVMWorkloadSQLAvailabilityGroupProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLDatabaseProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSQLDatabaseProtectableItem() (*AzureVMWorkloadSQLDatabaseProtectableItem, bool) { + return nil, false +} + +// AsAzureVMWorkloadSQLInstanceProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsAzureVMWorkloadSQLInstanceProtectableItem() (*AzureVMWorkloadSQLInstanceProtectableItem, bool) { + return nil, false +} + +// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) { + return nil, false +} + +// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) { + return nil, false +} + +// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) { + return &wpi, true +} + +// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem. +func (wpi WorkloadProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) { + return &wpi, true +} + +// WorkloadProtectableItemResource base class for backup item. Workload-specific backup items are derived +// from this class. +type WorkloadProtectableItemResource struct { + // Properties - WorkloadProtectableItemResource properties + Properties BasicWorkloadProtectableItem `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id represents the complete path to the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name associated with the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ETag - Optional ETag. + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for WorkloadProtectableItemResource. +func (wpir WorkloadProtectableItemResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = wpir.Properties + if wpir.Location != nil { + objectMap["location"] = wpir.Location + } + if wpir.Tags != nil { + objectMap["tags"] = wpir.Tags + } + if wpir.ETag != nil { + objectMap["eTag"] = wpir.ETag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WorkloadProtectableItemResource struct. +func (wpir *WorkloadProtectableItemResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicWorkloadProtectableItem(*v) + if err != nil { + return err + } + wpir.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + wpir.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wpir.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + wpir.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + wpir.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + wpir.Tags = tags + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + wpir.ETag = &eTag + } + } + } + + return nil +} + +// WorkloadProtectableItemResourceList list of WorkloadProtectableItem resources +type WorkloadProtectableItemResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]WorkloadProtectableItemResource `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"` +} + +// WorkloadProtectableItemResourceListIterator provides access to a complete listing of +// WorkloadProtectableItemResource values. +type WorkloadProtectableItemResourceListIterator struct { + i int + page WorkloadProtectableItemResourceListPage +} + +// NextWithContext 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 *WorkloadProtectableItemResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadProtectableItemResourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *WorkloadProtectableItemResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WorkloadProtectableItemResourceListIterator) 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 WorkloadProtectableItemResourceListIterator) Response() WorkloadProtectableItemResourceList { + 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 WorkloadProtectableItemResourceListIterator) Value() WorkloadProtectableItemResource { + if !iter.page.NotDone() { + return WorkloadProtectableItemResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the WorkloadProtectableItemResourceListIterator type. +func NewWorkloadProtectableItemResourceListIterator(page WorkloadProtectableItemResourceListPage) WorkloadProtectableItemResourceListIterator { + return WorkloadProtectableItemResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (wpirl WorkloadProtectableItemResourceList) IsEmpty() bool { + return wpirl.Value == nil || len(*wpirl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (wpirl WorkloadProtectableItemResourceList) hasNextLink() bool { + return wpirl.NextLink != nil && len(*wpirl.NextLink) != 0 +} + +// workloadProtectableItemResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wpirl WorkloadProtectableItemResourceList) workloadProtectableItemResourceListPreparer(ctx context.Context) (*http.Request, error) { + if !wpirl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(wpirl.NextLink))) +} + +// WorkloadProtectableItemResourceListPage contains a page of WorkloadProtectableItemResource values. +type WorkloadProtectableItemResourceListPage struct { + fn func(context.Context, WorkloadProtectableItemResourceList) (WorkloadProtectableItemResourceList, error) + wpirl WorkloadProtectableItemResourceList +} + +// NextWithContext 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 *WorkloadProtectableItemResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadProtectableItemResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.wpirl) + if err != nil { + return err + } + page.wpirl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// 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. +// Deprecated: Use NextWithContext() instead. +func (page *WorkloadProtectableItemResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WorkloadProtectableItemResourceListPage) NotDone() bool { + return !page.wpirl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WorkloadProtectableItemResourceListPage) Response() WorkloadProtectableItemResourceList { + return page.wpirl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WorkloadProtectableItemResourceListPage) Values() []WorkloadProtectableItemResource { + if page.wpirl.IsEmpty() { + return nil + } + return *page.wpirl.Value +} + +// Creates a new instance of the WorkloadProtectableItemResourceListPage type. +func NewWorkloadProtectableItemResourceListPage(cur WorkloadProtectableItemResourceList, getNextPage func(context.Context, WorkloadProtectableItemResourceList) (WorkloadProtectableItemResourceList, error)) WorkloadProtectableItemResourceListPage { + return WorkloadProtectableItemResourceListPage{ + fn: getNextPage, + wpirl: cur, + } +} + +// YearlyRetentionSchedule yearly retention schedule. +type YearlyRetentionSchedule struct { + // RetentionScheduleFormatType - Retention schedule format for yearly retention policy. Possible values include: 'RetentionScheduleFormatInvalid', 'RetentionScheduleFormatDaily', 'RetentionScheduleFormatWeekly' + RetentionScheduleFormatType RetentionScheduleFormat `json:"retentionScheduleFormatType,omitempty"` + // MonthsOfYear - List of months of year of yearly retention policy. + MonthsOfYear *[]MonthOfYear `json:"monthsOfYear,omitempty"` + // RetentionScheduleDaily - Daily retention format for yearly retention policy. + RetentionScheduleDaily *DailyRetentionFormat `json:"retentionScheduleDaily,omitempty"` + // RetentionScheduleWeekly - Weekly retention format for yearly retention policy. + RetentionScheduleWeekly *WeeklyRetentionFormat `json:"retentionScheduleWeekly,omitempty"` + // RetentionTimes - Retention times of retention policy. + RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"` + // RetentionDuration - Retention duration of retention Policy. + RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"` +} diff --git a/services/recoveryservices/mgmt/2022-03-01/backup/operation.go b/services/recoveryservices/mgmt/2022-03-01/backup/operation.go new file mode 100644 index 000000000000..b32a649cc49e --- /dev/null +++ b/services/recoveryservices/mgmt/2022-03-01/backup/operation.go @@ -0,0 +1,110 @@ +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type OperationClient struct { + BaseClient +} + +// NewOperationClient creates an instance of the OperationClient client. +func NewOperationClient(subscriptionID string) OperationClient { + return NewOperationClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationClientWithBaseURI creates an instance of the OperationClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewOperationClientWithBaseURI(baseURI string, subscriptionID string) OperationClient { + return OperationClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Validate validate operation for specified backed up item. This is a synchronous operation. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// parameters - resource validate operation request +func (client OperationClient) Validate(ctx context.Context, vaultName string, resourceGroupName string, parameters BasicValidateOperationRequest) (result ValidateOperationsResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationClient.Validate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ValidatePreparer(ctx, vaultName, resourceGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.OperationClient", "Validate", nil, "Failure preparing request") + return + } + + resp, err := client.ValidateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.OperationClient", "Validate", resp, "Failure sending request") + return + } + + result, err = client.ValidateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.OperationClient", "Validate", resp, "Failure responding to request") + return + } + + return +} + +// ValidatePreparer prepares the Validate request. +func (client OperationClient) ValidatePreparer(ctx context.Context, vaultName string, resourceGroupName string, parameters BasicValidateOperationRequest) (*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 = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupValidateOperation", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ValidateSender sends the Validate request. The method will close the +// http.Response Body if it receives an error. +func (client OperationClient) ValidateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ValidateResponder handles the response to the Validate request. The method always +// closes the http.Response Body. +func (client OperationClient) ValidateResponder(resp *http.Response) (result ValidateOperationsResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/operationresults.go b/services/recoveryservices/mgmt/2022-03-01/backup/operationresults.go similarity index 97% rename from services/recoveryservices/mgmt/2020-02-02/backup/operationresults.go rename to services/recoveryservices/mgmt/2022-03-01/backup/operationresults.go index d183574f15b9..4d034e44ea06 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/operationresults.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/operationresults.go @@ -82,7 +82,7 @@ func (client OperationResultsClient) GetPreparer(ctx context.Context, vaultName "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -90,7 +90,7 @@ func (client OperationResultsClient) GetPreparer(ctx context.Context, vaultName preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperationResults/{operationId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperationResults/{operationId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/operations.go b/services/recoveryservices/mgmt/2022-03-01/backup/operations.go similarity index 99% rename from services/recoveryservices/mgmt/2019-06-15/backup/operations.go rename to services/recoveryservices/mgmt/2022-03-01/backup/operations.go index 75e1357de17f..25f1f5e59441 100644 --- a/services/recoveryservices/mgmt/2019-06-15/backup/operations.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/operations.go @@ -71,7 +71,7 @@ func (client OperationsClient) List(ctx context.Context) (result ClientDiscovery // ListPreparer prepares the List request. func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2016-08-10" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/operationstatuses.go b/services/recoveryservices/mgmt/2022-03-01/backup/operationstatuses.go similarity index 97% rename from services/recoveryservices/mgmt/2019-05-13/backup/operationstatuses.go rename to services/recoveryservices/mgmt/2022-03-01/backup/operationstatuses.go index 44d75d9efebd..aaa3b1fa42aa 100644 --- a/services/recoveryservices/mgmt/2019-05-13/backup/operationstatuses.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/operationstatuses.go @@ -81,7 +81,7 @@ func (client OperationStatusesClient) GetPreparer(ctx context.Context, vaultName "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -89,7 +89,7 @@ func (client OperationStatusesClient) GetPreparer(ctx context.Context, vaultName preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperations/{operationId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperations/{operationId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/recoveryservices/mgmt/2022-03-01/backup/policies.go b/services/recoveryservices/mgmt/2022-03-01/backup/policies.go new file mode 100644 index 000000000000..1052fc45efe4 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-03-01/backup/policies.go @@ -0,0 +1,154 @@ +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PoliciesClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type PoliciesClient struct { + BaseClient +} + +// NewPoliciesClient creates an instance of the PoliciesClient client. +func NewPoliciesClient(subscriptionID string) PoliciesClient { + return NewPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPoliciesClientWithBaseURI creates an instance of the PoliciesClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewPoliciesClientWithBaseURI(baseURI string, subscriptionID string) PoliciesClient { + return PoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists of backup policies associated with Recovery Services Vault. API provides pagination parameters to fetch +// scoped results. +// 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. +func (client PoliciesClient) List(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result ProtectionPolicyResourceListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoliciesClient.List") + defer func() { + sc := -1 + if result.pprl.Response.Response != nil { + sc = result.pprl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, vaultName, resourceGroupName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.PoliciesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pprl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.PoliciesClient", "List", resp, "Failure sending request") + return + } + + result.pprl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.PoliciesClient", "List", resp, "Failure responding to request") + return + } + if result.pprl.hasNextLink() && result.pprl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client PoliciesClient) ListPreparer(ctx context.Context, vaultName string, resourceGroupName string, filter 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 = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies", 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 PoliciesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client PoliciesClient) ListResponder(resp *http.Response) (result ProtectionPolicyResourceList, err error) { + err = autorest.Respond( + resp, + 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 PoliciesClient) listNextResults(ctx context.Context, lastResults ProtectionPolicyResourceList) (result ProtectionPolicyResourceList, err error) { + req, err := lastResults.protectionPolicyResourceListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "backup.PoliciesClient", "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.PoliciesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.PoliciesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client PoliciesClient) ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string) (result ProtectionPolicyResourceListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoliciesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, vaultName, resourceGroupName, filter) + return +} diff --git a/services/recoveryservices/mgmt/2022-03-01/backup/privateendpoint.go b/services/recoveryservices/mgmt/2022-03-01/backup/privateendpoint.go new file mode 100644 index 000000000000..b7e1241d3061 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-03-01/backup/privateendpoint.go @@ -0,0 +1,111 @@ +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PrivateEndpointClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type PrivateEndpointClient struct { + BaseClient +} + +// NewPrivateEndpointClient creates an instance of the PrivateEndpointClient client. +func NewPrivateEndpointClient(subscriptionID string) PrivateEndpointClient { + return NewPrivateEndpointClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateEndpointClientWithBaseURI creates an instance of the PrivateEndpointClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewPrivateEndpointClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointClient { + return PrivateEndpointClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetOperationStatus sends the get operation status request. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// privateEndpointConnectionName - the name of the private endpoint connection. +// operationID - operation id +func (client PrivateEndpointClient) GetOperationStatus(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string, operationID string) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointClient.GetOperationStatus") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetOperationStatusPreparer(ctx, vaultName, resourceGroupName, privateEndpointConnectionName, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.PrivateEndpointClient", "GetOperationStatus", nil, "Failure preparing request") + return + } + + resp, err := client.GetOperationStatusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.PrivateEndpointClient", "GetOperationStatus", resp, "Failure sending request") + return + } + + result, err = client.GetOperationStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.PrivateEndpointClient", "GetOperationStatus", resp, "Failure responding to request") + return + } + + return +} + +// GetOperationStatusPreparer prepares the GetOperationStatus request. +func (client PrivateEndpointClient) GetOperationStatusPreparer(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "operationId": autorest.Encode("path", operationID), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2022-03-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}/privateEndpointConnections/{privateEndpointConnectionName}/operationsStatus/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetOperationStatusSender sends the GetOperationStatus request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointClient) GetOperationStatusSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetOperationStatusResponder handles the response to the GetOperationStatus request. The method always +// closes the http.Response Body. +func (client PrivateEndpointClient) GetOperationStatusResponder(resp *http.Response) (result OperationStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2022-03-01/backup/privateendpointconnection.go b/services/recoveryservices/mgmt/2022-03-01/backup/privateendpointconnection.go new file mode 100644 index 000000000000..0f2f2e4582ec --- /dev/null +++ b/services/recoveryservices/mgmt/2022-03-01/backup/privateendpointconnection.go @@ -0,0 +1,274 @@ +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PrivateEndpointConnectionClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type PrivateEndpointConnectionClient struct { + BaseClient +} + +// NewPrivateEndpointConnectionClient creates an instance of the PrivateEndpointConnectionClient client. +func NewPrivateEndpointConnectionClient(subscriptionID string) PrivateEndpointConnectionClient { + return NewPrivateEndpointConnectionClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateEndpointConnectionClientWithBaseURI creates an instance of the PrivateEndpointConnectionClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewPrivateEndpointConnectionClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionClient { + return PrivateEndpointConnectionClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Delete delete Private Endpoint requests. This call is made by Backup Admin. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// privateEndpointConnectionName - the name of the private endpoint connection. +func (client PrivateEndpointConnectionClient) Delete(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string) (result PrivateEndpointConnectionDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, vaultName, resourceGroupName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.PrivateEndpointConnectionClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.PrivateEndpointConnectionClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PrivateEndpointConnectionClient) DeletePreparer(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2022-03-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}/privateEndpointConnections/{privateEndpointConnectionName}", 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 PrivateEndpointConnectionClient) DeleteSender(req *http.Request) (future PrivateEndpointConnectionDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get Private Endpoint Connection. This call is made by Backup Admin. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// privateEndpointConnectionName - the name of the private endpoint connection. +func (client PrivateEndpointConnectionClient) Get(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string) (result PrivateEndpointConnectionResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.PrivateEndpointConnectionClient", "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.PrivateEndpointConnectionClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.PrivateEndpointConnectionClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateEndpointConnectionClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2022-03-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}/privateEndpointConnections/{privateEndpointConnectionName}", 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 PrivateEndpointConnectionClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionClient) GetResponder(resp *http.Response) (result PrivateEndpointConnectionResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Put approve or Reject Private Endpoint requests. This call is made by Backup Admin. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// privateEndpointConnectionName - the name of the private endpoint connection. +// parameters - request body for operation +func (client PrivateEndpointConnectionClient) Put(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string, parameters PrivateEndpointConnectionResource) (result PrivateEndpointConnectionPutFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionClient.Put") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PutPreparer(ctx, vaultName, resourceGroupName, privateEndpointConnectionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.PrivateEndpointConnectionClient", "Put", nil, "Failure preparing request") + return + } + + result, err = client.PutSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.PrivateEndpointConnectionClient", "Put", result.Response(), "Failure sending request") + return + } + + return +} + +// PutPreparer prepares the Put request. +func (client PrivateEndpointConnectionClient) PutPreparer(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string, parameters PrivateEndpointConnectionResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PutSender sends the Put request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionClient) PutSender(req *http.Request) (future PrivateEndpointConnectionPutFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PutResponder handles the response to the Put request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionClient) PutResponder(resp *http.Response) (result PrivateEndpointConnectionResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/protectablecontainers.go b/services/recoveryservices/mgmt/2022-03-01/backup/protectablecontainers.go similarity index 98% rename from services/recoveryservices/mgmt/2019-06-15/backup/protectablecontainers.go rename to services/recoveryservices/mgmt/2022-03-01/backup/protectablecontainers.go index 65f847abf488..3fe8afc14ae9 100644 --- a/services/recoveryservices/mgmt/2019-06-15/backup/protectablecontainers.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/protectablecontainers.go @@ -83,7 +83,7 @@ func (client ProtectableContainersClient) ListPreparer(ctx context.Context, vaul "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -94,7 +94,7 @@ func (client ProtectableContainersClient) ListPreparer(ctx context.Context, vaul preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectableContainers", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectableContainers", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/protectableitems.go b/services/recoveryservices/mgmt/2022-03-01/backup/protectableitems.go similarity index 98% rename from services/recoveryservices/mgmt/2019-06-15/backup/protectableitems.go rename to services/recoveryservices/mgmt/2022-03-01/backup/protectableitems.go index 167e39969e21..d2cb8016df0b 100644 --- a/services/recoveryservices/mgmt/2019-06-15/backup/protectableitems.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/protectableitems.go @@ -84,7 +84,7 @@ func (client ProtectableItemsClient) ListPreparer(ctx context.Context, vaultName "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -98,7 +98,7 @@ func (client ProtectableItemsClient) ListPreparer(ctx context.Context, vaultName preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectableItems", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectableItems", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/protecteditemoperationstatuses.go b/services/recoveryservices/mgmt/2022-03-01/backup/protecteditemoperationresults.go similarity index 57% rename from services/recoveryservices/mgmt/2020-02-02/backup/protecteditemoperationstatuses.go rename to services/recoveryservices/mgmt/2022-03-01/backup/protecteditemoperationresults.go index c75e6bfe8f46..5f004af393b5 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/protecteditemoperationstatuses.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/protecteditemoperationresults.go @@ -14,37 +14,34 @@ import ( "net/http" ) -// ProtectedItemOperationStatusesClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type ProtectedItemOperationStatusesClient struct { +// ProtectedItemOperationResultsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ProtectedItemOperationResultsClient struct { BaseClient } -// NewProtectedItemOperationStatusesClient creates an instance of the ProtectedItemOperationStatusesClient client. -func NewProtectedItemOperationStatusesClient(subscriptionID string) ProtectedItemOperationStatusesClient { - return NewProtectedItemOperationStatusesClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewProtectedItemOperationResultsClient creates an instance of the ProtectedItemOperationResultsClient client. +func NewProtectedItemOperationResultsClient(subscriptionID string) ProtectedItemOperationResultsClient { + return NewProtectedItemOperationResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewProtectedItemOperationStatusesClientWithBaseURI creates an instance of the ProtectedItemOperationStatusesClient +// NewProtectedItemOperationResultsClientWithBaseURI creates an instance of the ProtectedItemOperationResultsClient // client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI // (sovereign clouds, Azure stack). -func NewProtectedItemOperationStatusesClientWithBaseURI(baseURI string, subscriptionID string) ProtectedItemOperationStatusesClient { - return ProtectedItemOperationStatusesClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewProtectedItemOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) ProtectedItemOperationResultsClient { + return ProtectedItemOperationResultsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Get fetches the status of an operation such as triggering a backup, restore. The status can be in progress, -// completed -// or failed. You can refer to the OperationStatus enum for all the possible states of the operation. Some operations -// create jobs. This method returns the list of jobs associated with the operation. +// Get fetches the result of any operation on the backup 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 backup item. // containerName - container name associated with the backup item. // protectedItemName - backup item name whose details are to be fetched. -// operationID - operationID represents the operation whose status needs to be fetched. -func (client ProtectedItemOperationStatusesClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, operationID string) (result OperationStatus, err error) { +// operationID - operationID which represents the operation whose result needs to be fetched. +func (client ProtectedItemOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, operationID string) (result ProtectedItemResource, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemOperationStatusesClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemOperationResultsClient.Get") defer func() { sc := -1 if result.Response.Response != nil { @@ -55,20 +52,20 @@ func (client ProtectedItemOperationStatusesClient) Get(ctx context.Context, vaul } req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationID) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectedItemOperationStatusesClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "backup.ProtectedItemOperationResultsClient", "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.ProtectedItemOperationStatusesClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "backup.ProtectedItemOperationResultsClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectedItemOperationStatusesClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "backup.ProtectedItemOperationResultsClient", "Get", resp, "Failure responding to request") return } @@ -76,7 +73,7 @@ func (client ProtectedItemOperationStatusesClient) Get(ctx context.Context, vaul } // GetPreparer prepares the Get request. -func (client ProtectedItemOperationStatusesClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, operationID string) (*http.Request, error) { +func (client ProtectedItemOperationResultsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, operationID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "containerName": autorest.Encode("path", containerName), "fabricName": autorest.Encode("path", fabricName), @@ -87,7 +84,7 @@ func (client ProtectedItemOperationStatusesClient) GetPreparer(ctx context.Conte "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -95,23 +92,23 @@ func (client ProtectedItemOperationStatusesClient) GetPreparer(ctx context.Conte preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/operationsStatus/{operationId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/operationResults/{operationId}", 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 ProtectedItemOperationStatusesClient) GetSender(req *http.Request) (*http.Response, error) { +func (client ProtectedItemOperationResultsClient) GetSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client ProtectedItemOperationStatusesClient) GetResponder(resp *http.Response) (result OperationStatus, err error) { +func (client ProtectedItemOperationResultsClient) GetResponder(resp *http.Response) (result ProtectedItemResource, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/protecteditemoperationstatuses.go b/services/recoveryservices/mgmt/2022-03-01/backup/protecteditemoperationstatuses.go similarity index 98% rename from services/recoveryservices/mgmt/2019-05-13/backup/protecteditemoperationstatuses.go rename to services/recoveryservices/mgmt/2022-03-01/backup/protecteditemoperationstatuses.go index c75e6bfe8f46..f8976ad81fba 100644 --- a/services/recoveryservices/mgmt/2019-05-13/backup/protecteditemoperationstatuses.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/protecteditemoperationstatuses.go @@ -87,7 +87,7 @@ func (client ProtectedItemOperationStatusesClient) GetPreparer(ctx context.Conte "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -95,7 +95,7 @@ func (client ProtectedItemOperationStatusesClient) GetPreparer(ctx context.Conte preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/operationsStatus/{operationId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/operationsStatus/{operationId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/recoveryservices/mgmt/2022-03-01/backup/protecteditems.go b/services/recoveryservices/mgmt/2022-03-01/backup/protecteditems.go new file mode 100644 index 000000000000..f6e251937d32 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-03-01/backup/protecteditems.go @@ -0,0 +1,289 @@ +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ProtectedItemsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ProtectedItemsClient struct { + BaseClient +} + +// NewProtectedItemsClient creates an instance of the ProtectedItemsClient client. +func NewProtectedItemsClient(subscriptionID string) ProtectedItemsClient { + return NewProtectedItemsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProtectedItemsClientWithBaseURI creates an instance of the ProtectedItemsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewProtectedItemsClientWithBaseURI(baseURI string, subscriptionID string) ProtectedItemsClient { + return ProtectedItemsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate enables backup of an item or to modifies the backup policy information of an already backed 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 backup item. +// containerName - container name associated with the backup item. +// protectedItemName - item name to be backed up. +// parameters - resource backed up item +func (client ProtectedItemsClient) CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters ProtectedItemResource) (result ProtectedItemResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ProtectedItemsClient) CreateOrUpdatePreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters ProtectedItemResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "fabricName": autorest.Encode("path", fabricName), + "protectedItemName": autorest.Encode("path", protectedItemName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ProtectedItemsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ProtectedItemsClient) CreateOrUpdateResponder(resp *http.Response) (result ProtectedItemResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete used to disable backup of an item within a container. This is an asynchronous operation. To know the status +// of the +// request, 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. +// containerName - container name associated with the backed up item. +// protectedItemName - backed up item to be deleted. +func (client ProtectedItemsClient) Delete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ProtectedItemsClient) DeletePreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "fabricName": autorest.Encode("path", fabricName), + "protectedItemName": autorest.Encode("path", protectedItemName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2022-03-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}/protectionContainers/{containerName}/protectedItems/{protectedItemName}", 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 ProtectedItemsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ProtectedItemsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get provides the details of the backed 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. +// containerName - container name associated with the backed up item. +// protectedItemName - backed up item name whose details are to be fetched. +// filter - oData filter options. +func (client ProtectedItemsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result ProtectedItemResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "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.ProtectedItemsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ProtectedItemsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "fabricName": autorest.Encode("path", fabricName), + "protectedItemName": autorest.Encode("path", protectedItemName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}", 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 ProtectedItemsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ProtectedItemsClient) GetResponder(resp *http.Response) (result ProtectedItemResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2021-07-01/backup/protecteditemscrr.go b/services/recoveryservices/mgmt/2022-03-01/backup/protecteditemsgroup.go similarity index 60% rename from services/recoveryservices/mgmt/2021-07-01/backup/protecteditemscrr.go rename to services/recoveryservices/mgmt/2022-03-01/backup/protecteditemsgroup.go index 74fb6bf3b709..b945520b6ad2 100644 --- a/services/recoveryservices/mgmt/2021-07-01/backup/protecteditemscrr.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/protecteditemsgroup.go @@ -14,21 +14,21 @@ import ( "net/http" ) -// ProtectedItemsCrrClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type ProtectedItemsCrrClient struct { +// ProtectedItemsGroupClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ProtectedItemsGroupClient struct { BaseClient } -// NewProtectedItemsCrrClient creates an instance of the ProtectedItemsCrrClient client. -func NewProtectedItemsCrrClient(subscriptionID string) ProtectedItemsCrrClient { - return NewProtectedItemsCrrClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewProtectedItemsGroupClient creates an instance of the ProtectedItemsGroupClient client. +func NewProtectedItemsGroupClient(subscriptionID string) ProtectedItemsGroupClient { + return NewProtectedItemsGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewProtectedItemsCrrClientWithBaseURI creates an instance of the ProtectedItemsCrrClient client using a custom +// NewProtectedItemsGroupClientWithBaseURI creates an instance of the ProtectedItemsGroupClient client using a custom // endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure // stack). -func NewProtectedItemsCrrClientWithBaseURI(baseURI string, subscriptionID string) ProtectedItemsCrrClient { - return ProtectedItemsCrrClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewProtectedItemsGroupClientWithBaseURI(baseURI string, subscriptionID string) ProtectedItemsGroupClient { + return ProtectedItemsGroupClient{NewWithBaseURI(baseURI, subscriptionID)} } // List provides a pageable list of all items that are backed up within a vault. @@ -37,9 +37,9 @@ func NewProtectedItemsCrrClientWithBaseURI(baseURI string, subscriptionID string // resourceGroupName - the name of the resource group where the recovery services vault is present. // filter - oData filter options. // skipToken - skipToken Filter. -func (client ProtectedItemsCrrClient) List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result ProtectedItemResourceListPage, err error) { +func (client ProtectedItemsGroupClient) List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result ProtectedItemResourceListPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemsCrrClient.List") + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemsGroupClient.List") defer func() { sc := -1 if result.pirl.Response.Response != nil { @@ -51,20 +51,20 @@ func (client ProtectedItemsCrrClient) List(ctx context.Context, vaultName string result.fn = client.listNextResults req, err := client.ListPreparer(ctx, vaultName, resourceGroupName, filter, skipToken) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsCrrClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsGroupClient", "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.ProtectedItemsCrrClient", "List", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsGroupClient", "List", resp, "Failure sending request") return } result.pirl, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsCrrClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsGroupClient", "List", resp, "Failure responding to request") return } if result.pirl.hasNextLink() && result.pirl.IsEmpty() { @@ -76,14 +76,14 @@ func (client ProtectedItemsCrrClient) List(ctx context.Context, vaultName string } // ListPreparer prepares the List request. -func (client ProtectedItemsCrrClient) ListPreparer(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (*http.Request, error) { +func (client ProtectedItemsGroupClient) 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 = "2018-12-20" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -97,20 +97,20 @@ func (client ProtectedItemsCrrClient) ListPreparer(ctx context.Context, vaultNam preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectedItems/", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectedItems", 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 ProtectedItemsCrrClient) ListSender(req *http.Request) (*http.Response, error) { +func (client ProtectedItemsGroupClient) ListSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client ProtectedItemsCrrClient) ListResponder(resp *http.Response) (result ProtectedItemResourceList, err error) { +func (client ProtectedItemsGroupClient) ListResponder(resp *http.Response) (result ProtectedItemResourceList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -121,10 +121,10 @@ func (client ProtectedItemsCrrClient) ListResponder(resp *http.Response) (result } // listNextResults retrieves the next set of results, if any. -func (client ProtectedItemsCrrClient) listNextResults(ctx context.Context, lastResults ProtectedItemResourceList) (result ProtectedItemResourceList, err error) { +func (client ProtectedItemsGroupClient) listNextResults(ctx context.Context, lastResults ProtectedItemResourceList) (result ProtectedItemResourceList, err error) { req, err := lastResults.protectedItemResourceListPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "backup.ProtectedItemsCrrClient", "listNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "backup.ProtectedItemsGroupClient", "listNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -132,19 +132,19 @@ func (client ProtectedItemsCrrClient) listNextResults(ctx context.Context, lastR resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "backup.ProtectedItemsCrrClient", "listNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "backup.ProtectedItemsGroupClient", "listNextResults", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectedItemsCrrClient", "listNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "backup.ProtectedItemsGroupClient", "listNextResults", resp, "Failure responding to next results request") } return } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ProtectedItemsCrrClient) ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result ProtectedItemResourceListIterator, err error) { +func (client ProtectedItemsGroupClient) ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result ProtectedItemResourceListIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemsCrrClient.List") + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemsGroupClient.List") defer func() { sc := -1 if result.Response().Response.Response != nil { diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/protectioncontaineroperationresults.go b/services/recoveryservices/mgmt/2022-03-01/backup/protectioncontaineroperationresults.go similarity index 98% rename from services/recoveryservices/mgmt/2019-06-15/backup/protectioncontaineroperationresults.go rename to services/recoveryservices/mgmt/2022-03-01/backup/protectioncontaineroperationresults.go index 3972ce476457..73f8afd86747 100644 --- a/services/recoveryservices/mgmt/2019-06-15/backup/protectioncontaineroperationresults.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/protectioncontaineroperationresults.go @@ -83,7 +83,7 @@ func (client ProtectionContainerOperationResultsClient) GetPreparer(ctx context. "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -91,7 +91,7 @@ func (client ProtectionContainerOperationResultsClient) GetPreparer(ctx context. preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/operationResults/{operationId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/operationResults/{operationId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/protectioncontainerrefreshoperationresults.go b/services/recoveryservices/mgmt/2022-03-01/backup/protectioncontainerrefreshoperationresults.go similarity index 98% rename from services/recoveryservices/mgmt/2019-05-13/backup/protectioncontainerrefreshoperationresults.go rename to services/recoveryservices/mgmt/2022-03-01/backup/protectioncontainerrefreshoperationresults.go index 5b491864b588..8dab9c58ce20 100644 --- a/services/recoveryservices/mgmt/2019-05-13/backup/protectioncontainerrefreshoperationresults.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/protectioncontainerrefreshoperationresults.go @@ -81,7 +81,7 @@ func (client ProtectionContainerRefreshOperationResultsClient) GetPreparer(ctx c "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -89,7 +89,7 @@ func (client ProtectionContainerRefreshOperationResultsClient) GetPreparer(ctx c preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/operationResults/{operationId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/operationResults/{operationId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/protectioncontainers.go b/services/recoveryservices/mgmt/2022-03-01/backup/protectioncontainers.go similarity index 97% rename from services/recoveryservices/mgmt/2020-02-02/backup/protectioncontainers.go rename to services/recoveryservices/mgmt/2022-03-01/backup/protectioncontainers.go index d12c30289ff6..e7e3b2cf81e2 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/protectioncontainers.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/protectioncontainers.go @@ -80,7 +80,7 @@ func (client ProtectionContainersClient) GetPreparer(ctx context.Context, vaultN "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -88,7 +88,7 @@ func (client ProtectionContainersClient) GetPreparer(ctx context.Context, vaultN preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -161,7 +161,7 @@ func (client ProtectionContainersClient) InquirePreparer(ctx context.Context, va "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -172,7 +172,7 @@ func (client ProtectionContainersClient) InquirePreparer(ctx context.Context, va preparer := autorest.CreatePreparer( autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/inquire", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/inquire", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -244,7 +244,7 @@ func (client ProtectionContainersClient) RefreshPreparer(ctx context.Context, va "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -255,7 +255,7 @@ func (client ProtectionContainersClient) RefreshPreparer(ctx context.Context, va preparer := autorest.CreatePreparer( autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/refreshContainers", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/refreshContainers", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -329,7 +329,7 @@ func (client ProtectionContainersClient) RegisterPreparer(ctx context.Context, v "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -338,7 +338,7 @@ func (client ProtectionContainersClient) RegisterPreparer(ctx context.Context, v autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -413,7 +413,7 @@ func (client ProtectionContainersClient) UnregisterPreparer(ctx context.Context, "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -421,7 +421,7 @@ func (client ProtectionContainersClient) UnregisterPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/protectioncontainersgroup.go b/services/recoveryservices/mgmt/2022-03-01/backup/protectioncontainersgroup.go similarity index 98% rename from services/recoveryservices/mgmt/2019-05-13/backup/protectioncontainersgroup.go rename to services/recoveryservices/mgmt/2022-03-01/backup/protectioncontainersgroup.go index 408df75c78bd..006f32880021 100644 --- a/services/recoveryservices/mgmt/2019-05-13/backup/protectioncontainersgroup.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/protectioncontainersgroup.go @@ -82,7 +82,7 @@ func (client ProtectionContainersGroupClient) ListPreparer(ctx context.Context, "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -93,7 +93,7 @@ func (client ProtectionContainersGroupClient) ListPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectionContainers", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectionContainers", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/protectionintent.go b/services/recoveryservices/mgmt/2022-03-01/backup/protectionintent.go similarity index 99% rename from services/recoveryservices/mgmt/2020-02-02/backup/protectionintent.go rename to services/recoveryservices/mgmt/2022-03-01/backup/protectionintent.go index 0327017ed0bb..c615e936db8f 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/protectionintent.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/protectionintent.go @@ -81,7 +81,7 @@ func (client ProtectionIntentClient) CreateOrUpdatePreparer(ctx context.Context, "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2017-07-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -163,7 +163,7 @@ func (client ProtectionIntentClient) DeletePreparer(ctx context.Context, vaultNa "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2017-07-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -244,7 +244,7 @@ func (client ProtectionIntentClient) GetPreparer(ctx context.Context, vaultName "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2017-07-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -319,7 +319,7 @@ func (client ProtectionIntentClient) ValidatePreparer(ctx context.Context, azure "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-07-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/protectionintentgroup.go b/services/recoveryservices/mgmt/2022-03-01/backup/protectionintentgroup.go similarity index 99% rename from services/recoveryservices/mgmt/2019-06-15/backup/protectionintentgroup.go rename to services/recoveryservices/mgmt/2022-03-01/backup/protectionintentgroup.go index a7975f8baaec..5cc376c78ba3 100644 --- a/services/recoveryservices/mgmt/2019-06-15/backup/protectionintentgroup.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/protectionintentgroup.go @@ -83,7 +83,7 @@ func (client ProtectionIntentGroupClient) ListPreparer(ctx context.Context, vaul "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2017-07-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2022-03-01/backup/protectionpolicies.go b/services/recoveryservices/mgmt/2022-03-01/backup/protectionpolicies.go new file mode 100644 index 000000000000..05922895f0e3 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-03-01/backup/protectionpolicies.go @@ -0,0 +1,276 @@ +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ProtectionPoliciesClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ProtectionPoliciesClient struct { + BaseClient +} + +// NewProtectionPoliciesClient creates an instance of the ProtectionPoliciesClient client. +func NewProtectionPoliciesClient(subscriptionID string) ProtectionPoliciesClient { + return NewProtectionPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProtectionPoliciesClientWithBaseURI creates an instance of the ProtectionPoliciesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewProtectionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ProtectionPoliciesClient { + return ProtectionPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or modifies a backup policy. This is an asynchronous operation. Status of the operation can +// be fetched +// using GetPolicyOperationResult API. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// policyName - backup policy to be created. +// parameters - resource backup policy +func (client ProtectionPoliciesClient) CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, policyName string, parameters ProtectionPolicyResource) (result ProtectionPolicyResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionPoliciesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, vaultName, resourceGroupName, policyName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ProtectionPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, vaultName string, resourceGroupName string, policyName string, parameters ProtectionPolicyResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ProtectionPoliciesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ProtectionPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ProtectionPolicyResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status +// of the +// operation can be fetched using GetProtectionPolicyOperationResult API. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// policyName - backup policy to be deleted. +func (client ProtectionPoliciesClient) Delete(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (result ProtectionPoliciesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionPoliciesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, vaultName, resourceGroupName, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ProtectionPoliciesClient) DeletePreparer(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2022-03-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}/backupPolicies/{policyName}", 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 ProtectionPoliciesClient) DeleteSender(req *http.Request) (future ProtectionPoliciesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ProtectionPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous +// operation. Status of the operation can be fetched using GetPolicyOperationResult API. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// policyName - backup policy information to be fetched. +func (client ProtectionPoliciesClient) Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (result ProtectionPolicyResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionPoliciesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "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.ProtectionPoliciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionPoliciesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ProtectionPoliciesClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2022-03-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}/backupPolicies/{policyName}", 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 ProtectionPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ProtectionPoliciesClient) GetResponder(resp *http.Response) (result ProtectionPolicyResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/protectionpolicyoperationstatuses.go b/services/recoveryservices/mgmt/2022-03-01/backup/protectionpolicyoperationresults.go similarity index 52% rename from services/recoveryservices/mgmt/2019-05-13/backup/protectionpolicyoperationstatuses.go rename to services/recoveryservices/mgmt/2022-03-01/backup/protectionpolicyoperationresults.go index 7f45850a8d3a..acb7f5820366 100644 --- a/services/recoveryservices/mgmt/2019-05-13/backup/protectionpolicyoperationstatuses.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/protectionpolicyoperationresults.go @@ -14,36 +14,32 @@ import ( "net/http" ) -// ProtectionPolicyOperationStatusesClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type ProtectionPolicyOperationStatusesClient struct { +// ProtectionPolicyOperationResultsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ProtectionPolicyOperationResultsClient struct { BaseClient } -// NewProtectionPolicyOperationStatusesClient creates an instance of the ProtectionPolicyOperationStatusesClient -// client. -func NewProtectionPolicyOperationStatusesClient(subscriptionID string) ProtectionPolicyOperationStatusesClient { - return NewProtectionPolicyOperationStatusesClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewProtectionPolicyOperationResultsClient creates an instance of the ProtectionPolicyOperationResultsClient client. +func NewProtectionPolicyOperationResultsClient(subscriptionID string) ProtectionPolicyOperationResultsClient { + return NewProtectionPolicyOperationResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewProtectionPolicyOperationStatusesClientWithBaseURI creates an instance of the -// ProtectionPolicyOperationStatusesClient client using a custom endpoint. Use this when interacting with an Azure +// NewProtectionPolicyOperationResultsClientWithBaseURI creates an instance of the +// ProtectionPolicyOperationResultsClient client using a custom endpoint. Use this when interacting with an Azure // cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewProtectionPolicyOperationStatusesClientWithBaseURI(baseURI string, subscriptionID string) ProtectionPolicyOperationStatusesClient { - return ProtectionPolicyOperationStatusesClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewProtectionPolicyOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) ProtectionPolicyOperationResultsClient { + return ProtectionPolicyOperationResultsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Get provides the status of the asynchronous operations like backup, restore. The status can be in progress, -// completed -// or failed. You can refer to the Operation Status enum for all the possible states of an operation. Some operations -// create jobs. This method returns the list of jobs associated with operation. +// Get provides the result of an operation. // Parameters: // vaultName - the name of the recovery services vault. // resourceGroupName - the name of the resource group where the recovery services vault is present. -// policyName - backup policy name whose operation's status needs to be fetched. -// operationID - operation ID which represents an operation whose status needs to be fetched. -func (client ProtectionPolicyOperationStatusesClient) Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string) (result OperationStatus, err error) { +// policyName - backup policy name whose operation's result needs to be fetched. +// operationID - operation ID which represents the operation whose result needs to be fetched. +func (client ProtectionPolicyOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string) (result ProtectionPolicyResource, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionPolicyOperationStatusesClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/ProtectionPolicyOperationResultsClient.Get") defer func() { sc := -1 if result.Response.Response != nil { @@ -54,20 +50,20 @@ func (client ProtectionPolicyOperationStatusesClient) Get(ctx context.Context, v } req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, policyName, operationID) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionPolicyOperationStatusesClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "backup.ProtectionPolicyOperationResultsClient", "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.ProtectionPolicyOperationStatusesClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "backup.ProtectionPolicyOperationResultsClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ProtectionPolicyOperationStatusesClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "backup.ProtectionPolicyOperationResultsClient", "Get", resp, "Failure responding to request") return } @@ -75,7 +71,7 @@ func (client ProtectionPolicyOperationStatusesClient) Get(ctx context.Context, v } // GetPreparer prepares the Get request. -func (client ProtectionPolicyOperationStatusesClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string) (*http.Request, error) { +func (client ProtectionPolicyOperationResultsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "operationId": autorest.Encode("path", operationID), "policyName": autorest.Encode("path", policyName), @@ -84,7 +80,7 @@ func (client ProtectionPolicyOperationStatusesClient) GetPreparer(ctx context.Co "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -92,20 +88,20 @@ func (client ProtectionPolicyOperationStatusesClient) GetPreparer(ctx context.Co preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}/operations/{operationId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}/operationResults/{operationId}", 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 ProtectionPolicyOperationStatusesClient) GetSender(req *http.Request) (*http.Response, error) { +func (client ProtectionPolicyOperationResultsClient) GetSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client ProtectionPolicyOperationStatusesClient) GetResponder(resp *http.Response) (result OperationStatus, err error) { +func (client ProtectionPolicyOperationResultsClient) GetResponder(resp *http.Response) (result ProtectionPolicyResource, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/protectionpolicyoperationstatuses.go b/services/recoveryservices/mgmt/2022-03-01/backup/protectionpolicyoperationstatuses.go similarity index 98% rename from services/recoveryservices/mgmt/2020-02-02/backup/protectionpolicyoperationstatuses.go rename to services/recoveryservices/mgmt/2022-03-01/backup/protectionpolicyoperationstatuses.go index 7f45850a8d3a..091898f94351 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/protectionpolicyoperationstatuses.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/protectionpolicyoperationstatuses.go @@ -84,7 +84,7 @@ func (client ProtectionPolicyOperationStatusesClient) GetPreparer(ctx context.Co "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -92,7 +92,7 @@ func (client ProtectionPolicyOperationStatusesClient) GetPreparer(ctx context.Co preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}/operations/{operationId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}/operations/{operationId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/recoveryservices/mgmt/2022-03-01/backup/recoverypoints.go b/services/recoveryservices/mgmt/2022-03-01/backup/recoverypoints.go new file mode 100644 index 000000000000..609fa3b648a9 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-03-01/backup/recoverypoints.go @@ -0,0 +1,245 @@ +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RecoveryPointsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type RecoveryPointsClient struct { + BaseClient +} + +// NewRecoveryPointsClient creates an instance of the RecoveryPointsClient client. +func NewRecoveryPointsClient(subscriptionID string) RecoveryPointsClient { + return NewRecoveryPointsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRecoveryPointsClientWithBaseURI creates an instance of the RecoveryPointsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewRecoveryPointsClientWithBaseURI(baseURI string, subscriptionID string) RecoveryPointsClient { + return RecoveryPointsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get provides the information of the backed up data identified using RecoveryPointID. This is an asynchronous +// operation. +// To know the status of the operation, call the GetProtectedItemOperationResult 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 backed up item. +// containerName - container name associated with backed up item. +// protectedItemName - backed up item name whose backup data needs to be fetched. +// recoveryPointID - recoveryPointID represents the backed up data to be fetched. +func (client RecoveryPointsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string) (result RecoveryPointResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointID) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "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.RecoveryPointsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client RecoveryPointsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "fabricName": autorest.Encode("path", fabricName), + "protectedItemName": autorest.Encode("path", protectedItemName), + "recoveryPointId": autorest.Encode("path", recoveryPointID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2022-03-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}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}", 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 RecoveryPointsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RecoveryPointsClient) GetResponder(resp *http.Response) (result RecoveryPointResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the backup copies for the backed up 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 backed up item. +// containerName - container name associated with the backed up item. +// protectedItemName - backed up item whose backup copies are to be fetched. +// filter - oData filter options. +func (client RecoveryPointsClient) List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result RecoveryPointResourceListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.List") + defer func() { + sc := -1 + if result.rprl.Response.Response != nil { + sc = result.rprl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rprl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "List", resp, "Failure sending request") + return + } + + result.rprl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "List", resp, "Failure responding to request") + return + } + if result.rprl.hasNextLink() && result.rprl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client RecoveryPointsClient) ListPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "fabricName": autorest.Encode("path", fabricName), + "protectedItemName": autorest.Encode("path", protectedItemName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints", 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 RecoveryPointsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client RecoveryPointsClient) ListResponder(resp *http.Response) (result RecoveryPointResourceList, err error) { + err = autorest.Respond( + resp, + 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 RecoveryPointsClient) listNextResults(ctx context.Context, lastResults RecoveryPointResourceList) (result RecoveryPointResourceList, err error) { + req, err := lastResults.recoveryPointResourceListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "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.RecoveryPointsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.RecoveryPointsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client RecoveryPointsClient) ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result RecoveryPointResourceListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter) + return +} diff --git a/services/recoveryservices/mgmt/2021-07-01/backup/recoverypointscrr.go b/services/recoveryservices/mgmt/2022-03-01/backup/recoverypointsrecommendedformove.go similarity index 50% rename from services/recoveryservices/mgmt/2021-07-01/backup/recoverypointscrr.go rename to services/recoveryservices/mgmt/2022-03-01/backup/recoverypointsrecommendedformove.go index 65031ef88a9e..280524f5b3dc 100644 --- a/services/recoveryservices/mgmt/2021-07-01/backup/recoverypointscrr.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/recoverypointsrecommendedformove.go @@ -14,34 +14,31 @@ import ( "net/http" ) -// RecoveryPointsCrrClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type RecoveryPointsCrrClient struct { +// RecoveryPointsRecommendedForMoveClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type RecoveryPointsRecommendedForMoveClient struct { BaseClient } -// NewRecoveryPointsCrrClient creates an instance of the RecoveryPointsCrrClient client. -func NewRecoveryPointsCrrClient(subscriptionID string) RecoveryPointsCrrClient { - return NewRecoveryPointsCrrClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewRecoveryPointsRecommendedForMoveClient creates an instance of the RecoveryPointsRecommendedForMoveClient client. +func NewRecoveryPointsRecommendedForMoveClient(subscriptionID string) RecoveryPointsRecommendedForMoveClient { + return NewRecoveryPointsRecommendedForMoveClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewRecoveryPointsCrrClientWithBaseURI creates an instance of the RecoveryPointsCrrClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewRecoveryPointsCrrClientWithBaseURI(baseURI string, subscriptionID string) RecoveryPointsCrrClient { - return RecoveryPointsCrrClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewRecoveryPointsRecommendedForMoveClientWithBaseURI creates an instance of the +// RecoveryPointsRecommendedForMoveClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewRecoveryPointsRecommendedForMoveClientWithBaseURI(baseURI string, subscriptionID string) RecoveryPointsRecommendedForMoveClient { + return RecoveryPointsRecommendedForMoveClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List lists the backup copies for the backed up item. +// List lists the recovery points recommended for move to another tier // 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. -// containerName - container name associated with the backed up item. -// protectedItemName - backed up item whose backup copies are to be fetched. -// filter - oData filter options. -func (client RecoveryPointsCrrClient) List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result RecoveryPointResourceListPage, err error) { +// parameters - list Recovery points Recommended for Move Request +func (client RecoveryPointsRecommendedForMoveClient) List(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters ListRecoveryPointsRecommendedForMoveRequest) (result RecoveryPointResourceListPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsCrrClient.List") + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsRecommendedForMoveClient.List") defer func() { sc := -1 if result.rprl.Response.Response != nil { @@ -51,22 +48,22 @@ func (client RecoveryPointsCrrClient) List(ctx context.Context, vaultName string }() } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter) + req, err := client.ListPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters) if err != nil { - err = autorest.NewErrorWithError(err, "backup.RecoveryPointsCrrClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "backup.RecoveryPointsRecommendedForMoveClient", "List", nil, "Failure preparing request") return } resp, err := client.ListSender(req) if err != nil { result.rprl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.RecoveryPointsCrrClient", "List", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "backup.RecoveryPointsRecommendedForMoveClient", "List", resp, "Failure sending request") return } result.rprl, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "backup.RecoveryPointsCrrClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "backup.RecoveryPointsRecommendedForMoveClient", "List", resp, "Failure responding to request") return } if result.rprl.hasNextLink() && result.rprl.IsEmpty() { @@ -78,7 +75,7 @@ func (client RecoveryPointsCrrClient) List(ctx context.Context, vaultName string } // ListPreparer prepares the List request. -func (client RecoveryPointsCrrClient) ListPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (*http.Request, error) { +func (client RecoveryPointsRecommendedForMoveClient) ListPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters ListRecoveryPointsRecommendedForMoveRequest) (*http.Request, error) { pathParameters := map[string]interface{}{ "containerName": autorest.Encode("path", containerName), "fabricName": autorest.Encode("path", fabricName), @@ -88,31 +85,30 @@ func (client RecoveryPointsCrrClient) ListPreparer(ctx context.Context, vaultNam "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2018-12-20" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } preparer := autorest.CreatePreparer( - autorest.AsGet(), + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPointsRecommendedForMove", pathParameters), + autorest.WithJSON(parameters), 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 RecoveryPointsCrrClient) ListSender(req *http.Request) (*http.Response, error) { +func (client RecoveryPointsRecommendedForMoveClient) ListSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client RecoveryPointsCrrClient) ListResponder(resp *http.Response) (result RecoveryPointResourceList, err error) { +func (client RecoveryPointsRecommendedForMoveClient) ListResponder(resp *http.Response) (result RecoveryPointResourceList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -123,10 +119,10 @@ func (client RecoveryPointsCrrClient) ListResponder(resp *http.Response) (result } // listNextResults retrieves the next set of results, if any. -func (client RecoveryPointsCrrClient) listNextResults(ctx context.Context, lastResults RecoveryPointResourceList) (result RecoveryPointResourceList, err error) { +func (client RecoveryPointsRecommendedForMoveClient) listNextResults(ctx context.Context, lastResults RecoveryPointResourceList) (result RecoveryPointResourceList, err error) { req, err := lastResults.recoveryPointResourceListPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "backup.RecoveryPointsCrrClient", "listNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "backup.RecoveryPointsRecommendedForMoveClient", "listNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -134,19 +130,19 @@ func (client RecoveryPointsCrrClient) listNextResults(ctx context.Context, lastR resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "backup.RecoveryPointsCrrClient", "listNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "backup.RecoveryPointsRecommendedForMoveClient", "listNextResults", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "backup.RecoveryPointsCrrClient", "listNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "backup.RecoveryPointsRecommendedForMoveClient", "listNextResults", resp, "Failure responding to next results request") } return } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client RecoveryPointsCrrClient) ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, filter string) (result RecoveryPointResourceListIterator, err error) { +func (client RecoveryPointsRecommendedForMoveClient) ListComplete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters ListRecoveryPointsRecommendedForMoveRequest) (result RecoveryPointResourceListIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsCrrClient.List") + ctx = tracing.StartSpan(ctx, fqdn+"/RecoveryPointsRecommendedForMoveClient.List") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -155,6 +151,6 @@ func (client RecoveryPointsCrrClient) ListComplete(ctx context.Context, vaultNam tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter) + result.page, err = client.List(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters) return } diff --git a/services/recoveryservices/mgmt/2022-03-01/backup/resourceencryptionconfigs.go b/services/recoveryservices/mgmt/2022-03-01/backup/resourceencryptionconfigs.go new file mode 100644 index 000000000000..885cff135472 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-03-01/backup/resourceencryptionconfigs.go @@ -0,0 +1,186 @@ +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ResourceEncryptionConfigsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ResourceEncryptionConfigsClient struct { + BaseClient +} + +// NewResourceEncryptionConfigsClient creates an instance of the ResourceEncryptionConfigsClient client. +func NewResourceEncryptionConfigsClient(subscriptionID string) ResourceEncryptionConfigsClient { + return NewResourceEncryptionConfigsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewResourceEncryptionConfigsClientWithBaseURI creates an instance of the ResourceEncryptionConfigsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewResourceEncryptionConfigsClientWithBaseURI(baseURI string, subscriptionID string) ResourceEncryptionConfigsClient { + return ResourceEncryptionConfigsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get fetches Vault Encryption config. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +func (client ResourceEncryptionConfigsClient) Get(ctx context.Context, vaultName string, resourceGroupName string) (result ResourceEncryptionConfigExtendedResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceEncryptionConfigsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ResourceEncryptionConfigsClient", "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.ResourceEncryptionConfigsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ResourceEncryptionConfigsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ResourceEncryptionConfigsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName 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 = "2022-03-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}/backupEncryptionConfigs/backupResourceEncryptionConfig", 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 ResourceEncryptionConfigsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ResourceEncryptionConfigsClient) GetResponder(resp *http.Response) (result ResourceEncryptionConfigExtendedResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates Vault encryption config. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// parameters - vault encryption input config request +func (client ResourceEncryptionConfigsClient) Update(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceEncryptionConfigResource) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceEncryptionConfigsClient.Update") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, vaultName, resourceGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ResourceEncryptionConfigsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "backup.ResourceEncryptionConfigsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ResourceEncryptionConfigsClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ResourceEncryptionConfigsClient) UpdatePreparer(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceEncryptionConfigResource) (*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 = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEncryptionConfigs/backupResourceEncryptionConfig", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ResourceEncryptionConfigsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ResourceEncryptionConfigsClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/recoveryservices/mgmt/2022-03-01/backup/resourceguardproxies.go b/services/recoveryservices/mgmt/2022-03-01/backup/resourceguardproxies.go new file mode 100644 index 000000000000..f3c2a5dec214 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-03-01/backup/resourceguardproxies.go @@ -0,0 +1,150 @@ +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ResourceGuardProxiesClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ResourceGuardProxiesClient struct { + BaseClient +} + +// NewResourceGuardProxiesClient creates an instance of the ResourceGuardProxiesClient client. +func NewResourceGuardProxiesClient(subscriptionID string) ResourceGuardProxiesClient { + return NewResourceGuardProxiesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewResourceGuardProxiesClientWithBaseURI creates an instance of the ResourceGuardProxiesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewResourceGuardProxiesClientWithBaseURI(baseURI string, subscriptionID string) ResourceGuardProxiesClient { + return ResourceGuardProxiesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get list the ResourceGuardProxies under vault +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +func (client ResourceGuardProxiesClient) Get(ctx context.Context, vaultName string, resourceGroupName string) (result ResourceGuardProxyBaseResourceListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceGuardProxiesClient.Get") + defer func() { + sc := -1 + if result.rgpbrl.Response.Response != nil { + sc = result.rgpbrl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.getNextResults + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ResourceGuardProxiesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.rgpbrl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.ResourceGuardProxiesClient", "Get", resp, "Failure sending request") + return + } + + result.rgpbrl, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ResourceGuardProxiesClient", "Get", resp, "Failure responding to request") + return + } + if result.rgpbrl.hasNextLink() && result.rgpbrl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ResourceGuardProxiesClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName 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 = "2022-03-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}/backupResourceGuardProxies", 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 ResourceGuardProxiesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ResourceGuardProxiesClient) GetResponder(resp *http.Response) (result ResourceGuardProxyBaseResourceList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getNextResults retrieves the next set of results, if any. +func (client ResourceGuardProxiesClient) getNextResults(ctx context.Context, lastResults ResourceGuardProxyBaseResourceList) (result ResourceGuardProxyBaseResourceList, err error) { + req, err := lastResults.resourceGuardProxyBaseResourceListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "backup.ResourceGuardProxiesClient", "getNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "backup.ResourceGuardProxiesClient", "getNextResults", resp, "Failure sending next results request") + } + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ResourceGuardProxiesClient", "getNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetComplete enumerates all values, automatically crossing page boundaries as required. +func (client ResourceGuardProxiesClient) GetComplete(ctx context.Context, vaultName string, resourceGroupName string) (result ResourceGuardProxyBaseResourceListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceGuardProxiesClient.Get") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.Get(ctx, vaultName, resourceGroupName) + return +} diff --git a/services/recoveryservices/mgmt/2022-03-01/backup/resourceguardproxy.go b/services/recoveryservices/mgmt/2022-03-01/backup/resourceguardproxy.go new file mode 100644 index 000000000000..2562a131f40a --- /dev/null +++ b/services/recoveryservices/mgmt/2022-03-01/backup/resourceguardproxy.go @@ -0,0 +1,343 @@ +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ResourceGuardProxyClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ResourceGuardProxyClient struct { + BaseClient +} + +// NewResourceGuardProxyClient creates an instance of the ResourceGuardProxyClient client. +func NewResourceGuardProxyClient(subscriptionID string) ResourceGuardProxyClient { + return NewResourceGuardProxyClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewResourceGuardProxyClientWithBaseURI creates an instance of the ResourceGuardProxyClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewResourceGuardProxyClientWithBaseURI(baseURI string, subscriptionID string) ResourceGuardProxyClient { + return ResourceGuardProxyClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Delete delete ResourceGuardProxy under vault +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +func (client ResourceGuardProxyClient) Delete(ctx context.Context, vaultName string, resourceGroupName string, resourceGuardProxyName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceGuardProxyClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, vaultName, resourceGroupName, resourceGuardProxyName) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ResourceGuardProxyClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "backup.ResourceGuardProxyClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ResourceGuardProxyClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ResourceGuardProxyClient) DeletePreparer(ctx context.Context, vaultName string, resourceGroupName string, resourceGuardProxyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGuardProxyName": autorest.Encode("path", resourceGuardProxyName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2022-03-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}/backupResourceGuardProxies/{resourceGuardProxyName}", 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 ResourceGuardProxyClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ResourceGuardProxyClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get returns ResourceGuardProxy under vault and with the name referenced in request +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +func (client ResourceGuardProxyClient) Get(ctx context.Context, vaultName string, resourceGroupName string, resourceGuardProxyName string) (result ResourceGuardProxyBaseResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceGuardProxyClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, resourceGuardProxyName) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ResourceGuardProxyClient", "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.ResourceGuardProxyClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ResourceGuardProxyClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ResourceGuardProxyClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, resourceGuardProxyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGuardProxyName": autorest.Encode("path", resourceGuardProxyName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2022-03-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}/backupResourceGuardProxies/{resourceGuardProxyName}", 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 ResourceGuardProxyClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ResourceGuardProxyClient) GetResponder(resp *http.Response) (result ResourceGuardProxyBaseResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Put add or Update ResourceGuardProxy under vault +// Secures vault critical operations +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +func (client ResourceGuardProxyClient) Put(ctx context.Context, vaultName string, resourceGroupName string, resourceGuardProxyName string) (result ResourceGuardProxyBaseResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceGuardProxyClient.Put") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PutPreparer(ctx, vaultName, resourceGroupName, resourceGuardProxyName) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ResourceGuardProxyClient", "Put", nil, "Failure preparing request") + return + } + + resp, err := client.PutSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.ResourceGuardProxyClient", "Put", resp, "Failure sending request") + return + } + + result, err = client.PutResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ResourceGuardProxyClient", "Put", resp, "Failure responding to request") + return + } + + return +} + +// PutPreparer prepares the Put request. +func (client ResourceGuardProxyClient) PutPreparer(ctx context.Context, vaultName string, resourceGroupName string, resourceGuardProxyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGuardProxyName": autorest.Encode("path", resourceGuardProxyName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PutSender sends the Put request. The method will close the +// http.Response Body if it receives an error. +func (client ResourceGuardProxyClient) PutSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// PutResponder handles the response to the Put request. The method always +// closes the http.Response Body. +func (client ResourceGuardProxyClient) PutResponder(resp *http.Response) (result ResourceGuardProxyBaseResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UnlockDelete secures delete ResourceGuardProxy operations. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// parameters - request body for operation +func (client ResourceGuardProxyClient) UnlockDelete(ctx context.Context, vaultName string, resourceGroupName string, resourceGuardProxyName string, parameters UnlockDeleteRequest) (result UnlockDeleteResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceGuardProxyClient.UnlockDelete") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UnlockDeletePreparer(ctx, vaultName, resourceGroupName, resourceGuardProxyName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ResourceGuardProxyClient", "UnlockDelete", nil, "Failure preparing request") + return + } + + resp, err := client.UnlockDeleteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.ResourceGuardProxyClient", "UnlockDelete", resp, "Failure sending request") + return + } + + result, err = client.UnlockDeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ResourceGuardProxyClient", "UnlockDelete", resp, "Failure responding to request") + return + } + + return +} + +// UnlockDeletePreparer prepares the UnlockDelete request. +func (client ResourceGuardProxyClient) UnlockDeletePreparer(ctx context.Context, vaultName string, resourceGroupName string, resourceGuardProxyName string, parameters UnlockDeleteRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGuardProxyName": autorest.Encode("path", resourceGuardProxyName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}/unlockDelete", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UnlockDeleteSender sends the UnlockDelete request. The method will close the +// http.Response Body if it receives an error. +func (client ResourceGuardProxyClient) UnlockDeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UnlockDeleteResponder handles the response to the UnlockDelete request. The method always +// closes the http.Response Body. +func (client ResourceGuardProxyClient) UnlockDeleteResponder(resp *http.Response) (result UnlockDeleteResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/resourcestorageconfigs.go b/services/recoveryservices/mgmt/2022-03-01/backup/resourcestorageconfigsnoncrr.go similarity index 66% rename from services/recoveryservices/mgmt/2019-05-13/backup/resourcestorageconfigs.go rename to services/recoveryservices/mgmt/2022-03-01/backup/resourcestorageconfigsnoncrr.go index e763809902c3..5c5ceb68749e 100644 --- a/services/recoveryservices/mgmt/2019-05-13/backup/resourcestorageconfigs.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/resourcestorageconfigsnoncrr.go @@ -14,30 +14,30 @@ import ( "net/http" ) -// ResourceStorageConfigsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type ResourceStorageConfigsClient struct { +// ResourceStorageConfigsNonCRRClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ResourceStorageConfigsNonCRRClient struct { BaseClient } -// NewResourceStorageConfigsClient creates an instance of the ResourceStorageConfigsClient client. -func NewResourceStorageConfigsClient(subscriptionID string) ResourceStorageConfigsClient { - return NewResourceStorageConfigsClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewResourceStorageConfigsNonCRRClient creates an instance of the ResourceStorageConfigsNonCRRClient client. +func NewResourceStorageConfigsNonCRRClient(subscriptionID string) ResourceStorageConfigsNonCRRClient { + return NewResourceStorageConfigsNonCRRClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewResourceStorageConfigsClientWithBaseURI creates an instance of the ResourceStorageConfigsClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewResourceStorageConfigsClientWithBaseURI(baseURI string, subscriptionID string) ResourceStorageConfigsClient { - return ResourceStorageConfigsClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewResourceStorageConfigsNonCRRClientWithBaseURI creates an instance of the ResourceStorageConfigsNonCRRClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewResourceStorageConfigsNonCRRClientWithBaseURI(baseURI string, subscriptionID string) ResourceStorageConfigsNonCRRClient { + return ResourceStorageConfigsNonCRRClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get fetches resource storage config. // Parameters: // vaultName - the name of the recovery services vault. // resourceGroupName - the name of the resource group where the recovery services vault is present. -func (client ResourceStorageConfigsClient) Get(ctx context.Context, vaultName string, resourceGroupName string) (result ResourceConfigResource, err error) { +func (client ResourceStorageConfigsNonCRRClient) Get(ctx context.Context, vaultName string, resourceGroupName string) (result ResourceConfigResource, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceStorageConfigsClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceStorageConfigsNonCRRClient.Get") defer func() { sc := -1 if result.Response.Response != nil { @@ -48,20 +48,20 @@ func (client ResourceStorageConfigsClient) Get(ctx context.Context, vaultName st } req, err := client.GetPreparer(ctx, vaultName, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsNonCRRClient", "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.ResourceStorageConfigsClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsNonCRRClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsNonCRRClient", "Get", resp, "Failure responding to request") return } @@ -69,14 +69,14 @@ func (client ResourceStorageConfigsClient) Get(ctx context.Context, vaultName st } // GetPreparer prepares the Get request. -func (client ResourceStorageConfigsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string) (*http.Request, error) { +func (client ResourceStorageConfigsNonCRRClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName 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 = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -91,13 +91,13 @@ func (client ResourceStorageConfigsClient) GetPreparer(ctx context.Context, vaul // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client ResourceStorageConfigsClient) GetSender(req *http.Request) (*http.Response, error) { +func (client ResourceStorageConfigsNonCRRClient) GetSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client ResourceStorageConfigsClient) GetResponder(resp *http.Response) (result ResourceConfigResource, err error) { +func (client ResourceStorageConfigsNonCRRClient) GetResponder(resp *http.Response) (result ResourceConfigResource, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -112,9 +112,9 @@ func (client ResourceStorageConfigsClient) GetResponder(resp *http.Response) (re // vaultName - the name of the recovery services vault. // resourceGroupName - the name of the resource group where the recovery services vault is present. // parameters - vault storage config request -func (client ResourceStorageConfigsClient) Patch(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceConfigResource) (result autorest.Response, err error) { +func (client ResourceStorageConfigsNonCRRClient) Patch(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceConfigResource) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceStorageConfigsClient.Patch") + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceStorageConfigsNonCRRClient.Patch") defer func() { sc := -1 if result.Response != nil { @@ -125,20 +125,20 @@ func (client ResourceStorageConfigsClient) Patch(ctx context.Context, vaultName } req, err := client.PatchPreparer(ctx, vaultName, resourceGroupName, parameters) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Patch", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsNonCRRClient", "Patch", nil, "Failure preparing request") return } resp, err := client.PatchSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Patch", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsNonCRRClient", "Patch", resp, "Failure sending request") return } result, err = client.PatchResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Patch", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsNonCRRClient", "Patch", resp, "Failure responding to request") return } @@ -146,14 +146,14 @@ func (client ResourceStorageConfigsClient) Patch(ctx context.Context, vaultName } // PatchPreparer prepares the Patch request. -func (client ResourceStorageConfigsClient) PatchPreparer(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceConfigResource) (*http.Request, error) { +func (client ResourceStorageConfigsNonCRRClient) PatchPreparer(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceConfigResource) (*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 = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -170,13 +170,13 @@ func (client ResourceStorageConfigsClient) PatchPreparer(ctx context.Context, va // PatchSender sends the Patch request. The method will close the // http.Response Body if it receives an error. -func (client ResourceStorageConfigsClient) PatchSender(req *http.Request) (*http.Response, error) { +func (client ResourceStorageConfigsNonCRRClient) PatchSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // PatchResponder handles the response to the Patch request. The method always // closes the http.Response Body. -func (client ResourceStorageConfigsClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) { +func (client ResourceStorageConfigsNonCRRClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), @@ -190,9 +190,9 @@ func (client ResourceStorageConfigsClient) PatchResponder(resp *http.Response) ( // vaultName - the name of the recovery services vault. // resourceGroupName - the name of the resource group where the recovery services vault is present. // parameters - vault storage config request -func (client ResourceStorageConfigsClient) Update(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceConfigResource) (result ResourceConfigResource, err error) { +func (client ResourceStorageConfigsNonCRRClient) Update(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceConfigResource) (result ResourceConfigResource, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceStorageConfigsClient.Update") + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceStorageConfigsNonCRRClient.Update") defer func() { sc := -1 if result.Response.Response != nil { @@ -203,20 +203,20 @@ func (client ResourceStorageConfigsClient) Update(ctx context.Context, vaultName } req, err := client.UpdatePreparer(ctx, vaultName, resourceGroupName, parameters) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Update", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsNonCRRClient", "Update", nil, "Failure preparing request") return } resp, err := client.UpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Update", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsNonCRRClient", "Update", resp, "Failure sending request") return } result, err = client.UpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Update", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsNonCRRClient", "Update", resp, "Failure responding to request") return } @@ -224,14 +224,14 @@ func (client ResourceStorageConfigsClient) Update(ctx context.Context, vaultName } // UpdatePreparer prepares the Update request. -func (client ResourceStorageConfigsClient) UpdatePreparer(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceConfigResource) (*http.Request, error) { +func (client ResourceStorageConfigsNonCRRClient) UpdatePreparer(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceConfigResource) (*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 = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -248,13 +248,13 @@ func (client ResourceStorageConfigsClient) UpdatePreparer(ctx context.Context, v // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. -func (client ResourceStorageConfigsClient) UpdateSender(req *http.Request) (*http.Response, error) { +func (client ResourceStorageConfigsNonCRRClient) UpdateSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always // closes the http.Response Body. -func (client ResourceStorageConfigsClient) UpdateResponder(resp *http.Response) (result ResourceConfigResource, err error) { +func (client ResourceStorageConfigsNonCRRClient) UpdateResponder(resp *http.Response) (result ResourceConfigResource, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/services/recoveryservices/mgmt/2021-01-01/backup/resourcestorageconfigs.go b/services/recoveryservices/mgmt/2022-03-01/backup/resourcevaultconfigs.go similarity index 53% rename from services/recoveryservices/mgmt/2021-01-01/backup/resourcestorageconfigs.go rename to services/recoveryservices/mgmt/2022-03-01/backup/resourcevaultconfigs.go index 35cfa96543b8..13659f41d36c 100644 --- a/services/recoveryservices/mgmt/2021-01-01/backup/resourcestorageconfigs.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/resourcevaultconfigs.go @@ -14,30 +14,30 @@ import ( "net/http" ) -// ResourceStorageConfigsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type ResourceStorageConfigsClient struct { +// ResourceVaultConfigsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ResourceVaultConfigsClient struct { BaseClient } -// NewResourceStorageConfigsClient creates an instance of the ResourceStorageConfigsClient client. -func NewResourceStorageConfigsClient(subscriptionID string) ResourceStorageConfigsClient { - return NewResourceStorageConfigsClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewResourceVaultConfigsClient creates an instance of the ResourceVaultConfigsClient client. +func NewResourceVaultConfigsClient(subscriptionID string) ResourceVaultConfigsClient { + return NewResourceVaultConfigsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewResourceStorageConfigsClientWithBaseURI creates an instance of the ResourceStorageConfigsClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewResourceStorageConfigsClientWithBaseURI(baseURI string, subscriptionID string) ResourceStorageConfigsClient { - return ResourceStorageConfigsClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewResourceVaultConfigsClientWithBaseURI creates an instance of the ResourceVaultConfigsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewResourceVaultConfigsClientWithBaseURI(baseURI string, subscriptionID string) ResourceVaultConfigsClient { + return ResourceVaultConfigsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Get fetches resource storage config. +// Get fetches resource vault config. // Parameters: // vaultName - the name of the recovery services vault. // resourceGroupName - the name of the resource group where the recovery services vault is present. -func (client ResourceStorageConfigsClient) Get(ctx context.Context, vaultName string, resourceGroupName string) (result ResourceConfigResource, err error) { +func (client ResourceVaultConfigsClient) Get(ctx context.Context, vaultName string, resourceGroupName string) (result ResourceVaultConfigResource, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceStorageConfigsClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceVaultConfigsClient.Get") defer func() { sc := -1 if result.Response.Response != nil { @@ -48,20 +48,20 @@ func (client ResourceStorageConfigsClient) Get(ctx context.Context, vaultName st } req, err := client.GetPreparer(ctx, vaultName, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "backup.ResourceVaultConfigsClient", "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.ResourceStorageConfigsClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "backup.ResourceVaultConfigsClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "backup.ResourceVaultConfigsClient", "Get", resp, "Failure responding to request") return } @@ -69,14 +69,14 @@ func (client ResourceStorageConfigsClient) Get(ctx context.Context, vaultName st } // GetPreparer prepares the Get request. -func (client ResourceStorageConfigsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string) (*http.Request, error) { +func (client ResourceVaultConfigsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName 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 = "2018-12-20" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -84,20 +84,20 @@ func (client ResourceStorageConfigsClient) GetPreparer(ctx context.Context, vaul preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig", 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 ResourceStorageConfigsClient) GetSender(req *http.Request) (*http.Response, error) { +func (client ResourceVaultConfigsClient) GetSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client ResourceStorageConfigsClient) GetResponder(resp *http.Response) (result ResourceConfigResource, err error) { +func (client ResourceVaultConfigsClient) GetResponder(resp *http.Response) (result ResourceVaultConfigResource, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -107,92 +107,93 @@ func (client ResourceStorageConfigsClient) GetResponder(resp *http.Response) (re return } -// Patch updates vault storage model type. +// Put updates vault security config. // Parameters: // vaultName - the name of the recovery services vault. // resourceGroupName - the name of the resource group where the recovery services vault is present. -// parameters - vault storage config request -func (client ResourceStorageConfigsClient) Patch(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceConfigResource) (result autorest.Response, err error) { +// parameters - resource config request +func (client ResourceVaultConfigsClient) Put(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceVaultConfigResource) (result ResourceVaultConfigResource, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceStorageConfigsClient.Patch") + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceVaultConfigsClient.Put") defer func() { sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } - req, err := client.PatchPreparer(ctx, vaultName, resourceGroupName, parameters) + req, err := client.PutPreparer(ctx, vaultName, resourceGroupName, parameters) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Patch", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "backup.ResourceVaultConfigsClient", "Put", nil, "Failure preparing request") return } - resp, err := client.PatchSender(req) + resp, err := client.PutSender(req) if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Patch", resp, "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.ResourceVaultConfigsClient", "Put", resp, "Failure sending request") return } - result, err = client.PatchResponder(resp) + result, err = client.PutResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Patch", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "backup.ResourceVaultConfigsClient", "Put", resp, "Failure responding to request") return } return } -// PatchPreparer prepares the Patch request. -func (client ResourceStorageConfigsClient) PatchPreparer(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceConfigResource) (*http.Request, error) { +// PutPreparer prepares the Put request. +func (client ResourceVaultConfigsClient) PutPreparer(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceVaultConfigResource) (*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 = "2018-12-20" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), + autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// PatchSender sends the Patch request. The method will close the +// PutSender sends the Put request. The method will close the // http.Response Body if it receives an error. -func (client ResourceStorageConfigsClient) PatchSender(req *http.Request) (*http.Response, error) { +func (client ResourceVaultConfigsClient) PutSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// PatchResponder handles the response to the Patch request. The method always +// PutResponder handles the response to the Put request. The method always // closes the http.Response Body. -func (client ResourceStorageConfigsClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) { +func (client ResourceVaultConfigsClient) PutResponder(resp *http.Response) (result ResourceVaultConfigResource, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) - result.Response = resp + result.Response = autorest.Response{Response: resp} return } -// Update updates vault storage model type. +// Update updates vault security config. // Parameters: // vaultName - the name of the recovery services vault. // resourceGroupName - the name of the resource group where the recovery services vault is present. -// parameters - vault storage config request -func (client ResourceStorageConfigsClient) Update(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceConfigResource) (result ResourceConfigResource, err error) { +// parameters - resource config request +func (client ResourceVaultConfigsClient) Update(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceVaultConfigResource) (result ResourceVaultConfigResource, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceStorageConfigsClient.Update") + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceVaultConfigsClient.Update") defer func() { sc := -1 if result.Response.Response != nil { @@ -203,20 +204,20 @@ func (client ResourceStorageConfigsClient) Update(ctx context.Context, vaultName } req, err := client.UpdatePreparer(ctx, vaultName, resourceGroupName, parameters) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Update", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "backup.ResourceVaultConfigsClient", "Update", nil, "Failure preparing request") return } resp, err := client.UpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Update", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "backup.ResourceVaultConfigsClient", "Update", resp, "Failure sending request") return } result, err = client.UpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "backup.ResourceStorageConfigsClient", "Update", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "backup.ResourceVaultConfigsClient", "Update", resp, "Failure responding to request") return } @@ -224,23 +225,23 @@ func (client ResourceStorageConfigsClient) Update(ctx context.Context, vaultName } // UpdatePreparer prepares the Update request. -func (client ResourceStorageConfigsClient) UpdatePreparer(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceConfigResource) (*http.Request, error) { +func (client ResourceVaultConfigsClient) UpdatePreparer(ctx context.Context, vaultName string, resourceGroupName string, parameters ResourceVaultConfigResource) (*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 = "2018-12-20" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), + autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -248,13 +249,13 @@ func (client ResourceStorageConfigsClient) UpdatePreparer(ctx context.Context, v // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. -func (client ResourceStorageConfigsClient) UpdateSender(req *http.Request) (*http.Response, error) { +func (client ResourceVaultConfigsClient) UpdateSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always // closes the http.Response Body. -func (client ResourceStorageConfigsClient) UpdateResponder(resp *http.Response) (result ResourceConfigResource, err error) { +func (client ResourceVaultConfigsClient) UpdateResponder(resp *http.Response) (result ResourceVaultConfigResource, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/services/recoveryservices/mgmt/2022-03-01/backup/restores.go b/services/recoveryservices/mgmt/2022-03-01/backup/restores.go new file mode 100644 index 000000000000..75fe704f8ee3 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-03-01/backup/restores.go @@ -0,0 +1,122 @@ +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RestoresClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type RestoresClient struct { + BaseClient +} + +// NewRestoresClient creates an instance of the RestoresClient client. +func NewRestoresClient(subscriptionID string) RestoresClient { + return NewRestoresClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRestoresClientWithBaseURI creates an instance of the RestoresClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewRestoresClientWithBaseURI(baseURI string, subscriptionID string) RestoresClient { + return RestoresClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Trigger restores the specified backed up data. This is an asynchronous operation. To know the status of this API +// call, use +// GetProtectedItemOperationResult 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 items. +// containerName - container name associated with the backed up items. +// protectedItemName - backed up item to be restored. +// recoveryPointID - recovery point ID which represents the backed up data to be restored. +// parameters - resource restore request +func (client RestoresClient) Trigger(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters RestoreRequestResource) (result RestoresTriggerFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RestoresClient.Trigger") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.TriggerPreparer(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.RestoresClient", "Trigger", nil, "Failure preparing request") + return + } + + result, err = client.TriggerSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.RestoresClient", "Trigger", result.Response(), "Failure sending request") + return + } + + return +} + +// TriggerPreparer prepares the Trigger request. +func (client RestoresClient) TriggerPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters RestoreRequestResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "fabricName": autorest.Encode("path", fabricName), + "protectedItemName": autorest.Encode("path", protectedItemName), + "recoveryPointId": autorest.Encode("path", recoveryPointID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/restore", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TriggerSender sends the Trigger request. The method will close the +// http.Response Body if it receives an error. +func (client RestoresClient) TriggerSender(req *http.Request) (future RestoresTriggerFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TriggerResponder handles the response to the Trigger request. The method always +// closes the http.Response Body. +func (client RestoresClient) TriggerResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/recoveryservices/mgmt/2019-06-15/backup/securitypins.go b/services/recoveryservices/mgmt/2022-03-01/backup/securitypins.go similarity index 87% rename from services/recoveryservices/mgmt/2019-06-15/backup/securitypins.go rename to services/recoveryservices/mgmt/2022-03-01/backup/securitypins.go index 824a5f3c8eb4..5a49fb07947e 100644 --- a/services/recoveryservices/mgmt/2019-06-15/backup/securitypins.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/securitypins.go @@ -34,7 +34,8 @@ func NewSecurityPINsClientWithBaseURI(baseURI string, subscriptionID string) Sec // Parameters: // vaultName - the name of the recovery services vault. // resourceGroupName - the name of the resource group where the recovery services vault is present. -func (client SecurityPINsClient) Get(ctx context.Context, vaultName string, resourceGroupName string) (result TokenInformation, err error) { +// parameters - security pin request +func (client SecurityPINsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, parameters *SecurityPinBase) (result TokenInformation, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SecurityPINsClient.Get") defer func() { @@ -45,7 +46,7 @@ func (client SecurityPINsClient) Get(ctx context.Context, vaultName string, reso tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetPreparer(ctx, vaultName, resourceGroupName) + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "backup.SecurityPINsClient", "Get", nil, "Failure preparing request") return @@ -68,23 +69,28 @@ func (client SecurityPINsClient) Get(ctx context.Context, vaultName string, reso } // GetPreparer prepares the Get request. -func (client SecurityPINsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string) (*http.Request, error) { +func (client SecurityPINsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, parameters *SecurityPinBase) (*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 = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupSecurityPIN", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupSecurityPIN", pathParameters), autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/recoveryservices/mgmt/2021-01-01/backup/status.go b/services/recoveryservices/mgmt/2022-03-01/backup/status.go similarity index 99% rename from services/recoveryservices/mgmt/2021-01-01/backup/status.go rename to services/recoveryservices/mgmt/2022-03-01/backup/status.go index 4e62c544253c..09b1b4f1dc7f 100644 --- a/services/recoveryservices/mgmt/2021-01-01/backup/status.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/status.go @@ -74,7 +74,7 @@ func (client StatusClient) GetPreparer(ctx context.Context, azureRegion string, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-07-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/usagesummaries.go b/services/recoveryservices/mgmt/2022-03-01/backup/usagesummaries.go similarity index 99% rename from services/recoveryservices/mgmt/2020-02-02/backup/usagesummaries.go rename to services/recoveryservices/mgmt/2022-03-01/backup/usagesummaries.go index 1c70d7b13444..8acdc2f53e8f 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/usagesummaries.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/usagesummaries.go @@ -77,7 +77,7 @@ func (client UsageSummariesClient) ListPreparer(ctx context.Context, vaultName s "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2017-07-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/recoveryservices/mgmt/2022-03-01/backup/validateoperation.go b/services/recoveryservices/mgmt/2022-03-01/backup/validateoperation.go new file mode 100644 index 000000000000..a5efc1b0f781 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-03-01/backup/validateoperation.go @@ -0,0 +1,114 @@ +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ValidateOperationClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ValidateOperationClient struct { + BaseClient +} + +// NewValidateOperationClient creates an instance of the ValidateOperationClient client. +func NewValidateOperationClient(subscriptionID string) ValidateOperationClient { + return NewValidateOperationClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewValidateOperationClientWithBaseURI creates an instance of the ValidateOperationClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewValidateOperationClientWithBaseURI(baseURI string, subscriptionID string) ValidateOperationClient { + return ValidateOperationClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Trigger validate operation for specified backed up item in the form of an asynchronous operation. Returns tracking +// headers which can be tracked using GetValidateOperationResult API. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// parameters - resource validate operation request +func (client ValidateOperationClient) Trigger(ctx context.Context, vaultName string, resourceGroupName string, parameters BasicValidateOperationRequest) (result ValidateOperationTriggerFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ValidateOperationClient.Trigger") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.TriggerPreparer(ctx, vaultName, resourceGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ValidateOperationClient", "Trigger", nil, "Failure preparing request") + return + } + + result, err = client.TriggerSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ValidateOperationClient", "Trigger", result.Response(), "Failure sending request") + return + } + + return +} + +// TriggerPreparer prepares the Trigger request. +func (client ValidateOperationClient) TriggerPreparer(ctx context.Context, vaultName string, resourceGroupName string, parameters BasicValidateOperationRequest) (*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 = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupTriggerValidateOperation", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TriggerSender sends the Trigger request. The method will close the +// http.Response Body if it receives an error. +func (client ValidateOperationClient) TriggerSender(req *http.Request) (future ValidateOperationTriggerFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TriggerResponder handles the response to the Trigger request. The method always +// closes the http.Response Body. +func (client ValidateOperationClient) TriggerResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/recoveryservices/mgmt/2022-03-01/backup/validateoperationresults.go b/services/recoveryservices/mgmt/2022-03-01/backup/validateoperationresults.go new file mode 100644 index 000000000000..e6c8760fb12e --- /dev/null +++ b/services/recoveryservices/mgmt/2022-03-01/backup/validateoperationresults.go @@ -0,0 +1,110 @@ +package backup + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// 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" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ValidateOperationResultsClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ValidateOperationResultsClient struct { + BaseClient +} + +// NewValidateOperationResultsClient creates an instance of the ValidateOperationResultsClient client. +func NewValidateOperationResultsClient(subscriptionID string) ValidateOperationResultsClient { + return NewValidateOperationResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewValidateOperationResultsClientWithBaseURI creates an instance of the ValidateOperationResultsClient client using +// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewValidateOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) ValidateOperationResultsClient { + return ValidateOperationResultsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get fetches the result of a triggered validate operation. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// operationID - operationID which represents the operation whose result needs to be fetched. +func (client ValidateOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result ValidateOperationsResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ValidateOperationResultsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ValidateOperationResultsClient", "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.ValidateOperationResultsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ValidateOperationResultsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ValidateOperationResultsClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2022-03-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}/backupValidateOperationResults/{operationId}", 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 ValidateOperationResultsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ValidateOperationResultsClient) GetResponder(resp *http.Response) (result ValidateOperationsResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/recoveryservices/mgmt/2020-02-02/backup/operationstatuses.go b/services/recoveryservices/mgmt/2022-03-01/backup/validateoperationstatuses.go similarity index 51% rename from services/recoveryservices/mgmt/2020-02-02/backup/operationstatuses.go rename to services/recoveryservices/mgmt/2022-03-01/backup/validateoperationstatuses.go index 44d75d9efebd..f8d55b2905e7 100644 --- a/services/recoveryservices/mgmt/2020-02-02/backup/operationstatuses.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/validateoperationstatuses.go @@ -14,34 +14,33 @@ import ( "net/http" ) -// OperationStatusesClient is the open API 2.0 Specs for Azure RecoveryServices Backup service -type OperationStatusesClient struct { +// ValidateOperationStatusesClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ValidateOperationStatusesClient struct { BaseClient } -// NewOperationStatusesClient creates an instance of the OperationStatusesClient client. -func NewOperationStatusesClient(subscriptionID string) OperationStatusesClient { - return NewOperationStatusesClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewValidateOperationStatusesClient creates an instance of the ValidateOperationStatusesClient client. +func NewValidateOperationStatusesClient(subscriptionID string) ValidateOperationStatusesClient { + return NewValidateOperationStatusesClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewOperationStatusesClientWithBaseURI creates an instance of the OperationStatusesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewOperationStatusesClientWithBaseURI(baseURI string, subscriptionID string) OperationStatusesClient { - return OperationStatusesClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewValidateOperationStatusesClientWithBaseURI creates an instance of the ValidateOperationStatusesClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewValidateOperationStatusesClientWithBaseURI(baseURI string, subscriptionID string) ValidateOperationStatusesClient { + return ValidateOperationStatusesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Get fetches the status of an operation such as triggering a backup, restore. The status can be in progress, -// completed -// or failed. You can refer to the OperationStatus enum for all the possible states of an operation. Some operations -// create jobs. This method returns the list of jobs when the operation is complete. +// Get fetches the status of a triggered validate operation. The status can be in progress, completed +// or failed. You can refer to the OperationStatus enum for all the possible states of the operation. +// If operation has completed, this method returns the list of errors obtained while validating the operation. // Parameters: // vaultName - the name of the recovery services vault. // resourceGroupName - the name of the resource group where the recovery services vault is present. -// operationID - operationID which represents the operation. -func (client OperationStatusesClient) Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result OperationStatus, err error) { +// operationID - operationID represents the operation whose status needs to be fetched. +func (client ValidateOperationStatusesClient) Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (result OperationStatus, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationStatusesClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/ValidateOperationStatusesClient.Get") defer func() { sc := -1 if result.Response.Response != nil { @@ -52,20 +51,20 @@ func (client OperationStatusesClient) Get(ctx context.Context, vaultName string, } req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, operationID) if err != nil { - err = autorest.NewErrorWithError(err, "backup.OperationStatusesClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "backup.ValidateOperationStatusesClient", "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.OperationStatusesClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "backup.ValidateOperationStatusesClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "backup.OperationStatusesClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "backup.ValidateOperationStatusesClient", "Get", resp, "Failure responding to request") return } @@ -73,7 +72,7 @@ func (client OperationStatusesClient) Get(ctx context.Context, vaultName string, } // GetPreparer prepares the Get request. -func (client OperationStatusesClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (*http.Request, error) { +func (client ValidateOperationStatusesClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, operationID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "operationId": autorest.Encode("path", operationID), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -81,7 +80,7 @@ func (client OperationStatusesClient) GetPreparer(ctx context.Context, vaultName "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -89,20 +88,20 @@ func (client OperationStatusesClient) GetPreparer(ctx context.Context, vaultName preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperations/{operationId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupValidateOperationsStatuses/{operationId}", 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 OperationStatusesClient) GetSender(req *http.Request) (*http.Response, error) { +func (client ValidateOperationStatusesClient) GetSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client OperationStatusesClient) GetResponder(resp *http.Response) (result OperationStatus, err error) { +func (client ValidateOperationStatusesClient) GetResponder(resp *http.Response) (result OperationStatus, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/services/recoveryservices/mgmt/2022-03-01/backup/version.go b/services/recoveryservices/mgmt/2022-03-01/backup/version.go new file mode 100644 index 000000000000..e1c54f248ce5 --- /dev/null +++ b/services/recoveryservices/mgmt/2022-03-01/backup/version.go @@ -0,0 +1,19 @@ +package backup + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " backup/2022-03-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/recoveryservices/mgmt/2019-05-13/backup/workloaditems.go b/services/recoveryservices/mgmt/2022-03-01/backup/workloaditems.go similarity index 98% rename from services/recoveryservices/mgmt/2019-05-13/backup/workloaditems.go rename to services/recoveryservices/mgmt/2022-03-01/backup/workloaditems.go index 8f400e70af4e..e278889cb17a 100644 --- a/services/recoveryservices/mgmt/2019-05-13/backup/workloaditems.go +++ b/services/recoveryservices/mgmt/2022-03-01/backup/workloaditems.go @@ -88,7 +88,7 @@ func (client WorkloadItemsClient) ListPreparer(ctx context.Context, vaultName st "vaultName": autorest.Encode("path", vaultName), } - const APIVersion = "2016-12-01" + const APIVersion = "2022-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -102,7 +102,7 @@ func (client WorkloadItemsClient) ListPreparer(ctx context.Context, vaultName st preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/items", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/items", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) }